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

tdf#83830: Use samecontentlistbox in Header/Footer Panel

Change-Id: Ib24f6e6ac91859467f105c4db9b094454443ff9d
Reviewed-on: https://gerrit.libreoffice.org/28218Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 4ef79854
......@@ -1085,9 +1085,10 @@
#define RID_SVXSTRARY_PAPERSIZE_DRAW (RID_SVX_START + 1396)
#define RID_SVXSTRARY_PAGE_NUMBERING (RID_SVX_START + 1397)
#define RID_SVXSTRARY_SPACING (RID_SVX_START + 1398)
#define RID_SVXSTRARY_SAMECONTENT (RID_SVX_START + 1399)
// !!! IMPORTANT: consider and update RID_SVXSTR_NEXTFREE when introducing new RIDs for Strings !!!
#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1399)
#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1400)
// 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_SAMECONTENTLISTBOXHELPER_HXX
#define INCLUDED_SVX_SAMECONTENTLISTBOXHELPER_HXX
#include <svx/svxdllapi.h>
#include <vcl/lstbox.hxx>
/// Custom Widget ListBox to hold entries for SameContent setting of Header/Footer
class SVX_DLLPUBLIC SameContentListBox : public ListBox
{
public:
SameContentListBox( vcl::Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN );
Size GetOptimalSize() const override;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
......@@ -50,6 +50,7 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\
svx/source/dialog/prtqry.src \
svx/source/dialog/ruler.src \
svx/source/dialog/spacing.src \
svx/source/dialog/samecontent.src \
svx/source/dialog/sdstring.src \
svx/source/dialog/srchdlg.src \
svx/source/dialog/svxbmpnumvalueset.src \
......
......@@ -120,6 +120,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/dialog/langbox \
svx/source/dialog/pagenumberlistbox \
svx/source/dialog/papersizelistbox \
svx/source/dialog/samecontentlistbox \
svx/source/dialog/spacinglistbox \
svx/source/dialog/stddlg \
svx/source/dialog/svxdlg \
......
#include <svx/dialogs.hrc>
StringArray RID_SVXSTRARY_SAMECONTENT
{
ItemList [ en-US ] =
{
< "All Pages" ; 0; > ;
< "First Page" ; 1; > ;
< "Left and Right Pages" ; 2; > ;
< "First, Left and Right Pages" ; 3; > ;
};
};
\ 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/samecontentlistbox.hxx>
#include <tools/resary.hxx>
#include <vcl/builderfactory.hxx>
SameContentListBox::SameContentListBox(vcl::Window* pParent, WinBits nStyle)
: ListBox( pParent, nStyle)
{
ResStringArray aSameContentAry( SVX_RES( RID_SVXSTRARY_SAMECONTENT ) );
sal_uInt32 nCnt = aSameContentAry.Count();
for ( sal_uInt32 i = 0; i < nCnt; ++i )
{
OUString aStr = aSameContentAry.GetString(i);
sal_uInt16 nData = aSameContentAry.GetValue(i);
sal_Int32 nPos = InsertEntry( aStr );
SetEntryData( nPos, reinterpret_cast<void*>((sal_uLong)nData) );
}
SetDropDownLineCount(8);
SelectEntryPos(0);
}
VCL_BUILDER_FACTORY(SameContentListBox);
Size SameContentListBox::GetOptimalSize() const
{
return Size(150, ListBox::GetOptimalSize().Height());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -44,6 +44,7 @@
#include <svl/poolitem.hxx>
#include <svl/eitem.hxx>
#include <svx/spacinglistbox.hxx>
#include <svx/samecontentlistbox.hxx>
namespace sw { namespace sidebar {
......@@ -83,7 +84,7 @@ private:
VclPtr<CheckBox> mpFooterToggle;
VclPtr<SpacingListBox> mpFooterSpacingLB;
VclPtr<SpacingListBox> mpFooterMarginPresetLB;
VclPtr<ListBox> mpFooterLayoutLB;
VclPtr<SameContentListBox> mpFooterLayoutLB;
VclPtr<FixedText> mpCustomEntry;
OUString aCustomEntry;
......
......@@ -44,6 +44,7 @@
#include <svl/poolitem.hxx>
#include <svl/eitem.hxx>
#include <svx/spacinglistbox.hxx>
#include <svx/samecontentlistbox.hxx>
namespace sw { namespace sidebar {
......@@ -83,7 +84,7 @@ private:
VclPtr<CheckBox> mpHeaderToggle;
VclPtr<SpacingListBox> mpHeaderSpacingLB;
VclPtr<SpacingListBox> mpHeaderMarginPresetLB;
VclPtr<ListBox> mpHeaderLayoutLB;
VclPtr<SameContentListBox> mpHeaderLayoutLB;
VclPtr<FixedText> mpCustomEntry;
OUString aCustomEntry;
......
......@@ -93,7 +93,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="model">spacinglist</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -105,7 +104,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="model">spacinglist</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -113,17 +111,10 @@
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="samecontentLB">
<property name="width_request">150</property>
<object class="svxcorelo-SameContentListBox" id="samecontentLB">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<items>
<item translatable="yes">All Pages</item>
<item translatable="yes">First Page</item>
<item translatable="yes">Left and Right Pages</item>
<item translatable="yes">First, Left and Right Pages</item>
</items>
</object>
<packing>
<property name="left_attach">1</property>
......
......@@ -93,7 +93,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="model">spacinglist</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -105,7 +104,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="model">spacinglist</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -113,17 +111,10 @@
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="samecontentLB">
<property name="width_request">150</property>
<object class="svxcorelo-SameContentListBox" id="samecontentLB">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<items>
<item translatable="yes">All Pages</item>
<item translatable="yes">First Page</item>
<item translatable="yes">Left and Right Pages</item>
<item translatable="yes">First, Left and Right Pages</item>
</items>
</object>
<packing>
<property name="left_attach">1</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment