summaryrefslogtreecommitdiff
path: root/cui/source/tabpages
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-02-13 15:43:22 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-02-14 12:41:43 +0100
commit1417d691a6ea9024ca392d725b331037a175f723 (patch)
treed29ee29e4c2cd3e0ad9944f2629fb81f00c60873 /cui/source/tabpages
parentea7eef21707bb18ec5811f27c0584fe9421e30d8 (diff)
SvxBackgroundTabPage: select matching gradient entry on load, if possible
Change-Id: Ie654fc795a3f46f1ff26a1ff5adb7e8ce9091851
Diffstat (limited to 'cui/source/tabpages')
-rw-r--r--cui/source/tabpages/backgrnd.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index d436bb1e46ea..8309d1bff0b9 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -1286,6 +1286,12 @@ void SvxBackgroundTabPage::ShowGradientUI_Impl()
m_pLbGradients->SelectEntryPos(0);
ModifyGradientHdl_Impl(this);
}
+ else
+ {
+ // It has one, try to select the matching entry in the gradient list box.
+ const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)m_rXFillSet.Get(XATTR_FILLGRADIENT);
+ m_pLbGradients->SelectEntryByList(m_pGradientList, rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue());
+ }
}
}
@@ -1483,7 +1489,7 @@ IMPL_LINK_NOARG(SvxBackgroundTabPage, ModifyGradientHdl_Impl)
{
XGradientEntry* pEntry = m_pGradientList->GetGradient(nPos);
m_rXFillSet.Put( XFillStyleItem( XFILL_GRADIENT ) );
- m_rXFillSet.Put( XFillGradientItem( String(), pEntry->GetGradient() ) );
+ m_rXFillSet.Put( XFillGradientItem( pEntry->GetName(), pEntry->GetGradient() ) );
}
m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
m_pCtlPreview->Invalidate();
@@ -1935,7 +1941,7 @@ void SvxBackgroundTabPage::PageCreated (SfxAllItemSet aSet)
const XFillStyleItem& rFillStyleItem = (const XFillStyleItem&)aSet.Get(SID_ATTR_FILL_STYLE);
m_rXFillSet.Put(XFillStyleItem(rFillStyleItem.GetValue()));
const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)aSet.Get(SID_ATTR_FILL_GRADIENT);
- m_rXFillSet.Put(XFillGradientItem(rFillGradientItem.GetGradientValue()));
+ m_rXFillSet.Put(XFillGradientItem(rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue()));
}
else
// Otherwise hide the gradient UI.