From ddcf9b9ff2caaffcc59d250b2d7f50ca3ab20330 Mon Sep 17 00:00:00 2001
From: Jens-Heiner Rechtien
Date: Wed, 19 Nov 2008 14:05:59 +0000
Subject: CWS-TOOLING: integrate CWS aw058 2008-11-19 14:27:57 +0100 aw
r263994 : #i95264# corrected line primitive range calculation for hairlines
2008-11-18 11:31:52 +0100 wg r263754 : i96156 2008-11-18 11:22:38 +0100 wg
r263752 : i96156 2008-11-13 11:46:49 +0100 aw r263626 : #i93169# used flag
the wrong way; true means that nothing was done yet 2008-11-12 15:33:41 +0100
wg r263601 : i96156 2008-11-12 13:22:38 +0100 wg r263592 : i95527
2008-11-12 13:18:51 +0100 wg r263591 : i95527 2008-10-29 13:22:02 +0100 aw
r262794 : #i93485# identified reason and with PL's help changed problem
accordingly with usage of an old fallback. This will need to be optimized
again by HDU when he finds the time. 2008-10-28 18:23:04 +0100 aw r262763 :
unxmacxi compiler warning fixed 2008-10-28 18:17:01 +0100 aw r262762 :
unxmacxi compiler warning fixed 2008-10-28 17:55:18 +0100 aw r262761 :
unxmacxi compiler warning fixed 2008-10-28 13:48:22 +0100 aw r262743 :
#i93485# added UnifiedAlphaPrimitive2D to VclRenderer; corrected getB2DRange
implementations for hairlines which are view-dependent 2008-10-28 12:40:55
+0100 aw r262735 : #i93485# had to move Pre/PostPaint to LocalPre/PostPaint
since PrePaint is a virtual window method 2008-10-27 15:54:10 +0100 aw
r262679 : #i19871# adapted the call order to parent implementations in some
Nbc methods in SdrPathObj due to errors in SnapRect recalculation when
GluePoints are involved 2008-10-24 18:31:48 +0200 aw r262661 : #i77187#
disable all buttons in bezier toolbar when move and/or resize protected
object is involved 2008-10-24 18:30:16 +0200 aw r262660 : #i77187#
simplified and secured model changers, added toolbar update, disabled move
drag start when polygon point is selected 2008-10-24 12:57:50 +0200 hdu
r262635 : #i93485# use device transformation for SAL layer 2008-10-24
12:41:37 +0200 hdu r262634 : #i93485# use device transformation for SAL
layer 2008-10-23 19:46:12 +0200 aw r262630 : mac compiler warning fixed
2008-10-23 18:15:02 +0200 aw r262628 : #i93485# modified dialog previews to
use prerendering 2008-10-23 18:14:27 +0200 aw r262627 : #i93485# added
assert when render helper uses Window as copy source 2008-10-22 18:07:30
+0200 aw r262610 : #i95264# fixes assertion 2008-10-22 14:31:51 +0200 aw
r262606 : #i89661# also enabling DrawTransparent shortcut for VCL-Renderer
2008-10-22 14:10:31 +0200 aw r262604 : #i89661# new HitTest 2D primitive to
support BoundRect and HitTest calculations/tests 2008-10-22 14:09:22 +0200 aw
r262603 : #i89661# new HitTest tolerance, new TextFrame selection overlay,
support for HitTest geometry 2008-10-22 14:08:16 +0200 aw r262602 : #i89661#
correcting old HitTest tolerance expansion 2008-10-20 15:31:48 +0200 aw
r262321 : #i89661# added patch to test it 2008-10-20 11:50:31 +0200 aw
r262310 : #i87762# removed no longer used icons (aw053) 2008-10-17 15:41:48
+0200 aw r262288 : #i93169#, #i93180# FormControl corrections for Primitive
handling 2008-10-17 15:40:54 +0200 aw r262287 : #i93169#, #i93180#
FormControl corrections for Primitive handling 2008-10-16 11:12:44 +0200 aw
r262253 : #i93595# removed superfluous grid interface 2008-10-16 11:11:20
+0200 aw r262252 : #i93595# changed grid display to sub-grid usage and new
defaults 2008-10-15 15:09:40 +0200 aw r262234 : #i93597# moved flag for only
vertical PageBorder, added reacting on it to primitive creation 2008-10-15
15:09:09 +0200 aw r262233 : #i93597# moved flag for only vertical PageBorder
2008-10-15 15:08:46 +0200 aw r262232 : #i93597# moved flag for only vertical
PageBorder, added reacting on it to primitive creation 2008-10-14 16:27:07
+0200 aw r262207 : #i93648# (flushViewObjectContacts) and #i93318#
(propertyChange) 2008-10-14 16:25:10 +0200 aw r262206 : #i93318# back to old
state since detecting a change is not placed well at the primitive (which is
a graphical information at the itme it was fetched). Instead i will add the
needed check and flush at the FormControl's VOC 2008-10-14 13:47:38 +0200 aw
r262201 : #i93318# added a change listener to the XControlModel and code to
make the operator== at control primitive fail
---
.../accessibility/AccessibleStaticTextBase.cxx | 4 +-
svx/source/dialog/dlgctrl.cxx | 341 ++++++++++-----------
svx/source/sdr/contact/viewcontact.cxx | 25 +-
svx/source/sdr/contact/viewcontactofe3d.cxx | 9 +-
svx/source/sdr/contact/viewcontactofsdrpage.cxx | 28 +-
.../sdr/contact/viewobjectcontactofunocontrol.cxx | 84 +++--
svx/source/sdr/overlay/makefile.mk | 1 +
svx/source/sdr/overlay/overlayhatchrect.cxx | 149 +++++++++
.../sdr/primitive2d/sdrcaptionprimitive2d.cxx | 12 +
.../sdr/primitive2d/sdrconnectorprimitive2d.cxx | 10 +
.../sdr/primitive2d/sdrellipseprimitive2d.cxx | 21 ++
svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 10 +
.../sdr/primitive2d/sdrmeasureprimitive2d.cxx | 48 ++-
svx/source/sdr/primitive2d/sdrole2primitive2d.cxx | 55 ++--
svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx | 14 +
.../sdr/primitive2d/sdrrectangleprimitive2d.cxx | 36 ++-
svx/source/svdraw/sdrmasterpagedescriptor.cxx | 9 -
svx/source/svdraw/svddrgv.cxx | 39 ++-
svx/source/svdraw/svdedtv1.cxx | 84 +++--
svx/source/svdraw/svdhdl.cxx | 139 ++++++---
svx/source/svdraw/svdmrkv.cxx | 77 +++--
svx/source/svdraw/svdobj.cxx | 31 +-
svx/source/svdraw/svdopath.cxx | 34 +-
svx/source/svdraw/svdorect.cxx | 46 +--
svx/source/svdraw/svdouno.cxx | 6 +-
svx/source/svdraw/svdpage.cxx | 78 +++--
svx/source/svdraw/svdpntv.cxx | 1 -
svx/source/unodraw/unoshape.cxx | 16 +-
svx/source/unoedit/unoedprx.cxx | 4 +-
29 files changed, 916 insertions(+), 495 deletions(-)
create mode 100644 svx/source/sdr/overlay/overlayhatchrect.cxx
(limited to 'svx/source')
diff --git a/svx/source/accessibility/AccessibleStaticTextBase.cxx b/svx/source/accessibility/AccessibleStaticTextBase.cxx
index d945044b1cf1..b611b62b47e6 100644
--- a/svx/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/svx/source/accessibility/AccessibleStaticTextBase.cxx
@@ -722,8 +722,8 @@ namespace accessibility
// #104481# Return the empty string for 'no selection'
if( nStart < 0 || nEnd < 0 )
return ::rtl::OUString();
- else
- return getTextRange( nStart, nEnd );
+
+ return getTextRange( nStart, nEnd );
}
sal_Int32 SAL_CALL AccessibleStaticTextBase::getSelectionStart() throw (uno::RuntimeException)
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index c48e74e1946a..beef4fe8ae48 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -56,6 +56,11 @@
#include
#include
+#include
+#include
+#include
+#include
+
#define OUTPUT_DRAWMODE_COLOR (DRAWMODE_DEFAULT)
#define OUTPUT_DRAWMODE_CONTRAST (DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT)
@@ -1895,36 +1900,146 @@ void LineEndLB::Modify( XLineEndEntry* pEntry, USHORT nPos, Bitmap* pBmp,
InsertEntry( pEntry->GetName(), nPos );
}
+//////////////////////////////////////////////////////////////////////////////
+
+void SvxPreviewBase::InitSettings(bool bForeground, bool bBackground)
+{
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+
+ if(bForeground)
+ {
+ svtools::ColorConfig aColorConfig;
+ Color aTextColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
+
+ if(IsControlForeground())
+ {
+ aTextColor = GetControlForeground();
+ }
+
+ getBufferDevice().SetTextColor(aTextColor);
+ }
+
+ if(bBackground)
+ {
+ if(IsControlBackground())
+ {
+ getBufferDevice().SetBackground(GetControlBackground());
+ }
+ else
+ {
+ getBufferDevice().SetBackground(rStyleSettings.GetWindowColor());
+ }
+ }
+
+ // do not paint background self, it gets painted buffered
+ SetControlBackground();
+ SetBackground();
+
+ Invalidate();
+}
+
+SvxPreviewBase::SvxPreviewBase( Window* pParent, const ResId& rResId )
+: Control( pParent, rResId ),
+ mpModel( new SdrModel() ),
+ mpBufferDevice( new VirtualDevice(*this) )
+{
+ // Draw the control's border as a flat thin black line.
+ SetBorderStyle(WINDOW_BORDER_MONO);
+ SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
+ SetMapMode(MAP_100TH_MM);
+
+ // init model
+ mpModel->GetItemPool().FreezeIdRanges();
+}
+
+SvxPreviewBase::~SvxPreviewBase()
+{
+ delete mpModel;
+ delete mpBufferDevice;
+}
+
+void SvxPreviewBase::LocalPrePaint()
+{
+ // init BufferDevice
+ if(mpBufferDevice->GetOutputSizePixel() != GetOutputSizePixel())
+ {
+ mpBufferDevice->SetDrawMode(GetDrawMode());
+ mpBufferDevice->SetSettings(GetSettings());
+ mpBufferDevice->SetAntialiasing(GetAntialiasing());
+ mpBufferDevice->SetOutputSizePixel(GetOutputSizePixel());
+ mpBufferDevice->SetMapMode(GetMapMode());
+ }
+
+ mpBufferDevice->Erase();
+}
+
+void SvxPreviewBase::LocalPostPaint()
+{
+ // copy to front (in pixel mode)
+ const bool bWasEnabledSrc(mpBufferDevice->IsMapModeEnabled());
+ const bool bWasEnabledDst(IsMapModeEnabled());
+ const Point aEmptyPoint;
+
+ mpBufferDevice->EnableMapMode(false);
+ EnableMapMode(false);
+
+ DrawOutDev(
+ aEmptyPoint, GetOutputSizePixel(),
+ aEmptyPoint, GetOutputSizePixel(),
+ *mpBufferDevice);
+
+ mpBufferDevice->EnableMapMode(bWasEnabledSrc);
+ EnableMapMode(bWasEnabledDst);
+}
+
+void SvxPreviewBase::StateChanged(StateChangedType nType)
+{
+ Control::StateChanged(nType);
+
+ if(STATE_CHANGE_CONTROLFOREGROUND == nType)
+ {
+ InitSettings(true, false);
+ }
+ else if(STATE_CHANGE_CONTROLBACKGROUND == nType)
+ {
+ InitSettings(false, true);
+ }
+}
+
+void SvxPreviewBase::DataChanged(const DataChangedEvent& rDCEvt)
+{
+ SetDrawMode(GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR);
+
+ if((DATACHANGED_SETTINGS == rDCEvt.GetType()) && (rDCEvt.GetFlags() & SETTINGS_STYLE))
+ {
+ InitSettings(true, true);
+ }
+ else
+ {
+ Control::DataChanged(rDCEvt);
+ }
+}
+
/*************************************************************************
|*
|* SvxXLinePreview::SvxXLinePreview()
|*
*************************************************************************/
-#include
-#include
-#include
-#include
SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId )
-: Control( pParent, rResId ),
+: SvxPreviewBase( pParent, rResId ),
mpLineObjA( 0L ),
mpLineObjB( 0L ),
mpLineObjC( 0L ),
- mpModel( 0L ),
mpGraphic( 0L ),
mbWithSymbol( sal_False )
{
- SetMapMode( MAP_100TH_MM );
const Size aOutputSize(GetOutputSize());
InitSettings( TRUE, TRUE );
const sal_Int32 nDistance(500L);
const sal_Int32 nAvailableLength(aOutputSize.Width() - (4 * nDistance));
- // create model
- mpModel = new SdrModel();
- mpModel->GetItemPool().FreezeIdRanges();
-
// create DrawObectA
const sal_Int32 aYPosA(aOutputSize.Height() / 2);
const basegfx::B2DPoint aPointA1( nDistance, aYPosA);
@@ -1933,7 +2048,7 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId )
aPolygonA.append(aPointA1);
aPolygonA.append(aPointA2);
mpLineObjA = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPolygonA));
- mpLineObjA->SetModel(mpModel);
+ mpLineObjA->SetModel(&getModel());
// create DrawObectB
const sal_Int32 aYPosB1((aOutputSize.Height() * 3) / 4);
@@ -1946,7 +2061,7 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId )
aPolygonB.append(aPointB2);
aPolygonB.append(aPointB3);
mpLineObjB = new SdrPathObj(OBJ_PLIN, basegfx::B2DPolyPolygon(aPolygonB));
- mpLineObjB->SetModel(mpModel);
+ mpLineObjB->SetModel(&getModel());
// create DrawObectC
const basegfx::B2DPoint aPointC1( aPointB3.getX() + nDistance, aYPosB1);
@@ -1957,11 +2072,7 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId )
aPolygonC.append(aPointC2);
aPolygonC.append(aPointC3);
mpLineObjC = new SdrPathObj(OBJ_PLIN, basegfx::B2DPolyPolygon(aPolygonC));
- mpLineObjC->SetModel(mpModel);
-
- // Draw the control's border as a flat thin black line.
- SetBorderStyle (WINDOW_BORDER_MONO);
- SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
+ mpLineObjC->SetModel(&getModel());
}
SvxXLinePreview::~SvxXLinePreview()
@@ -1969,33 +2080,6 @@ SvxXLinePreview::~SvxXLinePreview()
SdrObject::Free( mpLineObjA );
SdrObject::Free( mpLineObjB );
SdrObject::Free( mpLineObjC );
- delete mpModel;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxXLinePreview::InitSettings( BOOL bForeground, BOOL bBackground )
-{
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-
- if ( bForeground )
- {
- svtools::ColorConfig aColorConfig;
- Color aTextColor( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
-
- if ( IsControlForeground() )
- aTextColor = GetControlForeground();
- SetTextColor( aTextColor );
- }
-
- if ( bBackground )
- {
- if ( IsControlBackground() )
- SetBackground( GetControlBackground() );
- else
- SetBackground( rStyleSettings.GetWindowColor() );
- }
- Invalidate();
}
// -----------------------------------------------------------------------
@@ -2037,15 +2121,15 @@ void SvxXLinePreview::SetLineAttributes(const SfxItemSet& rItemSet)
void SvxXLinePreview::Paint( const Rectangle& )
{
- const Size aOutputSize(GetOutputSize());
+ LocalPrePaint();
- // paint objects
+ // paint objects to buffer device
sdr::contact::SdrObjectVector aObjectVector;
aObjectVector.push_back(mpLineObjA);
aObjectVector.push_back(mpLineObjB);
aObjectVector.push_back(mpLineObjC);
- sdr::contact::ObjectContactOfObjListPainter aPainter(*this, aObjectVector, 0);
+ sdr::contact::ObjectContactOfObjListPainter aPainter(getBufferDevice(), aObjectVector, 0);
sdr::contact::DisplayInfo aDisplayInfo;
// do processing
@@ -2053,35 +2137,14 @@ void SvxXLinePreview::Paint( const Rectangle& )
if ( mbWithSymbol && mpGraphic )
{
+ const Size aOutputSize(GetOutputSize());
Point aPos = Point( aOutputSize.Width() / 3, aOutputSize.Height() / 2 );
aPos.X() -= maSymbolSize.Width() / 2;
aPos.Y() -= maSymbolSize.Height() / 2;
- mpGraphic->Draw( this, aPos, maSymbolSize );
+ mpGraphic->Draw( &getBufferDevice(), aPos, maSymbolSize );
}
-}
-
-// -----------------------------------------------------------------------
-
-void SvxXLinePreview::StateChanged( StateChangedType nType )
-{
- if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
- InitSettings( TRUE, FALSE );
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
- InitSettings( FALSE, TRUE );
-
- Control::StateChanged( nType );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxXLinePreview::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
- InitSettings( TRUE, TRUE );
- else
- Control::DataChanged( rDCEvt );
- SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
+ LocalPostPaint();
}
/*************************************************************************
@@ -2090,57 +2153,21 @@ void SvxXLinePreview::DataChanged( const DataChangedEvent& rDCEvt )
|*
*************************************************************************/
-void SvxXRectPreview::InitSettings(bool bForeground, bool bBackground)
-{
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-
- if ( bForeground )
- {
- svtools::ColorConfig aColorConfig;
- Color aTextColor( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
-
- if ( IsControlForeground() )
- aTextColor = GetControlForeground();
- SetTextColor( aTextColor );
- }
-
- if ( bBackground )
- {
- if ( IsControlBackground() )
- SetBackground( GetControlBackground() );
- else
- SetBackground( rStyleSettings.GetWindowColor() );
- }
- Invalidate();
-}
-
SvxXRectPreview::SvxXRectPreview( Window* pParent, const ResId& rResId )
-: Control( pParent, rResId ),
- mpRectangleObject(0),
- mpModel(0)
+: SvxPreviewBase( pParent, rResId ),
+ mpRectangleObject(0)
{
- SetBorderStyle(WINDOW_BORDER_MONO);
- SetMapMode(MAP_100TH_MM);
InitSettings(true, true);
- // create model
- mpModel = new SdrModel();
- mpModel->GetItemPool().FreezeIdRanges();
-
// create RectangleObject
const Rectangle aObjectSize(Point(), GetOutputSize());
mpRectangleObject = new SdrRectObj(aObjectSize);
- mpRectangleObject->SetModel(mpModel);
-
- // Draw the control's border as a flat thin black line.
- SetBorderStyle (WINDOW_BORDER_MONO);
- SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
+ mpRectangleObject->SetModel(&getModel());
}
SvxXRectPreview::~SvxXRectPreview()
{
SdrObject::Free(mpRectangleObject);
- delete mpModel;
}
void SvxXRectPreview::SetAttributes(const SfxItemSet& rItemSet)
@@ -2151,30 +2178,18 @@ void SvxXRectPreview::SetAttributes(const SfxItemSet& rItemSet)
void SvxXRectPreview::Paint( const Rectangle& )
{
+ LocalPrePaint();
+
sdr::contact::SdrObjectVector aObjectVector;
+
aObjectVector.push_back(mpRectangleObject);
- sdr::contact::ObjectContactOfObjListPainter aPainter(*this, aObjectVector, 0);
+
+ sdr::contact::ObjectContactOfObjListPainter aPainter(getBufferDevice(), aObjectVector, 0);
sdr::contact::DisplayInfo aDisplayInfo;
aPainter.ProcessDisplay(aDisplayInfo);
-}
-void SvxXRectPreview::StateChanged( StateChangedType nType )
-{
- if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
- InitSettings(true, false);
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
- InitSettings(false, true);
-
- Control::StateChanged( nType );
-}
-
-void SvxXRectPreview::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
- InitSettings(true, true);
- else
- Control::DataChanged( rDCEvt );
+ LocalPostPaint();
}
/*************************************************************************
@@ -2183,44 +2198,13 @@ void SvxXRectPreview::DataChanged( const DataChangedEvent& rDCEvt )
|*
*************************************************************************/
-void SvxXShadowPreview::InitSettings(bool bForeground, bool bBackground)
-{
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-
- if ( bForeground )
- {
- svtools::ColorConfig aColorConfig;
- Color aTextColor( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
-
- if ( IsControlForeground() )
- aTextColor = GetControlForeground();
- SetTextColor( aTextColor );
- }
-
- if ( bBackground )
- {
- if ( IsControlBackground() )
- SetBackground( GetControlBackground() );
- else
- SetBackground( rStyleSettings.GetWindowColor() );
- }
- Invalidate();
-}
-
SvxXShadowPreview::SvxXShadowPreview( Window* pParent, const ResId& rResId )
-: Control( pParent, rResId ),
+: SvxPreviewBase( pParent, rResId ),
mpRectangleObject(0),
- mpRectangleShadow(0),
- mpModel(0)
+ mpRectangleShadow(0)
{
- SetBorderStyle(WINDOW_BORDER_MONO);
- SetMapMode(MAP_100TH_MM);
InitSettings(true, true);
- // create model
- mpModel = new SdrModel();
- mpModel->GetItemPool().FreezeIdRanges();
-
// prepare size
Size aSize = GetOutputSize();
aSize.Width() = aSize.Width() / 3;
@@ -2229,23 +2213,18 @@ SvxXShadowPreview::SvxXShadowPreview( Window* pParent, const ResId& rResId )
// create RectangleObject
const Rectangle aObjectSize( Point( aSize.Width(), aSize.Height() ), aSize );
mpRectangleObject = new SdrRectObj(aObjectSize);
- mpRectangleObject->SetModel(mpModel);
+ mpRectangleObject->SetModel(&getModel());
// create ShadowObject
const Rectangle aShadowSize( Point( aSize.Width(), aSize.Height() ), aSize );
mpRectangleShadow = new SdrRectObj(aShadowSize);
- mpRectangleShadow->SetModel(mpModel);
-
- // Draw the control's border as a flat thin black line.
- SetBorderStyle (WINDOW_BORDER_MONO);
- SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
+ mpRectangleShadow->SetModel(&getModel());
}
SvxXShadowPreview::~SvxXShadowPreview()
{
SdrObject::Free(mpRectangleObject);
SdrObject::Free(mpRectangleShadow);
- delete mpModel;
}
void SvxXShadowPreview::SetRectangleAttributes(const SfxItemSet& rItemSet)
@@ -2269,31 +2248,19 @@ void SvxXShadowPreview::SetShadowPosition(const Point& rPos)
void SvxXShadowPreview::Paint( const Rectangle& )
{
+ LocalPrePaint();
+
sdr::contact::SdrObjectVector aObjectVector;
+
aObjectVector.push_back(mpRectangleShadow);
aObjectVector.push_back(mpRectangleObject);
- sdr::contact::ObjectContactOfObjListPainter aPainter(*this, aObjectVector, 0);
+
+ sdr::contact::ObjectContactOfObjListPainter aPainter(getBufferDevice(), aObjectVector, 0);
sdr::contact::DisplayInfo aDisplayInfo;
aPainter.ProcessDisplay(aDisplayInfo);
-}
-
-void SvxXShadowPreview::StateChanged( StateChangedType nType )
-{
- if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
- InitSettings( TRUE, FALSE );
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
- InitSettings( FALSE, TRUE );
- Control::StateChanged( nType );
-}
-
-void SvxXShadowPreview::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
- InitSettings( TRUE, TRUE );
- else
- Control::DataChanged( rDCEvt );
+ LocalPostPaint();
}
// -----------------------------------------------------------------------
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index d3f09bcffdfe..fa9bc88d8f73 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -73,7 +73,12 @@ namespace sdr
ViewContact::~ViewContact()
{
- // get rid of all contacts
+ deleteAllVOCs();
+ }
+
+ void ViewContact::deleteAllVOCs()
+ {
+ // get rid of all VOCs
// #i84257# To avoid that each 'delete pCandidate' again uses
// the local RemoveViewObjectContact with a search and removal in the
// vector, simply copy and clear local vector.
@@ -301,6 +306,24 @@ namespace sdr
// default returns empty reference
return drawinglayer::primitive2d::Primitive2DSequence();
}
+
+ void ViewContact::flushViewObjectContacts(bool bWithHierarchy)
+ {
+ if(bWithHierarchy)
+ {
+ // flush DrawingLayer hierarchy
+ const sal_uInt32 nCount(GetObjectCount());
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ ViewContact& rChild = GetViewContact(a);
+ rChild.flushViewObjectContacts(bWithHierarchy);
+ }
+ }
+
+ // delete local VOCs
+ deleteAllVOCs();
+ }
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofe3d.cxx b/svx/source/sdr/contact/viewcontactofe3d.cxx
index f8d2558baf90..77a5bf4dff3c 100644
--- a/svx/source/sdr/contact/viewcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3d.cxx
@@ -211,14 +211,7 @@ namespace sdr
if(bFallbackToCreateAsLineForTest)
{
- ::std::vector< double > aEmptyVector;
- return new drawinglayer::attribute::SdrLineAttribute(
- basegfx::B2DLINEJOIN_NONE,
- 0.0,
- 0.0,
- rBColor,
- aEmptyVector,
- 0.0);
+ return new drawinglayer::attribute::SdrLineAttribute(rBColor);
}
else
{
diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index de45da9e0b51..01eb6699c4aa 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -305,18 +305,40 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfOuterPageBorder::createViewIndependentPrimitive2DSequence() const
{
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SdrPage& rPage = getPage();
const basegfx::B2DRange aPageBorderRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt());
- const basegfx::B2DPolygon aPageBorderPolygon(basegfx::tools::createPolygonFromRect(aPageBorderRange));
// We have only the page information, not the view information. Use the
// svtools::FONTCOLOR color for initialisation
const svtools::ColorConfig aColorConfig;
const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
const basegfx::BColor aRGBBorderColor(aBorderColor.getBColor());
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aPageBorderPolygon, aRGBBorderColor));
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ if(rPage.getPageBorderOnlyLeftRight())
+ {
+ // #i93597# for Report Designer, the page border shall be only displayed right and left,
+ // but not top and bottom. Create simplified geometry.
+ basegfx::B2DPolygon aLeft, aRight;
+
+ aLeft.append(basegfx::B2DPoint(aPageBorderRange.getMinX(), aPageBorderRange.getMinY()));
+ aLeft.append(basegfx::B2DPoint(aPageBorderRange.getMinX(), aPageBorderRange.getMaxY()));
+
+ aRight.append(basegfx::B2DPoint(aPageBorderRange.getMaxX(), aPageBorderRange.getMinY()));
+ aRight.append(basegfx::B2DPoint(aPageBorderRange.getMaxX(), aPageBorderRange.getMaxY()));
+
+ xRetval.realloc(2);
+ xRetval[0] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aLeft, aRGBBorderColor));
+ xRetval[1] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aRight, aRGBBorderColor));
+ }
+ else
+ {
+ xRetval.realloc(1);
+ const basegfx::B2DPolygon aPageBorderPolygon(basegfx::tools::createPolygonFromRect(aPageBorderRange));
+ xRetval[0] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aPageBorderPolygon, aRGBBorderColor));
+ }
+
+ return xRetval;
}
ViewContactOfOuterPageBorder::ViewContactOfOuterPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage)
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 2631bc50c276..ea260f3285f7 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -1347,7 +1347,9 @@ namespace sdr { namespace contact {
// a generic property changed. If we're in design mode, we need to repaint the control
if ( impl_isControlDesignMode_nothrow() )
- m_pAntiImpl->GetObjectContact().InvalidatePartOfView( m_pAntiImpl->getObjectRange() );
+ {
+ m_pAntiImpl->propertyChange();
+ }
}
//--------------------------------------------------------------------
@@ -1477,7 +1479,7 @@ namespace sdr { namespace contact {
DBG_NAME( ViewObjectContactOfUnoControl )
//--------------------------------------------------------------------
ViewObjectContactOfUnoControl::ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact )
- :ViewObjectContact( _rObjectContact, _rViewContact )
+ :ViewObjectContactOfSdrObj( _rObjectContact, _rViewContact )
,m_pImpl( new ViewObjectContactOfUnoControl_Impl( this ) )
{
DBG_CTOR( ViewObjectContactOfUnoControl, NULL );
@@ -1569,6 +1571,14 @@ namespace sdr { namespace contact {
{
VOCGuard aGuard( *m_pImpl );
m_pImpl->setControlDesignMode( _bDesignMode );
+
+ if(!_bDesignMode)
+ {
+ // when live mode is switched on, a refresh is needed. The edit mode visualisation
+ // needs to be repainted and the now used VCL-Window needs to be positioned and
+ // sized. Both is done from the repant refresh.
+ const_cast< ViewObjectContactOfUnoControl* >(this)->ActionChanged();
+ }
}
//--------------------------------------------------------------------
@@ -1581,36 +1591,10 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfUnoControl::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
{
- // current vsiualisation call. This is necessary to actually incarnate, position and size
- // a control which is represented as VCL-ChildWindow. This mechanism is placed here ATM for
- // convenience but may be placed to the View completely later:
- //
- // Let the OC (ObjectContact) aka View have a Pre-Run through the draw hierarchy and handle
- // necessary changes at xShapes which ARE controls. This needs to be done in Preparation of a
- // Paint.
- //
- // There is also the possibility to create a ControlPrimitiveRenderer which may be used as
- // paint-pre-run and records/handles all ControlPrimitives he finds.
- //
- // To test the possibility that the renderer does the positioning and sizing i added a
- // static flag here which will force a xControl to exist as a VCL Child window and it will
- // be added to the Primitive. There is an analog flag in the VCL pixel renderer in drawinglayer
- // to position and size he control there (look for bDoSizeAndPositionControlsA)
- static bool bDoSizeAndPositionControlsA(true);
-
- if(bDoSizeAndPositionControlsA)
- {
- if(rDisplayInfo.GetControlLayerProcessingActive())
- {
- positionControlForPaint(rDisplayInfo);
- }
- }
- else
- {
- // force control here to make it a VCL ChildWindow. Will be fetched
- // and used below by getExistentControl()
- m_pImpl->ensureControl();
- }
+ // force control here to make it a VCL ChildWindow. Will be fetched
+ // and used below by getExistentControl()
+ m_pImpl->ensureControl();
+ m_pImpl->positionControlForPaint(rDisplayInfo);
// get needed data
const ViewContactOfUnoControl& rViewContactOfUnoControl(static_cast< const ViewContactOfUnoControl& >(GetViewContact()));
@@ -1650,6 +1634,42 @@ namespace sdr { namespace contact {
}
}
+ void ViewObjectContactOfUnoControl::propertyChange()
+ {
+ // graphical invalidate at all views
+ ActionChanged();
+
+ // #i93318# flush Primitive2DSequence to force recreation with updated XControlModel
+ // since e.g. background color has changed and existing decompositions are evtl. no
+ // longer valid. Unfortunately this is not detected from ControlPrimitive2D::operator==
+ // since it only has a uno reference to the XControlModel
+ flushPrimitive2DSequence();
+ }
+
+ void ViewObjectContactOfUnoControl::ActionChanged()
+ {
+ // call parent
+ ViewObjectContactOfSdrObj::ActionChanged();
+ const ControlHolder& rControl(m_pImpl->getExistentControl());
+
+ if(rControl.is() && !rControl.isDesignMode())
+ {
+ // #i93180# if layer visibility has changed and control is in live mode, it is necessary
+ // to correct visibility to make those control vanish on SdrObject LayerID changes
+ const SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView();
+
+ if(pSdrPageView)
+ {
+ const bool bIsLayerVisible(pSdrPageView->GetVisibleLayers().IsSet(getSdrObject().GetLayer()));
+
+ if(rControl.isVisible() != bIsLayerVisible)
+ {
+ rControl.setVisible(bIsLayerVisible);
+ }
+ }
+ }
+ }
+
//====================================================================
//= UnoControlDefaultContact
//====================================================================
diff --git a/svx/source/sdr/overlay/makefile.mk b/svx/source/sdr/overlay/makefile.mk
index 636e1f7c1d02..fa12baba4c5d 100644
--- a/svx/source/sdr/overlay/makefile.mk
+++ b/svx/source/sdr/overlay/makefile.mk
@@ -54,6 +54,7 @@ SLOFILES=\
$(SLO)$/overlaytriangle.obj \
$(SLO)$/overlaycrosshair.obj \
$(SLO)$/overlayhelpline.obj \
+ $(SLO)$/overlayhatchrect.obj \
$(SLO)$/overlayrollingrectangle.obj \
$(SLO)$/overlaypolypolygon.obj \
$(SLO)$/overlaysdrobject.obj \
diff --git a/svx/source/sdr/overlay/overlayhatchrect.cxx b/svx/source/sdr/overlay/overlayhatchrect.cxx
new file mode 100644
index 000000000000..a15d38f16bc9
--- /dev/null
+++ b/svx/source/sdr/overlay/overlayhatchrect.cxx
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: overlaybitmap.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ *
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace overlay
+ {
+ basegfx::B2DPolyPolygon OverlayHatchRect::getGeometry(OutputDevice& rOutputDevice)
+ {
+ const basegfx::B2DPoint aDiscreteTopLeft(rOutputDevice.GetViewTransformation() * getBasePosition());
+ const basegfx::B2DPoint aDiscreteBottomRight(rOutputDevice.GetViewTransformation() * getSecondPosition());
+
+ basegfx::B2DRange aInnerRange(
+ floor(aDiscreteTopLeft.getX()), floor(aDiscreteTopLeft.getY()),
+ floor(aDiscreteBottomRight.getX()), floor(aDiscreteBottomRight.getY()));
+ basegfx::B2DRange aOuterRange(aInnerRange);
+ basegfx::B2DPolyPolygon aRetval;
+
+ aOuterRange.grow(getDiscreteWidth() * 0.5);
+ aInnerRange.grow(getDiscreteWidth() * -0.5);
+
+ aRetval.append(basegfx::tools::createPolygonFromRect(aOuterRange));
+ aRetval.append(basegfx::tools::createPolygonFromRect(aInnerRange));
+
+ if(!basegfx::fTools::equalZero(mfRotation))
+ {
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-aOuterRange.getMinX(), -aOuterRange.getMinY());
+ aTransform.rotate(getRotation());
+ aTransform.translate(aOuterRange.getMinX(), aOuterRange.getMinY());
+
+ aRetval.transform(aTransform);
+ }
+
+ return aRetval;
+ }
+
+ void OverlayHatchRect::drawGeometry(OutputDevice& rOutputDevice)
+ {
+ const basegfx::B2DPolyPolygon aB2DGeometry(getGeometry(rOutputDevice));
+ const bool bMapModeWasEnabled(rOutputDevice.IsMapModeEnabled());
+
+ // use VCL polygon and methodology for paint
+ double fFullRotation(getHatchRotation() - getRotation());
+
+ while(fFullRotation < 0.0)
+ {
+ fFullRotation += F_2PI;
+ }
+
+ while(fFullRotation >= F_2PI)
+ {
+ fFullRotation -= F_2PI;
+ }
+
+ const Hatch aHatch(HATCH_SINGLE, getBaseColor(), 3, (sal_uInt16)basegfx::fround(fFullRotation * ( 10.0 / F_PI180)));
+ rOutputDevice.EnableMapMode(false);
+ rOutputDevice.DrawHatch(PolyPolygon(aB2DGeometry), aHatch);
+ rOutputDevice.EnableMapMode(bMapModeWasEnabled);
+ }
+
+ void OverlayHatchRect::createBaseRange(OutputDevice& rOutputDevice)
+ {
+ // reset range and expand with fresh geometry
+ maBaseRange = getGeometry(rOutputDevice).getB2DRange();
+
+ // getGeometry data is in discrete coordinates (pixels), so transform back to
+ // world coordinates (logic)
+ maBaseRange.transform(rOutputDevice.GetInverseViewTransformation());
+ }
+
+ OverlayHatchRect::OverlayHatchRect(
+ const basegfx::B2DPoint& rBasePosition,
+ const basegfx::B2DPoint& rSecondPosition,
+ const Color& rHatchColor,
+ double fDiscreteWidth,
+ double fHatchRotation,
+ double fRotation)
+ : OverlayObjectWithBasePosition(rBasePosition, rHatchColor),
+ maSecondPosition(rSecondPosition),
+ mfDiscreteWidth(fDiscreteWidth),
+ mfHatchRotation(fHatchRotation),
+ mfRotation(fRotation)
+ {
+ }
+
+ void OverlayHatchRect::setSecondPosition(const basegfx::B2DPoint& rNew)
+ {
+ if(rNew != maSecondPosition)
+ {
+ // remember new value
+ maSecondPosition = rNew;
+
+ // register change (after change)
+ objectChange();
+ }
+ }
+
+ void OverlayHatchRect::zoomHasChanged()
+ {
+ // reset validity of range in logical coor to force recalculation
+ mbIsChanged = sal_True;
+ }
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
index 506792cb185d..d935cf3d2438 100644
--- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
//////////////////////////////////////////////////////////////////////////////
@@ -64,6 +65,17 @@ namespace drawinglayer
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(getTail(), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd()));
}
+ else
+ {
+ // if initially no line is defined, create one for HitTest and BoundRect
+ Primitive2DSequence aLineSequence(2);
+ const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
+
+ aLineSequence[0] = createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline);
+ aLineSequence[1] = createPolygonLinePrimitive(getTail(), getTransform(), aBlackHairline);
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(aLineSequence)));
+ }
// add text
if(getSdrLFSTAttribute().getText())
diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
index f560ddf2f73e..157bb3b5ec77 100644
--- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
//////////////////////////////////////////////////////////////////////////////
@@ -57,6 +58,15 @@ namespace drawinglayer
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(getUnitPolygon(), aEmptyMatrix, *getSdrLSTAttribute().getLine(), getSdrLSTAttribute().getLineStartEnd()));
}
+ else
+ {
+ // if initially no line is defined, create one for HitTest and BoundRect
+ const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
+ const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(getUnitPolygon(), aEmptyMatrix, aBlackHairline));
+ const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ }
// add text
if(getSdrLSTAttribute().getText())
diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
index 4f99a2bce348..4c075453bd70 100644
--- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
@@ -35,6 +35,9 @@
#include
#include
#include
+#include
+#include
+#include
//////////////////////////////////////////////////////////////////////////////
@@ -77,6 +80,15 @@ namespace drawinglayer
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
}
+ else
+ {
+ // if initially no line is defined, create one for HitTest and BoundRect
+ const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
+ const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
+ const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ }
// add text
if(getSdrLFSTAttribute().getText())
@@ -174,6 +186,15 @@ namespace drawinglayer
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd()));
}
+ else
+ {
+ // if initially no line is defined, create one for HitTest and BoundRect
+ const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
+ const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
+ const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ }
// add text
if(getSdrLFSTAttribute().getText())
diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
index 7122918aaed2..0d774c02dbe1 100644
--- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
@@ -35,6 +35,7 @@
#include
#include
#include
+#include
//////////////////////////////////////////////////////////////////////////////
@@ -82,6 +83,15 @@ namespace drawinglayer
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
}
}
+ else
+ {
+ // if initially no line is defined, create one for HitTest and BoundRect
+ const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
+ const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
+ const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ }
// add graphic content
if(255L != getGraphicAttr().GetTransparency())
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index b21757b26620..c4074a47217e 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -38,6 +38,7 @@
#include
#include
#include
+#include
//////////////////////////////////////////////////////////////////////////////
@@ -64,22 +65,21 @@ namespace drawinglayer
{
return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), 0L);
}
- else if(bLeftActive && bRightActive)
+
+ if(bLeftActive && bRightActive)
{
return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), maSdrLSTAttribute.getLineStartEnd());
}
- else
- {
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = maSdrLSTAttribute.getLineStartEnd();
- const ::basegfx::B2DPolyPolygon aEmpty;
- const attribute::SdrLineStartEndAttribute aLineStartEnd(
- bLeftActive ? pLineStartEnd->getStartPolyPolygon() : aEmpty, bRightActive ? pLineStartEnd->getEndPolyPolygon() : aEmpty,
- bLeftActive ? pLineStartEnd->getStartWidth() : 0.0, bRightActive ? pLineStartEnd->getEndWidth() : 0.0,
- bLeftActive ? pLineStartEnd->isStartActive() : false, bRightActive ? pLineStartEnd->isEndActive() : false,
- bLeftActive ? pLineStartEnd->isStartCentered() : false, bRightActive? pLineStartEnd->isEndCentered() : false);
-
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), &aLineStartEnd);
- }
+
+ const attribute::SdrLineStartEndAttribute* pLineStartEnd = maSdrLSTAttribute.getLineStartEnd();
+ const ::basegfx::B2DPolyPolygon aEmpty;
+ const attribute::SdrLineStartEndAttribute aLineStartEnd(
+ bLeftActive ? pLineStartEnd->getStartPolyPolygon() : aEmpty, bRightActive ? pLineStartEnd->getEndPolyPolygon() : aEmpty,
+ bLeftActive ? pLineStartEnd->getStartWidth() : 0.0, bRightActive ? pLineStartEnd->getEndWidth() : 0.0,
+ bLeftActive ? pLineStartEnd->isStartActive() : false, bRightActive ? pLineStartEnd->isEndActive() : false,
+ bLeftActive ? pLineStartEnd->isStartCentered() : false, bRightActive? pLineStartEnd->isEndCentered() : false);
+
+ return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *maSdrLSTAttribute.getLine(), &aLineStartEnd);
}
Primitive2DSequence SdrMeasurePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
@@ -128,7 +128,15 @@ namespace drawinglayer
aTextRange = pBlockText->getB2DRange(aViewInformation);
}
- if(maSdrLSTAttribute.getLine())
+ // prepare line attribute and result
+ const attribute::SdrLineAttribute* pLineAttribute(maSdrLSTAttribute.getLine());
+
+ if(!pLineAttribute)
+ {
+ // if initially no line is defined, create one for HitTest and BoundRect
+ pLineAttribute = new attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0));
+ }
+
{
bool bArrowsOutside(false);
bool bMainLineSplitted(false);
@@ -167,7 +175,7 @@ namespace drawinglayer
const double fSpaceNeededByArrows(fStartArrowH + fEndArrowH + ((fStartArrowW + fEndArrowW) * 0.5));
const double fArrowsOutsideLen((fStartArrowH + fEndArrowH + fStartArrowW + fEndArrowW) * 0.5);
- const double fHalfLineWidth(maSdrLSTAttribute.getLine()->getWidth() * 0.5);
+ const double fHalfLineWidth(pLineAttribute->getWidth() * 0.5);
if(fSpaceNeededByArrows > fDistance)
{
@@ -380,6 +388,16 @@ namespace drawinglayer
}
}
+ if(!maSdrLSTAttribute.getLine())
+ {
+ // embed line geometry to invisible line group
+ const Primitive2DReference xHiddenLines(new HitTestPrimitive2D(aRetval));
+ aRetval = Primitive2DSequence(&xHiddenLines, 1);
+
+ // delete temporary LineAttribute again
+ delete pLineAttribute;
+ }
+
if(pBlockText)
{
// create transformation to text primitive end position
diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
index 84dc238eb7e6..e30678bdbf77 100644
--- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
@@ -33,6 +33,7 @@
#include
#include
#include
+#include
//////////////////////////////////////////////////////////////////////////////
@@ -64,31 +65,43 @@ namespace drawinglayer
}
// add line
- if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine())
{
- // if line width is given, polygon needs to be grown by half of it to make the
- // outline to be outside of the bitmap
- if(0.0 != getSdrLFSTAttribute().getLine()->getWidth())
+ if(bBehaveCompatibleToPaintVersion)
{
- // decompose to get scale
- basegfx::B2DVector aScale, aTranslate;
- double fRotate, fShearX;
- getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
-
- // create expanded range (add relative half line width to unit rectangle)
- double fHalfLineWidth(getSdrLFSTAttribute().getLine()->getWidth() * 0.5);
- double fScaleX(0.0 != aScale.getX() ? fHalfLineWidth / fabs(aScale.getX()) : 1.0);
- double fScaleY(0.0 != aScale.getY() ? fHalfLineWidth / fabs(aScale.getY()) : 1.0);
- const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY);
- basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange));
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aExpandedUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
- }
- else
- {
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ // if line width is given, polygon needs to be grown by half of it to make the
+ // outline to be outside of the bitmap
+ if(0.0 != getSdrLFSTAttribute().getLine()->getWidth())
+ {
+ // decompose to get scale
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // create expanded range (add relative half line width to unit rectangle)
+ double fHalfLineWidth(getSdrLFSTAttribute().getLine()->getWidth() * 0.5);
+ double fScaleX(0.0 != aScale.getX() ? fHalfLineWidth / fabs(aScale.getX()) : 1.0);
+ double fScaleY(0.0 != aScale.getY() ? fHalfLineWidth / fabs(aScale.getY()) : 1.0);
+ const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY);
+ basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange));
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aExpandedUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ }
+ else
+ {
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ }
}
}
+ else
+ {
+ // if initially no line is defined, create one for HitTest and BoundRect
+ const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
+ const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
+ const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ }
// add graphic content
appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, getChildren());
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index 7409100e9f7e..20367e49f5f0 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
//////////////////////////////////////////////////////////////////////////////
@@ -70,6 +71,19 @@ namespace drawinglayer
appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp);
}
+ else
+ {
+ // if initially no line is defined, create one for HitTest and BoundRect
+ const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
+ Primitive2DSequence xHiddenLineSequence(maUnitPolyPolygon.count());
+
+ for(sal_uInt32 a(0); a < maUnitPolyPolygon.count(); a++)
+ {
+ xHiddenLineSequence[a] = createPolygonLinePrimitive(maUnitPolyPolygon.getB2DPolygon(a), maTransform, aBlackHairline);
+ }
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ }
// add text
if(maSdrLFSTAttribute.getText())
diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
index 6ffb9f9f08fd..ab54e1af1af5 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
//////////////////////////////////////////////////////////////////////////////
@@ -50,31 +51,40 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromRect(::basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), mfCornerRadiusX, mfCornerRadiusY));
+ ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromRect(::basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), getCornerRadiusX(), getCornerRadiusY()));
// add fill
- if(maSdrLFSTAttribute.getFill())
+ if(getSdrLFSTAttribute().getFill())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), maTransform, *maSdrLFSTAttribute.getFill(), maSdrLFSTAttribute.getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(maSdrLFSTAttribute.getLine())
+ if(getSdrLFSTAttribute().getLine())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, maTransform, *maSdrLFSTAttribute.getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ }
+ else
+ {
+ // if initially no line is defined, create one for HitTest and BoundRect
+ const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
+ const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
+ const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
}
// add text
- if(maSdrLFSTAttribute.getText())
+ if(getSdrLFSTAttribute().getText())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), maTransform, *maSdrLFSTAttribute.getText(), maSdrLFSTAttribute.getLine(), false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false));
}
// add shadow
- if(maSdrLFSTAttribute.getShadow())
+ if(getSdrLFSTAttribute().getShadow())
{
// attention: shadow is added BEFORE object stuff to render it BEHIND object (!)
- const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *maSdrLFSTAttribute.getShadow()));
+ const Primitive2DReference xShadow(createShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow()));
if(xShadow.is())
{
@@ -107,10 +117,10 @@ namespace drawinglayer
{
const SdrRectanglePrimitive2D& rCompare = (SdrRectanglePrimitive2D&)rPrimitive;
- return (mfCornerRadiusX == rCompare.mfCornerRadiusX
- && mfCornerRadiusY == rCompare.mfCornerRadiusY
- && maTransform == rCompare.maTransform
- && maSdrLFSTAttribute == rCompare.maSdrLFSTAttribute);
+ return (getCornerRadiusX() == rCompare.getCornerRadiusX()
+ && getCornerRadiusY() == rCompare.getCornerRadiusY()
+ && getTransform() == rCompare.getTransform()
+ && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute());
}
return false;
diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
index 9500c350e8d0..652327f3ff85 100644
--- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx
+++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
@@ -82,15 +82,6 @@ namespace sdr
return *mpViewContact;
}
- void MasterPageDescriptor::FlushViewContact() const
- {
- if(mpViewContact)
- {
- delete mpViewContact;
- ((MasterPageDescriptor*)this)->mpViewContact = 0;
- }
- }
-
// this method is called form the destructor of the referenced page.
// do all necessary action to forget the page. It is not necessary to call
// RemovePageUser(), that is done form the destructor.
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 4d99598bed78..6cc43df61a3e 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -634,32 +634,49 @@ BOOL SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl
} break;
default:
- { // SDRDRAG_MOVE
- if ( ( eDragHdl == HDL_MOVE ) && !IsMoveAllowed() )
+ {
+ // SDRDRAG_MOVE
+ if((eDragHdl == HDL_MOVE) && !IsMoveAllowed())
+ {
return FALSE;
- else if ( eDragHdl==HDL_GLUE )
+ }
+ else if(eDragHdl == HDL_GLUE)
+ {
pDragBla = new SdrDragMove(*this);
+ }
else
{
- if ( bFramDrag )
+ if(bFramDrag)
{
- if ( eDragHdl == HDL_MOVE )
+ if(eDragHdl == HDL_MOVE)
+ {
pDragBla=new SdrDragMove(*this);
+ }
else
{
- if (!IsResizeAllowed(TRUE)) return FALSE;
- pDragBla=new SdrDragResize(*this);
+ if(!IsResizeAllowed(TRUE))
+ {
+ return FALSE;
+ }
+
+ pDragBla = new SdrDragResize(*this);
}
}
else
{
- if ( ( eDragHdl == HDL_MOVE ) && ( GetMarkedObjectCount() == 1 )
- && GetMarkedObjectByIndex( 0 )->ISA( SdrObjCustomShape ) )
+ if((eDragHdl == HDL_MOVE) && (GetMarkedObjectCount() == 1) && GetMarkedObjectByIndex(0)->ISA(SdrObjCustomShape))
+ {
pDragBla = new SdrDragMove( *this );
+ }
+ else if((eDragHdl == HDL_POLY) && (!IsMoveAllowed() || !IsResizeAllowed()))
+ {
+ // #i77187# do not allow move of polygon points if object is move or size protected
+ return FALSE;
+ }
else
{
- bDragSpecial=TRUE;
- pDragBla=new SdrDragObjOwn(*this);
+ bDragSpecial = TRUE;
+ pDragBla = new SdrDragObjOwn(*this);
}
}
}
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 632761bb819c..ba1f8914ba8b 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -1410,40 +1410,74 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
MoveMarkedObj(Size(nPosDX,nPosDY));
}
- // Position geschuetzt
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS,TRUE,&pPoolItem))
+ // protect position
+ if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS, TRUE, &pPoolItem))
{
- BOOL bProtPos=((const SfxBoolItem*)pPoolItem)->GetValue();
- for (ULONG i=0; iGetMarkedSdrObj();
- pObj->SetMoveProtect(bProtPos);
- if( bProtPos )
- pObj->SetResizeProtect(true);
+ const sal_Bool bProtPos(((const SfxBoolItem*)pPoolItem)->GetValue());
+ bool bChanged(false);
+
+ for(sal_uInt32 i(0); i < nMarkCount; i++)
+ {
+ pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+
+ if(pObj->IsMoveProtect() != bProtPos)
+ {
+ bChanged = true;
+ pObj->SetMoveProtect(bProtPos);
+
+ if(bProtPos)
+ {
+ pObj->SetResizeProtect(true);
+ }
+ }
+ }
+
+ if(bChanged)
+ {
+ bMoveProtect = bProtPos;
+
+ if(bProtPos)
+ {
+ bResizeProtect = true;
+ }
+
+ // #i77187# there is no simple method to get the toolbars updated
+ // in the application. The App is listening to selection change and i
+ // will use it here (even if not true). It's acceptable since changing
+ // this model data is pretty rare and only possible using the F4 dialog
+ MarkListHasChanged();
}
- // BugFix 13897: hier muesste besser ein Broadcast her!
- // Ausserdem fehlt Undo
- // oder -> bProtPos/Size als Item (Interface)
- bMoveProtect=bProtPos;
- if( bProtPos )
- bResizeProtect=true;
}
- if( !bMoveProtect )
+ if(!bMoveProtect)
{
- // Groesse geschuetzt
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_SIZE,TRUE,&pPoolItem))
+ // protect size
+ if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_SIZE, TRUE, &pPoolItem))
{
- BOOL bProtSize=((const SfxBoolItem*)pPoolItem)->GetValue();
- for (ULONG i=0; iGetMarkedSdrObj();
- pObj->SetResizeProtect(bProtSize);
+ const sal_Bool bProtSize(((const SfxBoolItem*)pPoolItem)->GetValue());
+ bool bChanged(false);
+
+ for(sal_uInt32 i(0); i < nMarkCount; i++)
+ {
+ pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+
+ if(pObj->IsResizeProtect() != bProtSize)
+ {
+ bChanged = true;
+ pObj->SetResizeProtect(bProtSize);
+ }
+ }
+
+ if(bChanged)
+ {
+ bResizeProtect = bProtSize;
+
+ // #i77187# see above
+ MarkListHasChanged();
}
- // BugFix 13897: hier muesste besser ein Broadcast her!
- // Ausserdem fehlt Undo
- // oder -> bProtPos/Size als Item (Interface)
- bResizeProtect=bProtSize;
}
}
+
EndUndo();
}
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 8ada8ace73fa..c338d9845c21 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -65,6 +65,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -815,55 +816,50 @@ bool SdrHdl::IsHdlHit(const Point& rPnt) const
Pointer SdrHdl::GetPointer() const
{
PointerStyle ePtr=POINTER_MOVE;
- BOOL bSize=eKind>=HDL_UPLFT && eKind<=HDL_LWRGT;
- // Fuer Resize von gedrehten Rechtecken die Mauszeiger etwas mitdrehen
- if (bSize && nDrehWink!=0)
- {
- long nHdlWink=0;
+ const BOOL bSize=eKind>=HDL_UPLFT && eKind<=HDL_LWRGT;
+ const BOOL bRot=pHdlList!=NULL && pHdlList->IsRotateShear();
+ const BOOL bDis=pHdlList!=NULL && pHdlList->IsDistortShear();
+ if (bSize && pHdlList!=NULL && (bRot || bDis)) {
switch (eKind) {
- case HDL_UPLFT: nHdlWink=13500; break;
- case HDL_UPPER: nHdlWink=9000; break;
- case HDL_UPRGT: nHdlWink=4500; break;
- case HDL_LEFT : nHdlWink=0; break;
- case HDL_RIGHT: nHdlWink=0; break;
- case HDL_LWLFT: nHdlWink=4500; break;
- case HDL_LOWER: nHdlWink=9000; break;
- case HDL_LWRGT: nHdlWink=13500; break;
+ case HDL_UPLFT: case HDL_UPRGT:
+ case HDL_LWLFT: case HDL_LWRGT: ePtr=bRot ? POINTER_ROTATE : POINTER_REFHAND; break;
+ case HDL_LEFT : case HDL_RIGHT: ePtr=POINTER_VSHEAR; break;
+ case HDL_UPPER: case HDL_LOWER: ePtr=POINTER_HSHEAR; break;
default:
break;
}
- nHdlWink+=nDrehWink+2249; // und etwas drauf (zum runden)
- while (nHdlWink<0) nHdlWink+=18000;
- while (nHdlWink>=18000) nHdlWink-=18000;
- nHdlWink/=4500;
- switch ((BYTE)nHdlWink)
- {
- case 0: ePtr=POINTER_ESIZE; break;
- case 1: ePtr=POINTER_NESIZE; break;
- case 2: ePtr=POINTER_SSIZE; break;
- case 3: ePtr=POINTER_SESIZE; break;
- } // switch
- }
- if (ePtr==POINTER_MOVE)
- {
- BOOL bRot=pHdlList!=NULL && pHdlList->IsRotateShear();
- BOOL bDis=pHdlList!=NULL && pHdlList->IsDistortShear();
- if (bSize && pHdlList!=NULL && (bRot || bDis))
- {
- switch (eKind)
- {
- case HDL_UPLFT: case HDL_UPRGT:
- case HDL_LWLFT: case HDL_LWRGT: ePtr=bRot ? POINTER_ROTATE : POINTER_REFHAND; break;
- case HDL_LEFT : case HDL_RIGHT: ePtr=POINTER_VSHEAR; break;
- case HDL_UPPER: case HDL_LOWER: ePtr=POINTER_HSHEAR; break;
+ } else {
+ // Fuer Resize von gedrehten Rechtecken die Mauszeiger etwas mitdrehen
+ if (bSize && nDrehWink!=0) {
+ long nHdlWink=0;
+ switch (eKind) {
+ case HDL_LWRGT: nHdlWink=31500; break;
+ case HDL_LOWER: nHdlWink=27000; break;
+ case HDL_LWLFT: nHdlWink=22500; break;
+ case HDL_LEFT : nHdlWink=18000; break;
+ case HDL_UPLFT: nHdlWink=13500; break;
+ case HDL_UPPER: nHdlWink=9000; break;
+ case HDL_UPRGT: nHdlWink=4500; break;
+ case HDL_RIGHT: nHdlWink=0; break;
default:
break;
}
- }
- else
- {
- switch (eKind)
- {
+ nHdlWink+=nDrehWink+2249; // und etwas drauf (zum runden)
+ while (nHdlWink<0) nHdlWink+=36000;
+ while (nHdlWink>=36000) nHdlWink-=36000;
+ nHdlWink/=4500;
+ switch ((BYTE)nHdlWink) {
+ case 0: ePtr=POINTER_ESIZE; break;
+ case 1: ePtr=POINTER_NESIZE; break;
+ case 2: ePtr=POINTER_NSIZE; break;
+ case 3: ePtr=POINTER_NWSIZE; break;
+ case 4: ePtr=POINTER_WSIZE; break;
+ case 5: ePtr=POINTER_SWSIZE; break;
+ case 6: ePtr=POINTER_SSIZE; break;
+ case 7: ePtr=POINTER_SESIZE; break;
+ } // switch
+ } else {
+ switch (eKind) {
case HDL_UPLFT: ePtr=POINTER_NWSIZE; break;
case HDL_UPPER: ePtr=POINTER_NSIZE; break;
case HDL_UPRGT: ePtr=POINTER_NESIZE; break;
@@ -1655,6 +1651,65 @@ Pointer ImpMeasureHdl::GetPointer() const
////////////////////////////////////////////////////////////////////////////////////////////////////
+ImpTextframeHdl::ImpTextframeHdl(const Rectangle& rRect) :
+ SdrHdl(rRect.TopLeft(),HDL_MOVE),
+ maRect(rRect)
+{
+}
+
+void ImpTextframeHdl::CreateB2dIAObject()
+{
+ // first throw away old one
+ GetRidOfIAObject();
+
+ if(pHdlList)
+ {
+ SdrMarkView* pView = pHdlList->GetView();
+
+ if(pView && !pView->areMarkHandlesHidden())
+ {
+ SdrPageView* pPageView = pView->GetSdrPageView();
+
+ if(pPageView)
+ {
+ for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
+ {
+ const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
+
+ if(rPageWindow.GetPaintWindow().OutputToWindow())
+ {
+ if(rPageWindow.GetOverlayManager())
+ {
+ const basegfx::B2DPoint aTopLeft(maRect.Left(), maRect.Top());
+ const basegfx::B2DPoint aBottomRight(maRect.Right(), maRect.Bottom());
+ const svtools::ColorConfig aColorConfig;
+ const Color aHatchCol( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
+
+ ::sdr::overlay::OverlayHatchRect* pNewOverlayObject = new ::sdr::overlay::OverlayHatchRect(
+ aTopLeft,
+ aBottomRight,
+ aHatchCol,
+ 6.0,
+ 45 * F_PI180,
+ nDrehWink * -F_PI18000);
+ pNewOverlayObject->setHittable(false);
+
+ // OVERLAYMANAGER
+ if(pNewOverlayObject)
+ {
+ rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
class ImpSdrHdlListSorter: public ContainerSorter {
public:
ImpSdrHdlListSorter(Container& rNewCont): ContainerSorter(rNewCont) {}
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 97793ffa769e..fb5f76d41229 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -696,10 +696,15 @@ void SdrMarkView::SetMarkHandles()
{
ULONG nMarkAnz=GetMarkedObjectCount();
BOOL bStdDrag=eDragMode==SDRDRAG_MOVE;
+ BOOL bSingleTextObjMark=FALSE;
if (nMarkAnz==1)
{
pMarkedObj=GetMarkedObjectByIndex(0);
+ bSingleTextObjMark =
+ pMarkedObj &&
+ pMarkedObj->ISA(SdrTextObj) &&
+ static_cast(pMarkedObj)->IsTextFrame();
}
BOOL bFrmHdl=ImpIsFrameHandles();
@@ -732,8 +737,20 @@ void SdrMarkView::SetMarkHandles()
if(!aRect.IsEmpty() && !bHideHandlesWhenInTextEdit)
{ // sonst nix gefunden
-
- if( eDragMode==SDRDRAG_CROP )
+ if( bSingleTextObjMark )
+ {
+ const ULONG nSiz0=aHdl.GetHdlCount();
+ pMarkedObj->AddToHdlList(aHdl);
+ const ULONG nSiz1=aHdl.GetHdlCount();
+ for (ULONG i=nSiz0; iSetObj(pMarkedObj);
+ pHdl->SetPageView(pMarkedPV);
+ pHdl->SetObjHdlNum(USHORT(i-nSiz0));
+ }
+ }
+ else if( eDragMode==SDRDRAG_CROP )
{
aHdl.AddHdl(new SdrCropHdl(aRect.TopLeft() ,HDL_UPLFT));
aHdl.AddHdl(new SdrCropHdl(aRect.TopCenter() ,HDL_UPPER));
@@ -778,9 +795,9 @@ void SdrMarkView::SetMarkHandles()
const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
SdrObject* pObj=pM->GetMarkedSdrObj();
SdrPageView* pPV=pM->GetPageView();
- ULONG nSiz0=aHdl.GetHdlCount();
+ const ULONG nSiz0=aHdl.GetHdlCount();
pObj->AddToHdlList(aHdl);
- ULONG nSiz1=aHdl.GetHdlCount();
+ const ULONG nSiz1=aHdl.GetHdlCount();
bool bPoly=pObj->IsPolyObj();
const SdrUShortCont* pMrkPnts=pM->GetMarkedPoints();
for (ULONG i=nSiz0; iIsNotVisibleAsMaster()) {
+ if((nOptions & SDRSEARCH_IMPISMASTER) && pObj->IsNotVisibleAsMaster())
+ {
return NULL;
}
- BOOL bCheckIfMarkable=(nOptions & SDRSEARCH_TESTMARKABLE)!=0;
- //BOOL bBack=(nOptions & SDRSEARCH_BACKWARD)!=0;
- BOOL bDeep=(nOptions & SDRSEARCH_DEEP)!=0;
- BOOL bOLE=pObj->ISA(SdrOle2Obj);
+
+ const bool bCheckIfMarkable(nOptions & SDRSEARCH_TESTMARKABLE);
+ const bool bDeep(nOptions & SDRSEARCH_DEEP);
+ const bool bOLE(pObj->ISA(SdrOle2Obj));
+ const bool bTXT(pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsTextFrame());
SdrObject* pRet=NULL;
Rectangle aRect(pObj->GetCurrentBoundRect());
- USHORT nTol2=nTol;
- // Doppelte Tolezanz fuer ein an dieser View im TextEdit befindliches Objekt
- if (bOLE || pObj==((SdrObjEditView*)this)->GetTextEditObject()) nTol2*=2;
+ USHORT nTol2(nTol);
+
+ // double tolerance for OLE, text frames and objects in
+ // active text edit
+ if(bOLE || bTXT || pObj==((SdrObjEditView*)this)->GetTextEditObject())
+ {
+ nTol2*=2;
+ }
+
aRect.Left ()-=nTol2; // Einmal Toleranz drauf fuer alle Objekte
aRect.Top ()-=nTol2;
aRect.Right ()+=nTol2;
aRect.Bottom()+=nTol2;
- if (aRect.IsInside(rPnt)) {
- if ((!bCheckIfMarkable || IsObjMarkable(pObj,pPV))) {
+
+ if (aRect.IsInside(rPnt))
+ {
+ if ((!bCheckIfMarkable || IsObjMarkable(pObj,pPV)))
+ {
SdrObjList* pOL=pObj->GetSubList();
- if (pOL!=NULL && pOL->GetObjCount()!=0) {
+
+ if (pOL!=NULL && pOL->GetObjCount()!=0)
+ {
SdrObject* pTmpObj;
// OD 30.06.2003 #108784# - adjustment hit point for virtual
// objects.
Point aPnt( rPnt );
+
if ( pObj->ISA(SdrVirtObj) )
{
Point aOffset = static_cast(pObj)->GetOffset();
aPnt.Move( -aOffset.X(), -aOffset.Y() );
}
+
pRet=ImpCheckObjHit(aPnt,nTol,pOL,pPV,nOptions,pMVisLay,pTmpObj);
- } else {
+ }
+ else
+ {
SdrLayerID nLay=pObj->GetLayer();
- if (pPV->GetVisibleLayers().IsSet(nLay) &&
- (pMVisLay==NULL || pMVisLay->IsSet(nLay)))
+
+ if(pPV->GetVisibleLayers().IsSet(nLay) && (pMVisLay==NULL || pMVisLay->IsSet(nLay)))
{
pRet=pObj->CheckHit(rPnt,nTol2,&pPV->GetVisibleLayers());
}
}
}
}
- if (!bDeep && pRet!=NULL) pRet=pObj;
+
+ if (!bDeep && pRet!=NULL)
+ {
+ pRet=pObj;
+ }
+
return pRet;
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index b68dddbd4637..514d78e2cbf9 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -365,15 +365,6 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const
return *mpViewContact;
}
-void SdrObject::FlushViewContact() const
-{
- if(mpViewContact)
- {
- delete mpViewContact;
- ((SdrObject*)this)->mpViewContact = 0;
- }
-}
-
// DrawContact support: Methods for handling Object changes
void SdrObject::ActionChanged() const
{
@@ -2637,23 +2628,23 @@ void SdrObject::SetInserted(sal_Bool bIns)
void SdrObject::SetMoveProtect(sal_Bool bProt)
{
- bMovProt = bProt;
- SetChanged();
-
- if(IsInserted() && pModel)
+ if(IsMoveProtect() != bProt)
{
- SdrHint aHint(*this);
- pModel->Broadcast(aHint);
+ // #i77187# secured and simplified
+ bMovProt = bProt;
+ SetChanged();
+ BroadcastObjectChange();
}
}
void SdrObject::SetResizeProtect(sal_Bool bProt)
{
- bSizProt=bProt;
- SetChanged();
- if (IsInserted() && pModel!=NULL) {
- SdrHint aHint(*this);
- pModel->Broadcast(aHint);
+ if(IsResizeProtect() != bProt)
+ {
+ // #i77187# secured and simplified
+ bSizProt = bProt;
+ SetChanged();
+ BroadcastObjectChange();
}
}
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 6dd5003ae2ef..0f8213d37e9e 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -2346,50 +2346,52 @@ Pointer SdrPathObj::GetCreatePointer() const
void SdrPathObj::NbcMove(const Size& rSiz)
{
- SdrTextObj::NbcMove(rSiz);
-
basegfx::B2DHomMatrix aTrans;
aTrans.translate(rSiz.Width(), rSiz.Height());
maPathPolygon.transform(aTrans);
+
+ // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
+ SdrTextObj::NbcMove(rSiz);
}
void SdrPathObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
{
- SdrTextObj::NbcResize(rRef,xFact,yFact);
-
basegfx::B2DHomMatrix aTrans;
aTrans.translate(-rRef.X(), -rRef.Y());
aTrans.scale(double(xFact), double(yFact));
aTrans.translate(rRef.X(), rRef.Y());
maPathPolygon.transform(aTrans);
+
+ // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
+ SdrTextObj::NbcResize(rRef,xFact,yFact);
}
void SdrPathObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
{
- SdrTextObj::NbcRotate(rRef,nWink,sn,cs);
-
basegfx::B2DHomMatrix aTrans;
aTrans.translate(-rRef.X(), -rRef.Y());
aTrans.rotate(-nWink * nPi180); // Thank JOE, the angles are defined mirrored to the mathematical meanings
aTrans.translate(rRef.X(), rRef.Y());
maPathPolygon.transform(aTrans);
+
+ // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
+ SdrTextObj::NbcRotate(rRef,nWink,sn,cs);
}
void SdrPathObj::NbcShear(const Point& rRefPnt, long nAngle, double fTan, FASTBOOL bVShear)
{
- SdrTextObj::NbcShear(rRefPnt,nAngle,fTan,bVShear);
-
basegfx::B2DHomMatrix aTrans;
aTrans.translate(-rRefPnt.X(), -rRefPnt.Y());
aTrans.shearX(-fTan); // Thank JOE, the angles are defined mirrored to the mathematical meanings
aTrans.translate(rRefPnt.X(), rRefPnt.Y());
maPathPolygon.transform(aTrans);
+
+ // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
+ SdrTextObj::NbcShear(rRefPnt,nAngle,fTan,bVShear);
}
void SdrPathObj::NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2)
{
- SdrTextObj::NbcMirror(rRefPnt1,rRefPnt2);
-
basegfx::B2DHomMatrix aTrans;
const double fDiffX(rRefPnt2.X() - rRefPnt1.X());
const double fDiffY(rRefPnt2.Y() - rRefPnt1.Y());
@@ -2403,13 +2405,19 @@ void SdrPathObj::NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2)
// #97538# Do Joe's special handling for lines when mirroring, too
ImpForceKind();
+
+ // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
+ SdrTextObj::NbcMirror(rRefPnt1,rRefPnt2);
}
void SdrPathObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
{
- if (aGeo.nDrehWink==0) {
- rRect=GetSnapRect();
- } else {
+ if(!aGeo.nDrehWink)
+ {
+ rRect = GetSnapRect();
+ }
+ else
+ {
XPolyPolygon aXPP(GetPathPoly());
RotateXPoly(aXPP,Point(),-aGeo.nSin,aGeo.nCos);
rRect=aXPP.GetBoundRect();
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index a338889afa48..8620110d6979 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -403,24 +403,34 @@ SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const
SdrHdl* pH=NULL;
Point aPnt;
SdrHdlKind eKind=HDL_MOVE;
- switch (nHdlNum) {
- case 0: {
- long a=GetEckenradius();
- long b=Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert
- if (a>b) a=b;
- if (a<0) a=0;
- aPnt=aRect.TopLeft();
- aPnt.X()+=a;
- eKind=HDL_CIRC;
- } break; // Eckenradius
- case 1: aPnt=aRect.TopLeft(); eKind=HDL_UPLFT; break; // Oben links
- case 2: aPnt=aRect.TopCenter(); eKind=HDL_UPPER; break; // Oben
- case 3: aPnt=aRect.TopRight(); eKind=HDL_UPRGT; break; // Oben rechts
- case 4: aPnt=aRect.LeftCenter(); eKind=HDL_LEFT ; break; // Links
- case 5: aPnt=aRect.RightCenter(); eKind=HDL_RIGHT; break; // Rechts
- case 6: aPnt=aRect.BottomLeft(); eKind=HDL_LWLFT; break; // Unten links
- case 7: aPnt=aRect.BottomCenter(); eKind=HDL_LOWER; break; // Unten
- case 8: aPnt=aRect.BottomRight(); eKind=HDL_LWRGT; break; // Unten rechts
+ if( IsTextFrame() && !nHdlNum )
+ {
+ pH=new ImpTextframeHdl(aRect);
+ pH->SetObj((SdrObject*)this);
+ pH->SetDrehWink(aGeo.nDrehWink);
+ return pH;
+ }
+ else
+ {
+ switch (nHdlNum) {
+ case 0: {
+ long a=GetEckenradius();
+ long b=Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert
+ if (a>b) a=b;
+ if (a<0) a=0;
+ aPnt=aRect.TopLeft();
+ aPnt.X()+=a;
+ eKind=HDL_CIRC;
+ } break; // Eckenradius
+ case 1: aPnt=aRect.TopLeft(); eKind=HDL_UPLFT; break; // Oben links
+ case 2: aPnt=aRect.TopCenter(); eKind=HDL_UPPER; break; // Oben
+ case 3: aPnt=aRect.TopRight(); eKind=HDL_UPRGT; break; // Oben rechts
+ case 4: aPnt=aRect.LeftCenter(); eKind=HDL_LEFT ; break; // Links
+ case 5: aPnt=aRect.RightCenter(); eKind=HDL_RIGHT; break; // Rechts
+ case 6: aPnt=aRect.BottomLeft(); eKind=HDL_LWLFT; break; // Unten links
+ case 7: aPnt=aRect.BottomCenter(); eKind=HDL_LOWER; break; // Unten
+ case 8: aPnt=aRect.BottomRight(); eKind=HDL_LWRGT; break; // Unten rechts
+ }
}
if (aGeo.nShearWink!=0) ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan);
if (aGeo.nDrehWink!=0) RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index ddf6e87fe51a..2c42adfd63c6 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -559,9 +559,9 @@ void SdrUnoObj::SetUnoControlModel( uno::Reference< awt::XControlModel > xModel)
ViewContactOfUnoControl* pVC = NULL;
if ( impl_getViewContact( pVC ) )
{
- // FlushViewContact() removes all existing VOCs. This is always allowed
- // since they will be re-created on demand (and with the changed model)
- FlushViewContact();
+ // flushViewObjectContacts() removes all existing VOCs for the local DrawHierarchy. This
+ // is always allowed since they will be re-created on demand (and with the changed model)
+ GetViewContact().flushViewObjectContacts(true);
}
}
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index f7dca8ee7e00..2986cb482aae 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -257,9 +257,9 @@ void SdrObjList::Clear()
SdrObject* pObj = maList.back();
RemoveObjectFromContainer(maList.size()-1);
- // FlushViewContact() is done since SdrObject::Free is not guaranteed
+ // flushViewObjectContacts() is done since SdrObject::Free is not guaranteed
// to delete the object and thus refresh visualisations
- pObj->FlushViewContact();
+ pObj->GetViewContact().flushViewObjectContacts(true);
bObjectsRemoved = sal_True;
@@ -441,8 +441,8 @@ SdrObject* SdrObjList::NbcRemoveObject(ULONG nObjNum)
SdrObject* pObj=maList[nObjNum];
RemoveObjectFromContainer(nObjNum);
- // FlushViewContact() clears the VOC's and those invalidate
- pObj->FlushViewContact();
+ // flushViewObjectContacts() clears the VOC's and those invalidate
+ pObj->GetViewContact().flushViewObjectContacts(true);
DBG_ASSERT(pObj!=NULL,"Object zum Removen nicht gefunden");
if (pObj!=NULL) {
@@ -475,8 +475,8 @@ SdrObject* SdrObjList::RemoveObject(ULONG nObjNum)
DBG_ASSERT(pObj!=NULL,"Object zum Removen nicht gefunden");
if(pObj)
{
- // FlushViewContact() clears the VOC's and those invalidate
- pObj->FlushViewContact();
+ // flushViewObjectContacts() clears the VOC's and those invalidate
+ pObj->GetViewContact().flushViewObjectContacts(true);
DBG_ASSERT(pObj->IsInserted(),"ZObjekt hat keinen Inserted-Status");
if (pModel!=NULL) {
@@ -526,8 +526,8 @@ SdrObject* SdrObjList::NbcReplaceObject(SdrObject* pNewObj, ULONG nObjNum)
pObj->SetPage(NULL);
ReplaceObjectInContainer(*pNewObj,nObjNum);
- // FlushViewContact() clears the VOC's and those invalidate
- pObj->FlushViewContact();
+ // flushViewObjectContacts() clears the VOC's and those invalidate
+ pObj->GetViewContact().flushViewObjectContacts(true);
pNewObj->SetOrdNum(nObjNum);
pNewObj->SetObjList(this);
@@ -573,8 +573,8 @@ SdrObject* SdrObjList::ReplaceObject(SdrObject* pNewObj, ULONG nObjNum)
pObj->SetPage(NULL);
ReplaceObjectInContainer(*pNewObj,nObjNum);
- // FlushViewContact() clears the VOC's and those invalidate
- pObj->FlushViewContact();
+ // flushViewObjectContacts() clears the VOC's and those invalidate
+ pObj->GetViewContact().flushViewObjectContacts(true);
pNewObj->SetOrdNum(nObjNum);
pNewObj->SetObjList(this);
@@ -1231,15 +1231,6 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const
return *mpViewContact;
}
-void SdrPage::FlushViewContact() const
-{
- if(mpViewContact)
- {
- delete mpViewContact;
- ((SdrPage*)this)->mpViewContact = 0;
- }
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
TYPEINIT1(SdrPage,SdrObjList);
@@ -1257,10 +1248,11 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
pBackgroundObj(0L),
mpMasterPageDescriptor(0L),
nPageNum(0L),
- bMaster(bMasterPage),
- bInserted(sal_False),
- bObjectsNotPersistent(sal_False),
- bSwappingLocked(sal_False)
+ mbMaster(bMasterPage),
+ mbInserted(false),
+ mbObjectsNotPersistent(false),
+ mbSwappingLocked(false),
+ mbPageBorderOnlyLeftRight(false)
{
DBG_CTOR(SdrPage,NULL);
aPrefVisiLayers.SetAll();
@@ -1281,14 +1273,15 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
pBackgroundObj(0L),
mpMasterPageDescriptor(0L),
nPageNum(rSrcPage.nPageNum),
- bMaster(rSrcPage.bMaster),
- bInserted(sal_False),
- bObjectsNotPersistent(rSrcPage.bObjectsNotPersistent),
- bSwappingLocked(rSrcPage.bSwappingLocked)
+ mbMaster(rSrcPage.mbMaster),
+ mbInserted(false),
+ mbObjectsNotPersistent(rSrcPage.mbObjectsNotPersistent),
+ mbSwappingLocked(rSrcPage.mbSwappingLocked),
+ mbPageBorderOnlyLeftRight(rSrcPage.mbPageBorderOnlyLeftRight)
{
DBG_CTOR(SdrPage,NULL);
aPrefVisiLayers.SetAll();
- eListKind = (bMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
+ eListKind = (mbMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
// copy things from source
// Warning: this leads to slicing (see issue 93186) and has to be
@@ -1297,7 +1290,7 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
// be careful and correct eListKind, a member of SdrObjList which
// will be changed by the SdrOIbjList::operator= before...
- eListKind = (bMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
+ eListKind = (mbMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
// The previous assignment to *this may have resulted in a call to
// createUnoPage at a partially initialized (sliced) SdrPage object.
@@ -1377,8 +1370,9 @@ void SdrPage::operator=(const SdrPage& rSrcPage)
// copy all the local parameters to make this instance
// a valid copy od source page before copying and inserting
// the contained objects
- bMaster = rSrcPage.bMaster;
- bSwappingLocked = rSrcPage.bSwappingLocked;
+ mbMaster = rSrcPage.mbMaster;
+ mbSwappingLocked = rSrcPage.mbSwappingLocked;
+ mbPageBorderOnlyLeftRight = rSrcPage.mbPageBorderOnlyLeftRight;
aPrefVisiLayers = rSrcPage.aPrefVisiLayers;
nWdt = rSrcPage.nWdt;
nHgt = rSrcPage.nHgt;
@@ -1399,7 +1393,7 @@ void SdrPage::operator=(const SdrPage& rSrcPage)
}
//aMasters = rSrcPage.aMasters;
- bObjectsNotPersistent = rSrcPage.bObjectsNotPersistent;
+ mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent;
if(rSrcPage.pBackgroundObj)
{
@@ -1621,8 +1615,10 @@ void SdrPage::SetPageNum(sal_uInt16 nNew)
USHORT SdrPage::GetPageNum() const
{
- if (!bInserted) return 0;
- if (bMaster) {
+ if (!mbInserted)
+ return 0;
+
+ if (mbMaster) {
if (pModel && pModel->IsMPgNumsDirty())
((SdrModel*)pModel)->RecalcPageNums(TRUE);
} else {
@@ -1666,8 +1662,8 @@ void SdrPage::TRG_ClearMasterPage()
{
SetChanged();
- // the FlushViewContact() will do needed invalidates by deleting the involved VOCs
- mpMasterPageDescriptor->GetUsedPage().FlushViewContact();
+ // the flushViewObjectContacts() will do needed invalidates by deleting the involved VOCs
+ mpMasterPageDescriptor->GetUsedPage().GetViewContact().flushViewObjectContacts(true);
delete mpMasterPageDescriptor;
mpMasterPageDescriptor = 0L;
@@ -1718,7 +1714,7 @@ FASTBOOL SdrPage::ImplGetFillColor(const Point& rPnt, const SetOfByte& rVisLayer
{
if (pModel==NULL) return FALSE;
FASTBOOL bRet=SdrObjList::GetFillColor(rPnt,rVisLayers,/*bLayerSorted,*/rCol);
- if (!bRet && !bMaster)
+ if (!bRet && !mbMaster)
{
// nun zu den Masterpages
if(TRG_HasMasterPage())
@@ -1787,11 +1783,11 @@ void SdrPage::SetBackgroundObj( SdrObject* pObj )
pBackgroundObj = pObj;
}
-void SdrPage::SetInserted( FASTBOOL bIns )
+void SdrPage::SetInserted( bool bIns )
{
- if( bInserted != bIns )
+ if( mbInserted != bIns )
{
- bInserted = bIns;
+ mbInserted = bIns;
SdrObjListIter aIter( *this, IM_FLAT );
while ( aIter.IsMore() )
@@ -1799,7 +1795,7 @@ void SdrPage::SetInserted( FASTBOOL bIns )
SdrObject* pObj = aIter.Next();
if ( pObj->ISA(SdrOle2Obj) )
{
- if( bInserted )
+ if( mbInserted )
( (SdrOle2Obj*) pObj)->Connect();
else
( (SdrOle2Obj*) pObj)->Disconnect();
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index be6805c3c544..da0f28cce54c 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -228,7 +228,6 @@ void SdrPaintView::ImpClearVars()
bPageVisible=TRUE;
bPageBorderVisible=TRUE;
bBordVisible=TRUE;
- bBordVisibleOnlyLeftRight=FALSE;
bGridVisible=TRUE;
bGridFront =FALSE;
bHlplVisible=TRUE;
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 1cc33d2560aa..9af61cebf6af 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -3221,17 +3221,15 @@ uno::Any SAL_CALL SvxShape::_getPropertyDefault( const OUString& aPropertyName )
{
return getPropertyValue( aPropertyName );
}
- else
- {
- // Default aus ItemPool holen
- if(!mpModel->GetItemPool().IsWhich(pMap->nWID))
- throw beans::UnknownPropertyException();
- SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID);
- aSet.Put(mpModel->GetItemPool().GetDefaultItem(pMap->nWID));
+ // Default aus ItemPool holen
+ if(!mpModel->GetItemPool().IsWhich(pMap->nWID))
+ throw beans::UnknownPropertyException();
- return GetAnyForItem( aSet, pMap );
- }
+ SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID);
+ aSet.Put(mpModel->GetItemPool().GetDefaultItem(pMap->nWID));
+
+ return GetAnyForItem( aSet, pMap );
}
// XMultiPropertyStates
diff --git a/svx/source/unoedit/unoedprx.cxx b/svx/source/unoedit/unoedprx.cxx
index 44c4c302e506..7c31f8b14ffc 100644
--- a/svx/source/unoedit/unoedprx.cxx
+++ b/svx/source/unoedit/unoedprx.cxx
@@ -811,8 +811,8 @@ Rectangle SvxAccessibleTextAdapter::GetParaBounds( USHORT nPara ) const
return aRect;
}
- else
- return mrTextForwarder->GetParaBounds( nPara );
+
+ return mrTextForwarder->GetParaBounds( nPara );
}
MapMode SvxAccessibleTextAdapter::GetMapMode() const
--
cgit