diff options
60 files changed, 1234 insertions, 720 deletions
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index 7bb181d7f50c..c81ef9625491 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -197,13 +197,13 @@ $(eval $(call gb_Library_add_exception_objects,cui,\ cui/source/tabpages/textanim \ cui/source/tabpages/textattr \ cui/source/tabpages/tparea \ - cui/source/tabpages/tpbitmap \ cui/source/tabpages/tpcolor \ cui/source/tabpages/tpgradnt \ cui/source/tabpages/tphatch \ cui/source/tabpages/tpline \ cui/source/tabpages/tplnedef \ cui/source/tabpages/tplneend \ + cui/source/tabpages/tppattern \ cui/source/tabpages/tpshadow \ cui/source/tabpages/tptrans \ cui/source/tabpages/transfrm \ diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index b0f72cb6a9ea..60c8d18b84ee 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -27,7 +27,6 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/autocorrectdialog \ cui/uiconfig/ui/backgroundpage \ cui/uiconfig/ui/baselinksdialog \ - cui/uiconfig/ui/bitmaptabpage \ cui/uiconfig/ui/blackorwhitelistentrydialog \ cui/uiconfig/ui/borderareatransparencydialog \ cui/uiconfig/ui/borderbackgrounddialog \ @@ -145,6 +144,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/paratabspage \ cui/uiconfig/ui/password \ cui/uiconfig/ui/pastespecial \ + cui/uiconfig/ui/patterntabpage \ cui/uiconfig/ui/percentdialog \ cui/uiconfig/ui/personalization_tab \ cui/uiconfig/ui/pickbulletpage \ diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index 376117cafc9a..67c79e2bb096 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -70,6 +70,8 @@ #define RID_SVXSTR_ASK_CHANGE_BITMAP (RID_SVX_START + 172) #define RID_SVXSTR_DESC_NEW_BITMAP (RID_SVX_START + 168) #define RID_SVXSTR_DESC_EXT_BITMAP (RID_SVX_START + 169) +#define RID_SVXSTR_DESC_NEW_PATTERN (RID_SVX_START + 170) +#define RID_SVXSTR_ASK_CHANGE_PATTERN (RID_SVX_START + 171) #define RID_SVXSTR_DESC_LINESTYLE (RID_SVX_START + 174) #define RID_SVXSTR_ASK_CHANGE_LINESTYLE (RID_SVX_START + 177) diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index d2a0391b00fb..397f3bc97e73 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -44,7 +44,8 @@ class SvxAreaTabDialog : public SfxTabDialog sal_uInt16 m_nColorTabPage; sal_uInt16 m_nGradientTabPage; sal_uInt16 m_nHatchTabPage; - sal_uInt16 m_nBitmapTabPage; + //sal_uInt16 m_nBitmapTabPage; + sal_uInt16 m_nPatternTabPage; private: SdrModel* mpDrawModel; @@ -57,11 +58,14 @@ private: XHatchListRef mpNewHatchingList; XBitmapListRef mpBitmapList; XBitmapListRef mpNewBitmapList; + XPatternListRef mpPatternList; + XPatternListRef mpNewPatternList; const SfxItemSet& mrOutAttrs; ChangeType mnColorListState; ChangeType mnBitmapListState; + ChangeType mnPatternListState; ChangeType mnGradientListState; ChangeType mnHatchingListState; @@ -97,6 +101,10 @@ public: void SetNewBitmapList( XBitmapListRef pBmpLst) { mpNewBitmapList = pBmpLst; } const XBitmapListRef& GetNewBitmapList() const { return mpNewBitmapList; } + + void SetNewPatternList( XPatternListRef pPtrnLst ) + { mpNewPatternList = pPtrnLst; } + const XPatternListRef& GetNewPatternList() const { return mpNewPatternList; } }; /************************************************************************/ @@ -545,7 +553,7 @@ public: /************************************************************************/ -class SvxBitmapTabPage : public SvxTabPage +class SvxPatternTabPage : public SvxTabPage { using TabPage::ActivatePage; using TabPage::DeactivatePage; @@ -555,12 +563,11 @@ private: VclPtr<SvxPixelCtl> m_pCtlPixel; VclPtr<ColorLB> m_pLbColor; VclPtr<ColorLB> m_pLbBackgroundColor; - VclPtr<FixedText> m_pLbBitmapsHidden; - VclPtr<BitmapLB> m_pLbBitmaps; + VclPtr<FixedText> m_pLbPatternsHidden; + VclPtr<PatternLB> m_pLbPatterns; VclPtr<SvxXRectPreview> m_pCtlPreview; VclPtr<PushButton> m_pBtnAdd; VclPtr<PushButton> m_pBtnModify; - VclPtr<PushButton> m_pBtnImport; VclPtr<PushButton> m_pBtnDelete; VclPtr<PushButton> m_pBtnLoad; VclPtr<PushButton> m_pBtnSave; @@ -570,37 +577,35 @@ private: const SfxItemSet& m_rOutAttrs; XColorListRef m_pColorList; - XBitmapListRef m_pBitmapList; + XPatternListRef m_pPatternList; - ChangeType* m_pnBitmapListState; + ChangeType* m_pnPatternListState; ChangeType* m_pnColorListState; sal_uInt16* m_pPageType; sal_uInt16 m_nDlgType; sal_Int32* m_pPos; bool* m_pbAreaTP; - bool m_bBmpChanged; + bool m_bPtrnChanged; XFillStyleItem m_aXFStyleItem; - XFillBitmapItem m_aXBitmapItem; + XFillBitmapItem m_aXPatternItem; XFillAttrSetItem m_aXFillAttr; SfxItemSet& m_rXFSet; DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void ); - DECL_LINK_TYPED( ClickImportHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); - DECL_LINK_TYPED( ChangeBitmapHdl_Impl, ListBox&, void ); - DECL_LINK_TYPED( ChangePixelColorHdl_Impl, ListBox&, void ); - DECL_LINK_TYPED( ChangeBackgrndColorHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ChangePatternHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ChangeColorHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); long CheckChanges_Impl(); public: - SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); - virtual ~SvxBitmapTabPage(); + SvxPatternTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); + virtual ~SvxPatternTabPage(); virtual void dispose() override; void Construct(); @@ -615,16 +620,16 @@ public: virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) override; void SetColorList( XColorListRef pColorList ) { m_pColorList = pColorList; } - void SetBitmapList( XBitmapListRef pBitmapList) { m_pBitmapList = pBitmapList; } + void SetPatternList( XPatternListRef pPatternList) { m_pPatternList = pPatternList; } void SetPageType( sal_uInt16* pInType ) { m_pPageType = pInType; } void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; } void SetPos( sal_Int32* pInPos ) { m_pPos = pInPos; } void SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; } - void SetBmpChgd( ChangeType* pIn ) { m_pnBitmapListState = pIn; } + void SetPtrnChgd( ChangeType* pIn ) { m_pnPatternListState = pIn; } void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; } - + void ChangeColor_Impl(); /** Return a label that is associated with the given control. This label is used to the determine the name for the control. @param pLabeled diff --git a/cui/source/tabpages/strings.src b/cui/source/tabpages/strings.src index db14dd06ae5f..2bf8809c0d97 100644 --- a/cui/source/tabpages/strings.src +++ b/cui/source/tabpages/strings.src @@ -35,10 +35,18 @@ String RID_SVXSTR_DESC_EXT_BITMAP { Text [ en-US ] = "Please enter a name for the external bitmap:" ; }; +String RID_SVXSTR_DESC_NEW_PATTERN +{ + Text [ en-US ] = "Please enter a name for the pattern:" ; +}; String RID_SVXSTR_ASK_CHANGE_BITMAP { Text [ en-US ] = "The bitmap was modified without saving. \nModify the selected bitmap or add a new bitmap." ; }; +String RID_SVXSTR_ASK_CHANGE_PATTERN +{ + Text [ en-US ] = "The pattern was modified without saving. \nModify the selected pattern or add a new pattern"; +}; String RID_SVXSTR_DESC_LINESTYLE { Text [ en-US ] = "Please enter a name for the line style:" ; diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx index 6a6ce0394e69..e6b9ae61aa3a 100644 --- a/cui/source/tabpages/tabarea.cxx +++ b/cui/source/tabpages/tabarea.cxx @@ -52,7 +52,8 @@ SvxAreaTabDialog::SvxAreaTabDialog , m_nColorTabPage(0) , m_nGradientTabPage(0) , m_nHatchTabPage(0) - , m_nBitmapTabPage(0) + //, m_nBitmapTabPage(0) + , m_nPatternTabPage(0) , mpDrawModel ( pModel ), mpColorList ( pModel->GetColorList() ), @@ -63,10 +64,13 @@ SvxAreaTabDialog::SvxAreaTabDialog mpNewHatchingList ( pModel->GetHatchList() ), mpBitmapList ( pModel->GetBitmapList() ), mpNewBitmapList ( pModel->GetBitmapList() ), + mpPatternList ( pModel->GetPatternList() ), + mpNewPatternList ( pModel->GetPatternList() ), mrOutAttrs ( *pAttr ), mnColorListState ( ChangeType::NONE ), mnBitmapListState ( ChangeType::NONE ), + mnPatternListState ( ChangeType::NONE ), mnGradientListState ( ChangeType::NONE ), mnHatchingListState ( ChangeType::NONE ), mnPageType( PT_AREA ), @@ -88,7 +92,7 @@ SvxAreaTabDialog::SvxAreaTabDialog m_nColorTabPage = AddTabPage( "RID_SVXPAGE_COLOR", SvxColorTabPage::Create, nullptr ); m_nGradientTabPage = AddTabPage( "RID_SVXPAGE_GRADIENT", SvxGradientTabPage::Create, nullptr ); m_nHatchTabPage = AddTabPage( "RID_SVXPAGE_HATCH", SvxHatchTabPage::Create, nullptr ); - m_nBitmapTabPage = AddTabPage( "RID_SVXPAGE_BITMAP", SvxBitmapTabPage::Create, nullptr); + m_nPatternTabPage = AddTabPage( "RID_SVXPAGE_PATTERN", SvxPatternTabPage::Create, nullptr); SetCurPageId( "RID_SVXPAGE_AREA" ); @@ -139,6 +143,16 @@ void SvxAreaTabDialog::SavePalettes() mpDrawModel->GetItemPool().Put(aItem,SID_BITMAP_LIST); mpBitmapList = mpDrawModel->GetBitmapList(); } + if( mpNewPatternList != mpDrawModel->GetPatternList() ) + { + mpDrawModel->SetPropertyList( static_cast<XPropertyList *>(mpNewPatternList.get()) ); + SvxPatternListItem aItem( mpNewPatternList, SID_PATTERN_LIST ); + if( pShell ) + pShell->PutItem( aItem ); + else + mpDrawModel->GetItemPool().Put(aItem,SID_PATTERN_LIST); + mpPatternList = mpDrawModel->GetPatternList(); + } // save the tables when they have been changed @@ -179,6 +193,19 @@ void SvxAreaTabDialog::SavePalettes() } } + if( mnPatternListState & ChangeType::MODIFIED ) + { + mpPatternList->SetPath( aPath ); + mpPatternList->Save(); + + SvxPatternListItem aItem( mpPatternList, SID_PATTERN_LIST ); + // ToolBoxControls are informed: + if( pShell ) + pShell->PutItem( aItem ); + else + mpDrawModel->GetItemPool().Put(aItem); + } + if( mnGradientListState & ChangeType::MODIFIED ) { mpGradientList->SetPath( aPath ); @@ -282,17 +309,17 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) static_cast<SvxHatchTabPage&>(rPage).SetColorChgd( &mnColorListState ); static_cast<SvxHatchTabPage&>(rPage).Construct(); } - else if (nId == m_nBitmapTabPage) + else if (nId == m_nPatternTabPage) { - static_cast<SvxBitmapTabPage&>(rPage).SetColorList( mpColorList ); - static_cast<SvxBitmapTabPage&>(rPage).SetBitmapList( mpBitmapList ); - static_cast<SvxBitmapTabPage&>(rPage).SetPageType( &mnPageType ); - static_cast<SvxBitmapTabPage&>(rPage).SetDlgType( 0 ); - static_cast<SvxBitmapTabPage&>(rPage).SetPos( &mnPos ); - static_cast<SvxBitmapTabPage&>(rPage).SetAreaTP( &mbAreaTP ); - static_cast<SvxBitmapTabPage&>(rPage).SetBmpChgd( &mnBitmapListState ); - static_cast<SvxBitmapTabPage&>(rPage).SetColorChgd( &mnColorListState ); - static_cast<SvxBitmapTabPage&>(rPage).Construct(); + static_cast<SvxPatternTabPage&>(rPage).SetColorList( mpColorList ); + static_cast<SvxPatternTabPage&>(rPage).SetPatternList( mpPatternList ); + static_cast<SvxPatternTabPage&>(rPage).SetPageType( &mnPageType ); + static_cast<SvxPatternTabPage&>(rPage).SetDlgType( 0 ); + static_cast<SvxPatternTabPage&>(rPage).SetPos( &mnPos ); + static_cast<SvxPatternTabPage&>(rPage).SetAreaTP( &mbAreaTP ); + static_cast<SvxPatternTabPage&>(rPage).SetPtrnChgd( &mnPatternListState ); + static_cast<SvxPatternTabPage&>(rPage).SetColorChgd( &mnColorListState ); + static_cast<SvxPatternTabPage&>(rPage).Construct(); } else if (nId == m_nColorTabPage) { diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tppattern.cxx index 05d9b5470017..b90a5bd95882 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tppattern.cxx @@ -49,25 +49,25 @@ using namespace com::sun::star; -SvxBitmapTabPage::SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs) : +SvxPatternTabPage::SvxPatternTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs) : SvxTabPage ( pParent, "BitmapTabPage", - "cui/ui/bitmaptabpage.ui", + "cui/ui/patterntabpage.ui", rInAttrs ), m_rOutAttrs ( rInAttrs ), - m_pnBitmapListState ( nullptr ), + m_pnPatternListState ( nullptr ), m_pnColorListState ( nullptr ), m_pPageType ( nullptr ), m_nDlgType ( 0 ), m_pPos ( nullptr ), m_pbAreaTP ( nullptr ), - m_bBmpChanged ( false ), + m_bPtrnChanged ( false ), m_aXFStyleItem ( drawing::FillStyle_BITMAP ), - m_aXBitmapItem ( OUString(), Graphic() ), + m_aXPatternItem ( OUString(), Graphic() ), m_aXFillAttr ( rInAttrs.GetPool() ), m_rXFSet ( m_aXFillAttr.GetItemSet() ) { @@ -76,19 +76,18 @@ SvxBitmapTabPage::SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rIn get(m_pLbColor,"LB_COLOR"); get(m_pLbBackgroundColor,"LB_BACKGROUND_COLOR"); get(m_pCtlPreview,"CTL_PREVIEW"); - get(m_pLbBitmaps,"LB_BITMAPS"); - get(m_pLbBitmapsHidden,"FT_BITMAPS_HIDDEN"); + get(m_pLbPatterns,"LB_PATTERN"); + get(m_pLbPatternsHidden,"FT_BITMAPS_HIDDEN"); get(m_pBtnAdd,"BTN_ADD"); get(m_pBtnModify,"BTN_MODIFY"); - get(m_pBtnImport,"BTN_IMPORT"); get(m_pBtnDelete,"BTN_DELETE"); get(m_pBtnLoad,"BTN_LOAD"); get(m_pBtnSave,"BTN_SAVE"); // size of the bitmap listbox Size aSize = getDrawListBoxOptimalSize(this); - m_pLbBitmaps->set_width_request(aSize.Width()); - m_pLbBitmaps->set_height_request(aSize.Height()); + m_pLbPatterns->set_width_request(aSize.Width()); + m_pLbPatterns->set_height_request(aSize.Height()); // size of the bitmap display Size aSize2 = getDrawPreviewOptimalSize(this); @@ -102,28 +101,27 @@ SvxBitmapTabPage::SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rIn // setting the output device m_rXFSet.Put( m_aXFStyleItem ); - m_rXFSet.Put( m_aXBitmapItem ); + m_rXFSet.Put( m_aXPatternItem ); - m_pBtnAdd->SetClickHdl( LINK( this, SvxBitmapTabPage, ClickAddHdl_Impl ) ); - m_pBtnImport->SetClickHdl( LINK( this, SvxBitmapTabPage, ClickImportHdl_Impl ) ); - m_pBtnModify->SetClickHdl( LINK( this, SvxBitmapTabPage, ClickModifyHdl_Impl ) ); - m_pBtnDelete->SetClickHdl( LINK( this, SvxBitmapTabPage, ClickDeleteHdl_Impl ) ); - m_pBtnLoad->SetClickHdl( LINK( this, SvxBitmapTabPage, ClickLoadHdl_Impl ) ); - m_pBtnSave->SetClickHdl( LINK( this, SvxBitmapTabPage, ClickSaveHdl_Impl ) ); + m_pBtnAdd->SetClickHdl( LINK( this, SvxPatternTabPage, ClickAddHdl_Impl ) ); + m_pBtnModify->SetClickHdl( LINK( this, SvxPatternTabPage, ClickModifyHdl_Impl ) ); + m_pBtnDelete->SetClickHdl( LINK( this, SvxPatternTabPage, ClickDeleteHdl_Impl ) ); + m_pBtnLoad->SetClickHdl( LINK( this, SvxPatternTabPage, ClickLoadHdl_Impl ) ); + m_pBtnSave->SetClickHdl( LINK( this, SvxPatternTabPage, ClickSaveHdl_Impl ) ); - m_pLbBitmaps->SetSelectHdl( LINK( this, SvxBitmapTabPage, ChangeBitmapHdl_Impl ) ); - m_pLbColor->SetSelectHdl( LINK( this, SvxBitmapTabPage, ChangePixelColorHdl_Impl ) ); - m_pLbBackgroundColor->SetSelectHdl( LINK( this, SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl ) ); + m_pLbPatterns->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangePatternHdl_Impl ) ); + m_pLbColor->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangeColorHdl_Impl ) ); + m_pLbBackgroundColor->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangeColorHdl_Impl ) ); setPreviewsToSamePlace(pParent, this); } -SvxBitmapTabPage::~SvxBitmapTabPage() +SvxPatternTabPage::~SvxPatternTabPage() { disposeOnce(); } -void SvxBitmapTabPage::dispose() +void SvxPatternTabPage::dispose() { delete m_pBitmapCtl; m_pBitmapCtl = nullptr; @@ -131,28 +129,26 @@ void SvxBitmapTabPage::dispose() m_pCtlPixel.clear(); m_pLbColor.clear(); m_pLbBackgroundColor.clear(); - m_pLbBitmapsHidden.clear(); - m_pLbBitmaps.clear(); + m_pLbPatternsHidden.clear(); + m_pLbPatterns.clear(); m_pCtlPreview.clear(); m_pBtnAdd.clear(); m_pBtnModify.clear(); - m_pBtnImport.clear(); m_pBtnDelete.clear(); m_pBtnLoad.clear(); m_pBtnSave.clear(); SvxTabPage::dispose(); } -void SvxBitmapTabPage::Construct() +void SvxPatternTabPage::Construct() { m_pLbColor->Fill( m_pColorList ); m_pLbBackgroundColor->CopyEntries( *m_pLbColor ); - - m_pLbBitmaps->Fill( m_pBitmapList ); + m_pLbPatterns->Fill( m_pPatternList ); } -void SvxBitmapTabPage::ActivatePage( const SfxItemSet& ) +void SvxPatternTabPage::ActivatePage( const SfxItemSet& ) { sal_Int32 nPos; sal_Int32 nCount; @@ -193,19 +189,17 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& ) m_pLbBackgroundColor->SelectEntryPos( 0 ); else m_pLbBackgroundColor->SelectEntryPos( nPos ); - - ChangePixelColorHdl_Impl( *m_pLbColor ); - ChangeBackgrndColorHdl_Impl( *m_pLbBackgroundColor ); + ChangeColor_Impl(); } // determining (possibly cutting) the name and // displaying it in the GroupBox OUString aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString += ": "; - INetURLObject aURL( m_pBitmapList->GetPath() ); + INetURLObject aURL( m_pPatternList->GetPath() ); - aURL.Append( m_pBitmapList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); + aURL.Append( m_pPatternList->GetName() ); + SAL_WARN_IF( aURL.GetProtocol() == INetProtocol::NotValid, "cui.tabpages", "invalid URL" ); if( aURL.getBase().getLength() > 18 ) { @@ -217,10 +211,10 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& ) if( *m_pPageType == PT_BITMAP && *m_pPos != LISTBOX_ENTRY_NOTFOUND ) { - m_pLbBitmaps->SelectEntryPos( *m_pPos ); + m_pLbPatterns->SelectEntryPos( *m_pPos ); } // colors could have been deleted - ChangeBitmapHdl_Impl( *m_pLbBitmaps ); + ChangePatternHdl_Impl( *m_pLbPatterns ); *m_pPageType = PT_BITMAP; *m_pPos = LISTBOX_ENTRY_NOTFOUND; @@ -229,7 +223,7 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& ) } -DeactivateRC SvxBitmapTabPage::DeactivatePage( SfxItemSet* _pSet) +DeactivateRC SvxPatternTabPage::DeactivatePage( SfxItemSet* _pSet) { if ( CheckChanges_Impl() == -1L ) return DeactivateRC::KeepPage; @@ -241,18 +235,18 @@ DeactivateRC SvxBitmapTabPage::DeactivatePage( SfxItemSet* _pSet) } -bool SvxBitmapTabPage::FillItemSet( SfxItemSet* _rOutAttrs ) +bool SvxPatternTabPage::FillItemSet( SfxItemSet* _rOutAttrs ) { if( m_nDlgType == 0 && !*m_pbAreaTP ) // area dialog { if(PT_BITMAP == *m_pPageType) { _rOutAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP)); - sal_Int32 nPos = m_pLbBitmaps->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbPatterns->GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { - const XBitmapEntry* pXBitmapEntry = m_pBitmapList->GetBitmap(nPos); - const OUString aString(m_pLbBitmaps->GetSelectEntry()); + const XBitmapEntry* pXBitmapEntry = m_pPatternList->GetBitmap(nPos); + const OUString aString(m_pLbPatterns->GetSelectEntry()); _rOutAttrs->Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject())); } @@ -269,7 +263,7 @@ bool SvxBitmapTabPage::FillItemSet( SfxItemSet* _rOutAttrs ) } -void SvxBitmapTabPage::Reset( const SfxItemSet* ) +void SvxPatternTabPage::Reset( const SfxItemSet* ) { // aLbBitmaps.SelectEntryPos( 0 ); @@ -284,10 +278,10 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* ) m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlPreview->Invalidate(); - ChangeBitmapHdl_Impl( *m_pLbBitmaps ); + ChangePatternHdl_Impl( *m_pLbPatterns ); // determine button state - if( m_pBitmapList.is() && m_pBitmapList->Count() ) + if( m_pPatternList.is() && m_pPatternList->Count() ) { m_pBtnAdd->Enable(); m_pBtnModify->Enable(); @@ -303,21 +297,21 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* ) } -VclPtr<SfxTabPage> SvxBitmapTabPage::Create( vcl::Window* pWindow, +VclPtr<SfxTabPage> SvxPatternTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rSet ) { - return VclPtr<SvxBitmapTabPage>::Create( pWindow, *rSet ); + return VclPtr<SvxPatternTabPage>::Create( pWindow, *rSet ); } -IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangeBitmapHdl_Impl, ListBox&, void) +IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ChangePatternHdl_Impl, ListBox&, void) { std::unique_ptr<GraphicObject> pGraphicObject; - int nPos(m_pLbBitmaps->GetSelectEntryPos()); + int nPos(m_pLbPatterns->GetSelectEntryPos()); if(LISTBOX_ENTRY_NOTFOUND != nPos) { - pGraphicObject.reset(new GraphicObject(m_pBitmapList->GetBitmap(nPos)->GetGraphicObject())); + pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap(nPos)->GetGraphicObject())); } else { @@ -335,12 +329,12 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangeBitmapHdl_Impl, ListBox&, void) if(!pGraphicObject) { - m_pLbBitmaps->SelectEntryPos(0); - nPos = m_pLbBitmaps->GetSelectEntryPos(); + m_pLbPatterns->SelectEntryPos(0); + nPos = m_pLbPatterns->GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { - pGraphicObject.reset(new GraphicObject(m_pBitmapList->GetBitmap(nPos)->GetGraphicObject())); + pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap(nPos)->GetGraphicObject())); } } } @@ -414,32 +408,25 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangeBitmapHdl_Impl, ListBox&, void) m_pCtlPixel->Invalidate(); - // display bitmap - const XFillBitmapItem aXBmpItem(OUString(), *pGraphicObject); - m_rXFSet.Put( aXBmpItem ); - - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); - - m_bBmpChanged = false; + m_bPtrnChanged = false; } } -long SvxBitmapTabPage::CheckChanges_Impl() +long SvxPatternTabPage::CheckChanges_Impl() { - sal_Int32 nPos = m_pLbBitmaps->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbPatterns->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - if( m_bBmpChanged ) + if( m_bPtrnChanged ) { ResMgr& rMgr = CUI_MGR(); Image aWarningBoxImage = WarningBox::GetStandardImage(); ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(), - SVX_RES( RID_SVXSTR_BITMAP ), - CUI_RES( RID_SVXSTR_ASK_CHANGE_BITMAP ), + SVX_RES( RID_SVXSTR_PATTERN ), + CUI_RES( RID_SVXSTR_ASK_CHANGE_PATTERN ), &aWarningBoxImage ); - DBG_ASSERT(aMessDlg, "Dialog creation failed!"); + assert(aMessDlg && "Dialog creation failed!"); aMessDlg->SetButtonText( SvxMessDialogButton::N1, ResId( RID_SVXSTR_CHANGE, rMgr ) ); aMessDlg->SetButtonText( SvxMessDialogButton::N2, ResId( RID_SVXSTR_ADD, rMgr ) ); @@ -464,21 +451,21 @@ long SvxBitmapTabPage::CheckChanges_Impl() } } } - nPos = m_pLbBitmaps->GetSelectEntryPos(); + nPos = m_pLbPatterns->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) *m_pPos = nPos; return 0L; } -IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickAddHdl_Impl, Button*, void) +IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) { - OUString aNewName( SVX_RES( RID_SVXSTR_BITMAP ) ); - OUString aDesc( CUI_RES( RID_SVXSTR_DESC_NEW_BITMAP ) ); + OUString aNewName( SVX_RES( RID_SVXSTR_PATTERN_UNTITLED ) ); + OUString aDesc( CUI_RES( RID_SVXSTR_DESC_NEW_PATTERN ) ); OUString aName; - long nCount = m_pBitmapList->Count(); + long nCount = m_pPatternList->Count(); long j = 1; bool bDifferent = false; @@ -490,14 +477,14 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickAddHdl_Impl, Button*, void) bDifferent = true; for( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == m_pBitmapList->GetBitmap( i )->GetName() ) + if( aName == m_pPatternList->GetBitmap( i )->GetName() ) bDifferent = false; } SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialog creation failed!"); + assert(pFact && "Dialog creation failed!"); std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); - DBG_ASSERT(pDlg, "Dialog creation failed!"); + assert(pDlg && "Dialog creation failed!"); ScopedVclPtr<MessageDialog> pWarnBox; sal_uInt16 nError(1); @@ -508,7 +495,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickAddHdl_Impl, Button*, void) bDifferent = true; for( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == m_pBitmapList->GetBitmap( i )->GetName() ) + if( aName == m_pPatternList->GetBitmap( i )->GetName() ) bDifferent = false; if( bDifferent ) { @@ -549,23 +536,23 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickAddHdl_Impl, Button*, void) } } - DBG_ASSERT( pEntry, "SvxBitmapTabPage::ClickAddHdl_Impl(), pEntry == 0 ?" ); + assert( pEntry && "SvxPatternTabPage::ClickAddHdl_Impl(), pEntry == 0 ?" ); if( pEntry ) { - m_pBitmapList->Insert( pEntry ); + m_pPatternList->Insert( pEntry ); const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - m_pLbBitmaps->Append(rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry ); - m_pLbBitmaps->SelectEntryPos( m_pLbBitmaps->GetEntryCount() - 1 ); + m_pLbPatterns->Append(rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry ); + m_pLbPatterns->SelectEntryPos( m_pLbPatterns->GetEntryCount() - 1 ); - *m_pnBitmapListState |= ChangeType::MODIFIED; + *m_pnPatternListState |= ChangeType::MODIFIED; - ChangeBitmapHdl_Impl( *m_pLbBitmaps ); + ChangePatternHdl_Impl( *m_pLbPatterns ); } } // determine button state - if( m_pBitmapList->Count() ) + if( m_pPatternList->Count() ) { m_pBtnModify->Enable(); m_pBtnDelete->Enable(); @@ -578,104 +565,23 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickAddHdl_Impl, Button*, void) /******************************************************************************/ -IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickImportHdl_Impl, Button*, void) -{ - ResMgr& rMgr = CUI_MGR(); - SvxOpenGraphicDialog aDlg( OUString("Import") ); - aDlg.EnableLink(false); - - if( !aDlg.Execute() ) - { - Graphic aGraphic; - - EnterWait(); - int nError = aDlg.GetGraphic( aGraphic ); - LeaveWait(); - - if( !nError ) - { - OUString aDesc( ResId(RID_SVXSTR_DESC_EXT_BITMAP, rMgr) ); - ScopedVclPtr<MessageDialog> pWarnBox; - - // convert file URL to UI name - OUString aName; - INetURLObject aURL( aDlg.GetPath() ); - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aURL.GetName().getToken( 0, '.' ), aDesc )); - DBG_ASSERT(pDlg, "Dialog creation failed!"); - nError = 1; - - while( pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - - bool bDifferent = true; - long nCount = m_pBitmapList->Count(); - - for( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == m_pBitmapList->GetBitmap( i )->GetName() ) - bDifferent = false; - - if( bDifferent ) { - nError = 0; - break; - } - - if( !pWarnBox ) - { - pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui")); - } - - if( pWarnBox->Execute() != RET_OK ) - break; - } - - pDlg.reset(); - pWarnBox.disposeAndClear(); - - if( !nError ) - { - XBitmapEntry* pEntry = new XBitmapEntry( aGraphic, aName ); - m_pBitmapList->Insert( pEntry ); - - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - m_pLbBitmaps->Append(rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry ); - m_pLbBitmaps->SelectEntryPos( m_pLbBitmaps->GetEntryCount() - 1 ); - - *m_pnBitmapListState |= ChangeType::MODIFIED; - - ChangeBitmapHdl_Impl( *m_pLbBitmaps ); - } - } - else - // graphic couldn't be loaded - ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog() - ,"NoLoadedFileDialog" - ,"cui/ui/querynoloadedfiledialog.ui")->Execute(); - } -} - - -IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickModifyHdl_Impl, Button*, void) +IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickModifyHdl_Impl, Button*, void) { - sal_Int32 nPos = m_pLbBitmaps->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbPatterns->GetSelectEntryPos(); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) { ResMgr& rMgr = CUI_MGR(); - OUString aDesc( ResId( RID_SVXSTR_DESC_NEW_BITMAP, rMgr ) ); - OUString aName( m_pBitmapList->GetBitmap( nPos )->GetName() ); + OUString aDesc( ResId( RID_SVXSTR_DESC_NEW_PATTERN, rMgr ) ); + OUString aName( m_pPatternList->GetBitmap( nPos )->GetName() ); OUString aOldName = aName; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialog creation failed!"); + assert(pFact && "Dialog creation failed!"); std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc )); - DBG_ASSERT(pDlg, "Dialog creation failed!"); + assert(pDlg && "Dialog creation failed!"); - long nCount = m_pBitmapList->Count(); + long nCount = m_pPatternList->Count(); bool bLoop = true; const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); @@ -686,7 +592,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickModifyHdl_Impl, Button*, void) for( long i = 0; i < nCount && bDifferent; i++ ) { - if( aName == m_pBitmapList->GetBitmap( i )->GetName() && + if( aName == m_pPatternList->GetBitmap( i )->GetName() && aName != aOldName ) bDifferent = false; } @@ -699,14 +605,14 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickModifyHdl_Impl, Button*, void) // #i123497# Need to replace the existing entry with a new one (old returned needs to be deleted) XBitmapEntry* pEntry = new XBitmapEntry(Graphic(aBitmapEx), aName); - delete m_pBitmapList->Replace(pEntry, nPos); + delete m_pPatternList->Replace(pEntry, nPos); - m_pLbBitmaps->Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry, nPos ); - m_pLbBitmaps->SelectEntryPos( nPos ); + m_pLbPatterns->Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry, nPos ); + m_pLbPatterns->SelectEntryPos( nPos ); - *m_pnBitmapListState |= ChangeType::MODIFIED; + *m_pnPatternListState |= ChangeType::MODIFIED; - m_bBmpChanged = false; + m_bPtrnChanged = false; } else { @@ -721,9 +627,9 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickModifyHdl_Impl, Button*, void) } -IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickDeleteHdl_Impl, Button*, void) +IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickDeleteHdl_Impl, Button*, void) { - sal_Int32 nPos = m_pLbBitmaps->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbPatterns->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { @@ -731,20 +637,20 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickDeleteHdl_Impl, Button*, void) if( aQueryBox->Execute() == RET_YES ) { - delete m_pBitmapList->Remove( nPos ); - m_pLbBitmaps->RemoveEntry( nPos ); - m_pLbBitmaps->SelectEntryPos( 0 ); + delete m_pPatternList->Remove( nPos ); + m_pLbPatterns->RemoveEntry( nPos ); + m_pLbPatterns->SelectEntryPos( 0 ); m_pCtlPreview->Invalidate(); m_pCtlPixel->Invalidate(); - ChangeBitmapHdl_Impl( *m_pLbBitmaps ); + ChangePatternHdl_Impl( *m_pLbPatterns ); - *m_pnBitmapListState |= ChangeType::MODIFIED; + *m_pnPatternListState |= ChangeType::MODIFIED; } } // determine button state - if( !m_pBitmapList->Count() ) + if( !m_pPatternList->Count() ) { m_pBtnModify->Disable(); m_pBtnDelete->Disable(); @@ -753,25 +659,25 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickDeleteHdl_Impl, Button*, void) } -IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickLoadHdl_Impl, Button*, void) +IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickLoadHdl_Impl, Button*, void) { sal_uInt16 nReturn = RET_YES; ResMgr& rMgr = CUI_MGR(); - if ( *m_pnBitmapListState & ChangeType::MODIFIED ) + if ( *m_pnPatternListState & ChangeType::MODIFIED ) { nReturn = ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog() ,"AskSaveList" ,"cui/ui/querysavelistdialog.ui")->Execute(); if ( nReturn == RET_YES ) - m_pBitmapList->Save(); + m_pPatternList->Save(); } if ( nReturn != RET_CANCEL ) { ::sfx2::FileDialogHelper aDlg( css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE ); - OUString aStrFilterType( "*.sob" ); + OUString aStrFilterType( "*.sop" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); OUString aPalettePath(SvtPathOptions().GetPalettePath()); OUString aLastDir; @@ -795,21 +701,21 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickLoadHdl_Impl, Button*, void) aPathURL.removeFinalSlash(); // save table - XBitmapListRef pBmpList = XPropertyList::AsBitmapList( + XPatternListRef pBmpList = XPropertyList::AsPatternList( XPropertyList::CreatePropertyList( - XBITMAP_LIST, aPathURL.GetMainURL(INetURLObject::NO_DECODE), + XPATTERN_LIST, aPathURL.GetMainURL(INetURLObject::NO_DECODE), "")); pBmpList->SetName( aURL.getName() ); if( pBmpList->Load() ) { - m_pBitmapList = pBmpList; - static_cast<SvxAreaTabDialog*>( GetParentDialog() )->SetNewBitmapList( m_pBitmapList ); + m_pPatternList = pBmpList; + static_cast<SvxAreaTabDialog*>( GetParentDialog() )->SetNewPatternList( m_pPatternList ); - m_pLbBitmaps->Clear(); - m_pLbBitmaps->Fill( m_pBitmapList ); + m_pLbPatterns->Clear(); + m_pLbPatterns->Fill( m_pPatternList ); Reset( &m_rOutAttrs ); - m_pBitmapList->SetName( aURL.getName() ); + m_pPatternList->SetName( aURL.getName() ); // determining (possibly cutting) the name // displaying it in the GroupBox @@ -824,8 +730,8 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickLoadHdl_Impl, Button*, void) else aString += aURL.getBase(); - *m_pnBitmapListState |= ChangeType::CHANGED; - *m_pnBitmapListState &= ~ChangeType::MODIFIED; + *m_pnPatternListState |= ChangeType::CHANGED; + *m_pnPatternListState &= ~ChangeType::MODIFIED; LeaveWait(); } else @@ -839,7 +745,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickLoadHdl_Impl, Button*, void) } // determine button state - if( m_pBitmapList->Count() ) + if( m_pPatternList->Count() ) { m_pBtnModify->Enable(); m_pBtnDelete->Enable(); @@ -854,10 +760,10 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickLoadHdl_Impl, Button*, void) } -IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickSaveHdl_Impl, Button*, void) +IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickSaveHdl_Impl, Button*, void) { ::sfx2::FileDialogHelper aDlg( css::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE ); - OUString aStrFilterType( "*.sob" ); + OUString aStrFilterType( "*.sop" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); OUString aPalettePath(SvtPathOptions().GetPalettePath()); @@ -870,14 +776,14 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickSaveHdl_Impl, Button*, void) while (nIndex >= 0); INetURLObject aFile(aLastDir); - DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); + SAL_WARN_IF( aFile.GetProtocol() == INetProtocol::NotValid, "cui.tabpages", "invalid URL" ); - if( !m_pBitmapList->GetName().isEmpty() ) + if( !m_pPatternList->GetName().isEmpty() ) { - aFile.Append( m_pBitmapList->GetName() ); + aFile.Append( m_pPatternList->GetName() ); if( aFile.getExtension().isEmpty() ) - aFile.SetExtension( "sob" ); + aFile.SetExtension( "sop" ); } aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); @@ -889,10 +795,10 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickSaveHdl_Impl, Button*, void) aPathURL.removeSegment(); aPathURL.removeFinalSlash(); - m_pBitmapList->SetName( aURL.getName() ); - m_pBitmapList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); + m_pPatternList->SetName( aURL.getName() ); + m_pPatternList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - if( m_pBitmapList->Save() ) + if( m_pPatternList->Save() ) { // determining (possibly cutting) the name // displaying it in the GroupBox @@ -907,8 +813,8 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickSaveHdl_Impl, Button*, void) else aString += aURL.getBase(); - *m_pnBitmapListState |= ChangeType::SAVED; - *m_pnBitmapListState &= ~ChangeType::MODIFIED; + *m_pnPatternListState |= ChangeType::SAVED; + *m_pnPatternListState &= ~ChangeType::MODIFIED; } else { @@ -920,27 +826,18 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickSaveHdl_Impl, Button*, void) } -IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangePixelColorHdl_Impl, ListBox&, void) +IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ChangeColorHdl_Impl, ListBox&, void) { - m_pCtlPixel->SetPixelColor( m_pLbColor->GetSelectEntryColor() ); - m_pCtlPixel->Invalidate(); - - m_pBitmapCtl->SetPixelColor( m_pLbColor->GetSelectEntryColor() ); - - // get bitmap and display it - m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_pBitmapCtl->GetBitmapEx()))); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); - - m_bBmpChanged = true; + ChangeColor_Impl(); } - -IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl, ListBox&, void) +void SvxPatternTabPage::ChangeColor_Impl() { + m_pCtlPixel->SetPixelColor( m_pLbColor->GetSelectEntryColor() ); m_pCtlPixel->SetBackgroundColor( m_pLbBackgroundColor->GetSelectEntryColor() ); m_pCtlPixel->Invalidate(); + m_pBitmapCtl->SetPixelColor( m_pLbColor->GetSelectEntryColor() ); m_pBitmapCtl->SetBackgroundColor( m_pLbBackgroundColor->GetSelectEntryColor() ); // get bitmap and display it @@ -948,11 +845,11 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl, ListBox&, v m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlPreview->Invalidate(); - m_bBmpChanged = true; + m_bPtrnChanged = true; } -void SvxBitmapTabPage::PointChanged( vcl::Window* pWindow, RECT_POINT ) +void SvxPatternTabPage::PointChanged( vcl::Window* pWindow, RECT_POINT ) { if( pWindow == m_pCtlPixel ) { @@ -963,15 +860,15 @@ void SvxBitmapTabPage::PointChanged( vcl::Window* pWindow, RECT_POINT ) m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlPreview->Invalidate(); - m_bBmpChanged = true; + m_bPtrnChanged = true; } } -vcl::Window* SvxBitmapTabPage::GetParentLabeledBy( const vcl::Window* pLabeled ) const +vcl::Window* SvxPatternTabPage::GetParentLabeledBy( const vcl::Window* pLabeled ) const { - if (pLabeled == m_pLbBitmaps) - return m_pLbBitmapsHidden.get(); + if (pLabeled == m_pLbPatterns) + return m_pLbPatternsHidden.get(); else return SvxTabPage::GetParentLabeledBy (pLabeled); } diff --git a/cui/uiconfig/ui/areadialog.ui b/cui/uiconfig/ui/areadialog.ui index bf6404833556..4482284db8b7 100644 --- a/cui/uiconfig/ui/areadialog.ui +++ b/cui/uiconfig/ui/areadialog.ui @@ -177,10 +177,10 @@ <placeholder/> </child> <child type="tab"> - <object class="GtkLabel" id="RID_SVXPAGE_BITMAP"> + <object class="GtkLabel" id="RID_SVXPAGE_PATTERN"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">Bitmaps</property> + <property name="label" translatable="yes">Patterns</property> </object> <packing> <property name="position">6</property> diff --git a/cui/uiconfig/ui/bitmaptabpage.ui b/cui/uiconfig/ui/patterntabpage.ui index 10f6d6831f74..cce44939e44a 100644 --- a/cui/uiconfig/ui/bitmaptabpage.ui +++ b/cui/uiconfig/ui/patterntabpage.ui @@ -1,7 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> <interface> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.0"/> <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">res/sc05501.png</property> + </object> + <object class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">res/sc05502.png</property> + </object> <object class="GtkBox" id="BitmapTabPage"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -85,7 +96,7 @@ </packing> </child> <child> - <object class="svxlo-ColorLB" id="LB_COLOR"> + <object class="svxlo-ColorLB" id="LB_BACKGROUND_COLOR"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> @@ -111,7 +122,7 @@ </packing> </child> <child> - <object class="svxlo-ColorLB" id="LB_BACKGROUND_COLOR"> + <object class="svxlo-ColorLB" id="LB_COLOR"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> @@ -139,7 +150,7 @@ <property name="orientation">vertical</property> <property name="spacing">6</property> <child> - <object class="svxlo-BitmapLB" id="LB_BITMAPS:border"> + <object class="svxlo-PatternLB" id="LB_PATTERN:border"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="vexpand">True</property> @@ -211,20 +222,6 @@ </packing> </child> <child> - <object class="GtkButton" id="BTN_IMPORT"> - <property name="label" translatable="yes">_Import</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="receives_default">True</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> <object class="GtkButton" id="BTN_DELETE"> <property name="label">gtk-delete</property> <property name="visible">True</property> @@ -334,14 +331,4 @@ </packing> </child> </object> - <object class="GtkImage" id="image1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="pixbuf">res/sc05501.png</property> - </object> - <object class="GtkImage" id="image2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="pixbuf">res/sc05502.png</property> - </object> </interface> diff --git a/extras/Package_palettes.mk b/extras/Package_palettes.mk index 5cf4c6104bd7..fa37de6d679a 100644 --- a/extras/Package_palettes.mk +++ b/extras/Package_palettes.mk @@ -26,6 +26,7 @@ $(eval $(call gb_Package_add_files,extras_palettes,$(LIBO_SHARE_FOLDER)/palette, standard.soe \ standard.sog \ standard.soh \ + standard.sop \ styles.sod \ tango.soc \ web.soc \ diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index 4dd4593d56e0..30dcecc94470 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -150,6 +150,17 @@ </property> </properties> </glade-widget-class> + <glade-widget-class title="Pattern ListBox" name="svxlo-PatternLB" + generic-name="PatternListBox" parent="GtkComboBox" + icon-name="widget-gtk-combobox"> + <properties> + <property save="True" query="False" id="dropdown" default="True" name="Use DropDown"> + <parameter-spec> + <type>GParamBoolean</type> + </parameter-spec> + </property> + </properties> + </glade-widget-class> <glade-widget-class title="Font Name ListBox" name="svtlo-FontNameBox" generic-name="Font name ListBox" parent="GtkComboBox" icon-name="widget-gtk-combobox"> diff --git a/extras/source/palettes/standard.sob b/extras/source/palettes/standard.sob Binary files differindex ee1f29f6bbdb..820190b59258 100644 --- a/extras/source/palettes/standard.sob +++ b/extras/source/palettes/standard.sob diff --git a/extras/source/palettes/standard.sop b/extras/source/palettes/standard.sop Binary files differnew file mode 100644 index 000000000000..bcdee67e2037 --- /dev/null +++ b/extras/source/palettes/standard.sop diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index c2af3bce3110..da820fcdf734 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -40,6 +40,8 @@ #define RID_SVXSTR_GRADIENT (RID_SVX_START + 161) #define RID_SVXSTR_HATCH (RID_SVX_START + 180) #define RID_SVXSTR_BITMAP (RID_SVX_START + 167) +#define RID_SVXSTR_PATTERN (RID_SVX_START + 168) +#define RID_SVXSTR_PATTERN_UNTITLED (RID_SVX_START + 169) #define RID_SVXSTR_LINESTYLE (RID_SVX_START + 173) #define RID_SVXSTR_FIELDUNIT_TABLE (RID_SVX_START + 311) #define RID_SVXSTR_COLOR_USER (RID_SVX_START + 250) @@ -84,6 +86,7 @@ #define RID_SVXPAGE_HATCH (RID_SVX_START + 57) #define RID_SVXPAGE_BITMAP (RID_SVX_START + 58) #define RID_SVXPAGE_GRADIENT (RID_SVX_START + 59) +#define RID_SVXPAGE_PATTERN (RID_SVX_START + 60) #define RID_SVXPAGE_MACROASSIGN (RID_SVX_START + 296) // why extra defines for pages that already exist? diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx index 2e6aa4c72aed..1478b6498639 100644 --- a/include/svx/dlgctrl.hxx +++ b/include/svx/dlgctrl.hxx @@ -293,6 +293,24 @@ private: /************************************************************************/ +class SAL_WARN_UNUSED SVX_DLLPUBLIC PatternLB : public ListBox +{ +public: + explicit PatternLB(vcl::Window* pParent, WinBits aWB); + + void Fill(const XPatternListRef &pList); + + void Append(const Size& rSize, const XBitmapEntry& rEntry); + void Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_Int32 nPos); + +private: + BitmapEx maBitmapEx; + + XPatternListRef mpList; +}; + +/************************************************************************/ + class SAL_WARN_UNUSED SVX_DLLPUBLIC FillAttrLB : public ColorListBox { private: @@ -304,6 +322,7 @@ public: void Fill( const XHatchListRef &pList ); void Fill( const XGradientListRef &pList ); void Fill( const XBitmapListRef &pList ); + void Fill( const XPatternListRef &pList ); }; /************************************************************************/ diff --git a/include/svx/drawitem.hxx b/include/svx/drawitem.hxx index 64e94e9b7faf..1d7068c2fdd4 100644 --- a/include/svx/drawitem.hxx +++ b/include/svx/drawitem.hxx @@ -123,6 +123,30 @@ public: const XBitmapListRef& GetBitmapList() const { return pBitmapList; } }; +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxPatternListItem : public SfxPoolItem +{ + XPatternListRef pPatternList; + +public: + static SfxPoolItem* CreateDefault(); + + SvxPatternListItem(); + SvxPatternListItem( XPatternListRef pBL, + sal_uInt16 nWhich ); + SvxPatternListItem( const SvxPatternListItem& ); + + virtual bool GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + OUString &rText, const IntlWrapper * = nullptr ) const override; + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const XPatternListRef& GetPatternList() const { return pPatternList; } +}; + class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxDashListItem : public SfxPoolItem { XDashListRef pDashList; diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx index 525199e3523d..a30bf7328ebf 100644 --- a/include/svx/sidebar/AreaPropertyPanelBase.hxx +++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx @@ -113,6 +113,7 @@ protected: sal_Int32 mnLastPosGradient; sal_Int32 mnLastPosHatch; sal_Int32 mnLastPosBitmap; + sal_Int32 mnLastPosPattern; sal_uInt16 mnLastTransSolid; XGradient maGradientLinear; @@ -136,7 +137,6 @@ protected: VclPtr<ToolBox> mpBTNGradient; VclPtr<MetricField> mpMTRAngle; VclPtr<ListBox> mpGradientStyle; - VclPtr<SvxFillAttrBox> mpLbFillBitmap; VclPtr<PushButton> mpBmpImport; std::unique_ptr< XFillStyleItem > mpStyleItem; diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 160af2d8398f..81ec9c52f84d 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -509,6 +509,7 @@ public: XHatchListRef GetHatchList() const { return XPropertyList::AsHatchList(GetPropertyList( XHATCH_LIST )); } XColorListRef GetColorList() const { return XPropertyList::AsColorList(GetPropertyList( XCOLOR_LIST )); } XBitmapListRef GetBitmapList() const { return XPropertyList::AsBitmapList(GetPropertyList( XBITMAP_LIST )); } + XPatternListRef GetPatternList() const { return XPropertyList::AsPatternList(GetPropertyList( XPATTERN_LIST )); } XLineEndListRef GetLineEndList() const { return XPropertyList::AsLineEndList(GetPropertyList( XLINE_END_LIST )); } XGradientListRef GetGradientList() const { return XPropertyList::AsGradientList(GetPropertyList( XGRADIENT_LIST )); } diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index c5e891860913..81eb9f44a0e0 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -339,25 +339,26 @@ #define SID_GRADIENT_LIST ( SID_SVX_START + 180 ) #define SID_HATCH_LIST ( SID_SVX_START + 181 ) #define SID_BITMAP_LIST ( SID_SVX_START + 182 ) -#define SID_DASH_LIST ( SID_SVX_START + 183 ) -#define SID_LINEEND_LIST ( SID_SVX_START + 184 ) -#define SID_BACKGROUND_COLOR ( SID_SVX_START + 185 ) -#define SID_BACKGROUND_PATTERN ( SID_SVX_START + 186 ) -#define SID_ATTR_BORDER ( SID_SVX_START + 187 ) -#define SID_INSERT_FIXEDTEXT ( SID_SVX_START + 188 ) -#define SID_INSERT_GROUPBOX ( SID_SVX_START + 189 ) -#define SID_INSERT_EDIT ( SID_SVX_START + 190 ) -#define SID_INSERT_LISTBOX ( SID_SVX_START + 191 ) -#define SID_INSERT_COMBOBOX ( SID_SVX_START + 192 ) -#define SID_INSERT_SPINBUTTON ( SID_SVX_START + 193 ) -#define SID_INSERT_HSCROLLBAR ( SID_SVX_START + 194 ) -#define SID_INSERT_VSCROLLBAR ( SID_SVX_START + 195 ) -#define SID_INSERT_PREVIEW ( SID_SVX_START + 196 ) -#define SID_INSERT_URLBUTTON ( SID_SVX_START + 197 ) -#define SID_INSERT_SELECT ( SID_SVX_START + 198 ) -#define SID_DIALOG_TESTMODE ( SID_SVX_START + 199 ) -#define SID_FRAME_LINESTYLE ( SID_SVX_START + 200 ) -#define SID_FRAME_LINECOLOR ( SID_SVX_START + 201 ) +#define SID_PATTERN_LIST ( SID_SVX_START + 183 ) +#define SID_DASH_LIST ( SID_SVX_START + 184 ) +#define SID_LINEEND_LIST ( SID_SVX_START + 185 ) +#define SID_BACKGROUND_COLOR ( SID_SVX_START + 186 ) +#define SID_BACKGROUND_PATTERN ( SID_SVX_START + 187 ) +#define SID_ATTR_BORDER ( SID_SVX_START + 188 ) +#define SID_INSERT_FIXEDTEXT ( SID_SVX_START + 189 ) +#define SID_INSERT_GROUPBOX ( SID_SVX_START + 190 ) +#define SID_INSERT_EDIT ( SID_SVX_START + 191 ) +#define SID_INSERT_LISTBOX ( SID_SVX_START + 192 ) +#define SID_INSERT_COMBOBOX ( SID_SVX_START + 193 ) +#define SID_INSERT_SPINBUTTON ( SID_SVX_START + 194 ) +#define SID_INSERT_HSCROLLBAR ( SID_SVX_START + 195 ) +#define SID_INSERT_VSCROLLBAR ( SID_SVX_START + 196 ) +#define SID_INSERT_PREVIEW ( SID_SVX_START + 197 ) +#define SID_INSERT_URLBUTTON ( SID_SVX_START + 198 ) +#define SID_INSERT_SELECT ( SID_SVX_START + 199 ) +#define SID_DIALOG_TESTMODE ( SID_SVX_START + 200 ) +#define SID_FRAME_LINESTYLE ( SID_SVX_START + 201 ) +#define SID_FRAME_LINECOLOR ( SID_SVX_START + 202 ) #define SID_SEARCHDLG_SEARCHSTRINGS ( SID_SVX_START + 215 ) #define SID_SEARCHDLG_REPLACESTRINGS ( SID_SVX_START + 216 ) #define SID_ATTR_TABLE ( SID_SVX_START + 217 ) diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx index 9217d18aa5fc..d9a90702620c 100644 --- a/include/svx/xtable.hxx +++ b/include/svx/xtable.hxx @@ -151,6 +151,7 @@ enum XPropertyListType { XHATCH_LIST, XGRADIENT_LIST, XBITMAP_LIST, + XPATTERN_LIST, XPROPERTY_LIST_COUNT }; @@ -160,6 +161,7 @@ class XDashList ; typedef rtl::Reference< class XDashList > XDashListRef; class XHatchList ; typedef rtl::Reference< class XHatchList > XHatchListRef; class XColorList ; typedef rtl::Reference< class XColorList > XColorListRef; class XBitmapList ; typedef rtl::Reference< class XBitmapList > XBitmapListRef; +class XPatternList ; typedef rtl::Reference< class XPatternList > XPatternListRef; class XLineEndList ; typedef rtl::Reference< class XLineEndList > XLineEndListRef; class XGradientList ; typedef rtl::Reference< class XGradientList > XGradientListRef; @@ -245,6 +247,8 @@ public: rtl::Reference<XPropertyList> const & plist); static inline XBitmapListRef AsBitmapList( rtl::Reference<XPropertyList> const & plist); + static inline XPatternListRef AsPatternList( + rtl::Reference<XPropertyList> const & plist); static inline XLineEndListRef AsLineEndList( rtl::Reference<XPropertyList> const & plist); static inline XGradientListRef AsGradientList( @@ -381,6 +385,25 @@ public: virtual bool Create() override; }; +class SVX_DLLPUBLIC XPatternList : public XPropertyList +{ +protected: + virtual Bitmap CreateBitmapForUI(long nIndex) override; + +public: + XPatternList(const OUString& rPath, const OUString& rReferer) + : XPropertyList(XPATTERN_LIST, rPath, rReferer) {} + + using XPropertyList::Replace; + using XPropertyList::Remove; + + XBitmapEntry* Remove(long nIndex); + XBitmapEntry* GetBitmap(long nIndex) const; + + virtual css::uno::Reference< css::container::XNameContainer > createInstance() override; + virtual bool Create() override; +}; + // FIXME: could add type checking too ... inline XDashListRef XPropertyList::AsDashList( rtl::Reference<XPropertyList> const & plist) @@ -394,6 +417,9 @@ inline XColorListRef XPropertyList::AsColorList( inline XBitmapListRef XPropertyList::AsBitmapList( rtl::Reference<XPropertyList> const & plist) { return XBitmapListRef( static_cast<XBitmapList *> (plist.get()) ); } +inline XPatternListRef XPropertyList::AsPatternList( + rtl::Reference<XPropertyList> const & plist) +{ return XPatternListRef( static_cast<XPatternList *> (plist.get()) ); } inline XLineEndListRef XPropertyList::AsLineEndList( rtl::Reference<XPropertyList> const & plist) { return XLineEndListRef( static_cast<XLineEndList *> (plist.get()) ); } diff --git a/sc/sdi/drawsh.sdi b/sc/sdi/drawsh.sdi index 0aa9964237ae..91af5543da25 100644 --- a/sc/sdi/drawsh.sdi +++ b/sc/sdi/drawsh.sdi @@ -57,6 +57,7 @@ interface TableDraw SID_GRADIENT_LIST [ StateMethod = GetDrawAttrState; Export = FALSE; ] SID_HATCH_LIST [ StateMethod = GetDrawAttrState; Export = FALSE; ] SID_BITMAP_LIST [ StateMethod = GetDrawAttrState; Export = FALSE; ] + SID_PATTERN_LIST [ StateMethod = GetDrawAttrState; Export = FALSE; ] SID_DASH_LIST [ StateMethod = GetDrawAttrState; Export = FALSE; ] SID_LINEEND_LIST [ StateMethod = GetDrawAttrState; Export = FALSE; ] diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index 429a3f5390fb..d4b2cdf7975c 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -78,6 +78,7 @@ void ScDocShell::InitItems() PutItem( SvxGradientListItem( pDrawLayer->GetGradientList(), SID_GRADIENT_LIST ) ); PutItem( SvxHatchListItem ( pDrawLayer->GetHatchList(), SID_HATCH_LIST ) ); PutItem( SvxBitmapListItem ( pDrawLayer->GetBitmapList(), SID_BITMAP_LIST ) ); + PutItem( SvxPatternListItem ( pDrawLayer->GetPatternList(), SID_PATTERN_LIST ) ); PutItem( SvxDashListItem ( pDrawLayer->GetDashList(), SID_DASH_LIST ) ); PutItem( SvxLineEndListItem ( pDrawLayer->GetLineEndList(), SID_LINEEND_LIST ) ); diff --git a/scp2/source/ooo/registryitem_ooo.scp b/scp2/source/ooo/registryitem_ooo.scp index 064040009c55..f3f006404f6b 100644 --- a/scp2/source/ooo/registryitem_ooo.scp +++ b/scp2/source/ooo/registryitem_ooo.scp @@ -110,6 +110,13 @@ RegistryItem gid_Regitem_Sob Value = "soffice.StarConfigFile.6"; End +RegistryItem gid_Regitem_Sop + ParentID = PREDEFINED_HKEY_CLASSES_ROOT; + Subkey = ".sop" + ModuleID = gid_Module_Root; + Value = "soffice.StarConfigFile.6"; +End + RegistryItem gid_Regitem_Soc ParentID = PREDEFINED_HKEY_CLASSES_ROOT; Subkey = ".soc"; diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index 94f1a1a7ab1f..7214f3f486ef 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -1406,6 +1406,10 @@ interface DrawView [ StateMethod = GetAttrState ; ] + SID_PATTERN_LIST + [ + StateMethod = GetAttrState ; + ] SID_ATTR_LINE_WIDTH // ole : no, status : ? [ ExecMethod = FuTemporary ; diff --git a/sd/source/ui/dlg/dlgpage.cxx b/sd/source/ui/dlg/dlgpage.cxx index d2cbe3987142..bba44fd63aed 100644 --- a/sd/source/ui/dlg/dlgpage.cxx +++ b/sd/source/ui/dlg/dlgpage.cxx @@ -46,6 +46,8 @@ SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, const SfxIte ( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ) ); SvxBitmapListItem aBitmapListItem(*static_cast<const SvxBitmapListItem*>( ( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ) ); + SvxPatternListItem aPatternListItem(*static_cast<const SvxPatternListItem*>( + ( mpDocShell->GetItem( SID_PATTERN_LIST ) ) ) ); SvxHatchListItem aHatchListItem(*static_cast<const SvxHatchListItem*>( ( mpDocShell->GetItem( SID_HATCH_LIST ) ) ) ); @@ -53,6 +55,7 @@ SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, const SfxIte mpGradientList = aGradientListItem.GetGradientList(); mpHatchingList = aHatchListItem.GetHatchList(); mpBitmapList = aBitmapListItem.GetBitmapList(); + mpPatternList = aPatternListItem.GetPatternList(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); @@ -80,6 +83,7 @@ void SdPageDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) aSet.Put (SvxGradientListItem(mpGradientList,SID_GRADIENT_LIST)); aSet.Put (SvxHatchListItem(mpHatchingList,SID_HATCH_LIST)); aSet.Put (SvxBitmapListItem(mpBitmapList,SID_BITMAP_LIST)); + aSet.Put (SvxPatternListItem(mpPatternList,SID_PATTERN_LIST)); aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0)); aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1)); aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0)); diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx index 1363cbdd05d8..7c254907be91 100644 --- a/sd/source/ui/dlg/prltempl.cxx +++ b/sd/source/ui/dlg/prltempl.cxx @@ -118,6 +118,7 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, SvxColorListItem aColorListItem(*static_cast<const SvxColorListItem*>( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ); SvxGradientListItem aGradientListItem(*static_cast<const SvxGradientListItem*>( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ); SvxBitmapListItem aBitmapListItem(*static_cast<const SvxBitmapListItem*>( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ); + SvxPatternListItem aPatternListItem(*static_cast<const SvxPatternListItem*>( mpDocShell->GetItem( SID_PATTERN_LIST ) ) ); SvxHatchListItem aHatchListItem(*static_cast<const SvxHatchListItem*>( mpDocShell->GetItem( SID_HATCH_LIST ) ) ); SvxDashListItem aDashListItem(*static_cast<const SvxDashListItem*>( mpDocShell->GetItem( SID_DASH_LIST ) ) ); SvxLineEndListItem aLineEndListItem(*static_cast<const SvxLineEndListItem*>( mpDocShell->GetItem( SID_LINEEND_LIST ) ) ); @@ -128,6 +129,7 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, pGradientList = aGradientListItem.GetGradientList(); pHatchingList = aHatchListItem.GetHatchList(); pBitmapList = aBitmapListItem.GetBitmapList(); + pPatternList = aPatternListItem.GetPatternList(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); diff --git a/sd/source/ui/dlg/tabtempl.cxx b/sd/source/ui/dlg/tabtempl.cxx index b7e119b1a0bf..17e962bc8b36 100644 --- a/sd/source/ui/dlg/tabtempl.cxx +++ b/sd/source/ui/dlg/tabtempl.cxx @@ -61,6 +61,7 @@ SdTabTemplateDlg::SdTabTemplateDlg( vcl::Window* pParent, , pGradientList(pModel->GetGradientList()) , pHatchingList(pModel->GetHatchList()) , pBitmapList(pModel->GetBitmapList()) + , pPatternList(pModel->GetPatternList()) , pDashList(pModel->GetDashList()) , pLineEndList(pModel->GetLineEndList()) , m_nLineId(0) @@ -120,6 +121,7 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0)); aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1)); aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0)); + aSet.Put (SvxPatternListItem(pPatternList,SID_PATTERN_LIST)); rPage.PageCreated(aSet); } else if (nId == m_nShadowId) diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index ccf257c54679..9a0698234420 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -369,6 +369,7 @@ void DrawDocShell::UpdateTablePointers() PutItem( SvxGradientListItem( mpDoc->GetGradientList(), SID_GRADIENT_LIST ) ); PutItem( SvxHatchListItem( mpDoc->GetHatchList(), SID_HATCH_LIST ) ); PutItem( SvxBitmapListItem( mpDoc->GetBitmapList(), SID_BITMAP_LIST ) ); + PutItem( SvxPatternListItem( mpDoc->GetPatternList(), SID_PATTERN_LIST ) ); PutItem( SvxDashListItem( mpDoc->GetDashList(), SID_DASH_LIST ) ); PutItem( SvxLineEndListItem( mpDoc->GetLineEndList(), SID_LINEEND_LIST ) ); diff --git a/sd/source/ui/inc/dlgpage.hxx b/sd/source/ui/inc/dlgpage.hxx index 3b56dc6805ec..c624ecb5ea87 100644 --- a/sd/source/ui/inc/dlgpage.hxx +++ b/sd/source/ui/inc/dlgpage.hxx @@ -37,6 +37,7 @@ private: XGradientListRef mpGradientList; XHatchListRef mpHatchingList; XBitmapListRef mpBitmapList; + XPatternListRef mpPatternList; sal_uInt16 mnArea; sal_uInt16 mnPage; diff --git a/sd/source/ui/inc/prltempl.hxx b/sd/source/ui/inc/prltempl.hxx index 105b465eae01..75d4d28776b4 100644 --- a/sd/source/ui/inc/prltempl.hxx +++ b/sd/source/ui/inc/prltempl.hxx @@ -42,6 +42,7 @@ private: XGradientListRef pGradientList; XHatchListRef pHatchingList; XBitmapListRef pBitmapList; + XPatternListRef pPatternList; XDashListRef pDashList; XLineEndListRef pLineEndList; diff --git a/sd/source/ui/inc/tabtempl.hxx b/sd/source/ui/inc/tabtempl.hxx index 88b84cbed86a..d5c2f5e824eb 100644 --- a/sd/source/ui/inc/tabtempl.hxx +++ b/sd/source/ui/inc/tabtempl.hxx @@ -39,6 +39,7 @@ private: XGradientListRef pGradientList; XHatchListRef pHatchingList; XBitmapListRef pBitmapList; + XPatternListRef pPatternList; XDashListRef pDashList; XLineEndListRef pLineEndList; diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 26f1dfd44071..a3c6ec94490a 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -64,6 +64,7 @@ #include <algorithm> #include "EventMultiplexer.hxx" #include "glob.hrc" +#include <vcl/salbtype.hxx> using namespace ::com::sun::star; @@ -71,6 +72,16 @@ using ::com::sun::star::uno::Reference; namespace sd { namespace sidebar { +enum eFillStyle +{ + NONE, + SOLID, + GRADIENT, + HATCH, + BITMAP, + PATTERN +}; + SlideBackground::SlideBackground( Window * pParent, ViewShellBase& rBase, @@ -151,7 +162,7 @@ void SlideBackground::Initialize() } } - mpFillStyle->SelectEntryPos(0); + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(NONE)); mpDspMasterBackground->SetClickHdl(LINK(this, SlideBackground, DspBackground)); mpDspMasterObjects->SetClickHdl(LINK(this,SlideBackground, DspObjects)); @@ -169,21 +180,22 @@ void SlideBackground::HandleContextChange( void SlideBackground::Update() { - const drawing::FillStyle eXFS = (drawing::FillStyle)mpFillStyle->GetSelectEntryPos(); + const eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectEntryPos(); + SfxObjectShell* pSh = SfxObjectShell::Current(); if (!pSh) return; - switch(eXFS) + switch(nPos) { - case drawing::FillStyle_NONE: + case NONE: { mpFillLB->Hide(); mpFillAttr->Hide(); mpFillGrad->Hide(); } break; - case drawing::FillStyle_SOLID: + case SOLID: { mpFillAttr->Hide(); mpFillGrad->Hide(); @@ -202,7 +214,7 @@ void SlideBackground::Update() } } break; - case drawing::FillStyle_GRADIENT: + case GRADIENT: { mpFillLB->Show(); const SvxColorListItem aItem(*static_cast<const SvxColorListItem*>(pSh->GetItem(SID_COLOR_TABLE))); @@ -233,7 +245,7 @@ void SlideBackground::Update() } break; - case drawing::FillStyle_HATCH: + case HATCH: { mpFillLB->Hide(); const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST))); @@ -247,20 +259,29 @@ void SlideBackground::Update() } break; - case drawing::FillStyle_BITMAP: + case BITMAP: + case PATTERN: { mpFillLB->Hide(); - const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); mpFillAttr->Show(); mpFillAttr->Clear(); - mpFillAttr->Fill(aItem.GetBitmapList()); mpFillGrad->Hide(); - - const OUString aBitmapName = GetBitmapSetOrDefault(); - mpFillAttr->SelectEntry( aBitmapName ); + OUString aName; + if(nPos == BITMAP) + { + const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); + mpFillAttr->Fill(aItem.GetBitmapList()); + aName = GetBitmapSetOrDefault(); + } + else if(nPos == PATTERN) + { + const SvxPatternListItem aItem(*static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST))); + mpFillAttr->Fill(aItem.GetPatternList()); + aName = GetPatternSetOrDefault(); + } + mpFillAttr->SelectEntry( aName ); } break; - default: break; } @@ -494,7 +515,7 @@ const OUString SlideBackground::GetHatchingSetOrDefault() const OUString SlideBackground::GetBitmapSetOrDefault() { - if( !mpBitmapItem ) + if( !mpBitmapItem || mpBitmapItem->isPattern()) { SfxObjectShell* pSh = SfxObjectShell::Current(); const SvxBitmapListItem aBmpListItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); @@ -507,6 +528,21 @@ const OUString SlideBackground::GetBitmapSetOrDefault() return mpBitmapItem->GetName(); } +const OUString SlideBackground::GetPatternSetOrDefault() +{ + if( !mpBitmapItem || !(mpBitmapItem->isPattern())) + { + SfxObjectShell* pSh = SfxObjectShell::Current(); + const SvxPatternListItem aPtrnListItem(*static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST))); + const GraphicObject aGraphObj = aPtrnListItem.GetPatternList()->GetBitmap(0)->GetGraphicObject(); + const OUString aPtrnName = aPtrnListItem.GetPatternList()->GetBitmap(0)->GetName(); + + mpBitmapItem.reset( new XFillBitmapItem( aPtrnName, aGraphObj ) ); + } + + return mpBitmapItem->GetName(); +} + void SlideBackground::DataChanged (const DataChangedEvent& /*rEvent*/) { @@ -527,7 +563,7 @@ void SlideBackground::NotifyItemUpdate( { if(eState >= SfxItemState::DEFAULT) { - mpFillStyle->SelectEntryPos(1); + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(SOLID)); mpColorItem.reset(pState ? static_cast< XFillColorItem* >(pState->Clone()) : nullptr); Update(); } @@ -538,7 +574,7 @@ void SlideBackground::NotifyItemUpdate( { if(eState >= SfxItemState::DEFAULT) { - mpFillStyle->SelectEntryPos(3); + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(HATCH)); mpHatchItem.reset(pState ? static_cast < XFillHatchItem* >(pState->Clone()) : nullptr); Update(); } @@ -549,7 +585,7 @@ void SlideBackground::NotifyItemUpdate( { if(eState >= SfxItemState::DEFAULT) { - mpFillStyle->SelectEntryPos(2); + mpFillStyle->SelectEntryPos(static_cast< sal_Int32>(GRADIENT)); mpGradientItem.reset(pState ? static_cast< XFillGradientItem* >(pState->Clone()) : nullptr); Update(); } @@ -559,8 +595,16 @@ void SlideBackground::NotifyItemUpdate( { if(eState >= SfxItemState::DEFAULT) { - mpFillStyle->SelectEntryPos(4); mpBitmapItem.reset(pState ? static_cast< XFillBitmapItem* >(pState->Clone()) : nullptr); + if(mpBitmapItem) + { + if(mpBitmapItem->isPattern()) + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(PATTERN)); + else + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(BITMAP)); + } + else + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(BITMAP)); Update(); } } @@ -577,20 +621,25 @@ void SlideBackground::NotifyItemUpdate( switch(eXFS) { case drawing::FillStyle_NONE: - mpFillStyle->SelectEntryPos(0); + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(NONE)); break; case drawing::FillStyle_SOLID: - mpFillStyle->SelectEntryPos(1); + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(SOLID)); break; case drawing::FillStyle_GRADIENT: - mpFillStyle->SelectEntryPos(2); + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(GRADIENT)); break; case drawing::FillStyle_HATCH: - mpFillStyle->SelectEntryPos(3); + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(HATCH)); break; case drawing::FillStyle_BITMAP: - mpFillStyle->SelectEntryPos(4); - break; + { + if(mpBitmapItem->isPattern()) + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(PATTERN)); + else + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(BITMAP)); + } + break; default: break; } @@ -653,7 +702,7 @@ void SlideBackground::NotifyItemUpdate( { if(eState >= SfxItemState::DEFAULT) { - mpFillStyle->SelectEntryPos(4); + mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(BITMAP)); Update(); } } @@ -665,42 +714,43 @@ void SlideBackground::NotifyItemUpdate( IMPL_LINK_NOARG_TYPED(SlideBackground, FillStyleModifyHdl, ListBox&, void) { - const drawing::FillStyle eXFS = (drawing::FillStyle)mpFillStyle->GetSelectEntryPos(); - const XFillStyleItem aXFillStyleItem(eXFS); + const eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectEntryPos(); Update(); - switch (eXFS) + switch (nPos) { - case drawing::FillStyle_NONE: + case NONE: { + const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_FILLSTYLE, SfxCallMode::RECORD, { &aXFillStyleItem }); } break; - case drawing::FillStyle_SOLID: + case SOLID: { - XFillColorItem aItem( OUString(), mpColorItem->GetColorValue() ); + const XFillColorItem aItem( OUString(), mpColorItem->GetColorValue() ); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLOR, SfxCallMode::RECORD, { &aItem }); } break; - case drawing::FillStyle_GRADIENT: + case GRADIENT: { - XFillGradientItem aItem( mpGradientItem->GetName(), mpGradientItem->GetGradientValue() ); + const XFillGradientItem aItem( mpGradientItem->GetName(), mpGradientItem->GetGradientValue() ); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_GRADIENT, SfxCallMode::RECORD, { &aItem }); } break; - case drawing::FillStyle_HATCH: + case HATCH: { - XFillHatchItem aItem( mpHatchItem->GetName(), mpHatchItem->GetHatchValue() ); + const XFillHatchItem aItem( mpHatchItem->GetName(), mpHatchItem->GetHatchValue() ); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_HATCH, SfxCallMode::RECORD, { &aItem }); } break; - case drawing::FillStyle_BITMAP: + case BITMAP: + case PATTERN: { - XFillBitmapItem aItem( mpBitmapItem->GetName(), mpBitmapItem->GetGraphicObject() ); + const XFillBitmapItem aItem( mpBitmapItem->GetName(), mpBitmapItem->GetGraphicObject() ); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_BITMAP, SfxCallMode::RECORD, { &aItem }); } break; @@ -751,12 +801,12 @@ IMPL_LINK_NOARG_TYPED(SlideBackground, FillColorHdl, ListBox&, void) IMPL_LINK_NOARG_TYPED(SlideBackground, FillBackgroundHdl, ListBox&, void) { - const drawing::FillStyle eXFS = (drawing::FillStyle)mpFillStyle->GetSelectEntryPos(); + const eFillStyle nFillPos = (eFillStyle)mpFillStyle->GetSelectEntryPos(); SfxObjectShell* pSh = SfxObjectShell::Current(); - switch(eXFS) + switch(nFillPos) { - case drawing::FillStyle_HATCH: + case HATCH: { const SvxHatchListItem aHatchListItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST))); sal_uInt16 nPos = mpFillAttr->GetSelectEntryPos(); @@ -768,17 +818,29 @@ IMPL_LINK_NOARG_TYPED(SlideBackground, FillBackgroundHdl, ListBox&, void) } break; - case drawing::FillStyle_BITMAP: + case BITMAP: + case PATTERN: { - SvxBitmapListItem aBitmapListItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); sal_Int16 nPos = mpFillAttr->GetSelectEntryPos(); - GraphicObject aBitmap = aBitmapListItem.GetBitmapList()->GetBitmap(nPos)->GetGraphicObject(); - OUString aBitmapName = aBitmapListItem.GetBitmapList()->GetBitmap(nPos)->GetName(); - - XFillBitmapItem aItem(aBitmapName, aBitmap); + GraphicObject aBitmap; + OUString aName; + if(nPos == static_cast< sal_Int32 >(BITMAP)) + { + SvxBitmapListItem aBitmapListItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); + aBitmap = aBitmapListItem.GetBitmapList()->GetBitmap(nPos)->GetGraphicObject(); + aName = aBitmapListItem.GetBitmapList()->GetBitmap(nPos)->GetName(); + } + else if(nPos == static_cast< sal_Int32 >(PATTERN)) + { + SvxPatternListItem aPatternListItem(*static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST))); + aBitmap = aPatternListItem.GetPatternList()->GetBitmap(nPos)->GetGraphicObject(); + aName = aPatternListItem.GetPatternList()->GetBitmap(nPos)->GetName(); + } + XFillBitmapItem aItem(aName, aBitmap); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_BITMAP, SfxCallMode::RECORD, { &aItem }); } break; + default: break; } diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx index 0848e56828c8..80802056da8e 100644 --- a/sd/source/ui/sidebar/SlideBackground.hxx +++ b/sd/source/ui/sidebar/SlideBackground.hxx @@ -128,6 +128,7 @@ private: XGradient GetGradientSetOrDefault(); const OUString GetHatchingSetOrDefault(); const OUString GetBitmapSetOrDefault(); + const OUString GetPatternSetOrDefault(); void addListener(); void removeListener(); void populateMasterSlideDropdown(); diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index f5c38f373b08..362cdae46bf0 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -416,6 +416,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/xoutdev/xtabgrdt \ svx/source/xoutdev/xtabhtch \ svx/source/xoutdev/xtable \ + svx/source/xoutdev/xtabptrn \ svx/source/xoutdev/XPropertyEntry \ svx/source/xoutdev/xtablend \ )) diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index ddab822c42cf..916ecc486f9b 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -10414,6 +10414,22 @@ SvxBitmapListItem BitmapListState SID_BITMAP_LIST GroupId = GID_EDIT; ] +SvxPatternListItem PatternListState SID_PATTERN_LIST +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_EDIT; +] + SvxEmphasisMarkItem EmphasisMark SID_ATTR_CHAR_EMPHASISMARK [ diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi index e44ae28b72b8..1e73fc11bc8c 100644 --- a/svx/sdi/svxitems.sdi +++ b/svx/sdi/svxitems.sdi @@ -244,6 +244,7 @@ item String SvxColorListItem; item String SvxGradientListItem; item String SvxHatchListItem; item String SvxBitmapListItem; +item String SvxPatternListItem; item String SfxLockBytesItem; item String SvxFontListItem; item String avmedia_MediaItem; diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 9ac13bbf7e6d..0d3b62686cda 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1511,6 +1511,139 @@ void BitmapLB::Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_Int32 n } } +// BitmapLB Constructor + +PatternLB::PatternLB( vcl::Window* pParent, WinBits aWB) +: ListBox( pParent, aWB ), + maBitmapEx(), + mpList(nullptr) +{ + SetEdgeBlending(true); +} + +VCL_BUILDER_DECL_FACTORY(PatternLB) +{ + WinBits nWinStyle = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinStyle |= WB_BORDER; + VclPtrInstance<BitmapLB> pListBox(pParent, nWinStyle); + pListBox->EnableAutoSize(true); + rRet = pListBox; +} + +namespace +{ + void formatPatternExToSize(BitmapEx& rBitmapEx, const Size& rSize) + { + if(!rBitmapEx.IsEmpty() && rSize.Width() > 0 && rSize.Height() > 0) + { + ScopedVclPtrInstance< VirtualDevice > pVirtualDevice; + pVirtualDevice->SetOutputSizePixel(rSize); + + if(rBitmapEx.IsTransparent()) + { + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + + if(rStyleSettings.GetPreviewUsesCheckeredBackground()) + { + const Point aNull(0, 0); + static const sal_uInt32 nLen(8); + static const Color aW(COL_WHITE); + static const Color aG(0xef, 0xef, 0xef); + + pVirtualDevice->DrawCheckered(aNull, rSize, nLen, aW, aG); + } + else + { + pVirtualDevice->SetBackground(rStyleSettings.GetFieldColor()); + pVirtualDevice->Erase(); + } + } + + if(rBitmapEx.GetSizePixel().Width() >= rSize.Width() && rBitmapEx.GetSizePixel().Height() >= rSize.Height()) + { + rBitmapEx.Scale(rSize); + pVirtualDevice->DrawBitmapEx(Point(0, 0), rBitmapEx); + } + else + { + const Size aBitmapSize(rBitmapEx.GetSizePixel()); + + for(long y(0); y < rSize.Height(); y += aBitmapSize.Height()) + { + for(long x(0); x < rSize.Width(); x += aBitmapSize.Width()) + { + pVirtualDevice->DrawBitmapEx( + Point(x, y), + rBitmapEx); + } + } + } + + rBitmapEx = pVirtualDevice->GetBitmap(Point(0, 0), rSize); + } + } +} // end of anonymous namespace + +void PatternLB::Fill( const XPatternListRef &pList ) +{ + if( !pList.is() ) + return; + + mpList = pList; + XBitmapEntry* pEntry; + const long nCount(pList->Count()); + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + const Size aSize(rStyleSettings.GetListBoxPreviewDefaultPixelSize()); + + SetUpdateMode(false); + + for(long i(0); i < nCount; i++) + { + pEntry = pList->GetBitmap(i); + maBitmapEx = pEntry->GetGraphicObject().GetGraphic().GetBitmapEx(); + formatPatternExToSize(maBitmapEx, aSize); + InsertEntry(pEntry->GetName(), Image(maBitmapEx)); + } + + AdaptDropDownLineCountToMaximum(); + SetUpdateMode(true); +} + +void PatternLB::Append(const Size& rSize, const XBitmapEntry& rEntry) +{ + maBitmapEx = rEntry.GetGraphicObject().GetGraphic().GetBitmapEx(); + + if(!maBitmapEx.IsEmpty()) + { + formatPatternExToSize(maBitmapEx, rSize); + InsertEntry(rEntry.GetName(), Image(maBitmapEx)); + } + else + { + InsertEntry(rEntry.GetName()); + } + + AdaptDropDownLineCountToMaximum(); +} + +void PatternLB::Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_Int32 nPos) +{ + RemoveEntry(nPos); + maBitmapEx = rEntry.GetGraphicObject().GetGraphic().GetBitmapEx(); + + if(!maBitmapEx.IsEmpty()) + { + formatPatternExToSize(maBitmapEx, rSize); + InsertEntry(rEntry.GetName(), Image(maBitmapEx), nPos); + } + else + { + InsertEntry(rEntry.GetName()); + } +} + FillAttrLB::FillAttrLB(vcl::Window* pParent, WinBits aWB) : ColorListBox(pParent, aWB) { @@ -1537,6 +1670,27 @@ void FillAttrLB::Fill( const XBitmapListRef &pList ) ListBox::SetUpdateMode(true); } +void FillAttrLB::Fill( const XPatternListRef &pList ) +{ + const long nCount(pList->Count()); + XBitmapEntry* pEntry; + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + const Size aSize(rStyleSettings.GetListBoxPreviewDefaultPixelSize()); + + ListBox::SetUpdateMode(false); + + for(long i(0); i < nCount; i++) + { + pEntry = pList->GetBitmap( i ); + maBitmapEx = pEntry->GetGraphicObject().GetGraphic().GetBitmapEx(); + formatBitmapExToSize(maBitmapEx, aSize); + ListBox::InsertEntry(pEntry->GetName(), Image(maBitmapEx)); + } + + AdaptDropDownLineCountToMaximum(); + ListBox::SetUpdateMode(true); +} + void FillTypeLB::Fill() { SetUpdateMode( false ); @@ -1546,6 +1700,7 @@ void FillTypeLB::Fill() InsertEntry( SVX_RESSTR(RID_SVXSTR_GRADIENT) ); InsertEntry( SVX_RESSTR(RID_SVXSTR_HATCH) ); InsertEntry( SVX_RESSTR(RID_SVXSTR_BITMAP) ); + InsertEntry( SVX_RESSTR(RID_SVXSTR_PATTERN) ); AdaptDropDownLineCountToMaximum(); SetUpdateMode( true ); diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 182c6a1af7bc..8386822eef4a 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -589,7 +589,7 @@ IMPL_LINK_NOARG_TYPED(SvxHFPage, BackgroundHdl, Button*, void) pBBSet = new SfxItemSet( *GetItemSet().GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, // DrawingLayer FillStyle definitions - SID_COLOR_TABLE, SID_BITMAP_LIST, // XPropertyLists for Color, Gradient, Hatch and Graphic fills + SID_COLOR_TABLE, SID_PATTERN_LIST, // XPropertyLists for Color, Gradient, Hatch and Graphic fills nOuter, nOuter, nInner, nInner, nShadow, nShadow, @@ -602,6 +602,7 @@ IMPL_LINK_NOARG_TYPED(SvxHFPage, BackgroundHdl, Button*, void) SID_GRADIENT_LIST, SID_HATCH_LIST, SID_BITMAP_LIST, + SID_PATTERN_LIST, 0 }; diff --git a/svx/source/dialog/sdstring.src b/svx/source/dialog/sdstring.src index b43fbc19e2c3..b70348583cb1 100644 --- a/svx/source/dialog/sdstring.src +++ b/svx/source/dialog/sdstring.src @@ -32,6 +32,14 @@ String RID_SVXSTR_BITMAP { Text [ en-US ] = "Bitmap" ; }; +String RID_SVXSTR_PATTERN +{ + Text [ en-US ] = "Pattern"; +}; +String RID_SVXSTR_PATTERN_UNTITLED +{ + Text [ en-US ] = "Untitled Pattern"; +}; String RID_SVXSTR_LINESTYLE { Text [ en-US ] = "Line Style" ; @@ -1659,7 +1667,7 @@ String RID_SVXSTR_BMP21_DEF String RID_SVXSTR_BMP0 { - Text [ en-US ] = "Blank"; + Text [ en-US ] = "Empty"; }; String RID_SVXSTR_BMP1 { diff --git a/svx/source/items/drawitem.cxx b/svx/source/items/drawitem.cxx index a0aec77420b3..1771e54a37c1 100644 --- a/svx/source/items/drawitem.cxx +++ b/svx/source/items/drawitem.cxx @@ -28,6 +28,7 @@ SfxPoolItem* SvxColorListItem::CreateDefault() { return new SvxColorListItem ;} SfxPoolItem* SvxGradientListItem::CreateDefault() { return new SvxGradientListItem ;} SfxPoolItem* SvxHatchListItem::CreateDefault() { return new SvxHatchListItem ;} SfxPoolItem* SvxBitmapListItem::CreateDefault() { return new SvxBitmapListItem ;} +SfxPoolItem* SvxPatternListItem::CreateDefault() { return new SvxPatternListItem ;} SfxPoolItem* SvxDashListItem::CreateDefault() { return new SvxDashListItem ;} SfxPoolItem* SvxLineEndListItem::CreateDefault() { return new SvxLineEndListItem ;} @@ -226,6 +227,47 @@ SfxPoolItem* SvxBitmapListItem::Clone( SfxItemPool * ) const QUERY_PUT_IMPL( SvxBitmapListItem, BitmapList ) +SvxPatternListItem::SvxPatternListItem() +{ +} + +SvxPatternListItem::SvxPatternListItem( XPatternListRef pList, sal_uInt16 nW ) : + SfxPoolItem( nW ), + pPatternList( pList ) +{ +} + +SvxPatternListItem::SvxPatternListItem( const SvxPatternListItem& rItem ) : + SfxPoolItem( rItem ), + pPatternList( rItem.pPatternList ) +{ +} + +bool SvxPatternListItem::GetPresentation +( + SfxItemPresentation /*ePres*/, + SfxMapUnit /*eCoreUnit*/, + SfxMapUnit /*ePresUnit*/, + OUString& rText, const IntlWrapper * +) const +{ + rText.clear(); + return false; +} + +bool SvxPatternListItem::operator==( const SfxPoolItem& rItem ) const +{ + DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); + return static_cast<const SvxPatternListItem&>(rItem).pPatternList == pPatternList; +} + +SfxPoolItem* SvxPatternListItem::Clone( SfxItemPool * ) const +{ + return new SvxPatternListItem( *this ); +} + +QUERY_PUT_IMPL( SvxPatternListItem, PatternList ) + SvxDashListItem::SvxDashListItem() : pDashList( nullptr ) { diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx index c0092c2a3fd8..1afba46385f1 100644 --- a/svx/source/sidebar/area/AreaPropertyPanel.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx @@ -57,6 +57,7 @@ AreaPropertyPanel::AreaPropertyPanel( maGradientListControl(SID_GRADIENT_LIST, *pBindings, *this), maHatchListControl(SID_HATCH_LIST, *pBindings, *this), maBitmapListControl(SID_BITMAP_LIST, *pBindings, *this), + maPatternListControl(SID_PATTERN_LIST, *pBindings, *this), maFillTransparenceController(SID_ATTR_FILL_TRANSPARENCE, *pBindings, *this), maFillFloatTransparenceController(SID_ATTR_FILL_FLOATTRANSPARENCE, *pBindings, *this), mpBindings(pBindings) @@ -79,6 +80,7 @@ void AreaPropertyPanel::dispose() maGradientListControl.dispose(); maHatchListControl.dispose(); maBitmapListControl.dispose(); + maPatternListControl.dispose(); maFillTransparenceController.dispose(); maFillFloatTransparenceController.dispose(); diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx index 5d2878fb0637..f8fc55faeeb3 100644 --- a/svx/source/sidebar/area/AreaPropertyPanel.hxx +++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx @@ -85,6 +85,7 @@ private: ::sfx2::sidebar::ControllerItem maGradientListControl; ::sfx2::sidebar::ControllerItem maHatchListControl; ::sfx2::sidebar::ControllerItem maBitmapListControl; + ::sfx2::sidebar::ControllerItem maPatternListControl; ::sfx2::sidebar::ControllerItem maFillTransparenceController; ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController; diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index 65be70b7b933..52a2deb49e61 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -37,6 +37,7 @@ #include <unotools/pathoptions.hxx> #include <svx/svxitems.hrc> #include <vcl/toolbox.hxx> +#include <vcl/salbtype.hxx> #include <svtools/toolbarmenu.hxx> #include <svx/tbcontrl.hxx> #include "sfx2/opengrf.hxx" @@ -48,6 +49,16 @@ const char UNO_SIDEBARGRADIENT[] = ".uno:sidebargradient"; namespace svx { namespace sidebar { +enum eFillStyle +{ + NONE, + SOLID, + GRADIENT, + HATCH, + BITMAP, + PATTERN +}; + const sal_Int32 AreaPropertyPanelBase::DEFAULT_CENTERX = 50; const sal_Int32 AreaPropertyPanelBase::DEFAULT_CENTERY = 50; const sal_Int32 AreaPropertyPanelBase::DEFAULT_ANGLE = 0; @@ -63,6 +74,7 @@ AreaPropertyPanelBase::AreaPropertyPanelBase( mnLastPosGradient(0), mnLastPosHatch(0), mnLastPosBitmap(0), + mnLastPosPattern(0), mnLastTransSolid(50), maGradientLinear(), maGradientAxial(), @@ -100,7 +112,6 @@ AreaPropertyPanelBase::AreaPropertyPanelBase( get(mpLbFillGradFrom, "fillgrad1"); get(mpLbFillGradTo, "fillgrad2"); get(mpGradientStyle, "gradientstyle"); - get(mpLbFillBitmap, "fillbitmap"); get(mpBmpImport, "bmpimport"); Initialize(); @@ -126,7 +137,6 @@ void AreaPropertyPanelBase::dispose() mpLbFillGradFrom.clear(); mpLbFillGradTo.clear(); mpGradientStyle.clear(); - mpLbFillBitmap.clear(); mpBmpImport.clear(); PanelLayout::dispose(); @@ -165,7 +175,6 @@ void AreaPropertyPanelBase::Initialize() mpGradientStyle->SetSelectHdl( aLink ); mpLbFillGradFrom->SetSelectHdl( aLink ); mpLbFillGradTo->SetSelectHdl( aLink ); - mpLbFillBitmap->SetSelectHdl( aLink ); mpMTRAngle->SetModifyHdl(LINK(this,AreaPropertyPanelBase, ChangeGradientAngle)); mpLBTransType->SetSelectHdl(LINK(this, AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl)); @@ -227,229 +236,249 @@ IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, ClickImportBitmapHdl, Button*, void XBitmapEntry* pEntry = new XBitmapEntry( aGraphic, aName ); pList->Insert(pEntry); pList->Save(); - mpLbFillBitmap->Clear(); - mpLbFillBitmap->Fill(pList); - mpLbFillBitmap->SelectEntry(aName); - SelectFillAttrHdl(*mpLbFillBitmap); + mpLbFillAttr->Clear(); + mpLbFillAttr->Fill(pList); + mpLbFillAttr->SelectEntry(aName); + SelectFillAttrHdl(*mpLbFillAttr); } } } IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void) { - const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectEntryPos(); + sal_Int32 nPos = (eFillStyle)mpLbFillType->GetSelectEntryPos(); + mpLbFillAttr->Clear(); + SfxObjectShell* pSh = SfxObjectShell::Current(); + if(!pSh) + return; - if((drawing::FillStyle)meLastXFS != eXFS) + // #i122676# Do no longer trigger two Execute calls, one for SID_ATTR_FILL_STYLE + // and one for setting the fill attribute itself, but add two SfxPoolItems to the + // call to get just one action at the SdrObject and to create only one Undo action, too. + // Checked that this works in all apps. + switch( nPos ) { - mpLbFillAttr->Clear(); - SfxObjectShell* pSh = SfxObjectShell::Current(); - const XFillStyleItem aXFillStyleItem(eXFS); - - // #i122676# Do no longer trigger two Execute calls, one for SID_ATTR_FILL_STYLE - // and one for setting the fill attribute itself, but add two SfxPoolItems to the - // call to get just one action at the SdrObject and to create only one Undo action, too. - // Checked that this works in all apps. - switch( eXFS ) + default: + case NONE: { - default: - case drawing::FillStyle_NONE: - { - mpLbFillAttr->Show(); - mpLbFillGradFrom->Hide(); - mpLbFillGradTo->Hide(); - mpGradientStyle->Hide(); - mpMTRAngle->Hide(); - mpToolBoxColor->Hide(); - mpLbFillBitmap->Hide(); - mpBmpImport->Hide(); - mpLbFillType->Selected(); - mpLbFillAttr->Disable(); + mpLbFillAttr->Show(); + mpLbFillGradFrom->Hide(); + mpLbFillGradTo->Hide(); + mpGradientStyle->Hide(); + mpMTRAngle->Hide(); + mpToolBoxColor->Hide(); + mpBmpImport->Hide(); + mpLbFillType->Selected(); + mpLbFillAttr->Disable(); - // #i122676# need to call a single SID_ATTR_FILL_STYLE change - setFillStyle(aXFillStyleItem); - break; - } - case drawing::FillStyle_SOLID: + // #i122676# need to call a single SID_ATTR_FILL_STYLE change + setFillStyle(XFillStyleItem(drawing::FillStyle_NONE)); + break; + } + case SOLID: + { + mpLbFillAttr->Hide(); + mpLbFillGradFrom->Hide(); + mpLbFillGradTo->Hide(); + mpGradientStyle->Hide(); + mpMTRAngle->Hide(); + mpBmpImport->Hide(); + mpToolBoxColor->Show(); + const OUString aTmpStr; + const Color aColor = mpColorItem ? mpColorItem->GetColorValue() : COL_AUTO; + const XFillColorItem aXFillColorItem( aTmpStr, aColor ); + + // #i122676# change FillStyle and Color in one call + XFillStyleItem aXFillStyleItem(drawing::FillStyle_SOLID); + setFillStyleAndColor(&aXFillStyleItem, aXFillColorItem); + break; + } + case GRADIENT: + { + mpLbFillAttr->Hide(); + mpLbFillGradFrom->Show(); + mpLbFillGradTo->Show(); + mpGradientStyle->Show(); + mpMTRAngle->Show(); + mpToolBoxColor->Hide(); + mpBmpImport->Hide(); + + const SvxColorListItem* pColorListItem = static_cast<const SvxColorListItem*>(pSh->GetItem(SID_COLOR_TABLE)); + if(pColorListItem) { - mpLbFillAttr->Hide(); - mpLbFillGradFrom->Hide(); - mpLbFillGradTo->Hide(); - mpGradientStyle->Hide(); - mpMTRAngle->Hide(); - mpLbFillBitmap->Hide(); - mpBmpImport->Hide(); - mpToolBoxColor->Show(); - const OUString aTmpStr; - const Color aColor = mpColorItem ? mpColorItem->GetColorValue() : COL_AUTO; - const XFillColorItem aXFillColorItem( aTmpStr, aColor ); + mpLbFillAttr->Enable(); + mpLbFillGradTo->Enable(); + mpLbFillGradFrom->Enable(); + mpGradientStyle->Enable(); + mpMTRAngle->Enable(); + mpLbFillAttr->Clear(); + mpLbFillGradTo->Clear(); + mpLbFillGradFrom->Clear(); + mpLbFillGradTo->Fill(pColorListItem->GetColorList()); + mpLbFillGradFrom->Fill(pColorListItem->GetColorList()); - // #i122676# change FillStyle and Color in one call - setFillStyleAndColor(&aXFillStyleItem, aXFillColorItem); - break; - } - case drawing::FillStyle_GRADIENT: - { - mpLbFillAttr->Hide(); - mpLbFillGradFrom->Show(); - mpLbFillGradTo->Show(); - mpGradientStyle->Show(); - mpMTRAngle->Show(); - mpToolBoxColor->Hide(); - mpLbFillBitmap->Hide(); - mpBmpImport->Hide(); + mpLbFillGradFrom->AdaptDropDownLineCountToMaximum(); + mpLbFillGradTo->AdaptDropDownLineCountToMaximum(); - const SvxColorListItem* pColorListItem = static_cast<const SvxColorListItem*>(pSh ? pSh->GetItem(SID_COLOR_TABLE) : nullptr); - if (pColorListItem) + if(LISTBOX_ENTRY_NOTFOUND != mnLastPosGradient) { - mpLbFillAttr->Enable(); - mpLbFillGradTo->Enable(); - mpLbFillGradFrom->Enable(); - mpGradientStyle->Enable(); - mpMTRAngle->Enable(); - mpLbFillAttr->Clear(); - mpLbFillGradTo->Clear(); - mpLbFillGradFrom->Clear(); - mpLbFillGradTo->Fill(pColorListItem->GetColorList()); - mpLbFillGradFrom->Fill(pColorListItem->GetColorList()); - - mpLbFillGradFrom->AdaptDropDownLineCountToMaximum(); - mpLbFillGradTo->AdaptDropDownLineCountToMaximum(); + const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST))); - if(LISTBOX_ENTRY_NOTFOUND != mnLastPosGradient) + if(mnLastPosGradient < aItem.GetGradientList()->Count()) { - const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST))); + const XGradient aGradient = aItem.GetGradientList()->GetGradient(mnLastPosGradient)->GetGradient(); + const XFillGradientItem aXFillGradientItem(aGradient); - if(mnLastPosGradient < aItem.GetGradientList()->Count()) + // #i122676# change FillStyle and Gradient in one call + XFillStyleItem aXFillStyleItem(drawing::FillStyle_SOLID); + setFillStyleAndGradient(&aXFillStyleItem, aXFillGradientItem); + mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor()); + if(mpLbFillGradFrom->GetSelectEntryCount() == 0) { - const XGradient aGradient = aItem.GetGradientList()->GetGradient(mnLastPosGradient)->GetGradient(); - const XFillGradientItem aXFillGradientItem(aGradient); - - // #i122676# change FillStyle and Gradient in one call - setFillStyleAndGradient(&aXFillStyleItem, aXFillGradientItem); + mpLbFillGradFrom->InsertEntry(aGradient.GetStartColor(), OUString()); mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor()); - if(mpLbFillGradFrom->GetSelectEntryCount() == 0) - { - mpLbFillGradFrom->InsertEntry(aGradient.GetStartColor(), OUString()); - mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor()); - } + } + mpLbFillGradTo->SelectEntry(aGradient.GetEndColor()); + if(mpLbFillGradTo->GetSelectEntryCount() == 0) + { + mpLbFillGradTo->InsertEntry(aGradient.GetEndColor(), OUString()); mpLbFillGradTo->SelectEntry(aGradient.GetEndColor()); - if(mpLbFillGradTo->GetSelectEntryCount() == 0) - { - mpLbFillGradTo->InsertEntry(aGradient.GetEndColor(), OUString()); - mpLbFillGradTo->SelectEntry(aGradient.GetEndColor()); - } - - mpMTRAngle->SetValue(aGradient.GetAngle() / 10); - css::awt::GradientStyle eXGS = aGradient.GetGradientStyle(); - mpGradientStyle->SelectEntryPos(sal::static_int_cast< sal_Int32 >( eXGS )); - } + + mpMTRAngle->SetValue(aGradient.GetAngle() / 10); + css::awt::GradientStyle eXGS = aGradient.GetGradientStyle(); + mpGradientStyle->SelectEntryPos(sal::static_int_cast< sal_Int32 >( eXGS )); } } - else - { - mpLbFillGradFrom->Disable(); - mpLbFillGradTo->Disable(); - mpMTRAngle->Disable(); - mpGradientStyle->Disable(); - } - break; } - case drawing::FillStyle_HATCH: + else { - mpLbFillAttr->Show(); - mpLbFillGradFrom->Hide(); - mpLbFillGradTo->Hide(); - mpMTRAngle->Hide(); - mpGradientStyle->Hide(); - mpToolBoxColor->Hide(); - mpLbFillBitmap->Hide(); - mpBmpImport->Hide(); + mpLbFillGradFrom->Disable(); + mpLbFillGradTo->Disable(); + mpMTRAngle->Disable(); + mpGradientStyle->Disable(); + } + break; + } + case HATCH: + { + mpLbFillAttr->Show(); + mpLbFillGradFrom->Hide(); + mpLbFillGradTo->Hide(); + mpMTRAngle->Hide(); + mpGradientStyle->Hide(); + mpToolBoxColor->Hide(); + mpBmpImport->Hide(); + + const SvxHatchListItem* aItem( static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST))); + if(aItem) + { + XHatchListRef pXHatchList(aItem->GetHatchList()); + mpLbFillAttr->Enable(); + mpLbFillAttr->Clear(); + mpLbFillAttr->Fill(pXHatchList); - if(pSh && pSh->GetItem(SID_HATCH_LIST)) + mpLbFillAttr->AdaptDropDownLineCountToMaximum(); + + if(LISTBOX_ENTRY_NOTFOUND != mnLastPosHatch) { - if(!mpLbFillAttr->GetEntryCount()) + if(mnLastPosHatch < pXHatchList->Count()) { - const SvxHatchListItem aItem( *static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST))); - mpLbFillAttr->Enable(); - mpLbFillAttr->Clear(); - mpLbFillAttr->Fill(aItem.GetHatchList()); + const XHatch aHatch = pXHatchList->GetHatch(mnLastPosHatch)->GetHatch(); + const XFillHatchItem aXFillHatchItem(mpLbFillAttr->GetSelectEntry(), aHatch); + + // #i122676# change FillStyle and Hatch in one call + XFillStyleItem aXFillStyleItem(drawing::FillStyle_HATCH); + setFillStyleAndHatch(&aXFillStyleItem, aXFillHatchItem); + mpLbFillAttr->SelectEntryPos(mnLastPosHatch); } + } + } + else + { + mpLbFillAttr->Disable(); + } + break; + } + case BITMAP: + case PATTERN: + { + mpLbFillAttr->Show(); + mpLbFillAttr->Enable(); + mpLbFillAttr->Clear(); + mpLbFillGradFrom->Hide(); + mpLbFillGradTo->Hide(); + mpMTRAngle->Hide(); + mpGradientStyle->Hide(); + mpToolBoxColor->Hide(); + + OUString aName; + GraphicObject aBitmap; + if(nPos == static_cast< sal_Int32 >(BITMAP)) + { + mpBmpImport->Show(); + const SvxBitmapListItem* aItem( static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); + if(aItem) + { + XBitmapListRef pXBitmapList(aItem->GetBitmapList()); + mpLbFillAttr->Fill(pXBitmapList); mpLbFillAttr->AdaptDropDownLineCountToMaximum(); - if(LISTBOX_ENTRY_NOTFOUND != mnLastPosHatch) + if(LISTBOX_ENTRY_NOTFOUND != mnLastPosBitmap) { - const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST))); - - if(mnLastPosHatch < aItem.GetHatchList()->Count()) + if(mnLastPosBitmap < pXBitmapList->Count()) { - const XHatch aHatch = aItem.GetHatchList()->GetHatch(mnLastPosHatch)->GetHatch(); - const XFillHatchItem aXFillHatchItem(mpLbFillAttr->GetSelectEntry(), aHatch); - - // #i122676# change FillStyle and Hatch in one call - setFillStyleAndHatch(&aXFillStyleItem, aXFillHatchItem); - mpLbFillAttr->SelectEntryPos(mnLastPosHatch); + const XBitmapEntry* pXBitmapEntry = pXBitmapList->GetBitmap(mnLastPosBitmap); + aBitmap = pXBitmapEntry->GetGraphicObject(); + aName = mpLbFillAttr->GetSelectEntry(); + mpLbFillAttr->SelectEntryPos(mnLastPosBitmap); } } } else { - mpLbFillAttr->Disable(); + mpLbFillAttr->Hide(); } - break; } - case drawing::FillStyle_BITMAP: + else if(nPos == static_cast< sal_Int32 >(PATTERN)) { - mpLbFillAttr->Hide(); - mpLbFillGradFrom->Hide(); - mpLbFillGradTo->Hide(); - mpMTRAngle->Hide(); - mpGradientStyle->Hide(); - mpToolBoxColor->Hide(); - mpLbFillBitmap->Show(); - mpBmpImport->Show(); - - if(pSh && pSh->GetItem(SID_BITMAP_LIST)) + mpBmpImport->Hide(); + const SvxPatternListItem* aItem( static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST))); + if(aItem) { - if(!mpLbFillBitmap->GetEntryCount()) - { - const SvxBitmapListItem aItem( *static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); - mpLbFillBitmap->Clear(); - mpLbFillBitmap->Fill(aItem.GetBitmapList()); - } - - mpLbFillBitmap->AdaptDropDownLineCountToMaximum(); + XPatternListRef pXPatternList(aItem->GetPatternList()); + mpLbFillAttr->Fill(pXPatternList); - if(LISTBOX_ENTRY_NOTFOUND != mnLastPosBitmap) + mpLbFillAttr->AdaptDropDownLineCountToMaximum(); + if(LISTBOX_ENTRY_NOTFOUND != mnLastPosPattern) { - const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); - - if(mnLastPosBitmap < aItem.GetBitmapList()->Count()) + if(mnLastPosPattern < pXPatternList->Count()) { - const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(mnLastPosBitmap); - const XFillBitmapItem aXFillBitmapItem(mpLbFillBitmap->GetSelectEntry(), pXBitmapEntry->GetGraphicObject()); - - // #i122676# change FillStyle and Bitmap in one call - setFillStyleAndBitmap(&aXFillStyleItem, aXFillBitmapItem); - mpLbFillBitmap->SelectEntryPos(mnLastPosBitmap); + const XBitmapEntry* pXPatternEntry = pXPatternList->GetBitmap(mnLastPosPattern); + aBitmap = pXPatternEntry->GetGraphicObject(); + aName = mpLbFillAttr->GetSelectEntry(); + mpLbFillAttr->SelectEntryPos(mnLastPosPattern); } } } else { - mpLbFillBitmap->Hide(); + mpLbFillAttr->Hide(); } - break; } + const XFillBitmapItem aXFillBitmapItem( aName, aBitmap ); + const XFillStyleItem aXFillStyleItem(drawing::FillStyle_BITMAP); + setFillStyleAndBitmap(&aXFillStyleItem, aXFillBitmapItem); + break; } + } - meLastXFS = (sal_uInt16)eXFS; + meLastXFS = (sal_uInt16)nPos; - if(drawing::FillStyle_NONE != eXFS) - { - mpLbFillType->Selected(); - } + if(eFillStyle::NONE != (eFillStyle)nPos) + { + mpLbFillType->Selected(); } mpSidebarController->NotifyResize(); @@ -477,26 +506,35 @@ void AreaPropertyPanelBase::DataChanged( void AreaPropertyPanelBase::SelectFillAttrHdl_Impl() { - const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectEntryPos(); - const XFillStyleItem aXFillStyleItem(eXFS); + sal_Int32 nPosFillStyle = (eFillStyle)mpLbFillType->GetSelectEntryPos(); SfxObjectShell* pSh = SfxObjectShell::Current(); // #i122676# dependent from bFillStyleChange, do execute a single or two // changes in one Execute call - const bool bFillStyleChange((drawing::FillStyle) meLastXFS != eXFS); + const bool bFillStyleChange((eFillStyle) meLastXFS != (eFillStyle)nPosFillStyle); - switch(eXFS) + switch(nPosFillStyle) { - case drawing::FillStyle_SOLID: + case eFillStyle::NONE: + { + if(bFillStyleChange) + { + XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE); + setFillStyle(aXFillStyleItem); + } + break; + } + case eFillStyle::SOLID: { if(bFillStyleChange) { // #i122676# Single FillStyle change call needed here + XFillStyleItem aXFillStyleItem(drawing::FillStyle_SOLID); setFillStyle(aXFillStyleItem); } break; } - case drawing::FillStyle_GRADIENT: + case eFillStyle::GRADIENT: { if(pSh && pSh->GetItem(SID_COLOR_TABLE)) @@ -510,12 +548,12 @@ void AreaPropertyPanelBase::SelectFillAttrHdl_Impl() const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetSelectEntry(), aGradient); // #i122676# Change FillStyle and Gradinet in one call + XFillStyleItem aXFillStyleItem(drawing::FillStyle_GRADIENT); setFillStyleAndGradient(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillGradientItem); } - break; } - case drawing::FillStyle_HATCH: + case eFillStyle::HATCH: { sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); @@ -534,6 +572,7 @@ void AreaPropertyPanelBase::SelectFillAttrHdl_Impl() const XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch); // #i122676# Change FillStyle and Hatch in one call + XFillStyleItem aXFillStyleItem(drawing::FillStyle_HATCH); setFillStyleAndHatch(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillHatchItem); } } @@ -544,9 +583,9 @@ void AreaPropertyPanelBase::SelectFillAttrHdl_Impl() } break; } - case drawing::FillStyle_BITMAP: + case eFillStyle::BITMAP: { - sal_Int32 nPos = mpLbFillBitmap->GetSelectEntryPos(); + sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND == nPos) { @@ -560,9 +599,10 @@ void AreaPropertyPanelBase::SelectFillAttrHdl_Impl() if(nPos < aItem.GetBitmapList()->Count()) { const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos); - const XFillBitmapItem aXFillBitmapItem(mpLbFillBitmap->GetSelectEntry(), pXBitmapEntry->GetGraphicObject()); + const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject()); // #i122676# Change FillStyle and Bitmap in one call + XFillStyleItem aXFillStyleItem(drawing::FillStyle_BITMAP); setFillStyleAndBitmap(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillBitmapItem); } } @@ -573,7 +613,36 @@ void AreaPropertyPanelBase::SelectFillAttrHdl_Impl() } break; } - default: break; + case eFillStyle::PATTERN: + { + sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); + + if(LISTBOX_ENTRY_NOTFOUND == nPos) + { + nPos = mnLastPosPattern; + } + + if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_PATTERN_LIST)) + { + const SvxPatternListItem aItem(*static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST))); + + if(nPos < aItem.GetPatternList()->Count()) + { + const XBitmapEntry* pXPatternEntry = aItem.GetPatternList()->GetBitmap(nPos); + const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXPatternEntry->GetGraphicObject()); + + // #i122676# Change FillStyle and Bitmap in one call + XFillStyleItem aXFillStyleItem(drawing::FillStyle_BITMAP); + setFillStyleAndBitmap(bFillStyleChange ? &aXFillStyleItem : nullptr, aXFillBitmapItem); + } + } + + if(LISTBOX_ENTRY_NOTFOUND != nPos) + { + mnLastPosPattern = nPos; + } + break; + } } mpSidebarController->NotifyResize(); } @@ -781,15 +850,42 @@ void AreaPropertyPanelBase::updateFillStyle(bool bDisabled, bool bDefault, const mpLbFillType->Enable(); mpColorTextFT->Enable(); drawing::FillStyle eXFS = (drawing::FillStyle)mpStyleItem->GetValue(); - meLastXFS = eXFS; - mpLbFillType->SelectEntryPos(sal::static_int_cast< sal_Int32 >(eXFS)); - - if(drawing::FillStyle_NONE == eXFS) + eFillStyle nPos = NONE; + switch(eXFS) { - mpLbFillAttr->SetNoSelection(); - mpLbFillAttr->Disable(); + default: + case drawing::FillStyle_NONE: + { + mpLbFillAttr->SetNoSelection(); + mpLbFillAttr->Disable(); + nPos = NONE; + break; + } + case drawing::FillStyle_SOLID: + nPos = SOLID; + break; + case drawing::FillStyle_GRADIENT: + nPos = GRADIENT; + break; + case drawing::FillStyle_HATCH: + nPos = HATCH; + break; + case drawing::FillStyle_BITMAP: + { + if(mpBitmapItem) + { + if(!mpBitmapItem->isPattern()) + nPos = BITMAP; + else + nPos = PATTERN; + } + else + nPos = BITMAP; + break; + } } - + meLastXFS = static_cast< sal_uInt16 >(mpLbFillType->GetSelectEntryPos()); + mpLbFillType->SelectEntryPos(static_cast< sal_Int32 >(nPos)); Update(); return; } @@ -822,6 +918,7 @@ void AreaPropertyPanelBase::updateFillGradient(bool bDisabled, bool bDefault, co if(bDefault) { + mpLbFillType->SelectEntryPos(GRADIENT); Update(); } else if(bDisabled) @@ -857,6 +954,7 @@ void AreaPropertyPanelBase::updateFillHatch(bool bDisabled, bool bDefault, const if(bDefault) { mpLbFillAttr->Enable(); + mpLbFillType->SelectEntryPos(HATCH); Update(); } else if(bDisabled) @@ -883,7 +981,7 @@ void AreaPropertyPanelBase::updateFillColor(bool bDefault, const XFillColorItem* { mpLbFillAttr->Hide(); mpToolBoxColor->Show(); - + mpLbFillType->SelectEntryPos(SOLID); Update(); } mpSidebarController->NotifyResize(); @@ -898,20 +996,25 @@ void AreaPropertyPanelBase::updateFillBitmap(bool bDisabled, bool bDefault, cons if(mpStyleItem && drawing::FillStyle_BITMAP == (drawing::FillStyle)mpStyleItem->GetValue()) { - mpLbFillBitmap->Show(); + mpLbFillAttr->Show(); mpToolBoxColor->Hide(); if(bDefault) { + if(mpBitmapItem->isPattern()) + mpLbFillType->SelectEntryPos(PATTERN); + else + mpLbFillType->SelectEntryPos(BITMAP); Update(); } else if(bDisabled) { - mpLbFillBitmap->Hide(); + mpLbFillAttr->Hide(); + mpLbFillAttr->SetNoSelection(); } else { - mpLbFillBitmap->SetNoSelection(); + mpLbFillAttr->SetNoSelection(); } } mpSidebarController->NotifyResize(); @@ -1008,6 +1111,7 @@ void AreaPropertyPanelBase::NotifyItemUpdate( break; } case SID_BITMAP_LIST: + case SID_PATTERN_LIST: { if(bDefault) { @@ -1017,16 +1121,24 @@ void AreaPropertyPanelBase::NotifyItemUpdate( { const OUString aString( mpBitmapItem->GetName() ); const SfxObjectShell* pSh = SfxObjectShell::Current(); - const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); + mpLbFillAttr->Clear(); + mpLbFillAttr->Show(); + if(nSID == SID_BITMAP_LIST) + { + const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); - mpLbFillBitmap->Clear(); - mpLbFillBitmap->Show(); - mpLbFillBitmap->Fill(aItem.GetBitmapList()); - mpLbFillBitmap->SelectEntry(aString); + mpLbFillAttr->Fill(aItem.GetBitmapList()); + } + else if(nSID == SID_PATTERN_LIST) + { + const SvxPatternListItem aItem(*static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST))); + mpLbFillAttr->Fill(aItem.GetPatternList()); + } + mpLbFillAttr->SelectEntry(aString); } else { - mpLbFillBitmap->SetNoSelection(); + mpLbFillAttr->SetNoSelection(); } } } @@ -1037,14 +1149,12 @@ void AreaPropertyPanelBase::NotifyItemUpdate( void AreaPropertyPanelBase::Update() { - if(mpStyleItem) - { - const drawing::FillStyle eXFS = (drawing::FillStyle)mpStyleItem->GetValue(); + const eFillStyle eXFS = (eFillStyle)mpLbFillType->GetSelectEntryPos(); SfxObjectShell* pSh = SfxObjectShell::Current(); switch( eXFS ) { - case drawing::FillStyle_NONE: + case eFillStyle::NONE: { mpLbFillAttr->Show(); mpLbFillGradFrom->Hide(); @@ -1052,11 +1162,10 @@ void AreaPropertyPanelBase::Update() mpMTRAngle->Hide(); mpGradientStyle->Hide(); mpToolBoxColor->Hide(); - mpLbFillBitmap->Hide(); mpBmpImport->Hide(); break; } - case drawing::FillStyle_SOLID: + case eFillStyle::SOLID: { if(mpColorItem) { @@ -1066,12 +1175,11 @@ void AreaPropertyPanelBase::Update() mpMTRAngle->Hide(); mpGradientStyle->Hide(); mpToolBoxColor->Show(); - mpLbFillBitmap->Hide(); mpBmpImport->Hide(); } break; } - case drawing::FillStyle_GRADIENT: + case eFillStyle::GRADIENT: { mpLbFillAttr->Hide(); mpLbFillGradFrom->Show(); @@ -1080,7 +1188,6 @@ void AreaPropertyPanelBase::Update() mpMTRAngle->Show(); mpGradientStyle->Show(); mpToolBoxColor->Hide(); - mpLbFillBitmap->Hide(); mpBmpImport->Hide(); if(pSh && pSh->GetItem(SID_GRADIENT_LIST)) @@ -1128,7 +1235,7 @@ void AreaPropertyPanelBase::Update() } break; } - case drawing::FillStyle_HATCH: + case eFillStyle::HATCH: { mpLbFillAttr->Show(); mpLbFillGradFrom->Hide(); @@ -1136,9 +1243,7 @@ void AreaPropertyPanelBase::Update() mpMTRAngle->Hide(); mpGradientStyle->Hide(); mpToolBoxColor->Hide(); - mpLbFillBitmap->Hide(); mpBmpImport->Hide(); - mpLbFillBitmap->Hide(); mpBmpImport->Hide(); if(pSh && pSh->GetItem(SID_HATCH_LIST)) @@ -1165,38 +1270,43 @@ void AreaPropertyPanelBase::Update() } break; } - case drawing::FillStyle_BITMAP: + case eFillStyle::BITMAP: + case eFillStyle::PATTERN: { - mpLbFillAttr->Hide(); + mpLbFillAttr->Show(); + mpLbFillAttr->Enable(); + mpLbFillAttr->Clear(); mpToolBoxColor->Hide(); mpLbFillGradFrom->Hide(); mpLbFillGradTo->Hide(); mpMTRAngle->Hide(); mpGradientStyle->Hide(); - mpLbFillBitmap->Show(); - mpBmpImport->Show(); - if(pSh && pSh->GetItem(SID_BITMAP_LIST)) + if(mpBitmapItem) { - const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); - mpLbFillBitmap->Clear(); - mpLbFillBitmap->Fill(aItem.GetBitmapList()); - - if(mpBitmapItem) + if(pSh && pSh->GetItem(SID_BITMAP_LIST) && eXFS == BITMAP) { - const OUString aString(mpBitmapItem->GetName()); + mpBmpImport->Show(); + mpLbFillType->SelectEntryPos((sal_uInt32)BITMAP); + const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); + mpLbFillAttr->Fill(aItem.GetBitmapList()); - mpLbFillBitmap->SelectEntry(aString); + const OUString aString(mpBitmapItem->GetName()); + mpLbFillAttr->SelectEntry(aString); } - else + else if(pSh && pSh->GetItem(SID_PATTERN_LIST) && eXFS == PATTERN) { - mpLbFillBitmap->SetNoSelection(); + mpBmpImport->Hide(); + mpLbFillType->SelectEntryPos((sal_uInt32)PATTERN); + const SvxPatternListItem aItem(*static_cast<const SvxPatternListItem*>(pSh->GetItem(SID_PATTERN_LIST))); + mpLbFillAttr->Fill(aItem.GetPatternList()); + + const OUString aString(mpBitmapItem->GetName()); + mpLbFillAttr->SelectEntry(aString); } } else - { - mpLbFillBitmap->SetNoSelection(); - } + mpLbFillAttr->SetNoSelection(); break; } default: @@ -1204,7 +1314,6 @@ void AreaPropertyPanelBase::Update() break; } mpSidebarController->NotifyResize(); - } } IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, ModifyTransSliderHdl, Slider*, void) diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index 1d7572ea9d64..31129f4d748c 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -523,11 +523,14 @@ XFillBitmapItem* XFillBitmapItem::checkForUniqueItem( SdrModel* pModel ) const { if( pModel ) { + XPropertyListType aListType = XBITMAP_LIST; + if(isPattern()) + aListType = XPATTERN_LIST; const OUString aUniqueName = NameOrIndex::CheckNamedItem( this, XATTR_FILLBITMAP, &pModel->GetItemPool(), pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : nullptr, XFillBitmapItem::CompareValueFunc, RID_SVXSTR_BMP21, - pModel->GetPropertyList( XBITMAP_LIST ) ); + pModel->GetPropertyList( aListType ) ); // if the given name is not valid, replace it! if( aUniqueName != GetName() ) diff --git a/svx/source/xoutdev/xtabbtmp.cxx b/svx/source/xoutdev/xtabbtmp.cxx index d5ed9d543d7f..bfc086671559 100644 --- a/svx/source/xoutdev/xtabbtmp.cxx +++ b/svx/source/xoutdev/xtabbtmp.cxx @@ -48,39 +48,6 @@ uno::Reference< container::XNameContainer > XBitmapList::createInstance() bool XBitmapList::Create() { - OUStringBuffer aStr(SVX_RESSTR(RID_SVXSTR_BITMAP)); - sal_uInt16 aArray[64]; - Bitmap aBitmap; - const sal_Int32 nLen(aStr.getLength() - 1); - - memset(aArray, 0, sizeof(aArray)); - - // white/white bitmap - aStr.append(" 1"); - aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_WHITE), RGB_Color(COL_WHITE)); - Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString())); - - // black/white bitmap - aArray[ 0] = 1; aArray[ 9] = 1; aArray[18] = 1; aArray[27] = 1; - aArray[36] = 1; aArray[45] = 1; aArray[54] = 1; aArray[63] = 1; - aStr[nLen] = '2'; - aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_BLACK), RGB_Color(COL_WHITE)); - Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString())); - - // lightred/white bitmap - aArray[ 7] = 1; aArray[14] = 1; aArray[21] = 1; aArray[28] = 1; - aArray[35] = 1; aArray[42] = 1; aArray[49] = 1; aArray[56] = 1; - aStr[nLen] = '3'; - aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_LIGHTRED), RGB_Color(COL_WHITE)); - Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString())); - - // lightblue/white bitmap - aArray[24] = 1; aArray[25] = 1; aArray[26] = 1; - aArray[29] = 1; aArray[30] = 1; aArray[31] = 1; - aStr[nLen] = '4'; - aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_LIGHTBLUE), RGB_Color(COL_WHITE)); - Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString())); - return true; } diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index e73fd080a4be..aebf849ccd74 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -334,6 +334,9 @@ XPropertyListRef XPropertyList::CreatePropertyList( XPropertyListType aType, case XBITMAP_LIST: pRet = XPropertyListRef(new XBitmapList(rPath, rReferer)); break; + case XPATTERN_LIST: + pRet = XPropertyListRef(new XPatternList(rPath, rReferer)); + break; default: OSL_FAIL("unknown xproperty type"); break; @@ -381,7 +384,8 @@ static struct { { XDASH_LIST, "sod" }, { XHATCH_LIST, "soh" }, { XGRADIENT_LIST, "sog" }, - { XBITMAP_LIST, "sob" } + { XBITMAP_LIST, "sob" }, + { XPATTERN_LIST, "sop"} }; OUString XPropertyList::GetDefaultExt( XPropertyListType t ) diff --git a/svx/source/xoutdev/xtabptrn.cxx b/svx/source/xoutdev/xtabptrn.cxx new file mode 100644 index 000000000000..6fcfec98e32f --- /dev/null +++ b/svx/source/xoutdev/xtabptrn.cxx @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "svx/XPropertyTable.hxx" + +#include <vcl/virdev.hxx> +#include <svl/itemset.hxx> +#include <sfx2/docfile.hxx> +#include <svx/dialogs.hrc> +#include <svx/dialmgr.hxx> +#include <svx/xtable.hxx> +#include <svx/xpool.hxx> +#include <svx/xbtmpit.hxx> + +using namespace com::sun::star; + +XBitmapEntry* XPatternList::Remove(long nIndex) +{ + return static_cast<XBitmapEntry*>( XPropertyList::Remove(nIndex) ); +} + +XBitmapEntry* XPatternList::GetBitmap(long nIndex) const +{ + return static_cast<XBitmapEntry*>( XPropertyList::Get(nIndex) ); +} + +uno::Reference< container::XNameContainer > XPatternList::createInstance() +{ + return uno::Reference< container::XNameContainer >( + SvxUnoXBitmapTable_createInstance( this ), uno::UNO_QUERY ); +} + +bool XPatternList::Create() +{ + OUStringBuffer aStr(SVX_RESSTR(RID_SVXSTR_PATTERN)); + sal_uInt16 aArray[64]; + Bitmap aBitmap; + const sal_Int32 nLen(aStr.getLength() - 1); + + memset(aArray, 0, sizeof(aArray)); + + // white/white bitmap + aStr.append(" 1"); + aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_WHITE), RGB_Color(COL_WHITE)); + Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString())); + + // black/white bitmap + aArray[ 0] = 1; aArray[ 9] = 1; aArray[18] = 1; aArray[27] = 1; + aArray[36] = 1; aArray[45] = 1; aArray[54] = 1; aArray[63] = 1; + aStr[nLen] = '2'; + aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_BLACK), RGB_Color(COL_WHITE)); + Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString())); + + // lightred/white bitmap + aArray[ 7] = 1; aArray[14] = 1; aArray[21] = 1; aArray[28] = 1; + aArray[35] = 1; aArray[42] = 1; aArray[49] = 1; aArray[56] = 1; + aStr[nLen] = '3'; + aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_LIGHTRED), RGB_Color(COL_WHITE)); + Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString())); + + // lightblue/white bitmap + aArray[24] = 1; aArray[25] = 1; aArray[26] = 1; + aArray[29] = 1; aArray[30] = 1; aArray[31] = 1; + aStr[nLen] = '4'; + aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_LIGHTBLUE), RGB_Color(COL_WHITE)); + Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString())); + + return true; +} + +Bitmap XPatternList::CreateBitmapForUI( long /*nIndex*/ ) +{ + return Bitmap(); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/uiconfig/ui/sidebararea.ui b/svx/uiconfig/ui/sidebararea.ui index efd1bcba568b..a11a4ea0cb23 100644 --- a/svx/uiconfig/ui/sidebararea.ui +++ b/svx/uiconfig/ui/sidebararea.ui @@ -150,52 +150,73 @@ </packing> </child> <child> - <object class="GtkToolbar" id="selectgradient"> + <object class="svxlo-ColorLB" id="fillgrad2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">start</property> - <child> - <object class="GtkMenuToolButton" id="gradient"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="has_tooltip">True</property> - <property name="tooltip_markup" translatable="yes">Specify the variation of gradient transparency.</property> - <property name="tooltip_text" translatable="yes">Specify the variation of gradient transparency.</property> - <property name="hexpand">True</property> - <property name="action_name">.uno:sidebargradient</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="homogeneous">True</property> - </packing> - </child> + <property name="has_tooltip">True</property> + <property name="tooltip_markup" translatable="yes">Fill gradient to.</property> + <property name="tooltip_text" translatable="yes">Fill gradient to.</property> </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">5</property> + <property name="top_attach">2</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="svxlo-ColorLB" id="fillgrad2"> + <object class="GtkBox" id="box2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="has_tooltip">True</property> - <property name="tooltip_markup" translatable="yes">Fill gradient to.</property> - <property name="tooltip_text" translatable="yes">Fill gradient to.</property> + <child> + <object class="GtkComboBoxText" id="gradientstyle"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_markup" translatable="yes">Select the gradient style.</property> + <property name="tooltip_text" translatable="yes">Select the gradient style.</property> + <items> + <item translatable="yes">Linear</item> + <item translatable="yes">Axial</item> + <item translatable="yes">Radial</item> + <item translatable="yes">Ellipsoid</item> + <item translatable="yes">Quadratic</item> + <item translatable="yes">Square</item> + </items> + <child internal-child="accessible"> + <object class="AtkObject" id="gradientstyle-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Gradient Type</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="bmpimport"> + <property name="label" translatable="yes">_Import</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> + <property name="left_attach">0</property> + <property name="top_attach">1</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> <object class="GtkSpinButton" id="gradangle:0degrees"> - <property name="visible">True</property> <property name="can_focus">True</property> <property name="tooltip_markup" translatable="yes">Select the gradient angle.</property> <property name="tooltip_text" translatable="yes">Select the gradient angle.</property> @@ -214,28 +235,19 @@ </packing> </child> <child> - <object class="GtkComboBoxText" id="gradientstyle"> + <object class="GtkLabel" id="transparencylabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="tooltip_markup" translatable="yes">Select the gradient style.</property> - <property name="tooltip_text" translatable="yes">Select the gradient style.</property> - <items> - <item translatable="yes">Linear</item> - <item translatable="yes">Axial</item> - <item translatable="yes">Radial</item> - <item translatable="yes">Ellipsoid</item> - <item translatable="yes">Quadratic</item> - <item translatable="yes">Square</item> - </items> - <child internal-child="accessible"> - <object class="AtkObject" id="gradientstyle-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes">Gradient Type</property> - </object> - </child> + <property name="has_tooltip">True</property> + <property name="tooltip_markup" translatable="yes">Transparency</property> + <property name="tooltip_text" translatable="yes">Transparency</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Transparency:</property> + <property name="use_underline">True</property> </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="top_attach">3</property> <property name="width">1</property> <property name="height">1</property> </packing> @@ -265,62 +277,36 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="transparencylabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="has_tooltip">True</property> - <property name="tooltip_markup" translatable="yes">Transparency</property> - <property name="tooltip_text" translatable="yes">Transparency</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">_Transparency:</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="bmpimport"> - <property name="label" translatable="yes">_Import</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="left_attach">0</property> <property name="top_attach">3</property> <property name="width">1</property> <property name="height">1</property> </packing> </child> <child> - <object class="svxlo-SvxFillAttrBox" id="fillbitmap"> + <object class="GtkToolbar" id="selectgradient"> + <property name="visible">True</property> <property name="can_focus">False</property> - <property name="has_tooltip">True</property> - <property name="tooltip_markup" translatable="yes">Select the effect to apply.</property> - <property name="tooltip_text" translatable="yes">Select the effect to apply.</property> - <accessibility> - <relation type="labelled-by" target="filllabel"/> - </accessibility> - <child internal-child="accessible"> - <object class="AtkObject" id="fillbitmap-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes">Hatching/Bitmap</property> + <property name="halign">start</property> + <child> + <object class="GtkMenuToolButton" id="gradient"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="has_tooltip">True</property> + <property name="tooltip_markup" translatable="yes">Specify the variation of gradient transparency.</property> + <property name="tooltip_text" translatable="yes">Specify the variation of gradient transparency.</property> + <property name="hexpand">True</property> + <property name="action_name">.uno:sidebargradient</property> + <property name="use_underline">True</property> </object> + <packing> + <property name="expand">True</property> + <property name="homogeneous">True</property> + </packing> </child> </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">3</property> + <property name="top_attach">4</property> <property name="width">1</property> <property name="height">1</property> </packing> @@ -406,4 +392,14 @@ <widget name="fillattr"/> </widgets> </object> + <object class="GtkSizeGroup" id="sizegroup2"> + <property name="ignore_hidden">True</property> + <widgets> + <widget name="filllabel"/> + <widget name="gradientstyle"/> + <widget name="bmpimport"/> + <widget name="gradangle:0degrees"/> + <widget name="transparencylabel"/> + </widgets> + </object> </interface> diff --git a/sw/sdi/_frmsh.sdi b/sw/sdi/_frmsh.sdi index 7702fde88373..e496cecf9de1 100644 --- a/sw/sdi/_frmsh.sdi +++ b/sw/sdi/_frmsh.sdi @@ -106,6 +106,12 @@ interface BaseTextFrame ] //UUUU + SID_PATTERN_LIST + [ + StateMethod = GetDrawAttrStateTextFrame; + ] + + //UUUU SID_ATTRIBUTES_AREA [ ExecMethod = ExecDrawDlgTextFrame; diff --git a/sw/sdi/drawsh.sdi b/sw/sdi/drawsh.sdi index 81fdbf8fd225..6b9542033d60 100644 --- a/sw/sdi/drawsh.sdi +++ b/sw/sdi/drawsh.sdi @@ -108,6 +108,11 @@ interface TextDraw : TextDrawBase StateMethod = GetDrawAttrState ; ] + SID_PATTERN_LIST + [ + StateMethod = GetDrawAttrState ; + ] + SID_ATTR_LINE_WIDTH [ ExecMethod = ExecDrawAttrArgs ; diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx index 786d86f91d3a..73155dadb1c0 100644 --- a/sw/source/core/draw/drawdoc.cxx +++ b/sw/source/core/draw/drawdoc.cxx @@ -154,6 +154,7 @@ void SwDrawModel::PutAreaListItems(SfxItemSet& rSet) const rSet.Put(SvxGradientListItem(GetGradientList(), SID_GRADIENT_LIST)); rSet.Put(SvxHatchListItem(GetHatchList(), SID_HATCH_LIST)); rSet.Put(SvxBitmapListItem(GetBitmapList(), SID_BITMAP_LIST)); + rSet.Put(SvxPatternListItem(GetPatternList(), SID_PATTERN_LIST)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index 9a2932a0888f..7e1428dcac40 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -266,7 +266,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) else if (m_nAreaId == nId) { SfxItemSet aNew(*aSet.GetPool(), - SID_COLOR_TABLE, SID_BITMAP_LIST, + SID_COLOR_TABLE, SID_PATTERN_LIST, SID_OFFER_IMPORT, SID_OFFER_IMPORT, 0, 0); aNew.Put(*GetInputSetImpl()); diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx index 66fffef1f306..30c411cfb19a 100644 --- a/sw/source/ui/frmdlg/frmdlg.cxx +++ b/sw/source/ui/frmdlg/frmdlg.cxx @@ -204,7 +204,7 @@ void SwFrameDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) else if (nId == m_nAreaId) { SfxItemSet aNew(*GetInputSetImpl()->GetPool(), - SID_COLOR_TABLE, SID_BITMAP_LIST, + SID_COLOR_TABLE, SID_PATTERN_LIST, SID_OFFER_IMPORT, SID_OFFER_IMPORT, 0, 0); aNew.Put(m_rSet); diff --git a/sw/source/uibase/app/docshdrw.cxx b/sw/source/uibase/app/docshdrw.cxx index 62621400dfcf..cc18ba2cd75f 100644 --- a/sw/source/uibase/app/docshdrw.cxx +++ b/sw/source/uibase/app/docshdrw.cxx @@ -82,6 +82,7 @@ void InitDrawModelAndDocShell(SwDocShell* pSwDocShell, SwDrawModel* pSwDrawDocum pSwDocShell->PutItem(SvxGradientListItem(pSwDrawDocument->GetGradientList(), SID_GRADIENT_LIST)); pSwDocShell->PutItem(SvxHatchListItem(pSwDrawDocument->GetHatchList(), SID_HATCH_LIST)); pSwDocShell->PutItem(SvxBitmapListItem(pSwDrawDocument->GetBitmapList(), SID_BITMAP_LIST)); + pSwDocShell->PutItem(SvxPatternListItem(pSwDrawDocument->GetPatternList(), SID_PATTERN_LIST)); pSwDocShell->PutItem(SvxDashListItem(pSwDrawDocument->GetDashList(), SID_DASH_LIST)); pSwDocShell->PutItem(SvxLineEndListItem(pSwDrawDocument->GetLineEndList(), SID_LINEEND_LIST)); } diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 635a0daca4bc..9633b084f790 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -773,6 +773,7 @@ sal_uInt16 SwDocShell::Edit( rSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST)); rSet.Put(SvxHatchListItem(pDrawModel->GetHatchList(), SID_HATCH_LIST)); rSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapList(), SID_BITMAP_LIST)); + rSet.Put(SvxPatternListItem(pDrawModel->GetPatternList(), SID_PATTERN_LIST)); } if (!bBasic) diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index d4dc4746dfb6..11f7e957c564 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -472,7 +472,7 @@ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument, //UUUU items to hand over XPropertyList things like // XColorList, XHatchList, XGradientList and XBitmapList // to the Area TabPage - SID_COLOR_TABLE, SID_BITMAP_LIST, // [10179 + SID_COLOR_TABLE, SID_PATTERN_LIST, // [10179 SID_SWREGISTER_COLLECTION, SID_SWREGISTER_COLLECTION, // [10451 SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM, // [10457 @@ -1353,6 +1353,7 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() aCoreSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST)); aCoreSet.Put(SvxHatchListItem(pDrawModel->GetHatchList(), SID_HATCH_LIST)); aCoreSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapList(), SID_BITMAP_LIST)); + aCoreSet.Put(SvxPatternListItem(pDrawModel->GetPatternList(), SID_PATTERN_LIST)); } } break; diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 0854306985f9..7d05b7260391 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -402,7 +402,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) //UUUU items to hand over XPropertyList things like // XColorList, XHatchList, XGradientList and XBitmapList // to the Area TabPage - SID_COLOR_TABLE, SID_BITMAP_LIST, // [10179 + SID_COLOR_TABLE, SID_PATTERN_LIST, // [10179 SID_HTML_MODE, SID_HTML_MODE, // [10414 FN_GET_PRINT_AREA, FN_GET_PRINT_AREA, // [21032 diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index c5fee03511b7..e58869336da0 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -236,7 +236,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) //UUUU items to hand over XPropertyList things like // XColorList, XHatchList, XGradientList and XBitmapList // to the Area TabPage - SID_COLOR_TABLE, SID_BITMAP_LIST, // [10179 + SID_COLOR_TABLE, SID_PATTERN_LIST, // [10179 SID_HTML_MODE,SID_HTML_MODE, // [10414 FN_GET_PRINT_AREA,FN_GET_PRINT_AREA, // [21032 @@ -255,6 +255,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST)); aSet.Put(SvxHatchListItem(pDrawModel->GetHatchList(), SID_HATCH_LIST)); aSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapList(), SID_BITMAP_LIST)); + aSet.Put(SvxPatternListItem(pDrawModel->GetPatternList(), SID_PATTERN_LIST)); sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode)); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index e302b8f0e55d..e97993d1980d 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -846,7 +846,7 @@ SfxItemSet SwTextShell::CreateInsertFrameItemSet(SwFlyFrameAttrMgr& rMgr) SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, FN_SET_FRM_NAME, FN_SET_FRM_NAME, SID_HTML_MODE, SID_HTML_MODE, - SID_COLOR_TABLE, SID_BITMAP_LIST, + SID_COLOR_TABLE, SID_PATTERN_LIST, 0 }; diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 6e7d1645c196..510225f921f9 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -934,7 +934,7 @@ void SwTextShell::Execute(SfxRequest &rReq) //UUUU items to hand over XPropertyList things like // XColorList, XHatchList, XGradientList and XBitmapList // to the Area TabPage - SID_COLOR_TABLE, SID_BITMAP_LIST, // [10179 + SID_COLOR_TABLE, SID_PATTERN_LIST, // [10179 SID_HTML_MODE, SID_HTML_MODE, // [10414 SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM, // [10457 @@ -955,7 +955,7 @@ void SwTextShell::Execute(SfxRequest &rReq) aCoreSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST)); aCoreSet.Put(SvxHatchListItem(pDrawModel->GetHatchList(), SID_HATCH_LIST)); aCoreSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapList(), SID_BITMAP_LIST)); - + aCoreSet.Put(SvxPatternListItem(pDrawModel->GetPatternList(), SID_PATTERN_LIST)); aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell()))); |