[Libreoffice-commits] core.git: cui/source
Katarina Behrens
Katarina.Behrens at cib.de
Sat Apr 7 17:58:17 UTC 2018
cui/source/tabpages/tpbitmap.cxx | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
New commits:
commit 177dbe968b5af1c548be9f52178daa528edc2aab
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Mar 30 19:46:51 2018 +0200
Correctly recognize tiled/stretched/other bitmap fill
Change-Id: Ib50dbfb937a6631429902592ae9bae08e58738d8
Reviewed-on: https://gerrit.libreoffice.org/52365
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
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)
More information about the Libreoffice-commits
mailing list