[Libreoffice-commits] core.git: 3 commits - sw/source
Ivan Timofeev
timofeev.i.s at gmail.com
Fri Jul 26 08:12:34 PDT 2013
sw/source/ui/dochdl/gloshdl.cxx | 10 ++--
sw/source/ui/inc/gloslst.hxx | 27 ++++++-----
sw/source/ui/inc/workctrl.hxx | 4 -
sw/source/ui/ribbar/workctrl.cxx | 39 +++++++---------
sw/source/ui/shells/textglos.cxx | 12 ++---
sw/source/ui/utlui/gloslst.cxx | 93 ++++++++++++++++++++++-----------------
6 files changed, 99 insertions(+), 86 deletions(-)
New commits:
commit 4a1c808b95c9a62f6ecf8ae3c20218ef85a9261e
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Fri Jul 26 18:59:27 2013 +0400
String -> OUString
Change-Id: I244de2137f6a7b26f21de24ff9273c5c3672d12e
diff --git a/sw/source/ui/inc/workctrl.hxx b/sw/source/ui/inc/workctrl.hxx
index 1c7b231..be38a29 100644
--- a/sw/source/ui/inc/workctrl.hxx
+++ b/sw/source/ui/inc/workctrl.hxx
@@ -151,7 +151,7 @@ class SwScrollNaviPopup : public SfxPopupWindow
FixedInfo aInfoField;
ImageList aIList;
- String sQuickHelp[2 * NID_COUNT];
+ OUString sQuickHelp[2 * NID_COUNT];
void ApplyImageList();
@@ -179,7 +179,7 @@ class SwNaviImageButton : public ImageButton
{
SwScrollNaviPopup* pPopup;
Image aImage;
- String sQuickText;
+ OUString sQuickText;
SfxPopupWindow* pPopupWindow;
SfxPopupWindow* pFloatingWindow;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index c925aed..69cded2 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -467,13 +467,13 @@ SwScrollNaviPopup::SwScrollNaviPopup( sal_uInt16 nId, const Reference< XFrame >&
for( i = 0; i < NID_COUNT; i++)
{
sal_uInt16 nNaviId = aNavigationInsertIds[i];
- String sText;
+ OUString sText;
ToolBoxItemBits nTbxBits = 0;
if((NID_PREV != nNaviId) && (NID_NEXT != nNaviId))
{
// -2, there's no string for Next/Prev
sal_uInt16 nResStr = ST_TBL - 2 + nNaviId - NID_START;
- sText = String(SW_RES(nResStr));
+ sText = SW_RESSTR(nResStr);
nTbxBits = TIB_CHECKABLE;
}
aToolBox.InsertItem(nNaviId, sText, nTbxBits);
@@ -487,7 +487,7 @@ SwScrollNaviPopup::SwScrollNaviPopup( sal_uInt16 nId, const Reference< XFrame >&
// these are global strings
for( i = 0; i < 2 * NID_COUNT; i++)
{
- sQuickHelp[i] = String(SW_RES(STR_IMGBTN_START + i));
+ sQuickHelp[i] = SW_RESSTR(STR_IMGBTN_START + i);
}
Size aImgSize = aIList.GetImageSize();
@@ -595,7 +595,7 @@ String SwScrollNaviPopup::GetQuickHelpText(sal_Bool bNext)
nResId += SwView::GetMoveType() - NID_START;
if(!bNext)
nResId += NID_COUNT;
- return String(SW_RES(nResId));
+ return SW_RESSTR(nResId);
}
void SwNaviImageButton::Click()
@@ -660,7 +660,7 @@ SwNaviImageButton::SwNaviImageButton(
ImageButton(pParent, SW_RES(BTN_NAVI)),
pPopup(0),
aImage(SW_RES(IMG_BTN)),
- sQuickText(SW_RES(ST_QUICK)),
+ sQuickText(SW_RESSTR(ST_QUICK)),
pPopupWindow(0),
pFloatingWindow(0),
m_xFrame( rFrame )
@@ -715,8 +715,7 @@ SwZoomBox_Impl::SwZoomBox_Impl(
{ 25, 50, 75, 100, 150, 200 };
for(sal_uInt16 i = 0; i < sizeof(aZoomValues)/sizeof(sal_uInt16); i++)
{
- String sEntry = OUString::number(aZoomValues[i]);
- sEntry += '%';
+ OUString sEntry = OUString::number(aZoomValues[i]) + "%";
InsertEntry(sEntry);
}
}
@@ -728,8 +727,8 @@ void SwZoomBox_Impl::Select()
{
if ( !IsTravelSelect() )
{
- String sEntry(comphelper::string::remove(GetText(), '%'));
- sal_uInt16 nZoom = (sal_uInt16)sEntry.ToInt32();
+ OUString sEntry(comphelper::string::remove(GetText(), '%'));
+ sal_uInt16 nZoom = (sal_uInt16)sEntry.toInt32();
if(nZoom < MINZOOM)
nZoom = MINZOOM;
if(nZoom > MAXZOOM)
@@ -831,8 +830,8 @@ void SwPreviewZoomControl::StateChanged( sal_uInt16 /*nSID*/,
SwZoomBox_Impl* pBox = (SwZoomBox_Impl*)GetToolBox().GetItemWindow( GetId() );
if(SFX_ITEM_AVAILABLE <= eState)
{
- String sZoom(OUString::number(((const SfxUInt16Item*)pState)->GetValue()));
- sZoom += '%';
+ OUString sZoom(OUString::number(((const SfxUInt16Item*)pState)->GetValue()));
+ sZoom += "%";
pBox->SetText(sZoom);
pBox->SaveValue();
}
diff --git a/sw/source/ui/shells/textglos.cxx b/sw/source/ui/shells/textglos.cxx
index b1dbb1c..89d02ed 100644
--- a/sw/source/ui/shells/textglos.cxx
+++ b/sw/source/ui/shells/textglos.cxx
@@ -63,11 +63,11 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
case FN_NEW_GLOSSARY:
if(pItem && pArgs->Count() == 3 )
{
- String aGroup = (( const SfxStringItem *)pItem)->GetValue();
- String aName;
+ OUString aGroup = (( const SfxStringItem *)pItem)->GetValue();
+ OUString aName;
if(SFX_ITEM_SET == pArgs->GetItemState(FN_PARAM_1, sal_False, &pItem ))
aName = (( const SfxStringItem *)pItem)->GetValue();
- String aShortName;
+ OUString aShortName;
if(SFX_ITEM_SET == pArgs->GetItemState(FN_PARAM_2, sal_False, &pItem ))
aShortName = (( const SfxStringItem *)pItem)->GetValue();
@@ -86,7 +86,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
case FN_SET_ACT_GLOSSARY:
if(pItem)
{
- String aGroup = (( const SfxStringItem *)pItem)->GetValue();
+ OUString aGroup = (( const SfxStringItem *)pItem)->GetValue();
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc();
@@ -99,8 +99,8 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
{
if(pItem && pArgs->Count() > 1)
{
- String aGroup = (( const SfxStringItem *)pItem)->GetValue();
- String aName;
+ OUString aGroup = (( const SfxStringItem *)pItem)->GetValue();
+ OUString aName;
if(SFX_ITEM_SET == pArgs->GetItemState(FN_PARAM_1, sal_False, &pItem ))
aName = (( const SfxStringItem *)pItem)->GetValue();
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
commit 3d1360baba19a968791c683c4c5e0c9ce04fd880
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Fri Jul 26 18:47:04 2013 +0400
String -> OUString, sal_Bool -> bool
Change-Id: I078599f1c109f85ff6ba5895c31912d5def98c27
diff --git a/sw/source/ui/inc/gloslst.hxx b/sw/source/ui/inc/gloslst.hxx
index 100b301..aa9f6d4 100644
--- a/sw/source/ui/inc/gloslst.hxx
+++ b/sw/source/ui/inc/gloslst.hxx
@@ -30,11 +30,11 @@ class vector;
struct AutoTextGroup
{
- sal_uInt16 nCount;
- String sName;
- String sTitle;
- String sLongNames; // by 0x0A separated long names
- String sShortNames; // by 0x0A separated short names
+ sal_uInt16 nCount;
+ OUString sName;
+ OUString sTitle;
+ OUString sLongNames; // by 0x0A separated long names
+ OUString sShortNames; // by 0x0A separated short names
DateTime aDateModified;
AutoTextGroup() : aDateModified( DateTime::EMPTY ) {}
@@ -46,10 +46,10 @@ typedef std::vector<AutoTextGroup*> AutoTextGroups;
class SwGlossaryList : public AutoTimer
{
AutoTextGroups aGroupArr;
- String sPath;
- sal_Bool bFilled;
+ OUString sPath;
+ bool bFilled;
- AutoTextGroup* FindGroup(const String& rGroupName);
+ AutoTextGroup* FindGroup(const OUString& rGroupName);
void FillGroup(AutoTextGroup* pGroup, SwGlossaries* pGloss);
public:
diff --git a/sw/source/ui/utlui/gloslst.cxx b/sw/source/ui/utlui/gloslst.cxx
index 0775d31..eab56d3 100644
--- a/sw/source/ui/utlui/gloslst.cxx
+++ b/sw/source/ui/utlui/gloslst.cxx
@@ -94,7 +94,7 @@ IMPL_LINK_NOARG(SwGlossDecideDlg, SelectHdl)
}
SwGlossaryList::SwGlossaryList() :
- bFilled(sal_False)
+ bFilled(false)
{
SvtPathOptions aPathOpt;
sPath = aPathOpt.GetAutoTextPath();
@@ -128,14 +128,14 @@ sal_Bool SwGlossaryList::GetShortName(const String& rLongName,
for(sal_uInt16 j = 0; j < pGroup->nCount; j++)
{
- String sLong = pGroup->sLongNames.GetToken(j, STRING_DELIM);
+ OUString sLong = pGroup->sLongNames.getToken(j, STRING_DELIM);
if(rLongName != sLong)
continue;
TripleString pTriple;
pTriple.sGroup = pGroup->sName;
pTriple.sBlock = sLong;
- pTriple.sShort = pGroup->sShortNames.GetToken(j, STRING_DELIM);
+ pTriple.sShort = pGroup->sShortNames.getToken(j, STRING_DELIM);
aTripleStrings.push_back(pTriple);
++nFound;
}
@@ -153,9 +153,7 @@ sal_Bool SwGlossaryList::GetShortName(const String& rLongName,
else if(1 < nCount)
{
SwGlossDecideDlg aDlg(0);
- String sTitle = aDlg.GetText();
- sTitle += ' ';
- sTitle += aTripleStrings.front().sBlock;
+ OUString sTitle = aDlg.GetText() + " " + aTripleStrings.front().sBlock;
aDlg.SetText(sTitle);
ListBox& rLB = aDlg.GetListBox();
@@ -226,7 +224,7 @@ OUString SwGlossaryList::GetBlockLongName(sal_uInt16 nGroup, sal_uInt16 nBlock)
if(nGroup < aGroupArr.size())
{
AutoTextGroup* pGroup = aGroupArr[nGroup];
- return pGroup->sLongNames.GetToken(nBlock, STRING_DELIM);
+ return pGroup->sLongNames.getToken(nBlock, STRING_DELIM);
}
return OUString();
}
@@ -237,7 +235,7 @@ OUString SwGlossaryList::GetBlockShortName(sal_uInt16 nGroup, sal_uInt16 nBlock)
if(nGroup < aGroupArr.size())
{
AutoTextGroup* pGroup = aGroupArr[nGroup];
- return pGroup->sShortNames.GetToken(nBlock, STRING_DELIM);
+ return pGroup->sShortNames.getToken(nBlock, STRING_DELIM);
}
return OUString();
}
@@ -248,11 +246,11 @@ void SwGlossaryList::Update()
Start();
SvtPathOptions aPathOpt;
- String sTemp( aPathOpt.GetAutoTextPath() );
+ OUString sTemp( aPathOpt.GetAutoTextPath() );
if(sTemp != sPath)
{
sPath = sTemp;
- bFilled = sal_False;
+ bFilled = false;
ClearGroups();
}
SwGlossaries* pGlossaries = ::GetGlossaries();
@@ -263,19 +261,16 @@ void SwGlossaryList::Update()
sal_uInt16 nGroupCount = pGlossaries->GetGroupCnt();
for(sal_uInt16 i = 0; i < nGroupCount; i++)
{
- String sGrpName = pGlossaries->GetGroupName(i);
- sal_uInt16 nPath = (sal_uInt16)sGrpName.GetToken(1, GLOS_DELIM).ToInt32();
+ OUString sGrpName = pGlossaries->GetGroupName(i);
+ sal_uInt16 nPath = (sal_uInt16)sGrpName.getToken(1, GLOS_DELIM).toInt32();
if( static_cast<size_t>(nPath) < rPathArr.size() )
{
AutoTextGroup* pGroup = new AutoTextGroup;
pGroup->sName = sGrpName;
FillGroup(pGroup, pGlossaries);
- String sName = rPathArr[nPath];
- sName += INET_PATH_TOKEN;
- sName += pGroup->sName.GetToken(0, GLOS_DELIM);
- sName += sExt;
-
+ OUString sName = rPathArr[nPath] + OUString(INET_PATH_TOKEN) +
+ pGroup->sName.getToken(0, GLOS_DELIM) + sExt;
FStatHelper::GetModifiedDateTimeOfFile( sName,
&pGroup->aDateModified,
&pGroup->aDateModified );
@@ -283,7 +278,7 @@ void SwGlossaryList::Update()
aGroupArr.insert( aGroupArr.begin(), pGroup );
}
}
- bFilled = sal_True;
+ bFilled = true;
}
else
{
@@ -300,10 +295,10 @@ void SwGlossaryList::Update()
String* pTitle = aFiles[ nFiles ];
::DateTime* pDT = (::DateTime*) aDateTimeArr[ static_cast<sal_uInt16>(nFiles) ];
- String sName( pTitle->Copy( 0, pTitle->Len() - sExt.Len() ));
+ OUString sName( pTitle->Copy( 0, pTitle->Len() - sExt.Len() ));
aFoundGroupNames.push_back(sName);
- sName += GLOS_DELIM;
+ sName += OUString(GLOS_DELIM);
sName += OUString::number( static_cast<sal_uInt16>(nPath) );
AutoTextGroup* pFound = FindGroup( sName );
if( !pFound )
@@ -331,14 +326,14 @@ void SwGlossaryList::Update()
{
// maybe remove deleted groups
AutoTextGroup* pGroup = aGroupArr[i - 1];
- sal_uInt16 nGroupPath = (sal_uInt16)pGroup->sName.GetToken( 1,
- GLOS_DELIM).ToInt32();
+ sal_uInt16 nGroupPath = (sal_uInt16)pGroup->sName.getToken( 1,
+ GLOS_DELIM).toInt32();
// Only the groups will be checked which are registered
// for the current subpath.
if( nGroupPath == static_cast<sal_uInt16>(nPath) )
{
bool bFound = false;
- String sCompareGroup = pGroup->sName.GetToken(0, GLOS_DELIM);
+ OUString sCompareGroup = pGroup->sName.getToken(0, GLOS_DELIM);
for(std::vector<String>::const_iterator j = aFoundGroupNames.begin(); j != aFoundGroupNames.end() && !bFound; ++j)
bFound = (sCompareGroup == *j);
@@ -360,7 +355,7 @@ void SwGlossaryList::Timeout()
Update();
}
-AutoTextGroup* SwGlossaryList::FindGroup(const String& rGroupName)
+AutoTextGroup* SwGlossaryList::FindGroup(const OUString& rGroupName)
{
for(sal_uInt16 i = 0; i < aGroupArr.size(); i++)
{
@@ -382,9 +377,9 @@ void SwGlossaryList::FillGroup(AutoTextGroup* pGroup, SwGlossaries* pGlossaries)
for(sal_uInt16 j = 0; j < pGroup->nCount; j++)
{
pGroup->sLongNames += pBlock->GetLongName(j);
- pGroup->sLongNames += STRING_DELIM;
+ pGroup->sLongNames += OUString(STRING_DELIM);
pGroup->sShortNames += pBlock->GetShortName(j);
- pGroup->sShortNames += STRING_DELIM;
+ pGroup->sShortNames += OUString(STRING_DELIM);
}
pGlossaries->PutGroupDoc(pBlock);
}
@@ -406,9 +401,9 @@ bool SwGlossaryList::HasLongName(const String& rBegin, std::vector<String> *pLon
AutoTextGroup* pGroup = aGroupArr[i];
for(sal_uInt16 j = 0; j < pGroup->nCount; j++)
{
- String sBlock = pGroup->sLongNames.GetToken(j, STRING_DELIM);
- if( rSCmp.isEqual( sBlock.Copy(0, nBeginLen), rBegin ) &&
- nBeginLen + 1 < sBlock.Len())
+ OUString sBlock = pGroup->sLongNames.getToken(j, STRING_DELIM);
+ if( nBeginLen + 1 < sBlock.getLength() &&
+ rSCmp.isEqual( sBlock.copy(0, nBeginLen), rBegin ))
{
pLongNames->push_back( sBlock );
nFound++;
@@ -427,7 +422,7 @@ void SwGlossaryList::ClearGroups()
delete aGroupArr[ i ];
aGroupArr.clear();
- bFilled = sal_False;
+ bFilled = false;
}
commit 35b64000f4acdb310748d84d588eb2f984500fc1
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Fri Jul 26 18:08:00 2013 +0400
SwGlossaryList: don't use output parameters, convert to OUString
Change-Id: Iae21524d85a832ba17ba120f491bb13d1bdfcffa
diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx
index 4253cf7..d796fe9 100644
--- a/sw/source/ui/dochdl/gloshdl.cxx
+++ b/sw/source/ui/dochdl/gloshdl.cxx
@@ -419,9 +419,9 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
sal_uInt16 nGroupCount = pGlossaryList->GetGroupCount();
for(sal_uInt16 i = 1; i <= nGroupCount; i++)
{
+ OUString sTitle = pGlossaryList->GetGroupTitle(i - 1);
// get group name with path-extension
- String sTitle;
- String sGroupName = pGlossaryList->GetGroupName(i - 1, false, &sTitle);
+ OUString sGroupName = pGlossaryList->GetGroupName(i - 1, false);
if(sGroupName == pGlossary->GetName())
continue;
sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i -1);
@@ -429,9 +429,9 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
{
for(sal_uInt16 j = 0; j < nBlockCount; j++)
{
- String sEntry;
- String sLongName(pGlossaryList->GetBlockName(i - 1, j, sEntry));
- if( rSCmp.isEqual( rShortName, sEntry ))
+ OUString sLongName(pGlossaryList->GetBlockLongName(i - 1, j));
+ OUString sShortName(pGlossaryList->GetBlockShortName(i - 1, j));
+ if( rSCmp.isEqual( rShortName, sShortName ))
{
TextBlockInfo_Impl* pData = new TextBlockInfo_Impl;
pData->sTitle = sTitle;
diff --git a/sw/source/ui/inc/gloslst.hxx b/sw/source/ui/inc/gloslst.hxx
index 9bc2c35..100b301 100644
--- a/sw/source/ui/inc/gloslst.hxx
+++ b/sw/source/ui/inc/gloslst.hxx
@@ -60,10 +60,13 @@ public:
sal_Bool GetShortName(const String& rLongName,
String& rShortName, String& rGroupName );
- sal_uInt16 GetGroupCount();
- String GetGroupName(sal_uInt16 nPos, bool bNoPath = true, String* pTitle = 0);
- sal_uInt16 GetBlockCount(sal_uInt16 nGroup);
- String GetBlockName(sal_uInt16 nGroup, sal_uInt16 nBlock, String& rShortName);
+ sal_uInt16 GetGroupCount();
+ OUString GetGroupName(sal_uInt16 nPos, bool bNoPath = true);
+ OUString GetGroupTitle(sal_uInt16 nPos);
+
+ sal_uInt16 GetBlockCount(sal_uInt16 nGroup);
+ OUString GetBlockLongName(sal_uInt16 nGroup, sal_uInt16 nBlock);
+ OUString GetBlockShortName(sal_uInt16 nGroup, sal_uInt16 nBlock);
void Update();
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index ccbc2bf..c925aed 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -193,9 +193,7 @@ SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow()
sal_uInt16 nGroupCount = pGlossaryList->GetGroupCount();
for(sal_uInt16 i = 1; i <= nGroupCount; i++)
{
- // Acquire group name with path extension
- String sTitle;
- pGlossaryList->GetGroupName(i - 1, sal_False, &sTitle);
+ OUString sTitle = pGlossaryList->GetGroupTitle(i - 1);
sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i -1);
if(nBlockCount)
{
@@ -207,10 +205,10 @@ SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow()
pPopup->SetPopupMenu(i, pSub);
for(sal_uInt16 j = 0; j < nBlockCount; j++)
{
- String sEntry;
- String sLongName(pGlossaryList->GetBlockName(i - 1, j, sEntry));
- sEntry.AppendAscii(" - ");
- sEntry += sLongName;
+ OUString sLongName(pGlossaryList->GetBlockLongName(i - 1, j));
+ OUString sShortName(pGlossaryList->GetBlockShortName(i - 1, j));
+
+ OUString sEntry = sShortName + " - " + sLongName;
pSub->InsertItem(++nIndex, sEntry);
}
}
@@ -251,9 +249,9 @@ IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu)
sal_uInt16 nBlock = nId / 100;
SwGlossaryList* pGlossaryList = ::GetGlossaryList();
- String sShortName;
- String sGroup = pGlossaryList->GetGroupName(nBlock - 1, false);
- pGlossaryList->GetBlockName(nBlock - 1, nId - (100 * nBlock) - 1, sShortName);
+ OUString sGroup = pGlossaryList->GetGroupName(nBlock - 1, false);
+ OUString sShortName =
+ pGlossaryList->GetBlockShortName(nBlock - 1, nId - (100 * nBlock) - 1);
SwGlossaryHdl* pGlosHdl = pView->GetGlosHdl();
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
diff --git a/sw/source/ui/utlui/gloslst.cxx b/sw/source/ui/utlui/gloslst.cxx
index 72bd51b..0775d31 100644
--- a/sw/source/ui/utlui/gloslst.cxx
+++ b/sw/source/ui/utlui/gloslst.cxx
@@ -184,24 +184,32 @@ sal_uInt16 SwGlossaryList::GetGroupCount()
return aGroupArr.size();
}
-String SwGlossaryList::GetGroupName(sal_uInt16 nPos, bool bNoPath, String* pTitle)
+OUString SwGlossaryList::GetGroupName(sal_uInt16 nPos, bool bNoPath)
{
OSL_ENSURE(aGroupArr.size() > nPos, "group not available");
- String sRet;
if(nPos < aGroupArr.size())
{
AutoTextGroup* pGroup = aGroupArr[nPos];
- sRet = pGroup->sName;
+ OUString sRet = pGroup->sName;
if(bNoPath)
- sRet = sRet.GetToken(0, GLOS_DELIM);
- if(pTitle)
- *pTitle = pGroup->sTitle;
+ sRet = sRet.getToken(0, GLOS_DELIM);
+ return sRet;
}
- return sRet;
+ return OUString();
+}
+OUString SwGlossaryList::GetGroupTitle(sal_uInt16 nPos)
+{
+ OSL_ENSURE(aGroupArr.size() > nPos, "group not available");
+ if(nPos < aGroupArr.size())
+ {
+ AutoTextGroup* pGroup = aGroupArr[nPos];
+ return pGroup->sTitle;
+ }
+ return OUString();
}
-sal_uInt16 SwGlossaryList::GetBlockCount(sal_uInt16 nGroup)
+sal_uInt16 SwGlossaryList::GetBlockCount(sal_uInt16 nGroup)
{
OSL_ENSURE(aGroupArr.size() > nGroup, "group not available");
if(nGroup < aGroupArr.size())
@@ -212,16 +220,26 @@ sal_uInt16 SwGlossaryList::GetBlockCount(sal_uInt16 nGroup)
return 0;
}
-String SwGlossaryList::GetBlockName(sal_uInt16 nGroup, sal_uInt16 nBlock, String& rShortName)
+OUString SwGlossaryList::GetBlockLongName(sal_uInt16 nGroup, sal_uInt16 nBlock)
{
OSL_ENSURE(aGroupArr.size() > nGroup, "group not available");
if(nGroup < aGroupArr.size())
{
AutoTextGroup* pGroup = aGroupArr[nGroup];
- rShortName = pGroup->sShortNames.GetToken(nBlock, STRING_DELIM);
return pGroup->sLongNames.GetToken(nBlock, STRING_DELIM);
}
- return aEmptyStr;
+ return OUString();
+}
+
+OUString SwGlossaryList::GetBlockShortName(sal_uInt16 nGroup, sal_uInt16 nBlock)
+{
+ OSL_ENSURE(aGroupArr.size() > nGroup, "group not available");
+ if(nGroup < aGroupArr.size())
+ {
+ AutoTextGroup* pGroup = aGroupArr[nGroup];
+ return pGroup->sShortNames.GetToken(nBlock, STRING_DELIM);
+ }
+ return OUString();
}
void SwGlossaryList::Update()
More information about the Libreoffice-commits
mailing list