[Libreoffice-commits] core.git: 8 commits - basic/source cui/source forms/source reportdesign/source svx/source sw/inc sw/source
Eike Rathke
erack at redhat.com
Thu Feb 25 16:34:07 UTC 2016
basic/source/runtime/runtime.cxx | 9 +++++----
cui/source/options/optaboutconfig.cxx | 5 +++--
cui/source/options/optaboutconfig.hxx | 4 ++--
forms/source/xforms/computedexpression.cxx | 11 +++++------
reportdesign/source/ui/inspection/GeometryHandler.cxx | 17 +++++++++--------
svx/source/form/fmsrcimp.cxx | 10 +++++-----
sw/inc/unosrch.hxx | 4 ++--
sw/source/core/crsr/findattr.cxx | 3 ++-
sw/source/core/crsr/findtxt.cxx | 8 ++++----
sw/source/core/unocore/unosrch.cxx | 12 ++++++++++--
sw/source/uibase/index/idxmrk.cxx | 4 ----
11 files changed, 47 insertions(+), 40 deletions(-)
New commits:
commit 224ecda045f49a0e96d3117233b667de6d5c6837
Author: Eike Rathke <erack at redhat.com>
Date: Thu Feb 25 17:04:54 2016 +0100
compare on AlgorithmType2
Change-Id: I36c6d690662913f12acc2b5e26ea05c8279ced19
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 43bec93..82c077f 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -19,6 +19,7 @@
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/util/SearchOptions2.hpp>
+#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
#include <i18nlangtag/languagetag.hxx>
#include <hintids.hxx>
@@ -1141,7 +1142,7 @@ int SwFindParaAttr::Find( SwPaM* pCursor, SwMoveFn fnMove, const SwPaM* pRegion,
if( bReplaceText )
{
const bool bRegExp(
- SearchAlgorithms_REGEXP == pSearchOpt->algorithmType);
+ SearchAlgorithms2::REGEXP == pSearchOpt->AlgorithmType2);
SwIndex& rSttCntIdx = pCursor->Start()->nContent;
const sal_Int32 nSttCnt = rSttCntIdx.GetIndex();
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index f918bb6..1a8924c 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -238,7 +238,7 @@ bool SwPaM::Find( const SearchOptions2& rSearchOpt, bool bSearchInNotes , utl::T
bool bFirst = true;
SwContentNode * pNode;
- const bool bRegSearch = SearchAlgorithms_REGEXP == rSearchOpt.algorithmType;
+ const bool bRegSearch = SearchAlgorithms2::REGEXP == rSearchOpt.AlgorithmType2;
const bool bChkEmptyPara = bRegSearch && 2 == rSearchOpt.searchString.getLength() &&
( rSearchOpt.searchString == "^$" ||
rSearchOpt.searchString == "$^" );
@@ -510,7 +510,7 @@ bool SwPaM::DoSearch( const SearchOptions2& rSearchOpt, utl::TextSearch& rSText,
sal_uInt16 nSearchScript = 0;
sal_uInt16 nCurrScript = 0;
- if ( SearchAlgorithms_APPROXIMATE == rSearchOpt.algorithmType &&
+ if ( SearchAlgorithms2::APPROXIMATE == rSearchOpt.AlgorithmType2 &&
g_pBreakIt->GetBreakIter().is() )
{
pScriptIter = new SwScriptIterator( sCleanStr, nStart, bSrchForward );
@@ -658,7 +658,7 @@ int SwFindParaText::Find( SwPaM* pCursor, SwMoveFn fnMove,
if( bFnd && m_bReplace ) // replace string
{
// use replace method in SwDoc
- const bool bRegExp(SearchAlgorithms_REGEXP == m_rSearchOpt.algorithmType);
+ const bool bRegExp(SearchAlgorithms2::REGEXP == m_rSearchOpt.AlgorithmType2);
SwIndex& rSttCntIdx = pCursor->Start()->nContent;
const sal_Int32 nSttCnt = rSttCntIdx.GetIndex();
// add to shell-cursor-ring so that the regions will be moved eventually
@@ -745,7 +745,7 @@ OUString *ReplaceBackReferences( const SearchOptions2& rSearchOpt, SwPaM* pPam )
{
OUString *pRet = nullptr;
if( pPam && pPam->HasMark() &&
- SearchAlgorithms_REGEXP == rSearchOpt.algorithmType )
+ SearchAlgorithms2::REGEXP == rSearchOpt.AlgorithmType2 )
{
const SwContentNode* pTextNode = pPam->GetContentNode();
if( pTextNode && pTextNode->IsTextNode() && pTextNode == pPam->GetContentNode( false ) )
commit f6b249d18fd2eff469985ff5da6777fddafacffe
Author: Eike Rathke <erack at redhat.com>
Date: Thu Feb 25 16:54:33 2016 +0100
remove unused Search includes
There are a lot more though..
Change-Id: I8b1e31e9f914057329b54603c21bc98d8dd2fca7
diff --git a/sw/source/uibase/index/idxmrk.cxx b/sw/source/uibase/index/idxmrk.cxx
index 7994686..99eb38d 100644
--- a/sw/source/uibase/index/idxmrk.cxx
+++ b/sw/source/uibase/index/idxmrk.cxx
@@ -23,14 +23,10 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/util/SearchOptions.hpp>
-#include <com/sun/star/util/SearchFlags.hpp>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <svl/stritem.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/dispatch.hxx>
#include <svl/eitem.hxx>
-#include <unotools/textsearch.hxx>
#include <editeng/scripttypeitem.hxx>
#include <svl/itemset.hxx>
#include <editeng/langitem.hxx>
commit cda1318aefed103917b40ac751826f0579cd557c
Author: Eike Rathke <erack at redhat.com>
Date: Thu Feb 25 16:44:56 2016 +0100
use SearchOptions2
Change-Id: Ibae6b5d3cacc84980d460432829be31782f941bc
diff --git a/sw/inc/unosrch.hxx b/sw/inc/unosrch.hxx
index 9f0536b..0fec59d 100644
--- a/sw/inc/unosrch.hxx
+++ b/sw/inc/unosrch.hxx
@@ -31,7 +31,7 @@ class SwSearchProperties_Impl;
class SfxItemSet;
namespace com{namespace sun{namespace star{namespace util{
- struct SearchOptions;
+ struct SearchOptions2;
}}}}
class SwXTextSearch : public cppu::WeakImplHelper
@@ -109,7 +109,7 @@ public:
bool HasSearchAttributes() const;
bool HasReplaceAttributes() const;
- void FillSearchOptions( css::util::SearchOptions&
+ void FillSearchOptions( css::util::SearchOptions2&
rSearchOpt ) const;
};
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index b192e55..7052638 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -27,7 +27,8 @@
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <editeng/unolingu.hxx>
-#include <com/sun/star/util/SearchOptions.hpp>
+#include <com/sun/star/util/SearchOptions2.hpp>
+#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -715,11 +716,12 @@ uno::Sequence< OUString > SwXTextSearch::getSupportedServiceNames() throw( uno::
return aRet;
}
-void SwXTextSearch::FillSearchOptions( util::SearchOptions& rSearchOpt ) const
+void SwXTextSearch::FillSearchOptions( util::SearchOptions2& rSearchOpt ) const
{
if( bSimilarity )
{
rSearchOpt.algorithmType = util::SearchAlgorithms_APPROXIMATE;
+ rSearchOpt.AlgorithmType2 = util::SearchAlgorithms2::APPROXIMATE;
rSearchOpt.changedChars = nLevExchange;
rSearchOpt.deletedChars = nLevRemove;
rSearchOpt.insertedChars = nLevAdd;
@@ -727,9 +729,15 @@ void SwXTextSearch::FillSearchOptions( util::SearchOptions& rSearchOpt ) const
rSearchOpt.searchFlag |= util::SearchFlags::LEV_RELAXED;
}
else if( bExpr )
+ {
rSearchOpt.algorithmType = util::SearchAlgorithms_REGEXP;
+ rSearchOpt.AlgorithmType2 = util::SearchAlgorithms2::REGEXP;
+ }
else
+ {
rSearchOpt.algorithmType = util::SearchAlgorithms_ABSOLUTE;
+ rSearchOpt.AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
+ }
rSearchOpt.Locale = GetAppLanguageTag().getLocale();
rSearchOpt.searchString = sSearchText;
commit f75b30c2e82e3e148a3d3acea163d4bb11ea5576
Author: Eike Rathke <erack at redhat.com>
Date: Thu Feb 25 16:31:19 2016 +0100
use SearchOptions2
Change-Id: I4d3820d097d520fdf7cce8b41d734dd4e2e8866f
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 6e5fbbc..4c51faf 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -57,7 +57,8 @@
#include <com/sun/star/sdb/FilterDialog.hpp>
#include <com/sun/star/sdb/SQLContext.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/util/SearchOptions.hpp>
+#include <com/sun/star/util/SearchOptions2.hpp>
+#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
@@ -1851,21 +1852,21 @@ bool GeometryHandler::impl_isDefaultFunction_nothrow( const uno::Reference< repo
try
{
const OUString sFormula( _xFunction->getFormula() );
- util::SearchOptions aSearchOptions;
- aSearchOptions.algorithmType = util::SearchAlgorithms_REGEXP;
+ util::SearchOptions2 aSearchOptions;
+ aSearchOptions.AlgorithmType2 = util::SearchAlgorithms2::REGEXP;
aSearchOptions.searchFlag = 0x00000100;
::std::vector< DefaultFunction >::const_iterator aIter = m_aDefaultFunctions.begin();
::std::vector< DefaultFunction >::const_iterator aDeEnd = m_aDefaultFunctions.end();
for (; aIter != aDeEnd; ++aIter)
{
aSearchOptions.searchString = aIter->m_sSearchString;
- utl::TextSearch aTextSearch( utl::TextSearch::UpgradeToSearchOptions2( aSearchOptions));
+ utl::TextSearch aTextSearch( aSearchOptions);
sal_Int32 start = 0;
sal_Int32 end = sFormula.getLength();
if ( aTextSearch.SearchForward(sFormula,&start,&end) && start == 0 && end == sFormula.getLength()) // default function found
{
aSearchOptions.searchString = "\\[[:alpha:]+([:space:]*[:alnum:]*)*\\]";
- utl::TextSearch aDataSearch( utl::TextSearch::UpgradeToSearchOptions2( aSearchOptions));
+ utl::TextSearch aDataSearch( aSearchOptions);
aDataSearch.SearchForward(sFormula,&start,&end );
++start;
_rDataField = sFormula.copy(start,end-start-1);
@@ -2072,11 +2073,11 @@ bool GeometryHandler::impl_isCounterFunction_throw(const OUString& _sQuotedFunct
if ( aInitalFormula.IsPresent )
{
const OUString sFormula( aFind.first->second.first->getFormula() );
- util::SearchOptions aSearchOptions;
- aSearchOptions.algorithmType = util::SearchAlgorithms_REGEXP;
+ util::SearchOptions2 aSearchOptions;
+ aSearchOptions.AlgorithmType2 = util::SearchAlgorithms2::REGEXP;
aSearchOptions.searchFlag = 0x00000100;
aSearchOptions.searchString = m_aCounterFunction.m_sSearchString;
- utl::TextSearch aTextSearch( utl::TextSearch::UpgradeToSearchOptions2( aSearchOptions));
+ utl::TextSearch aTextSearch( aSearchOptions);
sal_Int32 start = 0;
sal_Int32 end = sFormula.getLength();
if ( aTextSearch.SearchForward(sFormula,&start,&end) && start == 0 && end == sFormula.getLength()) // counter function found
commit 25d4142ce1fa2c1581ea03b66db6be694ac5fedb
Author: Eike Rathke <erack at redhat.com>
Date: Thu Feb 25 16:25:16 2016 +0100
use SearchOptions2
Change-Id: I29ed7ced7bedc0b00e58aa6b15fbde8c9f0859f4
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index 2b4abd4..14fcaf9 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -29,8 +29,8 @@
#include <svx/dialmgr.hxx>
#include <vcl/svapp.hxx>
#include <unotools/textsearch.hxx>
-#include <com/sun/star/util/SearchOptions.hpp>
-#include <com/sun/star/util/SearchAlgorithms.hpp>
+#include <com/sun/star/util/SearchOptions2.hpp>
+#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <com/sun/star/util/SearchResult.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/lang/Locale.hpp>
@@ -549,8 +549,8 @@ FmSearchEngine::SEARCH_RESULT FmSearchEngine::SearchRegularApprox(const OUString
FieldCollection::iterator iterInitialField = iterFieldLoop;
// Parameter sammeln
- SearchOptions aParam;
- aParam.algorithmType = m_bRegular ? SearchAlgorithms_REGEXP : SearchAlgorithms_APPROXIMATE;
+ SearchOptions2 aParam;
+ aParam.AlgorithmType2 = m_bRegular ? SearchAlgorithms2::REGEXP : SearchAlgorithms2::APPROXIMATE;
aParam.searchFlag = 0;
aParam.transliterateFlags = GetTransliterationFlags();
if ( !GetTransliteration() )
@@ -567,7 +567,7 @@ FmSearchEngine::SEARCH_RESULT FmSearchEngine::SearchRegularApprox(const OUString
}
aParam.searchString = strExpression;
aParam.Locale = SvtSysLocale().GetLanguageTag().getLocale();
- ::utl::TextSearch aLocalEngine( utl::TextSearch::UpgradeToSearchOptions2( aParam));
+ ::utl::TextSearch aLocalEngine( aParam);
bool bFound = false;
commit c09404917318b026902c2f26bdc16d0e52eb4720
Author: Eike Rathke <erack at redhat.com>
Date: Thu Feb 25 16:18:57 2016 +0100
use SearchOptions2
Change-Id: I58d39616dc15fc973e1377ed205452a683baf080
diff --git a/forms/source/xforms/computedexpression.cxx b/forms/source/xforms/computedexpression.cxx
index d67c8ba..31b9aaf 100644
--- a/forms/source/xforms/computedexpression.cxx
+++ b/forms/source/xforms/computedexpression.cxx
@@ -33,7 +33,7 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/util/SearchAlgorithms.hpp>
+#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <osl/diagnose.h>
@@ -52,8 +52,7 @@ using com::sun::star::xml::xpath::XPathExtension;
using com::sun::star::xml::xpath::XXPathExtension;
using com::sun::star::xml::xpath::XXPathObject;
using com::sun::star::xml::xpath::XPathObjectType_XPATH_UNDEFINED;
-using com::sun::star::util::SearchOptions;
-using com::sun::star::util::SearchAlgorithms_REGEXP;
+using com::sun::star::util::SearchOptions2;
namespace xforms
@@ -87,10 +86,10 @@ bool ComputedExpression::_checkExpression( const sal_Char* pExpression ) const
assert(pExpression && "no expression?");
// call RegExp engine
- SearchOptions aSearchOptions;
- aSearchOptions.algorithmType = SearchAlgorithms_REGEXP;
+ SearchOptions2 aSearchOptions;
+ aSearchOptions.AlgorithmType2 = css::util::SearchAlgorithms2::REGEXP;
aSearchOptions.searchString = OUString( pExpression, strlen(pExpression), RTL_TEXTENCODING_ASCII_US );
- utl::TextSearch aTextSearch( utl::TextSearch::UpgradeToSearchOptions2( aSearchOptions) );
+ utl::TextSearch aTextSearch( aSearchOptions );
sal_Int32 nLength = msExpression.getLength();
sal_Int32 nStart = 0;
commit b3ee4ba346ca21a89158a86c7fc1fc3b25d3e371
Author: Eike Rathke <erack at redhat.com>
Date: Thu Feb 25 16:13:39 2016 +0100
use SearchOptions2
Change-Id: I1eaf001475bacb29d23cb7465a0a19d89afb802b
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 85dc3f8..4d5110d 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/util/XChangesBatch.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
+#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <unotools/textsearch.hxx>
#include <vector>
@@ -172,7 +173,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI
aTabs[3] = aTabs[2] + fWidth * 20;
aTabs[4] = aTabs[3] + fWidth * 8;
- m_options.algorithmType = util::SearchAlgorithms_ABSOLUTE;
+ m_options.AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
m_options.transliterateFlags |= i18n::TransliterationModules_IGNORE_CASE;
m_options.searchFlag |= (util::SearchFlags::REG_NOT_BEGINOFLINE |
util::SearchFlags::REG_NOT_ENDOFLINE);
@@ -833,7 +834,7 @@ IMPL_LINK_NOARG_TYPED( CuiAboutConfigTabPage, SearchHdl_Impl, Button*, void)
else
{
m_options.searchString = m_pSearchEdit->GetText();
- utl::TextSearch textSearch( utl::TextSearch::UpgradeToSearchOptions2( m_options) );
+ utl::TextSearch textSearch( m_options );
for (auto const& it : m_prefBoxEntries)
{
sal_Int32 endPos, startPos = 0;
diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx
index db0df56..a9ecec3 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -12,7 +12,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/util/SearchOptions.hpp>
+#include <com/sun/star/util/SearchOptions2.hpp>
#include <sfx2/tabdlg.hxx>
#include <svtools/simptabl.hxx>
@@ -52,7 +52,7 @@ private:
VclPtr< SvSimpleTable > m_pPrefBox;
//for search
- css::util::SearchOptions m_options;
+ css::util::SearchOptions2 m_options;
SvTreeListEntries m_prefBoxEntries;
void AddToModifiedVector( const std::shared_ptr< Prop_Impl >& rProp );
commit c20c697294dc0eae789cbdcca382c3f60ed3d497
Author: Eike Rathke <erack at redhat.com>
Date: Thu Feb 25 16:08:08 2016 +0100
change to SearchOptions2
Change-Id: I07a72492f1cdc566109bf8e9247368558f420abe
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index b3c092b..b4ce32c 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -28,7 +28,8 @@
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/script/XDefaultMethod.hpp>
#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/util/SearchOptions.hpp>
+#include <com/sun/star/util/SearchOptions2.hpp>
+#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
@@ -1550,9 +1551,9 @@ void SbiRuntime::StepLIKE()
OUString pattern = VBALikeToRegexp(refVar1->GetOUString());
OUString value = refVar2->GetOUString();
- css::util::SearchOptions aSearchOpt;
+ css::util::SearchOptions2 aSearchOpt;
- aSearchOpt.algorithmType = css::util::SearchAlgorithms_REGEXP;
+ aSearchOpt.AlgorithmType2 = css::util::SearchAlgorithms2::REGEXP;
aSearchOpt.Locale = Application::GetSettings().GetLanguageTag().getLocale();
aSearchOpt.searchString = pattern;
@@ -1568,7 +1569,7 @@ void SbiRuntime::StepLIKE()
aSearchOpt.transliterateFlags |= css::i18n::TransliterationModules_IGNORE_CASE;
}
SbxVariable* pRes = new SbxVariable;
- utl::TextSearch aSearch( utl::TextSearch::UpgradeToSearchOptions2( aSearchOpt));
+ utl::TextSearch aSearch( aSearchOpt);
sal_Int32 nStart=0, nEnd=value.getLength();
bool bRes = aSearch.SearchForward(value, &nStart, &nEnd);
pRes->PutBool( bRes );
More information about the Libreoffice-commits
mailing list