[Libreoffice-commits] core.git: cui/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 9 09:30:55 UTC 2018
cui/source/tabpages/tpbitmap.cxx | 23 ++++++++++++++++-------
cui/source/tabpages/tppattern.cxx | 24 +++++++++++++++++-------
2 files changed, 33 insertions(+), 14 deletions(-)
New commits:
commit 4f6e104499625d69d2b37271d0fee52848c0a6d4
Author: Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Aug 9 20:07:35 2018 -0800
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Oct 9 11:30:34 2018 +0200
tdf#111718 Fix interaction between bitmap and pattern settings
Change-Id: I1c68b9f1f51cb15a30f56eef08dc384d10355bf1
Reviewed-on: https://gerrit.libreoffice.org/58805
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 5f51cc11a92a..e2a80c4d9473 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -154,14 +154,24 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& rSet )
{
XFillBitmapItem aItem( rSet.Get(XATTR_FILLBITMAP) );
- sal_Int32 nPos = SearchBitmapList( aItem.GetName() );
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ sal_Int32 nPos( 0 );
+ if ( !aItem.isPattern() )
{
- sal_uInt16 nId = m_xBitmapLB->GetItemId( static_cast<size_t>( nPos ) );
- m_xBitmapLB->SelectItem( nId );
+ nPos = SearchBitmapList( aItem.GetName() );
+ if ( nPos == LISTBOX_ENTRY_NOTFOUND )
+ nPos = 0;
+ }
+ else
+ {
+ m_xBitmapWidth->set_value( 100, FUNIT_NONE );
+ m_xBitmapHeight->set_value( 100, FUNIT_NONE );
+ const_cast<SfxItemSet&>(rSet).Put( XFillBmpSizeXItem( GetCoreValue( *m_xBitmapWidth, mePoolUnit ) ) );
+ const_cast<SfxItemSet&>(rSet).Put( XFillBmpSizeYItem( GetCoreValue( *m_xBitmapHeight, mePoolUnit ) ) );
}
-}
+ sal_uInt16 nId = m_xBitmapLB->GetItemId( static_cast<size_t>( nPos ) );
+ m_xBitmapLB->SelectItem( nId );
+}
DeactivateRC SvxBitmapTabPage::DeactivatePage( SfxItemSet* _pSet )
{
@@ -496,8 +506,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, SvtValueSet*, void)
ModifyBitmapStyleHdl( *m_xBitmapStyleLB );
ModifyBitmapPositionHdl( *m_xPositionLB );
- m_rXFSet.ClearItem();
-
+ m_rXFSet.ClearItem(XATTR_FILLBITMAP);
m_rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
m_rXFSet.Put(XFillBitmapItem(OUString(), *pGraphicObject));
diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index 724637f15b4c..261bfba4b0f0 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -176,12 +176,18 @@ void SvxPatternTabPage::ActivatePage( const SfxItemSet& rSet )
else
aString += aURL.getBase();
- sal_Int32 nPos = SearchPatternList( rSet.Get(XATTR_FILLBITMAP).GetName() );
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
+ XFillBitmapItem aItem( rSet.Get( XATTR_FILLBITMAP ) );
+
+ sal_Int32 nPos( 0 );
+ if ( aItem.isPattern() )
{
- sal_uInt16 nId = m_xPatternLB->GetItemId( static_cast<size_t>( nPos ) );
- m_xPatternLB->SelectItem( nId );
+ nPos = SearchPatternList( aItem.GetName() );
+ if ( nPos == LISTBOX_ENTRY_NOTFOUND )
+ nPos = 0;
}
+
+ sal_uInt16 nId = m_xPatternLB->GetItemId( static_cast<size_t>( nPos ) );
+ m_xPatternLB->SelectItem( nId );
}
}
@@ -212,6 +218,7 @@ bool SvxPatternTabPage::FillItemSet( SfxItemSet* _rOutAttrs )
_rOutAttrs->Put(XFillBitmapItem(OUString(), Graphic(aBitmapEx)));
}
+ _rOutAttrs->Put(XFillBmpTileItem(true));
return true;
}
@@ -224,9 +231,12 @@ void SvxPatternTabPage::Reset( const SfxItemSet* )
// get bitmap and display it
const XFillBitmapItem aBmpItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx()));
- m_rXFSet.Put( aBmpItem );
- m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
- m_aCtlPreview.Invalidate();
+ if(aBmpItem.isPattern())
+ {
+ m_rXFSet.Put( aBmpItem );
+ m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_aCtlPreview.Invalidate();
+ }
ChangePatternHdl_Impl(m_xPatternLB.get());
More information about the Libreoffice-commits
mailing list