[Libreoffice-commits] core.git: 2 commits - cui/source editeng/source fpicker/source include/svtools include/tools padmin/source sc/source svtools/source sw/AllLangResTarget_sw.mk sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk tools/source vcl/aqua
Caolán McNamara
caolanm at redhat.com
Fri Sep 27 02:16:33 PDT 2013
cui/source/dialogs/hlinettp.cxx | 11 -
cui/source/dialogs/hyphen.cxx | 10 -
editeng/source/misc/svxacorr.cxx | 6
fpicker/source/office/iodlg.cxx | 12 -
include/svtools/wizardmachine.hxx | 3
include/tools/string.hxx | 1
padmin/source/adddlg.cxx | 9 -
padmin/source/helper.cxx | 6
padmin/source/helper.hxx | 2
padmin/source/newppdlg.cxx | 2
sc/source/core/tool/address.cxx | 4
sc/source/filter/excel/xlroot.cxx | 2
sc/source/filter/inc/xlroot.hxx | 4
svtools/source/dialogs/wizardmachine.cxx | 7 +
sw/AllLangResTarget_sw.mk | 1
sw/UIConfig_swriter.mk | 1
sw/inc/helpid.h | 1
sw/source/filter/html/htmlgrin.cxx | 8 -
sw/source/filter/html/htmlsect.cxx | 46 +++----
sw/source/filter/html/wrthtml.cxx | 10 -
sw/source/filter/ww8/wrtww8.cxx | 8 -
sw/source/filter/ww8/ww8par5.cxx | 25 +---
sw/source/ui/dbui/mmaddressblockpage.cxx | 10 -
sw/source/ui/dbui/mmdocselectpage.cxx | 85 ++++++-------
sw/source/ui/dbui/mmdocselectpage.hrc | 31 -----
sw/source/ui/dbui/mmdocselectpage.hxx | 22 +--
sw/source/ui/dbui/mmdocselectpage.src | 99 ----------------
sw/uiconfig/swriter/ui/mmselectpage.ui | 190 +++++++++++++++++++++++++++++++
tools/source/string/tustring.cxx | 21 ---
vcl/aqua/source/window/salmenu.cxx | 12 -
30 files changed, 343 insertions(+), 306 deletions(-)
New commits:
commit c9483451aaeea5c47726336c7b465c7618e1d37e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Sep 26 14:00:22 2013 +0200
convert mailmerge select page to .ui
Change-Id: I34f527ff8e1e9819f4e6ac728efa1e31f8bc3d48
diff --git a/include/svtools/wizardmachine.hxx b/include/svtools/wizardmachine.hxx
index 99352ca..5275f99 100644
--- a/include/svtools/wizardmachine.hxx
+++ b/include/svtools/wizardmachine.hxx
@@ -99,7 +99,8 @@ namespace svt
if the OWizardPage is used in an OWizardMachine, this parameter
must be the OWizardMachine (which is derived from Window)
*/
- OWizardPage( Window* _pParent, const ResId& _rResId );
+ OWizardPage(Window* _pParent, const ResId& _rResId);
+ OWizardPage(Window *pParent, const OString& rID, const OUString& rUIXMLDescription);
~OWizardPage();
// IWizardPageController overridables
diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx
index 1b6dc0d..84467ab 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -49,6 +49,13 @@ namespace svt
{
}
+ OWizardPage::OWizardPage(Window *pParent, const OString& rID,
+ const OUString& rUIXMLDescription)
+ : TabPage(pParent, rID, rUIXMLDescription)
+ , m_pImpl(new WizardPageImplData)
+ {
+ }
+
//---------------------------------------------------------------------
OWizardPage::~OWizardPage()
{
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index aae7498..2cb0c71 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -76,7 +76,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/dbui/mailmergechildwindow.src \
sw/source/ui/dbui/mailmergewizard.src \
sw/source/ui/dbui/mmaddressblockpage.src \
- sw/source/ui/dbui/mmdocselectpage.src \
sw/source/ui/dbui/mmgreetingspage.src \
sw/source/ui/dbui/mmlayoutpage.src \
sw/source/ui/dbui/mmmergepage.src \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 5be26fd..7e5d930 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -159,6 +159,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/querydefaultcompatdialog \
sw/uiconfig/swriter/ui/querysavelabeldialog \
sw/uiconfig/swriter/ui/queryshowchangesdialog \
+ sw/uiconfig/swriter/ui/mmselectpage \
sw/uiconfig/swriter/ui/paradialog \
sw/uiconfig/swriter/ui/picturedialog \
sw/uiconfig/swriter/ui/picturepage \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index ecbf662..52ea16d 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -368,7 +368,6 @@
#define HID_MERGE_SOURCE_UNAVAILABLE "SW_HID_MERGE_SOURCE_UNAVAILABLE"
#define HID_MODULE_TOOLBOX "SW_HID_MODULE_TOOLBOX"
-#define HID_MM_DOCSELECTPAGE "SW_HID_MM_DOCSELECTPAGE"
#define HID_MM_OUTPUTTYPEPAGE "SW_HID_MM_OUTPUTTYPEPAGE"
#define HID_MM_ADDRESSBLOCKPAGE "SW_HID_MM_ADDRESSBLOCKPAGE"
#define HID_MM_GREETINGSPAGE "SW_HID_MM_GREETINGSPAGE"
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index c8551a5..de3b959 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -33,7 +33,6 @@
#include <mmconfigitem.hxx>
#include <dbui.hrc>
-#include <mmdocselectpage.hrc>
#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
@@ -44,54 +43,50 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace svt;
-SwMailMergeDocSelectPage::SwMailMergeDocSelectPage( SwMailMergeWizard* _pParent ) :
- svt::OWizardPage(_pParent, SW_RES(DLG_MM_DOCSELECT_PAGE)),
-#ifdef _MSC_VER
-#pragma warning (disable : 4355)
-#endif
- m_aHeaderFI(this, SW_RES( FI_HEADER ) ),
- m_aHowToFT (this, SW_RES( FT_HOWTO )),
- m_aCurrentDocRB (this, SW_RES( RB_CURRENTDOC )),
- m_aNewDocRB (this, SW_RES( RB_NEWDOC )),
- m_aLoadDocRB (this, SW_RES( RB_LOADDOC )),
- m_aLoadTemplateRB (this, SW_RES( RB_LOADTEMPLATE )),
- m_aRecentDocRB (this, SW_RES( RB_RECENTDOC )),
- m_aBrowseDocPB (this, SW_RES( PB_LOADDOC )),
- m_aBrowseTemplatePB (this, SW_RES( PB_BROWSETEMPLATE )),
- m_aRecentDocLB (this, SW_RES( LB_RECENTDOC )),
-#ifdef _MSC_VER
-#pragma warning (default : 4355)
-#endif
- m_pWizard(_pParent)
+SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(SwMailMergeWizard* pParent)
+ : svt::OWizardPage(pParent, "MMSelectPage",
+ "modules/swriter/ui/mmselectpage.ui")
+ , m_pWizard(pParent)
{
- FreeResource();
-
- m_aCurrentDocRB.Check();
- DocSelectHdl(&m_aNewDocRB);
+ get(m_pCurrentDocRB, "currentdoc");
+ get(m_pNewDocRB, "newdoc");
+ get(m_pLoadDocRB, "loaddoc");
+ get(m_pLoadTemplateRB, "template");
+ get(m_pRecentDocRB, "recentdoc");
+ get(m_pBrowseDocPB, "browsedoc");
+ get(m_pBrowseTemplatePB, "browsetemplate");
+ get(m_pRecentDocLB, "recentdoclb");
+
+ m_pCurrentDocRB->Check();
+ DocSelectHdl(m_pNewDocRB);
Link aDocSelectLink = LINK(this, SwMailMergeDocSelectPage, DocSelectHdl);
- m_aCurrentDocRB.SetClickHdl(aDocSelectLink);
- m_aNewDocRB.SetClickHdl(aDocSelectLink);
- m_aLoadDocRB.SetClickHdl(aDocSelectLink);
- m_aLoadTemplateRB.SetClickHdl(aDocSelectLink);
- m_aRecentDocRB.SetClickHdl(aDocSelectLink);
+ m_pCurrentDocRB->SetClickHdl(aDocSelectLink);
+ m_pNewDocRB->SetClickHdl(aDocSelectLink);
+ m_pLoadDocRB->SetClickHdl(aDocSelectLink);
+ m_pLoadTemplateRB->SetClickHdl(aDocSelectLink);
+ m_pRecentDocRB->SetClickHdl(aDocSelectLink);
Link aFileSelectHdl = LINK(this, SwMailMergeDocSelectPage, FileSelectHdl);
- m_aBrowseDocPB.SetClickHdl(aFileSelectHdl);
- m_aBrowseTemplatePB.SetClickHdl(aFileSelectHdl);
+ m_pBrowseDocPB->SetClickHdl(aFileSelectHdl);
+ m_pBrowseTemplatePB->SetClickHdl(aFileSelectHdl);
const uno::Sequence< OUString >& rDocs =
m_pWizard->GetConfigItem().GetSavedDocuments();
for(sal_Int32 nDoc = 0; nDoc < rDocs.getLength(); ++nDoc)
{
//insert in reverse order
- m_aRecentDocLB.InsertEntry(rDocs[nDoc], 0);
+ m_pRecentDocLB->InsertEntry(rDocs[nDoc], 0);
}
- m_aRecentDocLB.SelectEntryPos(0);
+ m_pRecentDocLB->SelectEntryPos(0);
if(!rDocs.getLength())
{
- m_aRecentDocRB.Enable(sal_False);
+ m_pRecentDocRB->Enable(sal_False);
}
+
+ //Temp hack until all pages are converted to .ui and wizard
+ //base class adapted
+ SetSizePixel(LogicToPixel(Size(260 , 250), MapMode(MAP_APPFONT)));
}
SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage()
@@ -100,7 +95,7 @@ SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage()
IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton)
{
- m_aRecentDocLB.Enable(&m_aRecentDocRB == pButton);
+ m_pRecentDocLB->Enable(m_pRecentDocRB == pButton);
m_pWizard->UpdateRoadmap();
m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE));
@@ -110,11 +105,11 @@ IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton)
IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
{
- bool bTemplate = &m_aBrowseTemplatePB == pButton;
+ bool bTemplate = m_pBrowseTemplatePB == pButton;
if(bTemplate)
{
- m_aLoadTemplateRB.Check();
+ m_pLoadTemplateRB->Check();
SfxNewFileDialog* pNewFileDlg = new SfxNewFileDialog(this, 0);
sal_uInt16 nRet = pNewFileDlg->Execute();
if(RET_TEMPLATE_LOAD == nRet)
@@ -124,7 +119,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
delete pNewFileDlg;
}
else
- m_aLoadDocRB.Check();
+ m_pLoadDocRB->Check();
if(!bTemplate)
{
@@ -172,15 +167,15 @@ sal_Bool SwMailMergeDocSelectPage::commitPage( ::svt::WizardTypes::CommitPageRea
if(bNext || _eReason == ::svt::WizardTypes::eValidate )
{
OUString sReloadDocument;
- bReturn = m_aCurrentDocRB.IsChecked() ||
- m_aNewDocRB.IsChecked() ||
- (!(sReloadDocument = m_sLoadFileName).isEmpty() && m_aLoadDocRB.IsChecked() )||
- (!(sReloadDocument = m_sLoadTemplateName).isEmpty() && m_aLoadTemplateRB.IsChecked())||
- (m_aRecentDocRB.IsChecked() && !(sReloadDocument = m_aRecentDocLB.GetSelectEntry()).isEmpty());
+ bReturn = m_pCurrentDocRB->IsChecked() ||
+ m_pNewDocRB->IsChecked() ||
+ (!(sReloadDocument = m_sLoadFileName).isEmpty() && m_pLoadDocRB->IsChecked() )||
+ (!(sReloadDocument = m_sLoadTemplateName).isEmpty() && m_pLoadTemplateRB->IsChecked())||
+ (m_pRecentDocRB->IsChecked() && !(sReloadDocument = m_pRecentDocLB->GetSelectEntry()).isEmpty());
if( _eReason == ::svt::WizardTypes::eValidate )
- m_pWizard->SetDocumentLoad(!m_aCurrentDocRB.IsChecked());
+ m_pWizard->SetDocumentLoad(!m_pCurrentDocRB->IsChecked());
- if(bNext && !m_aCurrentDocRB.IsChecked())
+ if(bNext && !m_pCurrentDocRB->IsChecked())
{
if(!sReloadDocument.isEmpty())
m_pWizard->SetReloadDocument( sReloadDocument );
diff --git a/sw/source/ui/dbui/mmdocselectpage.hrc b/sw/source/ui/dbui/mmdocselectpage.hrc
deleted file mode 100644
index 88077eb..0000000
--- a/sw/source/ui/dbui/mmdocselectpage.hrc
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- 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 .
- */
-
-#define FT_HOWTO 1
-#define RB_CURRENTDOC 2
-#define RB_NEWDOC 3
-#define RB_LOADDOC 4
-#define PB_LOADDOC 5
-#define RB_LOADTEMPLATE 6
-#define PB_BROWSETEMPLATE 7
-#define RB_RECENTDOC 8
-#define LB_RECENTDOC 9
-#define FI_HEADER 10
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx b/sw/source/ui/dbui/mmdocselectpage.hxx
index cc81c02..a10064b 100644
--- a/sw/source/ui/dbui/mmdocselectpage.hxx
+++ b/sw/source/ui/dbui/mmdocselectpage.hxx
@@ -28,21 +28,19 @@ class SwMailMergeWizard;
class SwMailMergeDocSelectPage : public svt::OWizardPage
{
- SwBoldFixedInfo m_aHeaderFI;
- FixedInfo m_aHowToFT;
- RadioButton m_aCurrentDocRB;
- RadioButton m_aNewDocRB;
- RadioButton m_aLoadDocRB;
- RadioButton m_aLoadTemplateRB;
- RadioButton m_aRecentDocRB;
+ RadioButton* m_pCurrentDocRB;
+ RadioButton* m_pNewDocRB;
+ RadioButton* m_pLoadDocRB;
+ RadioButton* m_pLoadTemplateRB;
+ RadioButton* m_pRecentDocRB;
- PushButton m_aBrowseDocPB;
- PushButton m_aBrowseTemplatePB;
+ PushButton* m_pBrowseDocPB;
+ PushButton* m_pBrowseTemplatePB;
- ListBox m_aRecentDocLB;
+ ListBox* m_pRecentDocLB;
- String m_sLoadFileName;
- String m_sLoadTemplateName;
+ OUString m_sLoadFileName;
+ OUString m_sLoadTemplateName;
SwMailMergeWizard* m_pWizard;
diff --git a/sw/source/ui/dbui/mmdocselectpage.src b/sw/source/ui/dbui/mmdocselectpage.src
deleted file mode 100644
index d69abe8..0000000
--- a/sw/source/ui/dbui/mmdocselectpage.src
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- 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 <mmdocselectpage.hrc>
-#include <dbui.hrc>
-#include <helpid.h>
-TabPage DLG_MM_DOCSELECT_PAGE
-{
- HelpID = HID_MM_DOCSELECTPAGE ;
- Size = MAP_APPFONT ( 260 , 250 ) ;
- Hide = TRUE ;
-
- FixedText FI_HEADER
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Select starting document for the mail merge";
- };
- FixedText FT_HOWTO
- {
- Pos = MAP_APPFONT ( 6 , 27 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Select the document upon which to base the mail merge document";
- };
- RadioButton RB_CURRENTDOC
- {
- HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_CURRENTDOC";
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 190 , 10 ) ;
- Text[ en-US ] = "Use the current ~document";
- };
- RadioButton RB_NEWDOC
- {
- HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_NEWDOC";
- Pos = MAP_APPFONT ( 12 , 66 ) ;
- Size = MAP_APPFONT ( 190 , 10 ) ;
- Text[ en-US ] = "Create a ne~w document";
- };
- RadioButton RB_LOADDOC
- {
- HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_LOADDOC";
- Pos = MAP_APPFONT ( 12 , 84) ;
- Size = MAP_APPFONT ( 190 , 10 ) ;
- Text[ en-US ] = "Start from ~existing document";
- };
- PushButton PB_LOADDOC
- {
- HelpID = "sw:PushButton:DLG_MM_DOCSELECT_PAGE:PB_LOADDOC";
- Pos = MAP_APPFONT ( 204 , 80) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text[ en-US ] = "B~rowse...";
- };
- RadioButton RB_LOADTEMPLATE
- {
- HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_LOADTEMPLATE";
- Pos = MAP_APPFONT ( 12 , 103 ) ;
- Size = MAP_APPFONT ( 190 , 10 ) ;
- Text[ en-US ] = "Start from a t~emplate";
- };
- PushButton PB_BROWSETEMPLATE
- {
- HelpID = "sw:PushButton:DLG_MM_DOCSELECT_PAGE:PB_BROWSETEMPLATE";
- Pos = MAP_APPFONT ( 204 , 99 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text[ en-US ] = "B~rowse...";
- };
- RadioButton RB_RECENTDOC
- {
- HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_RECENTDOC";
- Pos = MAP_APPFONT ( 12 , 120) ;
- Size = MAP_APPFONT ( 190 , 10 ) ;
- Text[ en-US ] = "Start fro~m a recently saved starting document";
- };
- ListBox LB_RECENTDOC
- {
- HelpID = "sw:ListBox:DLG_MM_DOCSELECT_PAGE:LB_RECENTDOC";
- Pos = MAP_APPFONT ( 20 , 134 ) ;
- Size = MAP_APPFONT ( 180 , 50 ) ;
- DropDown = TRUE;
- Border = TRUE;
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/uiconfig/swriter/ui/mmselectpage.ui b/sw/uiconfig/swriter/ui/mmselectpage.ui
new file mode 100644
index 0000000..fcfc4f4
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/mmselectpage.ui
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkBox" id="MMSelectPage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <property name="row_homogeneous">True</property>
+ <child>
+ <object class="GtkRadioButton" id="currentdoc">
+ <property name="label" translatable="yes">Use the current _document</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">newdoc</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="newdoc">
+ <property name="label" translatable="yes">Create a ne_w document</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">loaddoc</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="loaddoc">
+ <property name="label" translatable="yes">Start from _existing document</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="hexpand">True</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">template</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="template">
+ <property name="label" translatable="yes">Start from a t_emplate</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="hexpand">True</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">recentdoc</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="recentdoc">
+ <property name="label" translatable="yes">Start fro_m a recently saved starting document</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">currentdoc</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="recentdoclb">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="entry_text_column">0</property>
+ <property name="id_column">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="browsedoc">
+ <property name="label" translatable="yes">B_rowse...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="browsetemplate">
+ <property name="label" translatable="yes">B_rowse...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Select starting document for the mail merge</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
commit b3a8056a499ca2a5cb809fcec52aebddd4e17f23
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Sep 26 11:27:22 2013 +0200
Related: fdo#38838 remove UniString::SearchBackward
Change-Id: Ia474ee07b1bd411eae8cd1ddd55c4fa83dbd5f47
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index bbd51e2..520b7f4 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -467,16 +467,15 @@ void SvxHyperlinkInternetTp::RefreshMarkWindow()
void SvxHyperlinkInternetTp::SetMarkStr ( const String& aStrMark )
{
- String aStrURL ( maCbbTarget.GetText() );
+ OUString aStrURL ( maCbbTarget.GetText() );
const sal_Unicode sUHash = '#';
- xub_StrLen nPos = aStrURL.SearchBackward( sUHash );
+ sal_Int32 nPos = aStrURL.lastIndexOf( sUHash );
- if( nPos != STRING_NOTFOUND )
- aStrURL.Erase ( nPos );
+ if( nPos != -1 )
+ aStrURL = aStrURL.copy(0, nPos);
- aStrURL += sUHash;
- aStrURL += aStrMark;
+ aStrURL += OUString(sUHash) + aStrMark;
maCbbTarget.SetText ( aStrURL );
}
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index 734a9e9..6572614 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -151,7 +151,7 @@ String SvxHyphenWordDialog::EraseUnusableHyphens_Impl(
// find position nIdx after which all hyphen positions are unusable
xub_StrLen nIdx = STRING_NOTFOUND;
- xub_StrLen nPos = 0, nPos1 = 0, nPos2 = 0;
+ xub_StrLen nPos = 0, nPos1 = 0;
if (nLen)
{
xub_StrLen nStart = 0;
@@ -185,11 +185,11 @@ String SvxHyphenWordDialog::EraseUnusableHyphens_Impl(
nPos = aTxt.SearchAndReplace( aTmp, aEmpty, nPos + 1 );
// 2) remove all hyphenation positions from the start that are not considered by the core
- const String aSearchRange( aTxt.Copy( 0, nPos1 ) );
- nPos2 = aSearchRange.SearchBackward( '-' ); // the '-' position the core will use by default
- if (nPos2 != STRING_NOTFOUND)
+ const OUString aSearchRange( aTxt.Copy( 0, nPos1 ) );
+ sal_Int32 nPos2 = aSearchRange.lastIndexOf( '-' ); // the '-' position the core will use by default
+ if (nPos2 != -1 )
{
- String aLeft( aSearchRange.Copy( 0, nPos2 ) );
+ String aLeft( aSearchRange.copy( 0, nPos2 ) );
nPos = 0;
while (nPos != STRING_NOTFOUND)
{
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 3176db9..1cccc7b 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2349,10 +2349,10 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl()
{
try
{
- String sMain(aDest.GetMainURL( INetURLObject::DECODE_TO_IURI ));
+ OUString sMain(aDest.GetMainURL( INetURLObject::DECODE_TO_IURI ));
sal_Unicode cSlash = '/';
- xub_StrLen nSlashPos = sMain.SearchBackward(cSlash);
- sMain.Erase(nSlashPos);
+ sal_Int32 nSlashPos = sMain.lastIndexOf(cSlash);
+ sMain = sMain.copy(0, nSlashPos);
::ucbhelper::Content aNewContent( sMain, uno::Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
Any aAny;
TransferInfo aInfo;
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index cf8d179..c26bd0b 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -837,13 +837,13 @@ sal_Bool SvtFileDialog::createNewUserFilter( const String& _rNewFilter, sal_Bool
// if the former is not allowed (_bAllowUserDefExt = <FALSE/>), we have to use the ext of the current filter
// (if possible)
sal_Bool bUseCurFilterExt = sal_True;
- String sUserFilter = _pImp->_pUserFilter->GetType();
- xub_StrLen nSepPos = sUserFilter.SearchBackward( '.' );
- if ( STRING_NOTFOUND != nSepPos )
+ OUString sUserFilter = _pImp->_pUserFilter->GetType();
+ sal_Int32 nSepPos = sUserFilter.lastIndexOf( '.' );
+ if ( nSepPos != -1 )
{
- String sUserExt = sUserFilter.Copy( nSepPos + 1 );
- if ( ( STRING_NOTFOUND == sUserExt.Search( '*' ) )
- && ( STRING_NOTFOUND == sUserExt.Search( '?' ) )
+ OUString sUserExt = sUserFilter.copy( nSepPos + 1 );
+ if ( ( -1 == sUserExt.indexOf( '*' ) )
+ && ( -1 == sUserExt.indexOf( '?' ) )
)
bUseCurFilterExt = sal_False;
}
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index a8448e6..f962823 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -240,7 +240,6 @@ public:
xub_StrLen Search( sal_Unicode c, xub_StrLen nIndex = 0 ) const;
xub_StrLen Search( const UniString& rStr, xub_StrLen nIndex = 0 ) const;
xub_StrLen SearchAscii( const sal_Char* pAsciiStr, xub_StrLen nIndex = 0 ) const;
- xub_StrLen SearchBackward( sal_Unicode c, xub_StrLen nIndex = STRING_LEN ) const;
xub_StrLen SearchAndReplace( sal_Unicode c, sal_Unicode cRep,
xub_StrLen nIndex = 0 );
diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx
index 852c755..d87d7db 100644
--- a/padmin/source/adddlg.cxx
+++ b/padmin/source/adddlg.cxx
@@ -265,8 +265,8 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton )
std::list< OUString >::iterator dir;
for( dir = aDirs.begin(); dir != aDirs.end(); ++dir )
{
- ::std::list< String > aFiles;
- ::std::list< String >::iterator file;
+ ::std::list< OUString > aFiles;
+ ::std::list< OUString >::iterator file;
OUStringBuffer aDir( *dir );
aDir.append( sal_Unicode( '/' ) );
aDir.appendAscii( PRINTER_PPDDIR );
@@ -279,8 +279,9 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton )
aFile += "/";
aFile += *file;
- int nPos = file->SearchBackward( '.' );
- if( file->Copy( 0, nPos ) == String( aPPD ) )
+ sal_Int32 nPos = file->lastIndexOf( '.' );
+ OUString sCopy = nPos == -1 ? *file : file->copy(0, nPos);
+ if( sCopy == aPPD )
{
OString aSysPath(OUStringToOString(aFile, aEncoding));
if (unlink(aSysPath.getStr()))
diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx
index 1ca8803..a4a72d2 100644
--- a/padmin/source/helper.cxx
+++ b/padmin/source/helper.cxx
@@ -79,7 +79,7 @@ ResId padmin::PaResId( sal_uInt32 nId )
* FindFiles
*/
-void padmin::FindFiles( const OUString& rDirectory, ::std::list< String >& rResult, const OUString& rSuffixes, bool bRecursive )
+void padmin::FindFiles( const OUString& rDirectory, ::std::list< OUString >& rResult, const OUString& rSuffixes, bool bRecursive )
{
rResult.clear();
@@ -121,9 +121,9 @@ void padmin::FindFiles( const OUString& rDirectory, ::std::list< String >& rResu
OUStringBuffer aSubDir( rDirectory );
aSubDir.appendAscii( "/", 1 );
aSubDir.append( aStatus.getFileName() );
- std::list< String > subfiles;
+ std::list< OUString > subfiles;
FindFiles( aSubDir.makeStringAndClear(), subfiles, rSuffixes, bRecursive );
- for( std::list< String >::const_iterator it = subfiles.begin(); it != subfiles.end(); ++it )
+ for( std::list< OUString >::const_iterator it = subfiles.begin(); it != subfiles.end(); ++it )
{
OUStringBuffer aSubFile( aStatus.getFileName() );
aSubFile.appendAscii( "/", 1 );
diff --git a/padmin/source/helper.hxx b/padmin/source/helper.hxx
index ce4c409..0e7b627 100644
--- a/padmin/source/helper.hxx
+++ b/padmin/source/helper.hxx
@@ -103,7 +103,7 @@ sal_Bool AreYouSure( Window*, int nRid = -1 );
ResId PaResId( sal_uInt32 nId );
-void FindFiles( const OUString& rDirectory, ::std::list< String >& rResult, const OUString& rSuffixes, bool bRecursive = false );
+void FindFiles( const OUString& rDirectory, ::std::list< OUString >& rResult, const OUString& rSuffixes, bool bRecursive = false );
Config& getPadminRC();
void freePadminRC();
diff --git a/padmin/source/newppdlg.cxx b/padmin/source/newppdlg.cxx
index 56c2cbd..74a3035 100644
--- a/padmin/source/newppdlg.cxx
+++ b/padmin/source/newppdlg.cxx
@@ -122,7 +122,7 @@ void PPDImportDialog::Import()
ProgressDialog aProgress( Application::GetFocusWindow() );
aProgress.startOperation( m_aLoadingPPD );
- ::std::list< String > aFiles;
+ ::std::list< OUString > aFiles;
FindFiles( aImportPath, aFiles, OUString( "PS;PPD;PS.GZ;PPD.GZ" ), true );
int i = 0;
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 3a8aed3..bf6beb3 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1056,8 +1056,8 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd
{
// Specified table name is not found in this document. Assume this is an external document.
aDocName = aTab;
- xub_StrLen n = aTab.SearchBackward('.');
- if (n != STRING_NOTFOUND && n > 0)
+ sal_Int32 n = aDocName.lastIndexOf('.');
+ if (n != -1 && n > 0)
{
// Extension found. Strip it.
aTab.Erase(n);
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index 6e6d3e1..b21bb24 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -130,7 +130,7 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium,
if( const SfxItemSet* pItemSet = mrMedium.GetItemSet() )
if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_FILE_NAME ) ) )
maDocUrl = pItem->GetValue();
- maBasePath = maDocUrl.Copy( 0, maDocUrl.SearchBackward( '/' ) + 1 );
+ maBasePath = maDocUrl.copy( 0, maDocUrl.lastIndexOf( '/' ) + 1 );
// extended document options - always own object, try to copy existing data from document
if( const ScExtDocOptions* pOldDocOpt = mrDoc.GetExtDocOptions() )
diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx
index 2f1726d..f2cf2d3 100644
--- a/sc/source/filter/inc/xlroot.hxx
+++ b/sc/source/filter/inc/xlroot.hxx
@@ -82,7 +82,7 @@ struct XclRootData
SfxMedium& mrMedium; /// The medium to import from.
SotStorageRef mxRootStrg; /// The root OLE storage of imported/exported file.
ScDocument& mrDoc; /// The source or destination document.
- String maDocUrl; /// Document URL of imported/exported file.
+ OUString maDocUrl; /// Document URL of imported/exported file.
String maBasePath; /// Base path of imported/exported file (path of maDocUrl).
String maUserName; /// Current user name.
const String maDefPassword; /// The default password used for stream encryption.
@@ -178,7 +178,7 @@ public:
/** Returns the medium to import from. */
inline SfxMedium& GetMedium() const { return mrData.mrMedium; }
/** Returns the document URL of the imported/exported file. */
- inline const String& GetDocUrl() const { return mrData.maDocUrl; }
+ inline const OUString& GetDocUrl() const { return mrData.maDocUrl; }
/** Returns the base path of the imported/exported file. */
inline const String& GetBasePath() const { return mrData.maBasePath; }
/** Returns the current user name. */
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index fe22a33..94b3505 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1116,13 +1116,13 @@ ANCHOR_SETEVENT:
// wir hier ganz rigoros raus.
if( aName.Len() )
{
- String sDecoded( INetURLObject::decode( aName, INET_HEX_ESCAPE,
+ OUString sDecoded( INetURLObject::decode( aName, INET_HEX_ESCAPE,
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ));
- xub_StrLen nPos = sDecoded.SearchBackward( cMarkSeparator );
- if( STRING_NOTFOUND != nPos )
+ sal_Int32 nPos = sDecoded.lastIndexOf( cMarkSeparator );
+ if( nPos != -1 )
{
- OUString sCmp(comphelper::string::remove(sDecoded.Copy(nPos+1), ' '));
+ OUString sCmp(comphelper::string::remove(sDecoded.copy(nPos+1), ' '));
if( !sCmp.isEmpty() )
{
sCmp = sCmp.toAsciiLowerCase();
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index bb4cce1..fcf206e 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -64,8 +64,8 @@ using namespace ::com::sun::star;
void SwHTMLParser::NewDivision( int nToken )
{
- OUString aId;
- String aHRef, aStyle, aLang, aDir;
+ OUString aId, aHRef;
+ String aStyle, aLang, aDir;
OUString aClass;
SvxAdjust eAdjust = HTML_CENTER_ON==nToken ? SVX_ADJUST_CENTER
: SVX_ADJUST_END;
@@ -114,7 +114,7 @@ void SwHTMLParser::NewDivision( int nToken )
sal_Bool bAppended = sal_False;
if( pPam->GetPoint()->nContent.GetIndex() )
{
- AppendTxtNode( bHeader||bFooter||!aId.isEmpty()||aHRef.Len() ? AM_NORMAL
+ AppendTxtNode( bHeader||bFooter||!aId.isEmpty()|| !aHRef.isEmpty() ? AM_NORMAL
: AM_NOSPACE );
bAppended = sal_True;
}
@@ -242,7 +242,7 @@ void SwHTMLParser::NewDivision( int nToken )
}
// Bereiche fuegen wir in Rahmen nur dann ein, wenn der Bereich gelinkt ist.
- if( (!aId.isEmpty() && !bPositioned) || aHRef.Len() )
+ if( (!aId.isEmpty() && !bPositioned) || !aHRef.isEmpty() )
{
// Bereich einfuegen (muss vor dem Setzten von Attributen erfolgen,
// weil die Section vor der PaM-Position eingefuegt.
@@ -266,49 +266,49 @@ void SwHTMLParser::NewDivision( int nToken )
// Namen der Section eindeutig machen
const OUString aName( pDoc->GetUniqueSectionName( !aId.isEmpty() ? &aId : 0 ) );
- if( aHRef.Len() )
+ if( !aHRef.isEmpty() )
{
sal_Unicode cDelim = 255U;
- String aURL;
- xub_StrLen nPos = aHRef.SearchBackward( cDelim );
- xub_StrLen nPos2 = STRING_NOTFOUND;
- if( STRING_NOTFOUND != nPos )
+ sal_Int32 nPos = aHRef.lastIndexOf( cDelim );
+ sal_Int32 nPos2 = -1;
+ if( nPos != -1 )
{
- nPos2 = aHRef.SearchBackward( cDelim, nPos );
- if( STRING_NOTFOUND != nPos2 )
+ nPos2 = aHRef.lastIndexOf( cDelim, nPos );
+ if( nPos2 != -1 )
{
- xub_StrLen nTmp = nPos;
+ sal_Int32 nTmp = nPos;
nPos = nPos2;
nPos2 = nTmp;
}
}
- if( STRING_NOTFOUND == nPos )
+ OUString aURL;
+ if( nPos == -1 )
{
aURL = URIHelper::SmartRel2Abs(INetURLObject( sBaseURL ), aHRef, Link(), false);
}
else
{
- aURL = URIHelper::SmartRel2Abs(INetURLObject( sBaseURL ), aHRef.Copy( 0, nPos ), Link(), false );
- aURL += sfx2::cTokenSeparator;
- if( STRING_NOTFOUND == nPos2 )
+ aURL = URIHelper::SmartRel2Abs(INetURLObject( sBaseURL ), aHRef.copy( 0, nPos ), Link(), false );
+ aURL += OUString(sfx2::cTokenSeparator);
+ if( nPos2 == -1 )
{
- aURL += aHRef.Copy( nPos+1 );
+ aURL += aHRef.copy( nPos+1 );
}
else
{
- aURL += aHRef.Copy( nPos+1, nPos2 - (nPos+1) );
- aURL += sfx2::cTokenSeparator;
- aURL += String(rtl::Uri::decode( aHRef.Copy( nPos2+1 ),
+ aURL += aHRef.copy( nPos+1, nPos2 - (nPos+1) );
+ aURL += OUString(sfx2::cTokenSeparator);
+ aURL += rtl::Uri::decode( aHRef.copy( nPos2+1 ),
rtl_UriDecodeWithCharset,
- RTL_TEXTENCODING_ISO_8859_1 ));
+ RTL_TEXTENCODING_ISO_8859_1 );
}
}
aHRef = aURL;
}
- SwSectionData aSection( (aHRef.Len()) ? FILE_LINK_SECTION
+ SwSectionData aSection( (!aHRef.isEmpty()) ? FILE_LINK_SECTION
: CONTENT_SECTION, aName );
- if( aHRef.Len() )
+ if( !aHRef.isEmpty() )
{
aSection.SetLinkFileName( aHRef );
aSection.SetProtectFlag(true);
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index df04777..6e5b6ab 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1085,11 +1085,11 @@ void SwHTMLWriter::OutImplicitMark( const String& rMark,
void SwHTMLWriter::OutHyperlinkHRefValue( const String& rURL )
{
- String sURL( rURL );
- xub_StrLen nPos = sURL.SearchBackward( cMarkSeparator );
- if( STRING_NOTFOUND != nPos )
+ OUString sURL( rURL );
+ sal_Int32 nPos = sURL.lastIndexOf( cMarkSeparator );
+ if( nPos != -1 )
{
- OUString sCmp(comphelper::string::remove(sURL.Copy(nPos+1), ' '));
+ OUString sCmp(comphelper::string::remove(sURL.copy(nPos+1), ' '));
if( !sCmp.isEmpty() )
{
sCmp = sCmp.toAsciiLowerCase();
@@ -1101,7 +1101,7 @@ void SwHTMLWriter::OutHyperlinkHRefValue( const String& rURL )
sCmp == "outline" ||
sCmp == "text" )
{
- sURL.SearchAndReplaceAll( '?', '_' ); // '?' causes problems in IE/Netscape 5
+ sURL = sURL.replace( '?', '_' ); // '?' causes problems in IE/Netscape 5
}
}
}
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 1c3ab95..e0029d9 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2854,13 +2854,13 @@ void MSWordExportBase::AddLinkTarget(const String& rURL)
if( !rURL.Len() || rURL.GetChar(0) != INET_MARK_TOKEN )
return;
- String aURL( BookmarkToWriter( rURL.Copy( 1 ) ) );
- xub_StrLen nPos = aURL.SearchBackward( cMarkSeparator );
+ OUString aURL( BookmarkToWriter( rURL.Copy( 1 ) ) );
+ sal_Int32 nPos = aURL.lastIndexOf( cMarkSeparator );
if( nPos < 2 )
return;
- OUString sCmp(comphelper::string::remove(aURL.Copy(nPos+1), ' '));
+ OUString sCmp(comphelper::string::remove(aURL.copy(nPos+1), ' '));
if( sCmp.isEmpty() )
return;
@@ -2869,7 +2869,7 @@ void MSWordExportBase::AddLinkTarget(const String& rURL)
if( sCmp == "outline" )
{
SwPosition aPos( *pCurPam->GetPoint() );
- String aOutline( BookmarkToWriter(aURL.Copy( 0, nPos )) );
+ String aOutline( BookmarkToWriter(aURL.copy( 0, nPos )) );
// If we can find the outline this bookmark refers to
// save the name of the bookmark and the
// node index number of where it points to
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 82ea7a4..e3defb4 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2483,27 +2483,26 @@ void SwWW8ImplReader::Read_SubF_Ruby( WW8ReadFieldParams& rReadParam)
{
if (-2 == rReadParam.SkipToNextToken())
{
- String sPart = rReadParam.GetResult();
- xub_StrLen nBegin = sPart.Search('(');
+ OUString sPart = rReadParam.GetResult();
+ sal_Int32 nBegin = sPart.indexOf('(');
//Word disallows brackets in this field,
- xub_StrLen nEnd = sPart.Search(')');
+ sal_Int32 nEnd = sPart.indexOf(')');
- if ((nBegin != STRING_NOTFOUND) &&
- (nEnd != STRING_NOTFOUND))
+ if ((nBegin != -1) &&
+ (nEnd != -1))
{
- sRuby = sPart.Copy(nBegin+1,nEnd-nBegin-1);
+ sRuby = sPart.copy(nBegin+1,nEnd-nBegin-1);
}
- if (STRING_NOTFOUND ==
- (nBegin = sPart.Search(',',nEnd)))
+ if (-1 ==
+ (nBegin = sPart.indexOf(',',nEnd)))
{
- nBegin = sPart.Search(';',nEnd);
+ nBegin = sPart.indexOf(';',nEnd);
}
- nEnd = sPart.SearchBackward(')');
- if ((nBegin != STRING_NOTFOUND) &&
- (nEnd != STRING_NOTFOUND))
+ nEnd = sPart.lastIndexOf(')');
+ if ((nBegin != -1) && (nEnd != -1))
{
- sText = sPart.Copy(nBegin+1,nEnd-nBegin-1);
+ sText = sPart.copy(nBegin+1,nEnd-nBegin-1);
}
}
}
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index dcd6b8f..8cfec10 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1484,12 +1484,12 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove)
{
//go left to find a predecessor or simple text
--nIndex;
- String sPara = pTextEngine->GetText( nPara );
- xub_StrLen nSearchIndex = sPara.SearchBackward( '>', nIndex+1 );
- if( nSearchIndex != STRING_NOTFOUND && nSearchIndex == nIndex )
+ OUString sPara = pTextEngine->GetText( nPara );
+ sal_Int32 nSearchIndex = sPara.lastIndexOf( '>', nIndex+1 );
+ if( nSearchIndex != -1 && nSearchIndex == nIndex )
{
- nSearchIndex = sPara.SearchBackward( '<', nIndex );
- if( nSearchIndex != STRING_NOTFOUND )
+ nSearchIndex = sPara.lastIndexOf( '<', nIndex );
+ if( nSearchIndex != -1 )
nIndex = nSearchIndex;
}
}
diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx
index 2a73396..5d1d7e4 100644
--- a/tools/source/string/tustring.cxx
+++ b/tools/source/string/tustring.cxx
@@ -235,27 +235,6 @@ xub_StrLen STRING::Match( const STRING& rStr ) const
return STRING_MATCH;
}
-xub_StrLen STRING::SearchBackward( STRCODE c, xub_StrLen nIndex ) const
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-
- if ( nIndex > mpData->mnLen )
- nIndex = (xub_StrLen)mpData->mnLen;
-
- const STRCODE* pStr = mpData->maStr;
- pStr += nIndex;
-
- while ( nIndex )
- {
- nIndex--;
- pStr--;
- if ( *pStr == c )
- return nIndex;
- }
-
- return STRING_NOTFOUND;
-}
-
void STRING::SearchAndReplaceAll( const STRING& rStr, const STRING& rRepStr )
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx
index 350be25..5d29c23 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -676,19 +676,19 @@ void AquaSalMenu::SetItemText( unsigned /*i_nPos*/, SalMenuItem* i_pSalMenuItem,
AquaSalMenuItem *pAquaSalMenuItem = (AquaSalMenuItem *) i_pSalMenuItem;
// Delete mnemonics
- String aText( comphelper::string::remove(i_rText, '~') );
+ OUString aText( comphelper::string::remove(i_rText, '~') );
/* #i90015# until there is a correct solution
strip out any appended (.*) in menubar entries
*/
if( mbMenuBar )
{
- xub_StrLen nPos = aText.SearchBackward( sal_Unicode( '(' ) );
- if( nPos != STRING_NOTFOUND )
+ sal_Int32 nPos = aText.lastIndexOf( sal_Unicode( '(' ) );
+ if( nPos != -1 )
{
- xub_StrLen nPos2 = aText.Search( sal_Unicode( ')' ) );
- if( nPos2 != STRING_NOTFOUND )
- aText.Erase( nPos, nPos2-nPos+1 );
+ sal_Int32 nPos2 = aText.indexOf( sal_Unicode( ')' ) );
+ if( nPos2 != -1 )
+ aText = aText.replaceAt( nPos, nPos2-nPos+1, "" );
}
}
More information about the Libreoffice-commits
mailing list