[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source

2023-06-15 Thread Maxim Monastirsky (via logerrit)
 editeng/source/outliner/outlvw.cxx|   12 +
 include/editeng/outliner.hxx  |2 
 sw/inc/AnnotationWin.hxx  |5 --
 sw/inc/fmtfld.hxx |3 -
 sw/source/core/fields/textapi.cxx |4 +
 sw/source/core/text/txtfld.cxx|5 --
 sw/source/uibase/docvw/AnnotationWin.cxx  |   18 ---
 sw/source/uibase/docvw/AnnotationWin2.cxx |   72 --
 sw/source/uibase/docvw/PostItMgr.cxx  |   29 
 9 files changed, 20 insertions(+), 130 deletions(-)

New commits:
commit 6cb6f76095d2df07102ffd3da7accf7d075df90b
Author: Maxim Monastirsky 
AuthorDate: Thu Jun 15 11:39:25 2023 +0300
Commit: Maxim Monastirsky 
CommitDate: Fri Jun 16 00:49:09 2023 +0200

tdf#103064 sw: use the comment style by default instead of DF

As part of that, language changes in the document's body are
no longer applied to comments, as that would be a DF. Instead,
the default language of comments is controlled via the style
(see tdf#153805 for the use case).

Change-Id: Icfa9a7334b52fe74292e82fa8daa01a15197e384
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153158
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky 

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 705b5e10b06b..382d1d63f7da 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -715,6 +715,18 @@ void OutlinerView::CreateSelectionList 
(std::vector )
 }
 }
 
+void OutlinerView::SetStyleSheet(const OUString& rStyleName)
+{
+ParaRange aParas = ImpGetSelectedParagraphs(false);
+
+auto pStyle = pOwner->GetStyleSheetPool()->Find(rStyleName, 
SfxStyleFamily::Para);
+if (!pStyle)
+return;
+
+for (sal_Int32 nPara = aParas.nStartPara; nPara <= aParas.nEndPara; 
nPara++)
+pOwner->SetStyleSheet(nPara, static_cast(pStyle));
+}
+
 const SfxStyleSheet* OutlinerView::GetStyleSheet() const
 {
 return pEditView->GetStyleSheet();
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 7622138271ee..0b9b06395dba 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -267,6 +267,8 @@ public:
 voidPaste( bool bUseSpecial = false );
 voidPasteSpecial();
 
+void SetStyleSheet(const OUString& rStyleName);
+
 const SfxStyleSheet*  GetStyleSheet() const;
 SfxStyleSheet*  GetStyleSheet();
 
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index c3d556085a03..f7ac7b301d46 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -171,8 +171,6 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 
 bool IsMouseOverSidebarWin() const { return mbMouseOver; }
 
-void SetLanguage(const SvxLanguageItem& rNewItem);
-
 void ChangeSidebarItem( SwSidebarItem const & rSidebarItem );
 virtual css::uno::Reference< css::accessibility::XAccessible > 
CreateAccessible() override;
 
@@ -216,7 +214,6 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 virtual voidDataChanged( const DataChangedEvent& rDCEvt ) override;
 
 voidSetSizePixel( const Size& rNewSize ) override;
-SfxItemSet  DefaultItem();
 
 DECL_DLLPRIVATE_LINK(ModifyHdl, LinkParamNone*, void);
 DECL_DLLPRIVATE_LINK(ScrollHdl, weld::ScrolledWindow&, void);
@@ -228,8 +225,6 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 
 sal_uInt32 CountFollowing();
 
-SvxLanguageItem GetLanguage() const;
-
 void SetMenuButtonColors();
 
 SwPostItMgr&mrMgr;
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index 6f5811539b17..4c4c1ea91293 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -178,8 +178,7 @@ enum class SwFormatFieldHintWhich
 REMOVED= 2,
 FOCUS  = 3,
 CHANGED= 4,
-LANGUAGE   = 5,
-RESOLVED   = 6
+RESOLVED   = 5
 };
 
 class SW_DLLPUBLIC SwFormatFieldHint final : public SfxHint
diff --git a/sw/source/core/fields/textapi.cxx 
b/sw/source/core/fields/textapi.cxx
index 88520065c7e3..6dcdc99d3b47 100644
--- a/sw/source/core/fields/textapi.cxx
+++ b/sw/source/core/fields/textapi.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -189,6 +190,9 @@ void SwTextAPIEditSource::SetString( const OUString& rText )
 m_pImpl->mpOutliner->Clear();
 
 EnsureOutliner();
+
+if (auto pStyle = 
m_pImpl->mpOutliner->GetStyleSheetPool()->Find(SwResId(STR_POOLCOLL_COMMENT), 
SfxStyleFamily::Para))
+m_pImpl->mpOutliner->SetStyleSheet(0, 
static_cast(pStyle));
 m_pImpl->mpOutliner->Insert( rText );
 }
 
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 004a2bc17c09..aa8fef7331c5 100644
--- a/sw/source/core/text/txtfld.cxx
+++ 

[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source vcl/source

2021-08-22 Thread Noel Grandin (via logerrit)
 editeng/source/editeng/impedit.cxx |   10 +-
 editeng/source/editeng/impedit.hxx |2 +-
 editeng/source/misc/txtrange.cxx   |6 +++---
 include/editeng/txtrange.hxx   |2 +-
 sw/inc/ndnotxt.hxx |   12 ++--
 sw/source/core/docnode/ndnotxt.cxx |   12 ++--
 vcl/source/outdev/gradient.cxx |8 
 7 files changed, 26 insertions(+), 26 deletions(-)

New commits:
commit 4c5e264df432f4e6836535cbac7231ab579af424
Author: Noel Grandin 
AuthorDate: Sat Aug 21 18:21:48 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Aug 22 18:54:08 2021 +0200

no need to use unique_ptr for PolyPolygon

it is already a COW type

Change-Id: If28f67bff3f8df7763bf4b574b1125d568f0ee27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120821
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 720e50e8a998..d1b00e478560 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -322,7 +322,7 @@ void ImpEditView::SelectionChanged()
 }
 
 // This function is also called when a text's font || size is changed. Because 
its highlight rectangle must be updated.
-void ImpEditView::lokSelectionCallback(const 
std::unique_ptr , bool bStartHandleVisible, bool 
bEndHandleVisible) {
+void ImpEditView::lokSelectionCallback(const std::optional 
, bool bStartHandleVisible, bool bEndHandleVisible) {
 VclPtr pParent = pOutWin->GetParentWithLOKNotifier();
 vcl::Region aRegion( *pPolyPoly );
 
@@ -487,7 +487,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 bool bClipRegion = rTarget.IsClipRegion();
 vcl::Region aOldRegion = rTarget.GetClipRegion();
 
-std::unique_ptr pPolyPoly;
+std::optional pPolyPoly;
 
 if ( !pRegion && !comphelper::LibreOfficeKit::isActive())
 {
@@ -511,7 +511,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 }
 
 if (comphelper::LibreOfficeKit::isActive() || pRegion)
-pPolyPoly.reset(new tools::PolyPolygon);
+pPolyPoly = tools::PolyPolygon();
 
 DBG_ASSERT( !pEditEngine->IsIdleFormatterActive(), "DrawSelectionXOR: Not 
formatted!" );
 aTmpSel.Adjust( pEditEngine->GetEditDoc() );
@@ -601,7 +601,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 aTmpRect.SetRight(aLineXPosStartEnd.Max());
 aTmpRect.Move(aLineOffset.Width(), 0);
 ImplDrawHighlightRect(rTarget, aTmpRect.TopLeft(), 
aTmpRect.BottomRight(),
-  pPolyPoly.get());
+  pPolyPoly ? &*pPolyPoly : nullptr);
 }
 else
 {
@@ -627,7 +627,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 aTmpRect.Move(aLineOffset.Width(), 0);
 
 ImplDrawHighlightRect(rTarget, aTmpRect.TopLeft(), 
aTmpRect.BottomRight(),
-  pPolyPoly.get());
+  pPolyPoly ? &*pPolyPoly : nullptr);
 nTmpStartIndex = nTmpEndIndex;
 }
 }
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 33504968bf18..216506c98828 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -307,7 +307,7 @@ private:
 return mpEditViewCallbacks;
 }
 
-void lokSelectionCallback(const std::unique_ptr 
, bool bStartHandleVisible, bool bEndHandleVisible);
+void lokSelectionCallback(const std::optional 
, bool bStartHandleVisible, bool bEndHandleVisible);
 
 void setEditViewCallbacks(EditViewCallbacks* pEditViewCallbacks)
 {
diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx
index dadc4fc6f315..6374747be3c9 100644
--- a/editeng/source/misc/txtrange.cxx
+++ b/editeng/source/misc/txtrange.cxx
@@ -54,7 +54,7 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& 
rPolyPolygon,
 if( pLinePolyPolygon )
 {
 nCount = pLinePolyPolygon->count();
-mpLinePolyPolygon.reset( new tools::PolyPolygon() );
+mpLinePolyPolygon = tools::PolyPolygon(nCount);
 
 for(sal_uInt32 i(0); i < nCount; i++)
 {
@@ -64,7 +64,7 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& 
rPolyPolygon,
 }
 }
 else
-mpLinePolyPolygon = nullptr;
+mpLinePolyPolygon.reset();
 }
 
 
@@ -647,7 +647,7 @@ std::deque* TextRanger::GetTextRanges( const 
Range& rRange )
 SvxBoundArgs aArg( this, &(rngCache.results), rRange );
 aArg.Calc( maPolyPolygon );
 if( mpLinePolyPolygon )
-aArg.Concat( mpLinePolyPolygon.get() );
+aArg.Concat( &*mpLinePolyPolygon );
 //Add new result to the cache
 

[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source

2021-07-30 Thread Caolán McNamara (via logerrit)
 editeng/source/misc/hangulhanja.cxx |2 +-
 include/editeng/hangulhanja.hxx |2 +-
 sw/inc/hhcwrp.hxx   |2 +-
 sw/source/uibase/lingu/hhcwrp.cxx   |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b7322c23a69d0727d0ecb3185d6516ca457e2f14
Author: Caolán McNamara 
AuthorDate: Fri Jul 30 11:37:40 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 30 16:41:27 2021 +0200

cid#1399290 silence Uncaught exception

Change-Id: I1fecdb09374c3631e005039d38dfd852a7b4b671
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119704
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/editeng/source/misc/hangulhanja.cxx 
b/editeng/source/misc/hangulhanja.cxx
index c6057413d2d6..9ea8fba5d8ca 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -947,7 +947,7 @@ namespace editeng
 {
 }
 
-HangulHanjaConversion::~HangulHanjaConversion( )
+HangulHanjaConversion::~HangulHanjaConversion() COVERITY_NOEXCEPT_FALSE
 {
 }
 
diff --git a/include/editeng/hangulhanja.hxx b/include/editeng/hangulhanja.hxx
index cbbeaef658f0..f2a5dcf9992f 100644
--- a/include/editeng/hangulhanja.hxx
+++ b/include/editeng/hangulhanja.hxx
@@ -117,7 +117,7 @@ namespace editeng
 bool _bIsInteractive
 );
 
-virtual ~HangulHanjaConversion( );
+virtual ~HangulHanjaConversion() COVERITY_NOEXCEPT_FALSE;
 
 // converts the whole document
 voidConvertDocument();
diff --git a/sw/inc/hhcwrp.hxx b/sw/inc/hhcwrp.hxx
index f565401d830c..2a6bcb688d27 100644
--- a/sw/inc/hhcwrp.hxx
+++ b/sw/inc/hhcwrp.hxx
@@ -91,7 +91,7 @@ public:
 sal_Int32 nConvOptions, bool bIsInteractive,
 bool bStart, bool bOther, bool bSelection );
 
-virtual ~SwHHCWrapper() override;
+virtual ~SwHHCWrapper() COVERITY_NOEXCEPT_FALSE override;
 
 voidConvert();
 };
diff --git a/sw/source/uibase/lingu/hhcwrp.cxx 
b/sw/source/uibase/lingu/hhcwrp.cxx
index 7e78777fef51..fd0d7adee111 100644
--- a/sw/source/uibase/lingu/hhcwrp.cxx
+++ b/sw/source/uibase/lingu/hhcwrp.cxx
@@ -107,7 +107,7 @@ SwHHCWrapper::SwHHCWrapper(
 {
 }
 
-SwHHCWrapper::~SwHHCWrapper()
+SwHHCWrapper::~SwHHCWrapper() COVERITY_NOEXCEPT_FALSE
 {
 m_pConvArgs.reset();
 


[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source

2021-07-29 Thread Caolán McNamara (via logerrit)
 editeng/source/misc/hangulhanja.cxx |6 ++
 include/editeng/hangulhanja.hxx |1 +
 sw/inc/hhcwrp.hxx   |3 ---
 sw/source/uibase/lingu/hhcwrp.cxx   |4 +---
 4 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit a57ec3ca97b587c76dc082b75532cc62d423cc8d
Author: Caolán McNamara 
AuthorDate: Wed Jul 28 20:27:06 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jul 29 13:52:55 2021 +0200

use the parent as available from HangulHanjaConversion

Change-Id: I9b8e34f4358620f2bc3c510ea3d581be8f87bb97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119648
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/editeng/source/misc/hangulhanja.cxx 
b/editeng/source/misc/hangulhanja.cxx
index 1908586240e8..c6057413d2d6 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -131,6 +131,7 @@ namespace editeng
 
 boolIsValid() const { return m_xConverter.is(); }
 
+weld::Widget* GetUIParent() const { return m_pUIParent; }
 LanguageType GetSourceLang() const   { return m_nSourceLang; }
 LanguageType GetTargetLang() const   { return m_nTargetLang; }
 const vcl::Font * GetTargetFont() const   { return m_pTargetFont; }
@@ -960,6 +961,11 @@ namespace editeng
 return m_bUseSavedValues;
 }
 
+weld::Widget* HangulHanjaConversion::GetUIParent() const
+{
+return m_pImpl->GetUIParent();
+}
+
 LanguageType HangulHanjaConversion::GetSourceLanguage( ) const
 {
 return m_pImpl->GetSourceLang();
diff --git a/include/editeng/hangulhanja.hxx b/include/editeng/hangulhanja.hxx
index 25c7d0b1d354..cbbeaef658f0 100644
--- a/include/editeng/hangulhanja.hxx
+++ b/include/editeng/hangulhanja.hxx
@@ -122,6 +122,7 @@ namespace editeng
 // converts the whole document
 voidConvertDocument();
 
+weld::Widget*   GetUIParent() const; // the parent window for any UI 
we raise
 LanguageTypeGetSourceLanguage() const;
 LanguageTypeGetTargetLanguage() const;
 const vcl::Font* GetTargetFont() const;
diff --git a/sw/inc/hhcwrp.hxx b/sw/inc/hhcwrp.hxx
index accde1e11ba9..f565401d830c 100644
--- a/sw/inc/hhcwrp.hxx
+++ b/sw/inc/hhcwrp.hxx
@@ -21,8 +21,6 @@
 
 #include 
 #include 
-#include 
-#include 
 #include "swdllapi.h"
 
 class SwView;
@@ -33,7 +31,6 @@ class SwPaM;
 class SW_DLLPUBLIC SwHHCWrapper final : public editeng::HangulHanjaConversion
 {
 SwView *m_pView;
-VclPtr m_pWin;
 SwWrtShell _rWrtShell;
 
 std::unique_ptr m_pConvArgs;/**< object for 
arguments (and results) needed
diff --git a/sw/source/uibase/lingu/hhcwrp.cxx 
b/sw/source/uibase/lingu/hhcwrp.cxx
index 03b36d197b65..7e78777fef51 100644
--- a/sw/source/uibase/lingu/hhcwrp.cxx
+++ b/sw/source/uibase/lingu/hhcwrp.cxx
@@ -93,7 +93,6 @@ SwHHCWrapper::SwHHCWrapper(
 nConvOptions,
 bIsInteractive )
 , m_pView( pSwView )
-, m_pWin( >GetEditWin() )
 , m_rWrtShell( pSwView->GetWrtShell() )
 , m_nLastPos( 0 )
 , m_nUnitOffset( 0 )
@@ -648,7 +647,7 @@ void SwHHCWrapper::FindConvText_impl()
 
 bool bFound = false;
 
-m_pWin->EnterWait();
+weld::WaitObject aWait(GetUIParent());
 bool bConv = true;
 
 while ( bConv )
@@ -664,7 +663,6 @@ void SwHHCWrapper::FindConvText_impl()
 bConv = ConvNext_impl();
 }
 }
-m_pWin->LeaveWait();
 }
 
 void SwHHCWrapper::ConvStart_impl( SwConversionArgs /* [out] */ 
*pConversionArgs, SvxSpellArea eArea )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source

2019-10-08 Thread Mike Kaganski (via logerrit)
 editeng/source/misc/svxacorr.cxx   |   54 --
 include/editeng/svxacorr.hxx   |   10 +
 sw/inc/editsh.hxx  |6 -
 sw/source/core/edit/edws.cxx   |   27 +++--
 sw/source/uibase/docvw/edtwin.cxx  |  196 ++---
 sw/source/uibase/inc/edtwin.hxx|5 
 sw/source/uibase/inc/gloslst.hxx   |3 
 sw/source/uibase/utlui/gloslst.cxx |   61 +--
 8 files changed, 249 insertions(+), 113 deletions(-)

New commits:
commit ef2ec07b4113fdadf863352c832af657b5ae205c
Author: Mike Kaganski 
AuthorDate: Mon Oct 7 17:46:36 2019 +0300
Commit: Mike Kaganski 
CommitDate: Tue Oct 8 14:30:55 2019 +0200

tdf#128009: Allow spaces in AutoText suggestions

Currently autotext entries with long names starting with spaces, or
containing spaces after first or second character, would never be
suggested when SvxAutoCorrCfg::IsAutoTextTip() gives true (set in
Tools -> AutoCorrect -> [x] Display remainder of name as suggestion
while typing), because only a single word no less than 3 chars long
left to cursor is considered a candidate for the name matching.

This change allows to consider multiple chunks of text left to the
cursor as the candidates for name matching. The chunks are 3-9
characters long, may start only between words, and have spaces,
including leading. Thus, AutoText entries with long names like
"  Dr Foo" will now be suggested for an entry like "lorem  dr f".

Change-Id: If91c957341a4f4b281acb0e4ada558706ea2f8c1
Reviewed-on: https://gerrit.libreoffice.org/80392
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 1e3f8f680194..8b46f0f8e043 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1548,12 +1548,12 @@ bool SvxAutoCorrect::AddWrtSttException( const 
OUString& rNew,
 return pLists && pLists->AddToWrdSttExceptList(rNew);
 }
 
-bool SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc const & rDoc,
-const OUString& rTxt, sal_Int32 nPos,
-OUString& rWord )
+OUString SvxAutoCorrect::GetPrevAutoCorrWord(SvxAutoCorrDoc const& rDoc, const 
OUString& rTxt,
+ sal_Int32 nPos)
 {
+OUString sRet;
 if( !nPos )
-return false;
+return sRet;
 
 sal_Int32 nEnde = nPos;
 
@@ -1561,7 +1561,7 @@ bool SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc 
const & rDoc,
 if( ( nPos < rTxt.getLength() &&
 !IsWordDelim( rTxt[ nPos ])) ||
 IsWordDelim( rTxt[ --nPos ]))
-return false;
+return sRet;
 
 while( nPos && !IsWordDelim( rTxt[ --nPos ]))
 ;
@@ -1574,20 +1574,54 @@ bool SvxAutoCorrect::GetPrevAutoCorrWord( 
SvxAutoCorrDoc const & rDoc,
 
 while( lcl_IsInAsciiArr( sImplSttSkipChars, rTxt[ nCapLttrPos ]) )
 if( ++nCapLttrPos >= nEnde )
-return false;
+return sRet;
 
 if( 3 > nEnde - nCapLttrPos )
-return false;
+return sRet;
 
 const LanguageType eLang = GetDocLanguage( rDoc, nCapLttrPos );
 
 CharClass& rCC = GetCharClass(eLang);
 
 if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nEnde ))
-return false;
+return sRet;
 
-rWord = rTxt.copy( nCapLttrPos, nEnde - nCapLttrPos );
-return true;
+sRet = rTxt.copy( nCapLttrPos, nEnde - nCapLttrPos );
+return sRet;
+}
+
+// static
+std::vector SvxAutoCorrect::GetChunkForAutoText(const OUString& rTxt,
+  const sal_Int32 nPos)
+{
+constexpr sal_Int32 nMinLen = 3;
+constexpr sal_Int32 nMaxLen = 9;
+std::vector aRes;
+if (nPos >= nMinLen)
+{
+sal_Int32 nBegin = std::max(nPos - nMaxLen, 0);
+// TODO: better detect word boundaries (not only whitespaces, but also 
e.g. punctuation)
+if (nBegin > 0 && !IsWordDelim(rTxt[nBegin-1]))
+{
+while (nBegin + nMinLen <= nPos && !IsWordDelim(rTxt[nBegin]))
+++nBegin;
+}
+if (nBegin + nMinLen <= nPos)
+{
+OUString sRes = rTxt.copy(nBegin, nPos - nBegin);
+aRes.push_back(sRes);
+bool bLastStartedWithDelim = IsWordDelim(sRes[0]);
+for (sal_Int32 i = 1; i <= sRes.getLength() - nMinLen; ++i)
+{
+bool bAdd = bLastStartedWithDelim;
+bLastStartedWithDelim = IsWordDelim(sRes[i]);
+bAdd = bAdd || bLastStartedWithDelim;
+if (bAdd)
+aRes.push_back(sRes.copy(i));
+}
+}
+}
+return aRes;
 }
 
 bool SvxAutoCorrect::CreateLanguageFile( const LanguageTag& rLanguageTag, bool 
bNewFile )
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 5803938ce966..46c3df27f18f 

[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source

2019-10-04 Thread Mike Kaganski (via logerrit)
 editeng/source/misc/svxacorr.cxx |5 ++---
 include/editeng/svxacorr.hxx |2 +-
 sw/inc/editsh.hxx|2 +-
 sw/source/core/edit/edws.cxx |2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 5b8625bd88c5c23e5b7be1245737b6a2ac08c373
Author: Mike Kaganski 
AuthorDate: Fri Oct 4 12:02:14 2019 +0200
Commit: Mike Kaganski 
CommitDate: Fri Oct 4 17:20:20 2019 +0200

SvxAutoCorrect::GetPrevAutoCorrWord should not be const

Change-Id: Icc5f8eae4347e097f7ff22212dd94467d0702353
Reviewed-on: https://gerrit.libreoffice.org/80198
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index bf3ac6349545..52098a3f0334 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1550,7 +1550,7 @@ bool SvxAutoCorrect::AddWrtSttException( const OUString& 
rNew,
 
 bool SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc const & rDoc,
 const OUString& rTxt, sal_Int32 nPos,
-OUString& rWord ) const
+OUString& rWord )
 {
 if( !nPos )
 return false;
@@ -1581,8 +1581,7 @@ bool SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc 
const & rDoc,
 
 const LanguageType eLang = GetDocLanguage( rDoc, nCapLttrPos );
 
-SvxAutoCorrect* pThis = const_cast(this);
-CharClass& rCC = pThis->GetCharClass( eLang );
+CharClass& rCC = GetCharClass(eLang);
 
 if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nEnde ))
 return false;
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 4106122ee94b..c9c9bdee9677 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -292,7 +292,7 @@ public:
 // Return for the autotext expansion the previous word,
 // AutoCorrect - corresponding algorithm
 bool GetPrevAutoCorrWord( SvxAutoCorrDoc const & rDoc, const OUString& 
rTxt,
-sal_Int32 nPos, OUString& rWord ) const;
+sal_Int32 nPos, OUString& rWord );
 
 // Search for the words in the replacement table.
 // rText - check in this text the words of the list
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 8a2c2064d97b..29271604343d 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -816,7 +816,7 @@ public:
 /// Call AutoCorrect
 void AutoCorrect( SvxAutoCorrect& rACorr, bool bInsertMode,
 sal_Unicode cChar );
-bool GetPrevAutoCorrWord( SvxAutoCorrect const & rACorr, OUString& rWord );
+bool GetPrevAutoCorrWord(SvxAutoCorrect& rACorr, OUString& rWord);
 
 /// Set our styles according to the respective rules.
 void AutoFormat( const SvxSwAutoFormatFlags* pAFlags );
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index 4a238d2a34a0..1abceee1b75d 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -279,7 +279,7 @@ void SwEditShell::SetNewDoc()
 GetDoc()->getIDocumentState().SetNewDoc(true);
 }
 
-bool SwEditShell::GetPrevAutoCorrWord( SvxAutoCorrect const & rACorr, 
OUString& rWord )
+bool SwEditShell::GetPrevAutoCorrWord(SvxAutoCorrect& rACorr, OUString& rWord)
 {
 SET_CURR_SHELL( this );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source

2018-02-14 Thread Stephan Bergmann
 editeng/source/items/frmitems.cxx   |   24 +++
 include/editeng/sizeitem.hxx|   13 
 sw/inc/fmtfsize.hxx |   18 ++---
 sw/source/core/layout/atrfrm.cxx|   37 
 sw/source/uibase/uiview/viewtab.cxx |4 +--
 5 files changed, 55 insertions(+), 41 deletions(-)

New commits:
commit e2372907c991833a8bbe13f84460783d8d8fdfdb
Author: Stephan Bergmann 
Date:   Tue Feb 13 18:57:46 2018 +0100

Make SwFormatFrameSize derive from SvxSizeItem

...as seen in UBSan builds when, on an image in Writer, selecting context 
menu's
"Properties..." to open the "Image" dialog, there'll be failure

> cui/source/tabpages/grfpage.cxx:206:21: runtime error: downcast of 
address 0x1293f5c0 which does not point to an object of type 'const 
SvxSizeItem'
> 0x1293f5c0: note: object is of type 'SwFormatFrameSize'
 00 00 00 00  68 d5 ea aa 8f 7f 00 00  01 00 00 00 43 27 00 00  81 2e 00 00 
00 00 00 00  c5 41 00 00
>   ^~~
>   vptr for 'SwFormatFrameSize'
> #0 0x7f8f1ec29a34 in SvxGrfCropPage::Reset(SfxItemSet const*) 
cui/source/tabpages/grfpage.cxx:206:21
> #1 0x7f9036000d98 in SfxTabDialog::ActivatePageHdl(TabControl*) 
sfx2/source/dialog/tabdlg.cxx:1115:19

Moved the {Get,Set}{Width,Height} convenience functions down from
SwFormatFrameSize to SvxSizeItem.  And "reverted" the SvxSizeItem
{Has,Scale}Metrics overrides in SwFormatFrameSize, "just in case."  Renamed
SvxSizeItem::aSize to m_aSize to avoid GCC -Werror=shadow in
SwFormatFrameSize::dumpAsXml (sw/source/core/layout/atrfrm.cxx), which has a
local variable named aSize.

Change-Id: I9a2e0b19f21c1468ecba87a5bdafa40c8c424ae4
Reviewed-on: https://gerrit.libreoffice.org/49678
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 0ed13e1088af..f39dc856fb3d 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -201,7 +201,7 @@ SvxSizeItem::SvxSizeItem( const sal_uInt16 nId, const Size& 
rSize ) :
 
 SfxPoolItem( nId ),
 
-aSize( rSize )
+m_aSize( rSize )
 {
 }
 
@@ -211,7 +211,7 @@ bool SvxSizeItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 bool bConvert = 0!=(nMemberId_TWIPS);
 nMemberId &= ~CONVERT_TWIPS;
 
-awt::Size aTmp(aSize.Width(), aSize.Height());
+awt::Size aTmp(m_aSize.Width(), m_aSize.Height());
 if( bConvert )
 {
 aTmp.Height = convertTwipToMm100(aTmp.Height);
@@ -247,7 +247,7 @@ bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 
nMemberId )
 aTmp.Height = convertMm100ToTwip(aTmp.Height);
 aTmp.Width = convertMm100ToTwip(aTmp.Width);
 }
-aSize = Size( aTmp.Width, aTmp.Height );
+m_aSize = Size( aTmp.Width, aTmp.Height );
 }
 else
 {
@@ -261,7 +261,7 @@ bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 
nMemberId )
 if(!(rVal >>= nVal ))
 return false;
 
-aSize.setWidth( bConvert ? convertMm100ToTwip(nVal) : nVal );
+m_aSize.setWidth( bConvert ? convertMm100ToTwip(nVal) : nVal );
 }
 break;
 case MID_SIZE_HEIGHT:
@@ -270,7 +270,7 @@ bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 
nMemberId )
 if(!(rVal >>= nVal))
 return true;
 
-aSize.setHeight( bConvert ? convertMm100ToTwip(nVal) : nVal );
+m_aSize.setHeight( bConvert ? convertMm100ToTwip(nVal) : nVal );
 }
 break;
 default: OSL_FAIL("Wrong MemberId!");
@@ -291,7 +291,7 @@ bool SvxSizeItem::operator==( const SfxPoolItem& rAttr ) 
const
 {
 assert(SfxPoolItem::operator==(rAttr));
 
-return ( aSize == static_cast( rAttr ).GetSize() );
+return ( m_aSize == static_cast( rAttr ).GetSize() );
 }
 
 
@@ -313,18 +313,18 @@ bool SvxSizeItem::GetPresentation
 switch ( ePres )
 {
 case SfxItemPresentation::Nameless:
-rText = GetMetricText( aSize.Width(), eCoreUnit, ePresUnit,  
) +
+rText = GetMetricText( m_aSize.Width(), eCoreUnit, ePresUnit, 
 ) +
 cpDelimTmp +
-GetMetricText( aSize.Height(), eCoreUnit, ePresUnit, 
 );
+GetMetricText( m_aSize.Height(), eCoreUnit, ePresUnit, 
 );
 return true;
 
 case SfxItemPresentation::Complete:
 rText = EditResId(RID_SVXITEMS_SIZE_WIDTH) +
-GetMetricText( aSize.Width(), eCoreUnit, ePresUnit,  
) +
+GetMetricText( m_aSize.Width(), eCoreUnit, ePresUnit, 
 ) +
 " " + 

[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source

2016-06-22 Thread Miklos Vajna
 editeng/source/editeng/editview.cxx  |5 -
 editeng/source/editeng/impedit.cxx   |   12 
 editeng/source/editeng/impedit.hxx   |8 +---
 editeng/source/outliner/outlvw.cxx   |9 -
 include/editeng/editview.hxx |2 --
 include/editeng/outliner.hxx |   13 +
 sw/inc/PostItMgr.hxx |2 --
 sw/source/uibase/docvw/PostItMgr.cxx |   12 
 8 files changed, 2 insertions(+), 61 deletions(-)

New commits:
commit 03e83de83bcc640cf359fe7997edcdadb5067b36
Author: Miklos Vajna 
Date:   Wed Jun 22 08:01:04 2016 +0200

Remove no longer needed ImpEditView::mpLibreOfficeKitSearchable

All clients has been ported to use
ImpEditView::mpLibreOfficeKitViewCallable instead.

Change-Id: I3a2513ac5900f801a2e7aec79807f4e333dfba3d
Reviewed-on: https://gerrit.libreoffice.org/26561
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 20f8b48..84dba19 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -583,11 +583,6 @@ Color EditView::GetBackgroundColor() const
 return pImpEditView->GetBackgroundColor();
 }
 
-void EditView::registerLibreOfficeKitCallback(OutlinerSearchable *pSearchable)
-{
-pImpEditView->registerLibreOfficeKitCallback(pSearchable);
-}
-
 void EditView::registerLibreOfficeKitViewCallback(OutlinerViewCallable 
*pCallable)
 {
 pImpEditView->registerLibreOfficeKitViewCallback(pCallable);
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 0641e74..61454ad 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -79,7 +79,6 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, 
vcl::Window* pWindo
 pOutWin = pWindow;
 pPointer= nullptr;
 pBackgroundColor= nullptr;
-mpLibreOfficeKitSearchable = nullptr;
 mpLibreOfficeKitViewCallable = nullptr;
 nScrollDiffX= 0;
 nExtraCursorFlags   = 0;
@@ -118,17 +117,6 @@ void ImpEditView::SetBackgroundColor( const Color& rColor )
 pBackgroundColor = new Color( rColor );
 }
 
-void ImpEditView::registerLibreOfficeKitCallback(OutlinerSearchable* 
pSearchable)
-{
-mpLibreOfficeKitSearchable = pSearchable;
-}
-
-void ImpEditView::libreOfficeKitCallback(int nType, const char* pPayload) const
-{
-if (mpLibreOfficeKitSearchable)
-mpLibreOfficeKitSearchable->libreOfficeKitCallback(nType, pPayload);
-}
-
 void ImpEditView::registerLibreOfficeKitViewCallback(OutlinerViewCallable* 
pCallable)
 {
 mpLibreOfficeKitViewCallable = pCallable;
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 6c1c9f4..66b03b8 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -221,8 +221,6 @@ private:
 EditView*   pEditView;
 vcl::Cursor*pCursor;
 Color*  pBackgroundColor;
-/// Model callback.
-OutlinerSearchable* mpLibreOfficeKitSearchable;
 /// Per-view callback.
 OutlinerViewCallable* mpLibreOfficeKitViewCallable;
 EditEngine* pEditEngine;
@@ -369,11 +367,7 @@ public:
 const Color&GetBackgroundColor() const {
 return ( pBackgroundColor ? *pBackgroundColor : 
pOutWin->GetBackground().GetColor() ); }
 
-/// @see vcl::ITiledRenderable::registerCallback().
-void registerLibreOfficeKitCallback(OutlinerSearchable* pSearchable);
-/// Invokes the registered model callback, if there are any.
-void libreOfficeKitCallback(int nType, const char* pPayload) const;
-/// @see vcl::ITiledRenderable::registerCallback().
+/// @see SfxViewShell::registerLibreOfficeKitViewCallback().
 void registerLibreOfficeKitViewCallback(OutlinerViewCallable* pCallable);
 /// Invokes the registered view callback, if there are any.
 void libreOfficeKitViewCallback(int nType, const char* pPayload) const;
diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index eec3ec9..ea011f2 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1421,11 +1421,6 @@ void OutlinerView::SetBackgroundColor( const Color& 
rColor )
 pEditView->SetBackgroundColor( rColor );
 }
 
-void OutlinerView::registerLibreOfficeKitCallback(OutlinerSearchable* 
pSearchable)
-{
-pEditView->registerLibreOfficeKitCallback(pSearchable);
-}
-
 void OutlinerView::registerLibreOfficeKitViewCallback(OutlinerViewCallable* 
pCallable)
 {
 pEditView->registerLibreOfficeKitViewCallback(pCallable);
@@ -1456,10 +1451,6 @@ Selection OutlinerView::GetSurroundingTextSelection() 
const
 return pEditView->GetSurroundingTextSelection();
 }
 
-OutlinerSearchable::~OutlinerSearchable()
-{
-}
-
 

[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source

2014-11-05 Thread Daniel Sikeler
 editeng/source/misc/SvXMLAutoCorrectImport.cxx |3 ++-
 editeng/source/misc/svxacorr.cxx   |7 +--
 include/editeng/svxacorr.hxx   |5 +++--
 sw/inc/swacorr.hxx |9 +++--
 sw/source/core/sw3io/swacorr.cxx   |   16 ++--
 5 files changed, 27 insertions(+), 13 deletions(-)

New commits:
commit 4404b718bdb547cb9b7b17c73a53574724cdeeb7
Author: Daniel Sikeler d.sikele...@gmail.com
Date:   Thu Oct 30 14:53:48 2014 +

fdo#79761: parse BlockList.xml only once

Change-Id: I3cfc5b66ee73b0e4d07a84c8255c5a006e4fbb25
Reviewed-on: https://gerrit.libreoffice.org/12210
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.cxx 
b/editeng/source/misc/SvXMLAutoCorrectImport.cxx
index 8f2f69e..e68362e 100644
--- a/editeng/source/misc/SvXMLAutoCorrectImport.cxx
+++ b/editeng/source/misc/SvXMLAutoCorrectImport.cxx
@@ -56,6 +56,7 @@ SvXMLWordListContext::SvXMLWordListContext(
SvXMLImportContext ( rImport ),
rLocalRef(rImport)
 {
+rLocalRef.rAutoCorrect.refreshBlockList( rLocalRef.xStorage );
 }
 
 com::sun::star::uno::ReferenceXFastContextHandler SAL_CALL 
SvXMLWordListContext::createFastChildContext(
@@ -94,7 +95,7 @@ SvXMLWordContext::SvXMLWordContext(
 if( !bOnlyTxt )
 {
 const OUString sLongSave( sRight );
-if( !rLocalRef.rAutoCorrect.GetLongText( rLocalRef.xStorage, sWrong, 
sRight ) 
+if( !rLocalRef.rAutoCorrect.GetLongText( sWrong, sRight ) 
 !sLongSave.isEmpty() )
 {
 sRight = sLongSave;
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 9b840f3..6b235de 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1627,12 +1627,15 @@ bool SvxAutoCorrect::MakeCombinedChanges( 
std::vectorSvxAutocorrWord aNewEntr
 
 //  - return the replacement text (only for SWG-Format, all other
 //can be taken from the word list!)
-bool SvxAutoCorrect::GetLongText( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage ,
-  const OUString, OUString )
+bool SvxAutoCorrect::GetLongText( const OUString, OUString )
 {
 return false;
 }
 
+void SvxAutoCorrect::refreshBlockList( const uno::Reference embed::XStorage 
 )
+{
+}
+
 // Text with attribution (only the SWG - SWG format!)
 bool SvxAutoCorrect::PutText( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage ,
   const OUString, const OUString, 
SfxObjectShell, OUString )
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 8ad8564..f227ff3 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -275,8 +275,9 @@ public:
 
 sal_Unicode GetQuote( sal_Unicode cInsChar, bool bSttQuote,
 LanguageType eLang ) const;
-virtual bool GetLongText( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage  rStg,
-  const OUString rShort, OUString rLong );
+virtual bool GetLongText( const OUString rShort, OUString rLong );
+
+virtual void refreshBlockList( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage  rStg);
 
 TYPEINFO();
 
diff --git a/sw/inc/swacorr.hxx b/sw/inc/swacorr.hxx
index 5bb3c93..33598c6 100644
--- a/sw/inc/swacorr.hxx
+++ b/sw/inc/swacorr.hxx
@@ -24,15 +24,20 @@
 #include com/sun/star/uno/Reference.h
 #include com/sun/star/embed/XStorage.hpp
 
+#include SwXMLTextBlocks.hxx
+
 class SwAutoCorrect : public SvxAutoCorrect
 {
 using  SvxAutoCorrect::PutText;
 
+std::unique_ptrSwXMLTextBlocks m_pTextBlocks;
+
 protected:
 // Return replacement text (only for SWG-format, all others can be 
obtained from wordlist!).
 // rShort is stream-name - encrypted!
-virtual bool GetLongText( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage ,
-  const OUString rShort, OUString rLong ) 
SAL_OVERRIDE;
+virtual bool GetLongText( const OUString rShort, OUString rLong ) 
SAL_OVERRIDE;
+
+virtual void refreshBlockList( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage  ) SAL_OVERRIDE;
 
 // Text with attributes (only SWG-format!).
 // rShort is stream-name - encrypted!
diff --git a/sw/source/core/sw3io/swacorr.cxx b/sw/source/core/sw3io/swacorr.cxx
index 8472942..0a08b01 100644
--- a/sw/source/core/sw3io/swacorr.cxx
+++ b/sw/source/core/sw3io/swacorr.cxx
@@ -37,20 +37,24 @@ TYPEINIT1( SwAutoCorrect, SvxAutoCorrect );
  *
  * @param rShort - the stream name (encrypted)
  */
-bool SwAutoCorrect::GetLongText( const uno::Reference  embed::XStorage  
rStg,
- const OUString rShort, OUString rLong )
+bool SwAutoCorrect::GetLongText( const OUString rShort, OUString 

[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source

2013-08-17 Thread Matteo Casalin
 editeng/source/items/numitem.cxx   |   13 ++---
 include/editeng/numitem.hxx|4 ++--
 sw/inc/lineinfo.hxx|6 +++---
 sw/source/core/text/frmpaint.cxx   |2 +-
 sw/source/core/unocore/unosett.cxx |2 +-
 5 files changed, 13 insertions(+), 14 deletions(-)

New commits:
commit 8aee44c1814ae7c1af14e942cf0513e1612a82d9
Author: Matteo Casalin matteo.casa...@yahoo.com
Date:   Sat Aug 17 18:41:03 2013 +0200

String to OUString

Change-Id: I41b73e0af6841247a0403974b1c66e5a66123420
Reviewed-on: https://gerrit.libreoffice.org/5483
Reviewed-by: Matteo Casalin matteo.casa...@yahoo.com
Tested-by: Matteo Casalin matteo.casa...@yahoo.com

diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 9698c90..1a9e800 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -97,18 +97,17 @@ SvxNumberType::~SvxNumberType()
 xFormatter = 0;
 }
 
-String SvxNumberType::GetNumStr( sal_uLong nNo ) const
+OUString SvxNumberType::GetNumStr( sal_uLong nNo ) const
 {
 const LanguageTag rLang = Application::GetSettings().GetLanguageTag();
 return GetNumStr( nNo, rLang.getLocale() );
 }
 
-String  SvxNumberType::GetNumStr( sal_uLong nNo, const Locale rLocale ) const
+OUString SvxNumberType::GetNumStr( sal_uLong nNo, const Locale rLocale ) const
 {
 lcl_getFormatter(xFormatter);
-String aTmpStr;
 if(!xFormatter.is())
-return aTmpStr;
+return OUString();
 
 if(bShowSymbol)
 {
@@ -121,7 +120,7 @@ String  SvxNumberType::GetNumStr( sal_uLong nNo, const 
Locale rLocale ) const
 {
 // '0' allowed for ARABIC numberings
 if(NumberingType::ARABIC == nNumType  0 == nNo )
-aTmpStr = '0';
+return OUString('0');
 else
 {
 Sequence PropertyValue  aProperties(2);
@@ -133,7 +132,7 @@ String  SvxNumberType::GetNumStr( sal_uLong nNo, const 
Locale rLocale ) const
 
 try
 {
-aTmpStr = xFormatter-makeNumberingString( 
aProperties, rLocale );
+return xFormatter-makeNumberingString( 
aProperties, rLocale );
 }
 catch(const Exception)
 {
@@ -142,7 +141,7 @@ String  SvxNumberType::GetNumStr( sal_uLong nNo, const 
Locale rLocale ) const
 }
 }
 }
-return aTmpStr;
+return OUString();
 }
 
 SvxNumberFormat::SvxNumberFormat( sal_Int16 eType,
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index fbe59e6..3df4a96 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -72,8 +72,8 @@ public:
 SvxNumberType(const SvxNumberType rType);
 ~SvxNumberType();
 
-String  GetNumStr( sal_uLong nNo ) const;
-String  GetNumStr( sal_uLong nNo, const 
com::sun::star::lang::Locale rLocale ) const;
+OUStringGetNumStr( sal_uLong nNo ) const;
+OUStringGetNumStr( sal_uLong nNo, const 
com::sun::star::lang::Locale rLocale ) const;
 
 voidSetNumberingType(sal_Int16 nSet) {nNumType = nSet;}
 sal_Int16   GetNumberingType() const {return nNumType;}
diff --git a/sw/inc/lineinfo.hxx b/sw/inc/lineinfo.hxx
index 22bb1a9..2557ada 100644
--- a/sw/inc/lineinfo.hxx
+++ b/sw/inc/lineinfo.hxx
@@ -38,7 +38,7 @@ class SW_DLLPUBLIC SwLineNumberInfo : public SwClient /** 
purpose of derivation
  character style for 
displaying the numbers. */
 {
 SvxNumberType   aType;  /// e.g. roman linenumbers
-String  aDivider;   /// String for aditional 
interval (vert. lines user defined)
+OUStringaDivider;   /// String for aditional 
interval (vert. lines user defined)
 sal_uInt16  nPosFromLeft;   /// Position for paint
 sal_uInt16  nCountBy;   /// Paint only for every n 
line
 sal_uInt16  nDividerCountBy;/** Interval for display of 
an user defined
@@ -65,8 +65,8 @@ public:
 const SvxNumberType GetNumType() const { return aType; }
 voidSetNumType( SvxNumberType aNew ){ aType = aNew; }
 
-const String GetDivider() const{ return aDivider; }
-void SetDivider( const String r )  { aDivider = r; }
+OUString GetDivider() const   { return aDivider; }
+void SetDivider( const OUString r )  { aDivider = r; }
 sal_uInt16 GetDividerCountBy() const{ return nDividerCountBy; }
 void SetDividerCountBy( sal_uInt16 n )  { nDividerCountBy = n; }
 
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index f3a0da9..4296822 100644
--- 

[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source

2013-07-30 Thread Matteo Casalin
 editeng/source/misc/SvXMLAutoCorrectImport.cxx |9 +
 editeng/source/misc/svxacorr.cxx   |9 +
 include/editeng/svxacorr.hxx   |7 ---
 sw/inc/swacorr.hxx |7 ---
 sw/source/core/inc/SwXMLBlockImport.hxx|5 ++---
 sw/source/core/inc/SwXMLTextBlocks.hxx |8 
 sw/source/core/inc/swblocks.hxx|6 +++---
 sw/source/core/sw3io/swacorr.cxx   |   10 ++
 sw/source/core/swg/SwXMLBlockImport.cxx|2 +-
 sw/source/core/swg/SwXMLBlockListContext.cxx   |8 
 sw/source/core/swg/SwXMLTextBlocks.cxx |6 +++---
 sw/source/core/swg/SwXMLTextBlocks1.cxx|4 ++--
 12 files changed, 43 insertions(+), 38 deletions(-)

New commits:
commit 73a136945d50a207c9e1c552d02c90d5c862c470
Author: Matteo Casalin matteo.casa...@yahoo.com
Date:   Fri Jul 26 15:37:08 2013 +0200

String to OUString

Change-Id: Ia9bebaf92bf570c10d01a9ed3db437f70098a07d
Reviewed-on: https://gerrit.libreoffice.org/5185
Reviewed-by: Luboš Luňák l.lu...@suse.cz
Tested-by: Luboš Luňák l.lu...@suse.cz

diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.cxx 
b/editeng/source/misc/SvXMLAutoCorrectImport.cxx
index 9b4de02..b338b95 100644
--- a/editeng/source/misc/SvXMLAutoCorrectImport.cxx
+++ b/editeng/source/misc/SvXMLAutoCorrectImport.cxx
@@ -100,7 +100,8 @@ SvXMLWordContext::SvXMLWordContext(
SvXMLImportContext ( rImport, nPrefix, rLocalName ),
rLocalRef(rImport)
 {
-String sRight, sWrong;
+OUString sRight;
+OUString sWrong;
 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList-getLength() : 0;
 
 for (sal_Int16 i=0; i  nAttrCount; i++)
@@ -121,15 +122,15 @@ SvXMLWordContext::SvXMLWordContext(
 }
 }
 }
-if (!sWrong.Len() || !sRight.Len() )
+if (sWrong.isEmpty() || sRight.isEmpty())
 return;
 
 sal_Bool bOnlyTxt = sRight != sWrong;
 if( !bOnlyTxt )
 {
-String sLongSave( sRight );
+const OUString sLongSave( sRight );
 if( !rLocalRef.rAutoCorrect.GetLongText( rLocalRef.xStorage, String(), 
sWrong, sRight ) 
-sLongSave.Len() )
+!sLongSave.isEmpty() )
 {
 sRight = sLongSave;
 bOnlyTxt = sal_True;
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index d40f481..8b651a6 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1609,14 +1609,15 @@ sal_Bool SvxAutoCorrect::MakeCombinedChanges( 
std::vectorSvxAutocorrWord aNew
 
 //  - return the replacement text (only for SWG-Format, all other
 //  can be taken from the word list!)
-sal_Bool SvxAutoCorrect::GetLongText( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage , const String, const String , String )
+sal_Bool SvxAutoCorrect::GetLongText( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage ,
+  const String, const String, OUString )
 {
 return sal_False;
 }
 
 // Text with attribution (only the SWG - SWG format!)
-sal_Bool SvxAutoCorrect::PutText( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage , const String, const String, 
SfxObjectShell,
-String )
+sal_Bool SvxAutoCorrect::PutText( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage ,
+  const String, const String, 
SfxObjectShell, OUString )
 {
 return sal_False;
 }
@@ -2541,7 +2542,7 @@ sal_Bool SvxAutoCorrectLanguageLists::PutText( const 
String rShort,
 MakeUserStorage_Impl();
 
 sal_Bool bRet = sal_False;
-String sLong;
+OUString sLong;
 try
 {
 uno::Reference  embed::XStorage  xStg = 
comphelper::OStorageHelper::GetStorageFromURL( sUserAutoCorrFile, 
embed::ElementModes::READWRITE );
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 85bf3e9..0a493d7 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -267,8 +267,8 @@ class EDITENG_DLLPUBLIC SvxAutoCorrect
 protected:
 //  - Text with attribution (only the SWG - SWG format!)
 //  rShort is the stream name - encrypted!
-virtual sal_Bool PutText( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage  rStg, const String rFileName, const String 
rShort, SfxObjectShell ,
-String );
+virtual sal_Bool PutText( const com::sun::star::uno::Reference  
com::sun::star::embed::XStorage  rStg,
+  const String rFileName, const String rShort, 
SfxObjectShell, OUString );
 
 // required language in the table add if possible only when the file exists
 sal_BoolCreateLanguageFile(LanguageType eLang, sal_Bool bNewFile = 
sal_True);
@@ -279,7 +279,8 @@ public:
 
 sal_Unicode GetQuote(