Lines 122-127
Link Here
|
122 |
#include "tabprotection.hxx" |
122 |
#include "tabprotection.hxx" |
123 |
#include "clipparam.hxx" |
123 |
#include "clipparam.hxx" |
124 |
#include "dpcontrol.hxx" |
124 |
#include "dpcontrol.hxx" |
|
|
125 |
#include "overlayobject.hxx" |
126 |
#include "basegfx/range/b2drange.hxx" |
125 |
|
127 |
|
126 |
// #114409# |
128 |
// #114409# |
127 |
#include <vcl/salbtype.hxx> // FRound |
129 |
#include <vcl/salbtype.hxx> // FRound |
Lines 3060-3066
void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt)
Link Here
|
3060 |
|
3062 |
|
3061 |
// hide the border around the copy source |
3063 |
// hide the border around the copy source |
3062 |
pViewData->SetPasteMode( SC_PASTE_NONE ); |
3064 |
pViewData->SetPasteMode( SC_PASTE_NONE ); |
3063 |
UpdateCursorOverlay(); |
3065 |
UpdateCopySourceOverlay(); |
3064 |
return; |
3066 |
return; |
3065 |
} |
3067 |
} |
3066 |
// wenn semi-Modeless-SfxChildWindow-Dialog oben, keine KeyInputs: |
3068 |
// wenn semi-Modeless-SfxChildWindow-Dialog oben, keine KeyInputs: |
Lines 3069-3075
void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt)
Link Here
|
3069 |
if (rKeyCode.GetCode() == KEY_ESCAPE) |
3071 |
if (rKeyCode.GetCode() == KEY_ESCAPE) |
3070 |
{ |
3072 |
{ |
3071 |
pViewData->SetPasteMode( SC_PASTE_NONE ); |
3073 |
pViewData->SetPasteMode( SC_PASTE_NONE ); |
3072 |
UpdateCursorOverlay(); |
3074 |
UpdateCopySourceOverlay(); |
3073 |
} |
3075 |
} |
3074 |
// query for existing note marker before calling ViewShell's keyboard handling |
3076 |
// query for existing note marker before calling ViewShell's keyboard handling |
3075 |
// which may remove the marker |
3077 |
// which may remove the marker |
Lines 5149-5154
void ScGridWindow::CursorChanged()
Link Here
|
5149 |
void ScGridWindow::ImpCreateOverlayObjects() |
5151 |
void ScGridWindow::ImpCreateOverlayObjects() |
5150 |
{ |
5152 |
{ |
5151 |
UpdateCursorOverlay(); |
5153 |
UpdateCursorOverlay(); |
|
|
5154 |
UpdateCopySourceOverlay(); |
5152 |
UpdateSelectionOverlay(); |
5155 |
UpdateSelectionOverlay(); |
5153 |
UpdateAutoFillOverlay(); |
5156 |
UpdateAutoFillOverlay(); |
5154 |
UpdateDragRectOverlay(); |
5157 |
UpdateDragRectOverlay(); |
Lines 5160-5165
void ScGridWindow::ImpCreateOverlayObjects()
Link Here
|
5160 |
void ScGridWindow::ImpDestroyOverlayObjects() |
5163 |
void ScGridWindow::ImpDestroyOverlayObjects() |
5161 |
{ |
5164 |
{ |
5162 |
DeleteCursorOverlay(); |
5165 |
DeleteCursorOverlay(); |
|
|
5166 |
DeleteCopySourceOverlay(); |
5163 |
DeleteSelectionOverlay(); |
5167 |
DeleteSelectionOverlay(); |
5164 |
DeleteAutoFillOverlay(); |
5168 |
DeleteAutoFillOverlay(); |
5165 |
DeleteDragRectOverlay(); |
5169 |
DeleteDragRectOverlay(); |
Lines 5178-5184
void ScGridWindow::UpdateAllOverlays()
Link Here
|
5178 |
void ScGridWindow::DeleteCursorOverlay() |
5182 |
void ScGridWindow::DeleteCursorOverlay() |
5179 |
{ |
5183 |
{ |
5180 |
DELETEZ( mpOOCursors ); |
5184 |
DELETEZ( mpOOCursors ); |
5181 |
DELETEZ( mpOOSelectionBorder ); |
|
|
5182 |
} |
5185 |
} |
5183 |
|
5186 |
|
5184 |
void ScGridWindow::ConvertPixelRectsToRangeVector( const ::std::vector< Rectangle >& rPixelRects, |
5187 |
void ScGridWindow::ConvertPixelRectsToRangeVector( const ::std::vector< Rectangle >& rPixelRects, |
Lines 5202-5209
void ScGridWindow::ConvertPixelRectsToRangeVector( const ::std::vector< Rectangl
Link Here
|
5202 |
} |
5205 |
} |
5203 |
} |
5206 |
} |
5204 |
|
5207 |
|
5205 |
void ScGridWindow::UpdateCopySourceOverlay( const MapMode& rDrawMode ) |
5208 |
void ScGridWindow::DeleteCopySourceOverlay() |
|
|
5209 |
{ |
5210 |
DELETEZ( mpOOSelectionBorder ); |
5211 |
} |
5212 |
|
5213 |
void ScGridWindow::UpdateCopySourceOverlay() |
5206 |
{ |
5214 |
{ |
|
|
5215 |
MapMode aDrawMode = GetDrawMapMode(); |
5216 |
MapMode aOldMode = GetMapMode(); |
5217 |
if ( aOldMode != aDrawMode ) |
5218 |
SetMapMode( aDrawMode ); |
5219 |
|
5220 |
DeleteCopySourceOverlay(); |
5221 |
|
5207 |
if (!pViewData->ShowPasteSource()) |
5222 |
if (!pViewData->ShowPasteSource()) |
5208 |
return; |
5223 |
return; |
5209 |
::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager(); |
5224 |
::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager(); |
Lines 5232-5264
void ScGridWindow::UpdateCopySourceOverlay( const MapMode& rDrawMode )
Link Here
|
5232 |
|
5247 |
|
5233 |
Point aClipStartScrPos = pViewData->GetScrPos( nClipStartX, nClipStartY, eWhich ); |
5248 |
Point aClipStartScrPos = pViewData->GetScrPos( nClipStartX, nClipStartY, eWhich ); |
5234 |
Point aClipEndScrPos = pViewData->GetScrPos( nClipEndX + 1, nClipEndY + 1, eWhich ); |
5249 |
Point aClipEndScrPos = pViewData->GetScrPos( nClipEndX + 1, nClipEndY + 1, eWhich ); |
5235 |
|
5250 |
aClipStartScrPos -= Point(1, 1); |
5236 |
long nSizeXPix = aClipEndScrPos.X() - aClipStartScrPos.X(); |
5251 |
long nSizeXPix = aClipEndScrPos.X() - aClipStartScrPos.X(); |
5237 |
long nSizeYPix = aClipEndScrPos.Y() - aClipStartScrPos.Y(); |
5252 |
long nSizeYPix = aClipEndScrPos.Y() - aClipStartScrPos.Y(); |
5238 |
|
5253 |
|
5239 |
aClipStartScrPos.X() -= 2; |
5254 |
Rectangle aRect( aClipStartScrPos, Size(nSizeXPix, nSizeYPix) ); |
5240 |
aClipStartScrPos.Y() -= 2; |
|
|
5241 |
|
5255 |
|
5242 |
Rectangle aRect( aClipStartScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) ); |
|
|
5243 |
|
5244 |
std::vector<Rectangle> aPixelRects; |
5245 |
|
5246 |
aPixelRects.push_back(Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() )); |
5247 |
aPixelRects.push_back(Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() )); |
5248 |
aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 )); |
5249 |
aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() )); |
5250 |
|
5251 |
sdr::overlay::OverlayObjectCell::RangeVector aRanges; |
5252 |
ConvertPixelRectsToRangeVector( aPixelRects, &aRanges, rDrawMode ); |
5253 |
|
5254 |
ScOverlayType eType = SC_OVERLAY_BORDER_TRANSPARENT; |
5255 |
|
5256 |
|
5256 |
Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor(); |
5257 |
Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor(); |
5257 |
sdr::overlay::OverlayObjectCell* pOverlay = new sdr::overlay::OverlayObjectCell( eType, aHighlight, aRanges ); |
5258 |
|
5258 |
|
5259 |
Rectangle aLogic = PixelToLogic(aRect, aDrawMode); |
5259 |
pOverlayManager->add(*pOverlay); |
5260 |
::basegfx::B2DRange aRange(aLogic.Left(), aLogic.Top(), aLogic.Right(), aLogic.Bottom()); |
5260 |
mpOOSelectionBorder->append(*pOverlay); |
5261 |
ScOverlayDashedBorder* pDashedBorder = new ScOverlayDashedBorder(aRange, aHighlight, this); |
|
|
5262 |
pOverlayManager->add(*pDashedBorder); |
5263 |
mpOOSelectionBorder->append(*pDashedBorder); |
5261 |
} |
5264 |
} |
|
|
5265 |
|
5266 |
if ( aOldMode != aDrawMode ) |
5267 |
SetMapMode( aOldMode ); |
5262 |
} |
5268 |
} |
5263 |
|
5269 |
|
5264 |
void ScGridWindow::UpdateCursorOverlay() |
5270 |
void ScGridWindow::UpdateCursorOverlay() |
Lines 5273-5280
void ScGridWindow::UpdateCursorOverlay()
Link Here
|
5273 |
|
5280 |
|
5274 |
DeleteCursorOverlay(); |
5281 |
DeleteCursorOverlay(); |
5275 |
|
5282 |
|
5276 |
UpdateCopySourceOverlay( aDrawMode ); |
|
|
5277 |
|
5278 |
std::vector<Rectangle> aPixelRects; |
5283 |
std::vector<Rectangle> aPixelRects; |
5279 |
|
5284 |
|
5280 |
// |
5285 |
// |