summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2018-03-30 19:46:51 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2018-04-07 19:57:56 +0200
commit177dbe968b5af1c548be9f52178daa528edc2aab (patch)
treef40a1eb1011773c5c5b9da9b71ab904360091360
parentb85691995e7b1a1aadf714c34e7fe6b9cd3206d8 (diff)
Correctly recognize tiled/stretched/other bitmap fill
Change-Id: Ib50dbfb937a6631429902592ae9bae08e58738d8 Reviewed-on: https://gerrit.libreoffice.org/52365 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--cui/source/tabpages/tpbitmap.cxx27
1 files changed, 11 insertions, 16 deletions
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index aaf51917d776..95f1b6d206e9 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -309,21 +309,19 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
CalculateBitmapPresetSize();
}
+ bool bTiled = false; bool bStretched = false;
if(rAttrs->GetItemState( XATTR_FILLBMP_TILE ) != SfxItemState::DONTCARE)
- {
- if( rAttrs->Get( XATTR_FILLBMP_TILE ).GetValue() )
- {
- m_pBitmapStyleLB->SelectEntryPos(static_cast<sal_Int32>(TILED));
- }
- }
+ bTiled = rAttrs->Get( XATTR_FILLBMP_TILE ).GetValue();
- if( m_pBitmapStyleLB->GetSelectedEntryPos() == 0 && rAttrs->GetItemState( XATTR_FILLBMP_STRETCH ) != SfxItemState::DONTCARE)
- {
- if( rAttrs->Get( XATTR_FILLBMP_STRETCH ).GetValue() )
- {
- m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(STRETCHED) );
- }
- }
+ if(rAttrs->GetItemState( XATTR_FILLBMP_STRETCH ) != SfxItemState::DONTCARE)
+ bStretched = rAttrs->Get( XATTR_FILLBMP_STRETCH ).GetValue();
+
+ if (bTiled)
+ m_pBitmapStyleLB->SelectEntryPos(static_cast<sal_Int32>(TILED));
+ else if (bStretched)
+ m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(STRETCHED) );
+ else
+ m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(CUSTOM) );
long nWidth = 0;
long nHeight = 0;
@@ -360,9 +358,6 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
nHeight = (OutputDevice::LogicToLogic(nHeight, mePoolUnit, MapUnit::Map100thMM )) / fUIScale;
}
- if(m_pBitmapStyleLB->GetSelectedEntryPos() == 0)
- m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(CUSTOM) );
-
if(rBitmapSize.Width() > 0 && rBitmapSize.Height() > 0)
{
if(eRelative == TRISTATE_TRUE)