Kaydet (Commit) 3881fffe authored tarafından Susobhan Ghosh's avatar Susobhan Ghosh Kaydeden (comit) Katarina Behrens

tdf#83830: Page Styles Panel

Added new helper class to svx for numbering

Change-Id: Ie7db4059568024e9bed460fcf7c9215bd2ef788f
Reviewed-on: https://gerrit.libreoffice.org/26020Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 2fe32490
/* -*- 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 .
*/
#ifndef INCLUDED_SVX_SVXNUMOPTIONSTABPAGEHELPER_HXX
#define INCLUDED_SVX_SVXNUMOPTIONSTABPAGEHELPER_HXX
#include <com/sun/star/text/DefaultNumberingProvider.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/text/XNumberingTypeInfo.hpp>
#include <vcl/lstbox.hxx>
#include <svx/svxdllapi.h>
using namespace css::uno;
using namespace css::text;
class SVX_DLLPUBLIC SvxNumOptionsTabPageHelper
{
public:
static Reference<XDefaultNumberingProvider> GetNumberingProvider();
/** Get the numberings provided by the i18n framework (CTL, Asian, ...) and
add them to the listbox. Extended numbering schemes present in the
resource and already in the listbox but not offered by the i18n
framework per configuration are removed.
@param nDoNotRemove
A value that shall not be removed, i.e. the ugly 0x88
(SVX_NUM_BITMAP|0x80)
Pass ::std::numeric_limits<sal_uInt16>::max() if there is no such
restriction.
*/
static void GetI18nNumbering( ListBox& rFmtLB, sal_uInt16 nDoNotRemove );
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1075,9 +1075,10 @@
#define RID_SVXIMG_WIDTH_CUSTOM_GRAY (RID_SVX_START + 1394)
#define RID_SVXSTRARY_PAPERSIZE_STD (RID_SVX_START + 1395)
#define RID_SVXSTRARY_PAPERSIZE_DRAW (RID_SVX_START + 1396)
#define RID_SVXSTRARY_PAGE_NUMBERING (RID_SVX_START + 1397)
// !!! IMPORTANT: consider and update RID_SVXSTR_NEXTFREE when introducing new RIDs for Strings !!!
#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1397)
#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1398)
// if we have _a_lot_ time, we should group the resource ids by type, instead
// of grouping them by semantics. The reason is that resource ids have to be
......
/* -*- 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 .
*/
#ifndef INCLUDED_SVX_PAGENUMBERINGHELPER_HXX
#define INCLUDED_SVX_PAGENUMBERINGHELPER_HXX
#include <svx/svxdllapi.h>
#include <vcl/lstbox.hxx>
class SVX_DLLPUBLIC PageNumberListBox : public ListBox
{
public:
PageNumberListBox( vcl::Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN );
void SetSelection( sal_uInt16 );
sal_uInt16 GetSelection() const;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -45,6 +45,7 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\
svx/source/dialog/imapdlg.src \
svx/source/dialog/language.src \
svx/source/dialog/page.src \
svx/source/dialog/pagenumbering.src \
svx/source/dialog/passwd.src \
svx/source/dialog/prtqry.src \
svx/source/dialog/ruler.src \
......
......@@ -118,9 +118,11 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/dialog/hexcolorcontrol \
svx/source/dialog/framelink \
svx/source/dialog/langbox \
svx/source/dialog/pagenumberlistbox \
svx/source/dialog/papersizelistbox \
svx/source/dialog/stddlg \
svx/source/dialog/svxdlg \
svx/source/dialog/SvxNumOptionsTabPageHelper \
svx/source/engine3d/camera3d \
svx/source/engine3d/cube3d \
svx/source/engine3d/deflt3d \
......
/* -*- 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/SvxNumOptionsTabPageHelper.hxx>
#include <com/sun/star/style/NumberingType.hpp>
using namespace css;
using namespace css::uno;
using namespace css::text;
using namespace css::style;
Reference<XDefaultNumberingProvider> SvxNumOptionsTabPageHelper::GetNumberingProvider()
{
Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
Reference<XDefaultNumberingProvider> xRet = text::DefaultNumberingProvider::create(xContext);
return xRet;
}
void SvxNumOptionsTabPageHelper::GetI18nNumbering( ListBox& rFmtLB, sal_uInt16 nDoNotRemove )
{
Reference<XDefaultNumberingProvider> xDefNum = GetNumberingProvider();
Reference<XNumberingTypeInfo> xInfo(xDefNum, UNO_QUERY);
// Extended numbering schemes present in the resource but not offered by
// the i18n framework per configuration must be removed from the listbox.
// Do not remove a special entry matching nDoNotRemove.
const sal_uInt16 nDontRemove = SAL_MAX_UINT16;
::std::vector< sal_uInt16> aRemove( rFmtLB.GetEntryCount(), nDontRemove);
for (size_t i=0; i<aRemove.size(); ++i)
{
sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(rFmtLB.GetEntryData(
sal::static_int_cast< sal_Int32 >(i)));
if (nEntryData > NumberingType::CHARS_LOWER_LETTER_N && nEntryData != nDoNotRemove)
aRemove[i] = nEntryData;
}
if(xInfo.is())
{
Sequence<sal_Int16> aTypes = xInfo->getSupportedNumberingTypes( );
const sal_Int16* pTypes = aTypes.getConstArray();
for(sal_Int32 nType = 0; nType < aTypes.getLength(); nType++)
{
sal_Int16 nCurrent = pTypes[nType];
if(nCurrent > NumberingType::CHARS_LOWER_LETTER_N)
{
bool bInsert = true;
for(sal_Int32 nEntry = 0; nEntry < rFmtLB.GetEntryCount(); nEntry++)
{
sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(rFmtLB.GetEntryData(nEntry));
if(nEntryData == (sal_uInt16) nCurrent)
{
bInsert = false;
aRemove[nEntry] = nDontRemove;
break;
}
}
if(bInsert)
{
OUString aIdent = xInfo->getNumberingIdentifier( nCurrent );
sal_Int32 nPos = rFmtLB.InsertEntry(aIdent);
rFmtLB.SetEntryData(nPos, reinterpret_cast<void*>((sal_uLong)nCurrent));
}
}
}
}
for (unsigned short i : aRemove)
{
if (i != nDontRemove)
{
sal_Int32 nPos = rFmtLB.GetEntryPos( reinterpret_cast<void*>((sal_uLong)i));
rFmtLB.RemoveEntry( nPos);
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#include <svx/dialogs.hrc>
StringArray RID_SVXSTRARY_PAGE_NUMBERING
{
ItemList [ en-US ] =
{
< "1, 2, 3, ..." ; 4/*SVX_NUM_ARABIC */; > ;
< "A, B, C, ..." ; 0/*SVX_NUM_CHARS_UPPER_LETTER */; > ;
< "a, b, c, ..." ; 1/*SVX_NUM_CHARS_LOWER_LETTER */; > ;
< "I, II, III, ..." ; 2/*SVX_NUM_ROMAN_UPPER */; > ;
< "i, ii, iii, ..." ; 3/*SVX_NUM_ROMAN_LOWER */; > ;
< "None" ; 5/*SVX_NUM_NUMBER_NONE */; > ;
< "A, .., AA, .., AAA, ..." ; 9/*SVX_NUM_CHARS_UPPER_LETTER_N*/; > ;
< "a, .., aa, .., aaa, ..." ; 10/*SVX_NUM_CHARS_LOWER_LETTER_N*/; > ;
< "Native Numbering" ; 12 /*NATIVE_NUMBERING */; > ;
< "А, Б, .., Аа, Аб, ... (Bulgarian)" ; 38 /*CHARS_CYRILLIC_UPPER_LETTER_BG */; > ;
< "а, б, .., аа, аб, ... (Bulgarian)" ; 39 /*CHARS_CYRILLIC_LOWER_LETTER_BG */; > ;
< "А, Б, .., Аа, Бб, ... (Bulgarian)" ; 40 /*CHARS_CYRILLIC_UPPER_LETTER_N_BG */; > ;
< "а, б, .., аа, бб, ... (Bulgarian)" ; 41 /*CHARS_CYRILLIC_LOWER_LETTER_N_BG */; > ;
< "А, Б, .., Аа, Аб, ... (Russian)" ; 42 /*CHARS_CYRILLIC_UPPER_LETTER_RU */; > ;
< "а, б, .., аа, аб, ... (Russian)" ; 43 /*CHARS_CYRILLIC_LOWER_LETTER_RU */; > ;
< "А, Б, .., Аа, Бб, ... (Russian)" ; 44 /*CHARS_CYRILLIC_UPPER_LETTER_N_RU */; > ;
< "а, б, .., аа, бб, ... (Russian)" ; 45 /*CHARS_CYRILLIC_LOWER_LETTER_N_RU */; > ;
< "А, Б, .., Аа, Аб, ... (Serbian)" ; 48 /*CHARS_CYRILLIC_UPPER_LETTER_SR */; > ;
< "а, б, .., аа, аб, ... (Serbian)" ; 49 /*CHARS_CYRILLIC_LOWER_LETTER_SR */; > ;
< "А, Б, .., Аа, Бб, ... (Serbian)" ; 50 /*CHARS_CYRILLIC_UPPER_LETTER_N_SR */; > ;
< "а, б, .., аа, бб, ... (Serbian)" ; 51 /*CHARS_CYRILLIC_LOWER_LETTER_N_SR */; > ;
< "Α, Β, Γ, ... (Greek Upper Letter)"; 52 /*CHARS_GREEK_UPPER_LETTER */; > ;
< "α, β, γ, ... (Greek Lower Letter)"; 53 /*CHARS_GREEK_LOWER_LETTER */; > ;
};
};
\ No newline at end of file
/* -*- 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/dialogs.hrc>
#include <svx/dialmgr.hxx>
#include <svx/pagenumberlistbox.hxx>
#include <tools/resary.hxx>
#include <vcl/builderfactory.hxx>
PageNumberListBox::PageNumberListBox(vcl::Window* pParent, WinBits nStyle)
: ListBox( pParent, nStyle)
{
ResStringArray aPaperAry( SVX_RES( RID_SVXSTRARY_PAGE_NUMBERING ) );
sal_uInt32 nCnt = aPaperAry.Count();
for ( sal_uInt32 i = 0; i < nCnt; ++i )
{
OUString aStr = aPaperAry.GetString(i);
sal_uInt16 nData = aPaperAry.GetValue(i);
sal_Int32 nPos = InsertEntry( aStr );
SetEntryData( nPos, reinterpret_cast<void*>((sal_uLong)nData) );
}
}
VCL_BUILDER_FACTORY(PageNumberListBox);
void PageNumberListBox::SetSelection( sal_uInt16 nPos )
{
sal_Int32 nEntryCount = GetEntryCount();
sal_Int32 nSelPos = LISTBOX_ENTRY_NOTFOUND;
sal_Int32 nUserPos = LISTBOX_ENTRY_NOTFOUND;
for (sal_Int32 i = 0; i < nEntryCount; ++i )
{
sal_uInt16 nTmp = (sal_uInt16)reinterpret_cast<sal_uLong>(GetEntryData(i));
if ( nTmp == nPos )
{
nSelPos = i;
break;
}
}
SelectEntryPos( ( nSelPos != LISTBOX_ENTRY_NOTFOUND ) ? nSelPos : nUserPos );
}
sal_uInt16 PageNumberListBox::GetSelection() const
{
const sal_Int32 nPos = GetSelectEntryPos();
sal_uInt16 nData = (sal_uInt16)reinterpret_cast<sal_uLong>(GetEntryData( nPos ));
return nData;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -446,21 +446,41 @@ interface BaseTextEditView
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
]
SID_ATTR_PAGE_FILLSTYLE
[
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
]
SID_ATTR_PAGE_HEADER_LRMARGIN
[
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
]
SID_ATTR_PAGE_COLOR
[
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
]
SID_ATTR_PAGE_HEADER_SPACING
[
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
]
SID_ATTR_PAGE_GRADIENT
[
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
]
SID_ATTR_PAGE_HEADER_LAYOUT
[
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
]
SID_ATTR_PAGE_HATCH
[
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
]
SID_ATTR_PAGE_FOOTER
[
ExecMethod = ExecTabWin ;
......@@ -481,6 +501,11 @@ interface BaseTextEditView
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
]
SID_ATTR_PAGE_BITMAP
[
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
]
SID_ATTR_PAGE_ULSPACE
[
ExecMethod = ExecTabWin ;
......
......@@ -43,7 +43,13 @@
#include <tools/fldunit.hxx>
#include <svl/poolitem.hxx>
#include <svx/rulritem.hxx>
#include <svx/dlgctrl.hxx>
#include <svx/xfillit.hxx>
#include <svx/xfillit0.hxx>
#include <svx/itemwin.hxx>
#include <svx/pagenumberlistbox.hxx>
class List;
namespace sw { namespace sidebar {
class PageStylesPanel:
......@@ -53,7 +59,8 @@ class PageStylesPanel:
public:
static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame);
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
SfxBindings* pBindings);
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
......@@ -61,11 +68,57 @@ public:
const SfxPoolItem* pState,
const bool bIsEnabled) override;
SfxBindings* GetBindings() const { return mpBindings; }
PageStylesPanel(
vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame);
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
SfxBindings* pBindings);
virtual ~PageStylesPanel();
virtual void dispose() override;
private:
SfxBindings* mpBindings;
::std::unique_ptr<SfxInt16Item> mpPageColumnItem;
::std::unique_ptr<SvxPageItem> mpPageItem;
::std::unique_ptr<XFillStyleItem> mpBgFillStyleItem;
::std::unique_ptr<XFillColorItem> mpBgColorItem;
::std::unique_ptr<XFillGradientItem> mpBgGradientItem;
::std::unique_ptr<XFillHatchItem> mpBgHatchItem;
::std::unique_ptr<XFillBitmapItem> mpBgBitmapItem;
::sfx2::sidebar::ControllerItem maPageColumnControl;
::sfx2::sidebar::ControllerItem maPageNumFormatControl;
::sfx2::sidebar::ControllerItem maBgColorControl;
::sfx2::sidebar::ControllerItem maBgHatchingControl;
::sfx2::sidebar::ControllerItem maBgGradientControl;
::sfx2::sidebar::ControllerItem maBgBitmapControl;
::sfx2::sidebar::ControllerItem maBgFillStyleControl;
VclPtr<ColorLB> mpBgColorLB;
VclPtr<SvxFillAttrBox> mpBgHatchingLB;
VclPtr<ColorLB> mpBgGradientLB;
VclPtr<SvxFillAttrBox> mpBgBitmapLB;
VclPtr<ListBox> mpLayoutSelectLB;
VclPtr<ListBox> mpColumnCount;
VclPtr<PageNumberListBox> mpNumberSelectLB;
VclPtr<SvxFillTypeBox> mpBgFillType;
VclPtr<FixedText> mpCustomEntry;
OUString aCustomEntry;
void Initialize();
void Update();
Color GetColorSetOrDefault();
XGradient GetGradientSetOrDefault();
const OUString GetHatchingSetOrDefault();
const OUString GetBitmapSetOrDefault();
DECL_LINK_TYPED( ModifyColumnCountHdl, ListBox&, void );
DECL_LINK_TYPED( ModifyNumberingHdl, ListBox&, void );
DECL_LINK_TYPED( ModifyLayoutHdl, ListBox&, void );
DECL_LINK_TYPED( ModifyFillStyleHdl, ListBox&, void );
DECL_LINK_TYPED( ModifyFillColorHdl, ListBox&, void );
};
} } //end of namespace sw::sidebar
......
......@@ -135,7 +135,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
}
else if(rsResourceURL.endsWith("/PageStylesPanel"))
{
VclPtr<vcl::Window> pPanel = sw::sidebar::PageStylesPanel::Create( pParentWindow, xFrame );
VclPtr<vcl::Window> pPanel = sw::sidebar::PageStylesPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
......
......@@ -32,6 +32,8 @@
#include <svl/eitem.hxx>
#include <svl/whiter.hxx>
#include <svx/ruler.hxx>
#include <svx/xfillit.hxx>
#include <svx/xfillit0.hxx>
#include <editeng/protitem.hxx>
#include <svl/rectitem.hxx>
#include <sfx2/bindings.hxx>
......@@ -1086,6 +1088,68 @@ void SwView::ExecTabWin( SfxRequest& rReq )
}
break;
case SID_ATTR_PAGE_COLOR:
case SID_ATTR_PAGE_FILLSTYLE:
case SID_ATTR_PAGE_GRADIENT:
case SID_ATTR_PAGE_HATCH:
case SID_ATTR_PAGE_BITMAP:
{
if(pReqArgs)
{
SwPageDesc aDesc(rDesc);
SwFrameFormat &rMaster = aDesc.GetMaster();
switch (nSlot)
{
case(SID_ATTR_PAGE_FILLSTYLE):
{
XFillStyleItem aFSItem( static_cast<const XFillStyleItem&>(pReqArgs->Get( XATTR_FILLSTYLE )) );
drawing::FillStyle eXFS = aFSItem.GetValue();
if ( eXFS == drawing::FillStyle_NONE )
rMaster.SetFormatAttr( XFillStyleItem( eXFS ) );
}
break;
case(SID_ATTR_PAGE_COLOR):
{
XFillColorItem aColorItem( static_cast<const XFillColorItem&>(pReqArgs->Get( XATTR_FILLCOLOR )) );
rMaster.SetFormatAttr( XFillStyleItem( drawing::FillStyle_SOLID ) );
rMaster.SetFormatAttr( XFillColorItem( aColorItem ));
}
break;
case(SID_ATTR_PAGE_GRADIENT):
{
XFillGradientItem aGradientItem( static_cast<const XFillGradientItem&>(pReqArgs->Get( XATTR_FILLGRADIENT )) );
rMaster.SetFormatAttr( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
rMaster.SetFormatAttr( XFillGradientItem( aGradientItem ) );
}
break;
case(SID_ATTR_PAGE_HATCH):
{
XFillHatchItem aHatchItem( static_cast<const XFillHatchItem&>(pReqArgs->Get( XATTR_FILLHATCH )) );
rMaster.SetFormatAttr( XFillStyleItem( drawing::FillStyle_HATCH ) );
rMaster.SetFormatAttr( XFillHatchItem( aHatchItem ));
}
break;
case(SID_ATTR_PAGE_BITMAP):
{
XFillBitmapItem aBitmapItem( static_cast<const XFillBitmapItem&>(pReqArgs->Get( XATTR_FILLBITMAP )) );
rMaster.SetFormatAttr( XFillStyleItem( drawing::FillStyle_BITMAP ) );
rMaster.SetFormatAttr( XFillBitmapItem( aBitmapItem ));
}
break;
default:
break;
}
rSh.ChgPageDesc(rSh.GetCurPageDesc(), aDesc);
}
}
break;
default:
OSL_ENSURE( false, "wrong SlotId");
}
......@@ -2150,6 +2214,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
}
}
break;
case SID_ATTR_PAGE_HEADER:
case SID_ATTR_PAGE_HEADER_LRMARGIN:
case SID_ATTR_PAGE_HEADER_SPACING:
......@@ -2202,6 +2267,65 @@ void SwView::StateTabWin(SfxItemSet& rSet)
}
}
break;
case SID_ATTR_PAGE_COLOR:
case SID_ATTR_PAGE_FILLSTYLE:
case SID_ATTR_PAGE_GRADIENT:
case SID_ATTR_PAGE_HATCH:
case SID_ATTR_PAGE_BITMAP:
{
SfxItemSet aSet = rDesc.GetMaster().GetAttrSet();
drawing::FillStyle eXFS = (drawing::FillStyle) ( static_cast<const XFillStyleItem*>(
aSet.GetItem(XATTR_FILLSTYLE) )->GetValue() );
XFillStyleItem aFillStyleItem( eXFS );
aFillStyleItem.SetWhich( SID_ATTR_PAGE_FILLSTYLE );
rSet.Put(aFillStyleItem);
switch(eXFS)
{
case (drawing::FillStyle_SOLID):
{
Color aColor = static_cast<const XFillColorItem*>( aSet.GetItem( XATTR_FILLCOLOR, false ) )->GetColorValue();
XFillColorItem aFillColorItem( OUString(), aColor );
aFillColorItem.SetWhich( SID_ATTR_PAGE_COLOR );
rSet.Put( aFillColorItem );
}
break;
case (drawing::FillStyle_GRADIENT):
{
const XGradient& xGradient = static_cast<const XFillGradientItem*>( aSet.GetItem( XATTR_FILLGRADIENT ) )->GetGradientValue();
XFillGradientItem aFillGradientItem( OUString(), xGradient, SID_ATTR_PAGE_GRADIENT );
rSet.Put( aFillGradientItem );
}
break;
case (drawing::FillStyle_HATCH):
{
const XFillHatchItem *pFillHatchItem( static_cast<const XFillHatchItem*>( aSet.GetItem( XATTR_FILLHATCH ) ) );
XFillHatchItem aFillHatchItem( pFillHatchItem->GetName(), pFillHatchItem->GetHatchValue());
aFillHatchItem.SetWhich( SID_ATTR_PAGE_HATCH );
rSet.Put( aFillHatchItem );
}
break;
case (drawing::FillStyle_BITMAP):
{
const XFillBitmapItem *pFillBitmapItem = static_cast<const XFillBitmapItem*>( aSet.GetItem( XATTR_FILLBITMAP ) );
XFillBitmapItem aFillBitmapItem( pFillBitmapItem->GetName(), pFillBitmapItem->GetGraphicObject() );
aFillBitmapItem.SetWhich( SID_ATTR_PAGE_BITMAP );
rSet.Put( aFillBitmapItem );
}
break;
case (drawing::FillStyle_NONE):
{
}
break;
default:
break;
}
}
break;
}
nWhich = aIter.NextWhich();
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<requires lib="gtk+" version="3.0"/>
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkListStore" id="liststorePageLayout">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
<!-- column-name gint1 -->
<column type="gint"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Right and left</col>
<col id="1">0</col>
</row>
<row>
<col id="0" translatable="yes">Mirrored</col>
<col id="1">0</col>
</row>
<row>
<col id="0" translatable="yes">Only right</col>
<col id="1">0</col>
</row>
<row>
<col id="0" translatable="yes">Only left</col>
<col id="1">0</col>
</row>
</data>
</object>
<object class="GtkGrid" id="PageStylesPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -13,107 +40,193 @@
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="numberslabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Number:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="backgroundlabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Background:</property>
</object>
<packing>
<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="svxcorelo-PageNumberListBox" id="numberbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="layoutlabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Layout:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="top_attach">6</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>