gridwin.cxx (ee093554) | gridwin.cxx (3cc56398) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 3550 unchanged lines hidden (view full) --- 3559 // local jumps from an unnamed document are possible only within a document 3560 3561 if ( !rData.pJumpLocalDoc || rData.pJumpLocalDoc == pViewData->GetDocument() ) 3562 nRet = rEvt.mnAction; 3563 } 3564 else 3565 { 3566 sal_Int8 nMyAction = rEvt.mnAction; | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 3550 unchanged lines hidden (view full) --- 3559 // local jumps from an unnamed document are possible only within a document 3560 3561 if ( !rData.pJumpLocalDoc || rData.pJumpLocalDoc == pViewData->GetDocument() ) 3562 nRet = rEvt.mnAction; 3563 } 3564 else 3565 { 3566 sal_Int8 nMyAction = rEvt.mnAction; |
3567 3568 // clear DND_ACTION_LINK when other actions are set. The usage below cannot handle 3569 // multiple set values 3570 if((nMyAction & DND_ACTION_LINK) && (nMyAction & (DND_ACTION_COPYMOVE))) 3571 { 3572 nMyAction &= ~DND_ACTION_LINK; 3573 } |
|
3567 3568 if ( !rData.pDrawTransfer || 3569 !IsMyModel(rData.pDrawTransfer->GetDragSourceView()) ) // drawing within the document 3570 if ( rEvt.mbDefault && nMyAction == DND_ACTION_MOVE ) 3571 nMyAction = DND_ACTION_COPY; 3572 3573 ScDocument* pThisDoc = pViewData->GetDocument(); 3574 SdrObject* pHitObj = pThisDoc->GetObjectAtPoint( 3575 pViewData->GetTabNo(), PixelToLogic(rEvt.maPosPixel) ); | 3574 3575 if ( !rData.pDrawTransfer || 3576 !IsMyModel(rData.pDrawTransfer->GetDragSourceView()) ) // drawing within the document 3577 if ( rEvt.mbDefault && nMyAction == DND_ACTION_MOVE ) 3578 nMyAction = DND_ACTION_COPY; 3579 3580 ScDocument* pThisDoc = pViewData->GetDocument(); 3581 SdrObject* pHitObj = pThisDoc->GetObjectAtPoint( 3582 pViewData->GetTabNo(), PixelToLogic(rEvt.maPosPixel) ); |
3576 if ( pHitObj && nMyAction == DND_ACTION_LINK && !rData.pDrawTransfer ) | 3583 if ( pHitObj && nMyAction == DND_ACTION_LINK ) // && !rData.pDrawTransfer ) |
3577 { 3578 if ( IsDropFormatSupported(SOT_FORMATSTR_ID_SVXB) 3579 || IsDropFormatSupported(SOT_FORMAT_GDIMETAFILE) 3580 || IsDropFormatSupported(SOT_FORMAT_BITMAP) ) 3581 { 3582 // graphic dragged onto drawing object 3583 DrawMarkDropObj( pHitObj ); 3584 nRet = nMyAction; --- 601 unchanged lines hidden (view full) --- 4186 bOk = sal_False; 4187 } 4188 } 4189 4190 return bOk ? rEvt.mnAction : DND_ACTION_NONE; // don't try anything else 4191 } 4192 4193 Point aLogicPos = PixelToLogic(aPos); | 3584 { 3585 if ( IsDropFormatSupported(SOT_FORMATSTR_ID_SVXB) 3586 || IsDropFormatSupported(SOT_FORMAT_GDIMETAFILE) 3587 || IsDropFormatSupported(SOT_FORMAT_BITMAP) ) 3588 { 3589 // graphic dragged onto drawing object 3590 DrawMarkDropObj( pHitObj ); 3591 nRet = nMyAction; --- 601 unchanged lines hidden (view full) --- 4193 bOk = sal_False; 4194 } 4195 } 4196 4197 return bOk ? rEvt.mnAction : DND_ACTION_NONE; // don't try anything else 4198 } 4199 4200 Point aLogicPos = PixelToLogic(aPos); |
4201 sal_Bool bIsLink = ( rEvt.mnAction == DND_ACTION_LINK ); |
|
4194 | 4202 |
4195 if (rData.pDrawTransfer) | 4203 if (!bIsLink && rData.pDrawTransfer) |
4196 { 4197 sal_uInt16 nFlags = rData.pDrawTransfer->GetDragSourceFlags(); 4198 4199 sal_Bool bIsNavi = ( nFlags & SC_DROP_NAVIGATOR ) != 0; 4200 sal_Bool bIsMove = ( rEvt.mnAction == DND_ACTION_MOVE && !bIsNavi ); 4201 4202 bPasteIsMove = bIsMove; 4203 --- 19 unchanged lines hidden (view full) --- 4223 if ( !rData.pJumpLocalDoc || rData.pJumpLocalDoc == pViewData->GetDocument() ) 4224 { 4225 pViewData->GetViewShell()->InsertBookmark( rData.aJumpText, rData.aJumpTarget, 4226 nPosX, nPosY ); 4227 return rEvt.mnAction; 4228 } 4229 } 4230 | 4204 { 4205 sal_uInt16 nFlags = rData.pDrawTransfer->GetDragSourceFlags(); 4206 4207 sal_Bool bIsNavi = ( nFlags & SC_DROP_NAVIGATOR ) != 0; 4208 sal_Bool bIsMove = ( rEvt.mnAction == DND_ACTION_MOVE && !bIsNavi ); 4209 4210 bPasteIsMove = bIsMove; 4211 --- 19 unchanged lines hidden (view full) --- 4231 if ( !rData.pJumpLocalDoc || rData.pJumpLocalDoc == pViewData->GetDocument() ) 4232 { 4233 pViewData->GetViewShell()->InsertBookmark( rData.aJumpText, rData.aJumpTarget, 4234 nPosX, nPosY ); 4235 return rEvt.mnAction; 4236 } 4237 } 4238 |
4231 sal_Bool bIsLink = ( rEvt.mnAction == DND_ACTION_LINK ); 4232 | |
4233 ScDocument* pThisDoc = pViewData->GetDocument(); 4234 SdrObject* pHitObj = pThisDoc->GetObjectAtPoint( pViewData->GetTabNo(), PixelToLogic(aPos) ); 4235 if ( pHitObj && bIsLink ) 4236 { 4237 // dropped on drawing object 4238 // PasteOnDrawObject checks for valid formats 4239 if ( pViewData->GetView()->PasteOnDrawObject( rEvt.maDropEvent.Transferable, pHitObj, sal_True ) ) 4240 return rEvt.mnAction; --- 1124 unchanged lines hidden (view full) --- 5365 for(sal_uInt32 a(0); a < aPixelRects.size(); a++) 5366 { 5367 const Rectangle aRA(aPixelRects[a]); 5368 basegfx::B2DRange aRB(aRA.Left() - 1, aRA.Top() - 1, aRA.Right(), aRA.Bottom()); 5369 aRB.transform(aTransform); 5370 aRanges.push_back(aRB); 5371 } 5372 | 4239 ScDocument* pThisDoc = pViewData->GetDocument(); 4240 SdrObject* pHitObj = pThisDoc->GetObjectAtPoint( pViewData->GetTabNo(), PixelToLogic(aPos) ); 4241 if ( pHitObj && bIsLink ) 4242 { 4243 // dropped on drawing object 4244 // PasteOnDrawObject checks for valid formats 4245 if ( pViewData->GetView()->PasteOnDrawObject( rEvt.maDropEvent.Transferable, pHitObj, sal_True ) ) 4246 return rEvt.mnAction; --- 1124 unchanged lines hidden (view full) --- 5371 for(sal_uInt32 a(0); a < aPixelRects.size(); a++) 5372 { 5373 const Rectangle aRA(aPixelRects[a]); 5374 basegfx::B2DRange aRB(aRA.Left() - 1, aRA.Top() - 1, aRA.Right(), aRA.Bottom()); 5375 aRB.transform(aTransform); 5376 aRanges.push_back(aRB); 5377 } 5378 |
5373 // #i97672# get the system's hilight color and limit it to the maximum 5374 // allowed luminance. This is needed to react on too bright hilight colors 5375 // which would otherwise vive a bad visualisation 5376 Color aHighlight(GetSettings().GetStyleSettings().GetHighlightColor()); 5377 const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer; 5378 const basegfx::BColor aSelection(aHighlight.getBColor()); 5379 const double fLuminance(aSelection.luminance()); 5380 const double fMaxLum(aSvtOptionsDrawinglayer.GetSelectionMaximumLuminancePercent() / 100.0); | 5379 // get the system's hilight color 5380 const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer; 5381 const Color aHighlight(aSvtOptionsDrawinglayer.getHilightColor()); |
5381 | 5382 |
5382 if(fLuminance > fMaxLum) 5383 { 5384 const double fFactor(fMaxLum / fLuminance); 5385 const basegfx::BColor aNewSelection( 5386 aSelection.getRed() * fFactor, 5387 aSelection.getGreen() * fFactor, 5388 aSelection.getBlue() * fFactor); 5389 5390 aHighlight = Color(aNewSelection); 5391 } 5392 | |
5393 sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection( 5394 sdr::overlay::OVERLAY_TRANSPARENT, 5395 aHighlight, 5396 aRanges, 5397 true); 5398 5399 pOverlayManager->add(*pOverlay); 5400 mpOOSelection = new ::sdr::overlay::OverlayObjectList; --- 362 unchanged lines hidden --- | 5383 sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection( 5384 sdr::overlay::OVERLAY_TRANSPARENT, 5385 aHighlight, 5386 aRanges, 5387 true); 5388 5389 pOverlayManager->add(*pOverlay); 5390 mpOOSelection = new ::sdr::overlay::OverlayObjectList; --- 362 unchanged lines hidden --- |