summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-12-13 18:44:34 +0100
committerEike Rathke <erack@redhat.com>2016-12-13 18:45:37 +0100
commitb845be872cd3fc6b4dc0e6175675a9b31ef7fc42 (patch)
treec0efed52356fffb3c42a2ba49f147850fca0a893
parent9dba49471f289f68853ee6a5a7301cdc2cdf78a8 (diff)
use RID_SVXSTRARY_PAGE_NUMBERING StringArray also in Writer
... and add the two missing extra strings from sw/source/ui/misc/numberingtypelistbox.src to svx/source/dialog/pagenumbering.src and filter them out for the page number dialog, so later we can get rid of yet a 3rd place where those strings are to be translated and maintained. Change-Id: If7d124692c752f341d4ea11a8914b099f711fa10
-rw-r--r--svx/source/dialog/pagenumbering.src4
-rw-r--r--svx/source/dialog/pagenumberlistbox.cxx18
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx9
-rw-r--r--sw/source/uibase/misc/numberingtypelistbox.cxx11
4 files changed, 29 insertions, 13 deletions
diff --git a/svx/source/dialog/pagenumbering.src b/svx/source/dialog/pagenumbering.src
index c3b8852904e0..2c3a001912a5 100644
--- a/svx/source/dialog/pagenumbering.src
+++ b/svx/source/dialog/pagenumbering.src
@@ -23,12 +23,14 @@ StringArray RID_SVXSTRARY_PAGE_NUMBERING
{
ItemList [ en-US ] =
{
+ < "None" ; 5/*SVX_NUM_NUMBER_NONE */; > ;
+ < "Bullet" ; 6/*SVX_NUM_CHAR_SPECIAL */; > ;
+ < "Graphics" ; 8/*SVX_NUM_BITMAP */; > ;
< "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 */; > ;
diff --git a/svx/source/dialog/pagenumberlistbox.cxx b/svx/source/dialog/pagenumberlistbox.cxx
index d02767afa4a6..94a95854f0cd 100644
--- a/svx/source/dialog/pagenumberlistbox.cxx
+++ b/svx/source/dialog/pagenumberlistbox.cxx
@@ -21,6 +21,7 @@
#include <svx/pagenumberlistbox.hxx>
#include <tools/resary.hxx>
#include <vcl/builderfactory.hxx>
+#include <com/sun/star/style/NumberingType.hpp>
PageNumberListBox::PageNumberListBox(vcl::Window* pParent)
: ListBox( pParent, WB_BORDER | WB_DROPDOWN)
@@ -30,10 +31,21 @@ PageNumberListBox::PageNumberListBox(vcl::Window* pParent)
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) );
+ switch (nData)
+ {
+ // String list array is also used in Writer and contains strings
+ // for Bullet and Graphics, ignore those here.
+ case css::style::NumberingType::CHAR_SPECIAL:
+ case css::style::NumberingType::BITMAP:
+ break;
+ default:
+ {
+ OUString aStr = aPaperAry.GetString(i);
+ sal_Int32 nPos = InsertEntry( aStr );
+ SetEntryData( nPos, reinterpret_cast<void*>((sal_uLong)nData) );
+ }
+ }
}
SetDropDownLineCount(6);
}
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index 006b9587a5fc..600b544999ab 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -39,6 +39,8 @@
#include <sfx2/objsh.hxx>
#include <sfx2/linkmgr.hxx>
#include <sfx2/app.hxx>
+#include <svx/dialmgr.hxx>
+#include <svx/dialogs.hrc>
#include <basic/basmgr.hxx>
#include <editeng/langitem.hxx>
#include <svl/macitem.hxx>
@@ -592,8 +594,7 @@ OUString SwFieldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const
{
if(xNumberingInfo.is())
{
- SwOLENames aNames(SW_RES(STRRES_NUMTYPES));
- ResStringArray& rNames = aNames.GetNames();
+ ResStringArray aNames( SVX_RES( RID_SVXSTRARY_PAGE_NUMBERING ));
Sequence<sal_Int16> aTypes = xNumberingInfo->getSupportedNumberingTypes();
const sal_Int16* pTypes = aTypes.getConstArray();
@@ -606,10 +607,10 @@ OUString SwFieldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const
{
if(nValidEntry == ((sal_Int32)nFormatId) - nOffset)
{
- sal_uInt32 n = rNames.FindIndex(pTypes[nType]);
+ sal_uInt32 n = aNames.FindIndex(pTypes[nType]);
if (n != RESARRAY_INDEX_NOTFOUND)
{
- aRet = rNames.GetString(n);
+ aRet = aNames.GetString(n);
}
else
{
diff --git a/sw/source/uibase/misc/numberingtypelistbox.cxx b/sw/source/uibase/misc/numberingtypelistbox.cxx
index a0eeb5182d17..32b4eff4b689 100644
--- a/sw/source/uibase/misc/numberingtypelistbox.cxx
+++ b/sw/source/uibase/misc/numberingtypelistbox.cxx
@@ -26,6 +26,8 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/text/XNumberingTypeInfo.hpp>
#include <vcl/builderfactory.hxx>
+#include <svx/dialmgr.hxx>
+#include <svx/dialogs.hrc>
#include <unomid.h>
@@ -87,11 +89,10 @@ void SwNumberingTypeListBox::Reload(SwInsertNumTypes nTypeFlags)
pTypes = aTypes.getConstArray();
}
}
- SwOLENames aNames(SW_RES(STRRES_NUMTYPES));
- ResStringArray& rNames = aNames.GetNames();
- for(size_t i = 0; i < rNames.Count(); i++)
+ ResStringArray aNames( SVX_RES( RID_SVXSTRARY_PAGE_NUMBERING ));
+ for(size_t i = 0; i < aNames.Count(); i++)
{
- sal_IntPtr nValue = rNames.GetValue(i);
+ sal_IntPtr nValue = aNames.GetValue(i);
bool bInsert = true;
sal_Int32 nPos = LISTBOX_APPEND;
switch(nValue)
@@ -133,7 +134,7 @@ void SwNumberingTypeListBox::Reload(SwInsertNumTypes nTypeFlags)
}
if(bInsert)
{
- sal_Int32 nEntry = InsertEntry(rNames.GetString(i), nPos);
+ sal_Int32 nEntry = InsertEntry(aNames.GetString(i), nPos);
SetEntryData( nEntry, reinterpret_cast<void*>(nValue) );
}
}