summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2013-08-13 23:01:07 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2013-08-14 13:49:09 +0400
commitdcbad1b3bfe719f4eecdfafe8c78dd01f34b6605 (patch)
treeae7364a355c25d1537b5db19e229958503227441
parentfb0238d276e5835dbb316a6f4ae383988ed62aee (diff)
convert GetSelectionText... methods to OUString and bool
Change-Id: I77726f009338ae49877c5f58fe6c14d386089bbe
-rw-r--r--basctl/source/basicide/basides2.cxx4
-rw-r--r--basctl/source/inc/basidesh.hxx2
-rw-r--r--cui/source/tabpages/autocdlg.cxx4
-rw-r--r--include/sfx2/viewsh.hxx2
-rw-r--r--sc/source/ui/inc/editsh.hxx2
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx2
-rw-r--r--sc/source/ui/view/editsh.cxx4
-rw-r--r--sc/source/ui/view/tabvwshe.cxx12
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx2
-rw-r--r--sd/source/ui/inc/OutlineViewShell.hxx2
-rw-r--r--sd/source/ui/inc/ViewShellBase.hxx2
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx2
-rw-r--r--sd/source/ui/view/drviewsf.cxx2
-rw-r--r--sd/source/ui/view/outlnvsh.cxx2
-rw-r--r--sfx2/source/view/viewsh.cxx6
-rw-r--r--sw/source/ui/inc/view.hxx6
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx4
-rw-r--r--sw/source/ui/uiview/view.cxx7
18 files changed, 31 insertions, 36 deletions
diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx
index 8e1daa86b62b..052486ce22b4 100644
--- a/basctl/source/basicide/basides2.cxx
+++ b/basctl/source/basicide/basides2.cxx
@@ -63,9 +63,9 @@ sal_Bool Shell::HasSelection( sal_Bool /* bText */ ) const
return false;
}
-String Shell::GetSelectionText( sal_Bool bWholeWord )
+OUString Shell::GetSelectionText( bool bWholeWord )
{
- String aText;
+ OUString aText;
if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin))
{
if (TextView* pEditView = pMCurWin->GetEditView())
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index b16f535f873a..1945d8afc390 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -179,7 +179,7 @@ public:
// virtual sal_uInt16 Print( SfxProgress &rProgress, sal_Bool bIsAPI, PrintDialog *pPrintDialog = 0 );
virtual SfxPrinter* GetPrinter( sal_Bool bCreate );
virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
- virtual String GetSelectionText( sal_Bool bCompleteWords );
+ virtual OUString GetSelectionText( bool bCompleteWords );
virtual sal_Bool HasSelection( sal_Bool bText ) const;
void GetState( SfxItemSet& );
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 2b57b6c135e6..014b88974f4b 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -1032,10 +1032,10 @@ void OfaAutocorrReplacePage::RefillReplaceBox(sal_Bool bFromReset,
if( pViewShell && pViewShell->HasSelection( sal_True ) )
{
bHasSelectionText = sal_True;
- const String sSelection( pViewShell->GetSelectionText() );
+ const OUString sSelection( pViewShell->GetSelectionText() );
m_pReplaceED->SetText( sSelection );
m_pTextOnlyCB->Check( !bSWriter );
- m_pTextOnlyCB->Enable( bSWriter && sSelection.Len() );
+ m_pTextOnlyCB->Enable( bSWriter && !sSelection.isEmpty() );
}
else
{
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index ad4c64cd5272..b09708e64bdf 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -185,7 +185,7 @@ public:
// Misc
virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
- virtual String GetSelectionText( sal_Bool bCompleteWords = sal_False );
+ virtual OUString GetSelectionText( bool bCompleteWords = false );
virtual sal_Bool HasSelection( sal_Bool bText = sal_True ) const;
virtual SdrView* GetDrawView() const;
diff --git a/sc/source/ui/inc/editsh.hxx b/sc/source/ui/inc/editsh.hxx
index f888bbcc659f..1f84d27e065f 100644
--- a/sc/source/ui/inc/editsh.hxx
+++ b/sc/source/ui/inc/editsh.hxx
@@ -69,7 +69,7 @@ public:
void ExecuteUndo(SfxRequest& rReq);
void GetUndoState(SfxItemSet &rSet);
- String GetSelectionText( sal_Bool bWholeWord );
+ OUString GetSelectionText( bool bWholeWord );
};
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 06cd9c8b967c..a5da444426e6 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -213,7 +213,7 @@ protected:
virtual void QueryObjAreaPixel( Rectangle& rRect ) const;
- virtual String GetSelectionText( sal_Bool bWholeWord );
+ virtual OUString GetSelectionText( bool bWholeWord );
virtual sal_Bool HasSelection( sal_Bool bText ) const;
virtual String GetDescription() const;
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 58fc54220271..76a9529de885 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -1131,9 +1131,9 @@ void ScEditShell::GetAttrState(SfxItemSet &rSet)
}
}
-String ScEditShell::GetSelectionText( sal_Bool bWholeWord )
+OUString ScEditShell::GetSelectionText( bool bWholeWord )
{
- String aStrSelection;
+ OUString aStrSelection;
if ( pViewData->HasEditView( pViewData->GetActivePart() ) ) // #125326#
{
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index e64b22b7ae02..effbc7ae3263 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -42,9 +42,9 @@
//==================================================================
-String ScTabViewShell::GetSelectionText( sal_Bool bWholeWord )
+OUString ScTabViewShell::GetSelectionText( bool bWholeWord )
{
- String aStrSelection;
+ OUString aStrSelection;
if ( pEditShell && pEditShell == GetMySubShell() )
{
@@ -107,12 +107,8 @@ String ScTabViewShell::GetSelectionText( sal_Bool bWholeWord )
if ( bInFormatDialog || bWholeWord || aRange.aEnd.Row() == aRange.aStart.Row() )
{
- xub_StrLen nAt;
- while ( (nAt = aStrSelection.Search( CHAR_CR )) != STRING_NOTFOUND )
- aStrSelection.SetChar( nAt, ' ' );
- while ( (nAt = aStrSelection.Search( '\t' )) != STRING_NOTFOUND )
- aStrSelection.SetChar( nAt, ' ' );
-
+ aStrSelection = aStrSelection.replaceAll(OUString(CHAR_CR), " ");
+ aStrSelection = aStrSelection.replaceAll("\t", " ");
aStrSelection = comphelper::string::stripEnd(aStrSelection, ' ');
}
}
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index 61c8d1ce3da9..1565648391f7 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -154,7 +154,7 @@ public:
virtual void Deactivate(sal_Bool IsMDIActivate);
virtual void UIActivating( SfxInPlaceClient* );
virtual void UIDeactivated( SfxInPlaceClient* );
- virtual String GetSelectionText( sal_Bool bCompleteWords = sal_False );
+ virtual OUString GetSelectionText( bool bCompleteWords = false );
virtual sal_Bool HasSelection( sal_Bool bText = sal_True ) const;
void ExecCtrl(SfxRequest& rReq);
diff --git a/sd/source/ui/inc/OutlineViewShell.hxx b/sd/source/ui/inc/OutlineViewShell.hxx
index f4ca53f62fc8..957b3af219c7 100644
--- a/sd/source/ui/inc/OutlineViewShell.hxx
+++ b/sd/source/ui/inc/OutlineViewShell.hxx
@@ -102,7 +102,7 @@ public:
virtual void SetZoom(long nZoom);
virtual void SetZoomRect(const Rectangle& rZoomRect);
- virtual String GetSelectionText( sal_Bool bCompleteWords = sal_False );
+ virtual OUString GetSelectionText( bool bCompleteWords = false );
virtual sal_Bool HasSelection( sal_Bool bText = sal_True ) const;
void Execute(SfxRequest& rReq);
diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx
index 0de9a17007db..dc1cc4ea93c5 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -115,7 +115,7 @@ public:
virtual void GetState (SfxItemSet& rSet);
/* override these from SfxViewShell */
- virtual String GetSelectionText(sal_Bool);
+ virtual OUString GetSelectionText(bool);
virtual sal_Bool HasSelection(sal_Bool) const;
SvBorder GetBorder (bool bOuterResize);
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index a069311e4fa1..4c6817f3e151 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -459,7 +459,7 @@ void ViewShellBase::InitializeFramework (void)
}
-String ViewShellBase::GetSelectionText(sal_Bool bCompleteWords)
+OUString ViewShellBase::GetSelectionText(bool bCompleteWords)
{
::boost::shared_ptr<ViewShell> const pMainShell(GetMainViewShell());
DrawViewShell *const pDrawViewShell(
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index f18f17598464..5667740e39e0 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -744,7 +744,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
-String DrawViewShell::GetSelectionText(sal_Bool bCompleteWords)
+OUString DrawViewShell::GetSelectionText(bool bCompleteWords)
{
OUString aStrSelection;
::Outliner* pOl = mpDrawView->GetTextEditOutliner();
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 1c5a50d07e1e..6e0cee76bc43 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1466,7 +1466,7 @@ sal_Bool OutlineViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
/**
* Return text of the selection
*/
-String OutlineViewShell::GetSelectionText(sal_Bool bCompleteWords)
+OUString OutlineViewShell::GetSelectionText(bool bCompleteWords)
{
OUString aStrSelection;
::Outliner* pOl = pOlView->GetOutliner();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index fa00d8b09012..b4387cbf4f73 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1357,9 +1357,9 @@ SdrView* SfxViewShell::GetDrawView() const
//--------------------------------------------------------------------
-String SfxViewShell::GetSelectionText
+OUString SfxViewShell::GetSelectionText
(
- sal_Bool /*bCompleteWords*/ /* FALSE (default)
+ bool /*bCompleteWords*/ /* FALSE (default)
Only the actual selected text is returned.
TRUE
@@ -1382,7 +1382,7 @@ String SfxViewShell::GetSelectionText
*/
{
- return String();
+ return OUString();
}
//--------------------------------------------------------------------
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 056ae0dd6a41..d7f538d1ac05 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -413,10 +413,10 @@ public:
com::sun::star::view::XSelectionSupplier* GetUNOObject();
- String GetSelectionTextParam( sal_Bool bCompleteWords,
- sal_Bool bEraseTrail );
+ OUString GetSelectionTextParam( bool bCompleteWords,
+ bool bEraseTrail );
virtual sal_Bool HasSelection( sal_Bool bText ) const;
- virtual String GetSelectionText( sal_Bool bCompleteWords = sal_False );
+ virtual OUString GetSelectionText( bool bCompleteWords = false );
virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
virtual void MarginChanged();
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 8c89daf7907e..1421e2ff8fc1 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -269,7 +269,7 @@ void SwIndexMarkPane::InitControls()
if (nCnt < 2)
{
bSelected = !pSh->HasSelection();
- aOrgStr = pSh->GetView().GetSelectionTextParam(sal_True, sal_False);
+ aOrgStr = pSh->GetView().GetSelectionTextParam(true, false);
m_pEntryED->SetText(aOrgStr);
//to include all equal entries may only be allowed in the body and even there
@@ -361,7 +361,7 @@ void SwIndexMarkPane::Activate()
if (nCnt < 2)
{
bSelected = !pSh->HasSelection();
- aOrgStr = pSh->GetView().GetSelectionTextParam(sal_True, sal_False);
+ aOrgStr = pSh->GetView().GetSelectionTextParam(true, false);
m_pEntryED->SetText(aOrgStr);
//to include all equal entries may only be allowed in the body and even there
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index 0323f6d87b73..94fd75e401de 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -1572,13 +1572,12 @@ sal_Bool SwView::HasSelection( sal_Bool bText ) const
: GetWrtShell().HasSelection();
}
-String SwView::GetSelectionText( sal_Bool bCompleteWrds )
+OUString SwView::GetSelectionText( bool bCompleteWrds )
{
- return GetSelectionTextParam( bCompleteWrds, sal_True );
+ return GetSelectionTextParam( bCompleteWrds, true );
}
-String SwView::GetSelectionTextParam( sal_Bool bCompleteWrds,
- sal_Bool bEraseTrail )
+OUString SwView::GetSelectionTextParam( bool bCompleteWrds, bool bEraseTrail )
{
String sReturn;
if( bCompleteWrds && !GetWrtShell().HasSelection() )