summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2015-12-10 12:22:07 +0100
committerOliver Specht <oliver.specht@cib.de>2015-12-11 06:42:20 +0000
commite5246a6b679cfd15ba9ec6db23448066f34c7c08 (patch)
tree3ae6242e7cbca180b4a2065a97015a316ff52201
parenta5fb58caa0f941caacb1fff78c22285bb7f63026 (diff)
tdf#96382: background color is not applied unintentionally
background color attribute should only be applied in a dialog if the user selects it Change-Id: Idf03840f7332a8cdbbfd616ce47ac26b3602d840 Reviewed-on: https://gerrit.libreoffice.org/20592 Reviewed-by: Oliver Specht <oliver.specht@cib.de> Tested-by: Oliver Specht <oliver.specht@cib.de>
-rw-r--r--cui/source/tabpages/backgrnd.cxx4
-rw-r--r--include/svtools/valueset.hxx3
-rw-r--r--svtools/source/control/valueset.cxx1
3 files changed, 7 insertions, 1 deletions
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index d85a6a8f97d9..6504b11da2ac 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -598,6 +598,7 @@ void SvxBackgroundTabPage::ResetFromWallpaperItem( const SfxItemSet& rSet )
aBgdColor = pBgdAttr->GetColor();
sal_uInt16 nCol = GetItemId_Impl(*m_pBackgroundColorSet, aBgdColor);
m_pBackgroundColorSet->SelectItem( nCol );
+ m_pBackgroundColorSet->SaveValue();
m_pPreviewWin1->NotifyChange( aBgdColor );
}
}
@@ -682,7 +683,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
// Brush-treatment:
if ( rOldItem.GetColor() != aBgdColor ||
- (SfxItemState::DEFAULT >= eOldItemState && !m_pBackgroundColorSet->IsNoSelection()))
+ (SfxItemState::DEFAULT >= eOldItemState && m_pBackgroundColorSet->GetSavedValue() != m_pBackgroundColorSet->GetSelectItemId()))
{
bModified = true;
rCoreSet->Put( SvxBrushItem( aBgdColor, nWhich ) );
@@ -1423,6 +1424,7 @@ void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr,
{
m_pBackgroundColorSet->SelectItem( nCol );
}
+ m_pBackgroundColorSet->SaveValue();
m_pPreviewWin1->NotifyChange( aBgdColor );
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index 30aaffe6834e..e4fac32860f0 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -212,6 +212,7 @@ private:
long mnUserItemWidth;
long mnUserItemHeight;
sal_uInt16 mnSelItemId;
+ sal_uInt16 mnSavedItemId;
sal_uInt16 mnHighItemId;
sal_uInt16 mnCols;
sal_uInt16 mnCurCol;
@@ -349,6 +350,8 @@ public:
{
return mnSelItemId;
}
+ void SaveValue() { mnSavedItemId = GetSelectItemId(); }
+ sal_Int32 GetSavedValue() const { return mnSavedItemId; }
bool IsItemSelected( sal_uInt16 nItemId ) const
{
return !mbNoSelection && (nItemId == mnSelItemId);
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index b62d6ce68ada..e6481b9b7e9d 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -69,6 +69,7 @@ void ValueSet::ImplInit()
mnUserItemHeight = 0;
mnFirstLine = 0;
mnSelItemId = 0;
+ mnSavedItemId = 0;
mnHighItemId = 0;
mnCols = 0;
mnCurCol = 0;