Kaydet (Commit) b845be87 authored tarafından Eike Rathke's avatar Eike Rathke

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
üst 9dba4947
...@@ -23,12 +23,14 @@ StringArray RID_SVXSTRARY_PAGE_NUMBERING ...@@ -23,12 +23,14 @@ StringArray RID_SVXSTRARY_PAGE_NUMBERING
{ {
ItemList [ en-US ] = 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 */; > ; < "1, 2, 3, ..." ; 4/*SVX_NUM_ARABIC */; > ;
< "A, B, C, ..." ; 0/*SVX_NUM_CHARS_UPPER_LETTER */; > ; < "A, B, C, ..." ; 0/*SVX_NUM_CHARS_UPPER_LETTER */; > ;
< "a, b, c, ..." ; 1/*SVX_NUM_CHARS_LOWER_LETTER */; > ; < "a, b, c, ..." ; 1/*SVX_NUM_CHARS_LOWER_LETTER */; > ;
< "I, II, III, ..." ; 2/*SVX_NUM_ROMAN_UPPER */; > ; < "I, II, III, ..." ; 2/*SVX_NUM_ROMAN_UPPER */; > ;
< "i, ii, iii, ..." ; 3/*SVX_NUM_ROMAN_LOWER */; > ; < "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, ..." ; 9/*SVX_NUM_CHARS_UPPER_LETTER_N*/; > ;
< "a, .., aa, .., aaa, ..." ; 10/*SVX_NUM_CHARS_LOWER_LETTER_N*/; > ; < "a, .., aa, .., aaa, ..." ; 10/*SVX_NUM_CHARS_LOWER_LETTER_N*/; > ;
< "Native Numbering" ; 12 /*NATIVE_NUMBERING */; > ; < "Native Numbering" ; 12 /*NATIVE_NUMBERING */; > ;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <svx/pagenumberlistbox.hxx> #include <svx/pagenumberlistbox.hxx>
#include <tools/resary.hxx> #include <tools/resary.hxx>
#include <vcl/builderfactory.hxx> #include <vcl/builderfactory.hxx>
#include <com/sun/star/style/NumberingType.hpp>
PageNumberListBox::PageNumberListBox(vcl::Window* pParent) PageNumberListBox::PageNumberListBox(vcl::Window* pParent)
: ListBox( pParent, WB_BORDER | WB_DROPDOWN) : ListBox( pParent, WB_BORDER | WB_DROPDOWN)
...@@ -30,11 +31,22 @@ PageNumberListBox::PageNumberListBox(vcl::Window* pParent) ...@@ -30,11 +31,22 @@ PageNumberListBox::PageNumberListBox(vcl::Window* pParent)
for ( sal_uInt32 i = 0; i < nCnt; ++i ) for ( sal_uInt32 i = 0; i < nCnt; ++i )
{ {
OUString aStr = aPaperAry.GetString(i);
sal_uInt16 nData = aPaperAry.GetValue(i); sal_uInt16 nData = aPaperAry.GetValue(i);
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 ); sal_Int32 nPos = InsertEntry( aStr );
SetEntryData( nPos, reinterpret_cast<void*>((sal_uLong)nData) ); SetEntryData( nPos, reinterpret_cast<void*>((sal_uLong)nData) );
} }
}
}
SetDropDownLineCount(6); SetDropDownLineCount(6);
} }
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include <sfx2/objsh.hxx> #include <sfx2/objsh.hxx>
#include <sfx2/linkmgr.hxx> #include <sfx2/linkmgr.hxx>
#include <sfx2/app.hxx> #include <sfx2/app.hxx>
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
#include <basic/basmgr.hxx> #include <basic/basmgr.hxx>
#include <editeng/langitem.hxx> #include <editeng/langitem.hxx>
#include <svl/macitem.hxx> #include <svl/macitem.hxx>
...@@ -592,8 +594,7 @@ OUString SwFieldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const ...@@ -592,8 +594,7 @@ OUString SwFieldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const
{ {
if(xNumberingInfo.is()) if(xNumberingInfo.is())
{ {
SwOLENames aNames(SW_RES(STRRES_NUMTYPES)); ResStringArray aNames( SVX_RES( RID_SVXSTRARY_PAGE_NUMBERING ));
ResStringArray& rNames = aNames.GetNames();
Sequence<sal_Int16> aTypes = xNumberingInfo->getSupportedNumberingTypes(); Sequence<sal_Int16> aTypes = xNumberingInfo->getSupportedNumberingTypes();
const sal_Int16* pTypes = aTypes.getConstArray(); const sal_Int16* pTypes = aTypes.getConstArray();
...@@ -606,10 +607,10 @@ OUString SwFieldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const ...@@ -606,10 +607,10 @@ OUString SwFieldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const
{ {
if(nValidEntry == ((sal_Int32)nFormatId) - nOffset) 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) if (n != RESARRAY_INDEX_NOTFOUND)
{ {
aRet = rNames.GetString(n); aRet = aNames.GetString(n);
} }
else else
{ {
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <com/sun/star/text/XNumberingTypeInfo.hpp> #include <com/sun/star/text/XNumberingTypeInfo.hpp>
#include <vcl/builderfactory.hxx> #include <vcl/builderfactory.hxx>
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
#include <unomid.h> #include <unomid.h>
...@@ -87,11 +89,10 @@ void SwNumberingTypeListBox::Reload(SwInsertNumTypes nTypeFlags) ...@@ -87,11 +89,10 @@ void SwNumberingTypeListBox::Reload(SwInsertNumTypes nTypeFlags)
pTypes = aTypes.getConstArray(); pTypes = aTypes.getConstArray();
} }
} }
SwOLENames aNames(SW_RES(STRRES_NUMTYPES)); ResStringArray aNames( SVX_RES( RID_SVXSTRARY_PAGE_NUMBERING ));
ResStringArray& rNames = aNames.GetNames(); for(size_t i = 0; i < aNames.Count(); i++)
for(size_t i = 0; i < rNames.Count(); i++)
{ {
sal_IntPtr nValue = rNames.GetValue(i); sal_IntPtr nValue = aNames.GetValue(i);
bool bInsert = true; bool bInsert = true;
sal_Int32 nPos = LISTBOX_APPEND; sal_Int32 nPos = LISTBOX_APPEND;
switch(nValue) switch(nValue)
...@@ -133,7 +134,7 @@ void SwNumberingTypeListBox::Reload(SwInsertNumTypes nTypeFlags) ...@@ -133,7 +134,7 @@ void SwNumberingTypeListBox::Reload(SwInsertNumTypes nTypeFlags)
} }
if(bInsert) if(bInsert)
{ {
sal_Int32 nEntry = InsertEntry(rNames.GetString(i), nPos); sal_Int32 nEntry = InsertEntry(aNames.GetString(i), nPos);
SetEntryData( nEntry, reinterpret_cast<void*>(nValue) ); SetEntryData( nEntry, reinterpret_cast<void*>(nValue) );
} }
} }
......
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