summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorSusobhan Ghosh <susobhang70@gmail.com>2016-08-18 18:51:58 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-08-29 13:18:12 +0000
commit8393d4642273bfb3eb0cd0b68157e2b8674b70df (patch)
treee896339cebf19b6479e58d58cced7739cb87889b /svx
parent4ef79854ea1219186296480d69fb10b05d1810c3 (diff)
tdf#83830: Use samecontentlistbox in Header/Footer Panel
Change-Id: Ib24f6e6ac91859467f105c4db9b094454443ff9d Reviewed-on: https://gerrit.libreoffice.org/28218 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'svx')
-rw-r--r--svx/AllLangResTarget_svx.mk1
-rw-r--r--svx/Library_svxcore.mk1
-rw-r--r--svx/source/dialog/samecontent.src12
-rw-r--r--svx/source/dialog/samecontentlistbox.cxx48
4 files changed, 62 insertions, 0 deletions
diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk
index c7ee81f9748c..c56a5cea95e2 100644
--- a/svx/AllLangResTarget_svx.mk
+++ b/svx/AllLangResTarget_svx.mk
@@ -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 \
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 228c8f32e43c..a3fdf0274a63 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -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 \
diff --git a/svx/source/dialog/samecontent.src b/svx/source/dialog/samecontent.src
new file mode 100644
index 000000000000..38666d4c6503
--- /dev/null
+++ b/svx/source/dialog/samecontent.src
@@ -0,0 +1,12 @@
+#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
diff --git a/svx/source/dialog/samecontentlistbox.cxx b/svx/source/dialog/samecontentlistbox.cxx
new file mode 100644
index 000000000000..83f42b2cd08b
--- /dev/null
+++ b/svx/source/dialog/samecontentlistbox.cxx
@@ -0,0 +1,48 @@
+/* -*- 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: */