summaryrefslogtreecommitdiff
path: root/svx/source/sdr
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/sdr')
-rw-r--r--svx/source/sdr/contact/objectcontact.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontact.cxx4
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobj.cxx2
-rw-r--r--svx/source/sdr/event/eventhandler.cxx4
-rw-r--r--svx/source/sdr/overlay/overlayobjectlist.cxx6
-rw-r--r--svx/source/sdr/properties/defaultproperties.cxx4
-rw-r--r--svx/source/sdr/properties/pageproperties.cxx6
-rw-r--r--svx/source/sdr/properties/properties.cxx30
8 files changed, 48 insertions, 10 deletions
diff --git a/svx/source/sdr/contact/objectcontact.cxx b/svx/source/sdr/contact/objectcontact.cxx
index bda2e1529988..c0ba5cec6bb8 100644
--- a/svx/source/sdr/contact/objectcontact.cxx
+++ b/svx/source/sdr/contact/objectcontact.cxx
@@ -66,7 +66,7 @@ namespace sdr
std::vector< ViewObjectContact* > aLocalVOCList(maViewObjectContactVector);
maViewObjectContactVector.clear();
- while(aLocalVOCList.size())
+ while(!aLocalVOCList.empty())
{
ViewObjectContact* pCandidate = aLocalVOCList.back();
aLocalVOCList.pop_back();
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index 3057acf55df1..3d6bd2d79a5a 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -82,7 +82,7 @@ namespace sdr
std::vector< ViewObjectContact* > aLocalVOCList(maViewObjectContactVector);
maViewObjectContactVector.clear();
- while(aLocalVOCList.size())
+ while(!aLocalVOCList.empty())
{
ViewObjectContact* pCandidate = aLocalVOCList.back();
aLocalVOCList.pop_back();
@@ -147,7 +147,7 @@ namespace sdr
{
maViewObjectContactVector.erase(aFindResult);
- if(0 == maViewObjectContactVector.size())
+ if(maViewObjectContactVector.empty())
{
// This may need to get asynchron later since it eventually triggers
// deletes of OCs where the VOC is still added.
diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
index 3b002e406be1..c06bb7f25b0e 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
@@ -173,7 +173,7 @@ namespace sdr
aGluepointVector.push_back(basegfx::B2DPoint(aPosition.X(), aPosition.Y()));
}
- if(aGluepointVector.size())
+ if(!aGluepointVector.empty())
{
const basegfx::BColor aBackPen(1.0, 1.0, 1.0);
const basegfx::BColor aRGBFrontColor(0.0, 0.0, 1.0); // COL_LIGHTBLUE
diff --git a/svx/source/sdr/event/eventhandler.cxx b/svx/source/sdr/event/eventhandler.cxx
index 967b6fefe949..e65dfe927fda 100644
--- a/svx/source/sdr/event/eventhandler.cxx
+++ b/svx/source/sdr/event/eventhandler.cxx
@@ -83,7 +83,7 @@ namespace sdr
BaseEvent* EventHandler::GetEvent()
{
- if(maVector.size())
+ if(!maVector.empty())
{
// get the last event, that one is fastest to be removed
return maVector.back();
@@ -100,7 +100,7 @@ namespace sdr
EventHandler::~EventHandler()
{
- while(maVector.size())
+ while(!maVector.empty())
{
delete GetEvent();
}
diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx
index e9464bdee09b..0e9f61d9b03a 100644
--- a/svx/source/sdr/overlay/overlayobjectlist.cxx
+++ b/svx/source/sdr/overlay/overlayobjectlist.cxx
@@ -83,7 +83,7 @@ namespace sdr
bool OverlayObjectList::isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance) const
{
- if(maVector.size())
+ if(!maVector.empty())
{
OverlayObjectVector::const_iterator aStart(maVector.begin());
sdr::overlay::OverlayObject* pFirst = *aStart;
@@ -134,7 +134,7 @@ namespace sdr
bool OverlayObjectList::isHitPixel(const Point& rDiscretePosition, sal_uInt32 nDiscreteTolerance) const
{
- if(maVector.size())
+ if(!maVector.empty())
{
OverlayObjectVector::const_iterator aStart(maVector.begin());
sdr::overlay::OverlayObject* pCandidate = *aStart;
@@ -164,7 +164,7 @@ namespace sdr
{
basegfx::B2DRange aRetval;
- if(maVector.size())
+ if(!maVector.empty())
{
OverlayObjectVector::const_iterator aStart(maVector.begin());
diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx
index 7d51b26a0051..41149a965248 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -204,8 +204,10 @@ namespace sdr
{
}
- void DefaultProperties::PostItemChange(const sal_uInt16 /*nWhich*/)
+ void DefaultProperties::PostItemChange(const sal_uInt16 nWhich )
{
+ if( (nWhich == XATTR_FILLSTYLE) && (mpItemSet != NULL) )
+ CleanupFillProperties(*mpItemSet);
}
void DefaultProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, sal_Bool /*bDontRemoveHardAttr*/)
diff --git a/svx/source/sdr/properties/pageproperties.cxx b/svx/source/sdr/properties/pageproperties.cxx
index 2fc92633b953..c1d0467b740e 100644
--- a/svx/source/sdr/properties/pageproperties.cxx
+++ b/svx/source/sdr/properties/pageproperties.cxx
@@ -89,6 +89,12 @@ namespace sdr
return 0L;
}
+ void PageProperties::PostItemChange(const sal_uInt16 nWhich )
+ {
+ if( (nWhich == XATTR_FILLSTYLE) && (mpEmptyItemSet != NULL) )
+ CleanupFillProperties(*mpEmptyItemSet);
+ }
+
void PageProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
{
// simply ignore item clearing on page objects
diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx
index f8c307f26309..0439fd6baf4c 100644
--- a/svx/source/sdr/properties/properties.cxx
+++ b/svx/source/sdr/properties/properties.cxx
@@ -32,6 +32,7 @@
#include <svl/itemset.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svditer.hxx>
+#include <svx/xfillit0.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -182,6 +183,35 @@ namespace sdr
{
return 0;
}
+
+ void CleanupFillProperties( SfxItemSet& rItemSet )
+ {
+ const bool bFillBitmap = rItemSet.GetItemState(XATTR_FILLBITMAP, sal_False) == SFX_ITEM_SET;
+ const bool bFillGradient = rItemSet.GetItemState(XATTR_FILLGRADIENT, sal_False) == SFX_ITEM_SET;
+ const bool bFillHatch = rItemSet.GetItemState(XATTR_FILLHATCH, sal_False) == SFX_ITEM_SET;
+ if( bFillBitmap || bFillGradient || bFillHatch )
+ {
+ const XFillStyleItem* pFillStyleItem = dynamic_cast< const XFillStyleItem* >( rItemSet.GetItem(XATTR_FILLSTYLE) );
+ if( pFillStyleItem )
+ {
+ if( bFillBitmap && (pFillStyleItem->GetValue() != XFILL_BITMAP) )
+ {
+ rItemSet.ClearItem( XATTR_FILLBITMAP );
+ }
+
+ if( bFillGradient && (pFillStyleItem->GetValue() != XFILL_GRADIENT) )
+ {
+ rItemSet.ClearItem( XATTR_FILLGRADIENT );
+ }
+
+ if( bFillHatch && (pFillStyleItem->GetValue() != XFILL_HATCH) )
+ {
+ rItemSet.ClearItem( XATTR_FILLHATCH );
+ }
+ }
+ }
+ }
+
} // end of namespace properties
} // end of namespace sdr