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

2018-02-04 Thread Noel Grandin
 editeng/source/outliner/overflowingtxt.cxx |6 ++
 include/editeng/overflowingtxt.hxx |5 +++--
 2 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 12726ee86f9f6e1a03f0be0b2b3ade07a5402d01
Author: Noel Grandin 
Date:   Mon Jan 29 10:58:13 2018 +0200

loplugin:useuniqueptr in OFlowChainedText

Change-Id: I63f6242a41eddd36b9ebbef470faf9e5111b19f1
Reviewed-on: https://gerrit.libreoffice.org/49149
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 72d70ca66b44..5577104b7f7e 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -158,16 +158,14 @@ OutlinerParaObject 
*OverflowingText::DeeplyMergeParaObject(Outliner *pOutl, Outl
 
 OFlowChainedText::OFlowChainedText(Outliner const *pOutl, bool bIsDeepMerge)
 {
-mpOverflowingTxt = pOutl->GetOverflowingText();
-mpNonOverflowingTxt = pOutl->GetNonOverflowingText();
+mpOverflowingTxt.reset( pOutl->GetOverflowingText() );
+mpNonOverflowingTxt.reset( pOutl->GetNonOverflowingText() );
 
 mbIsDeepMerge = bIsDeepMerge;
 }
 
 OFlowChainedText::~OFlowChainedText()
 {
-delete mpNonOverflowingTxt;
-delete mpOverflowingTxt;
 }
 
 
diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index 0a84fd5f5e3a..19bf287995d5 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -25,6 +25,7 @@
 #include 
 
 #include 
+#include 
 
 namespace com { namespace sun { namespace star {
   namespace datatransfer {
@@ -115,8 +116,8 @@ public:
 bool IsLastParaInterrupted() const;
 
 private:
-NonOverflowingText *mpNonOverflowingTxt;
-OverflowingText *mpOverflowingTxt;
+std::unique_ptr mpNonOverflowingTxt;
+std::unique_ptr mpOverflowingTxt;
 
 bool mbIsDeepMerge;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-02 Thread Chris Sherlock
 editeng/source/accessibility/AccessibleContextBase.cxx |   12 
 editeng/source/outliner/outliner.cxx   |9 -
 2 files changed, 21 deletions(-)

New commits:
commit 6bec9bf0f85ec3503c46d8abd4a93139b1856a18
Author: Chris Sherlock 
Date:   Sun Jan 7 00:18:21 2018 +1100

editeng: remove dead code

Change-Id: I2ce15bc2c6b9663b479ae98bb1d5e0900716adcf
Reviewed-on: https://gerrit.libreoffice.org/47492
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx 
b/editeng/source/accessibility/AccessibleContextBase.cxx
index 557f769b5b2d..8a0c8e4bfc6d 100644
--- a/editeng/source/accessibility/AccessibleContextBase.cxx
+++ b/editeng/source/accessibility/AccessibleContextBase.cxx
@@ -317,18 +317,6 @@ uno::Reference SAL_CALL
 // Create a copy of the state set and return it.
 pStateSet = static_cast< 
::utl::AccessibleStateSetHelper*>(mxStateSet.get());
 
-// Merge current focused state from edit engine.
-#if 0
-if (aState == AccessibleStateType::FOCUSED
-&& pStateSet != NULL
-&& mpText != NULL)
-{
-if (mpText->GetFocusedState ())
-pStateSet->AddState (aState);
-else
-pStateSet->RemoveState (aState);
-}
-#endif
 if (pStateSet != nullptr)
 pStateSet = new ::utl::AccessibleStateSetHelper (*pStateSet);
 }
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index b6d5ac108ecc..f520239bf148 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1368,15 +1368,6 @@ bool Outliner::HasChildren( Paragraph const * pParagraph 
) const
 bool Outliner::ImplHasNumberFormat( sal_Int32 nPara ) const
 {
 return GetNumberFormat(nPara) != nullptr;
-#if 0 // The below code is obviously unreachable
-if ( GetNumberFormat(nPara) )
-{
-const SfxBoolItem& rBulletState = (const SfxBoolItem&) 
pEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE );
-return rBulletState.GetValue();
-}
-else
-return false;
-#endif
 }
 
 const SvxNumberFormat* Outliner::GetNumberFormat( sal_Int32 nPara ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/comphelper include/editeng include/svl include/svx sd/source svx/source sw/source

2018-02-01 Thread Noel Grandin
 editeng/source/uno/unoipset.cxx |   15 +++---
 include/comphelper/propertysetinfo.hxx  |   34 ++
 include/editeng/unoipset.hxx|2 
 include/editeng/unotext.hxx |   10 ++--
 include/svl/itemprop.hxx|   54 ++-
 include/svx/svddef.hxx  |3 -
 include/svx/unoshprp.hxx|   64 ++--
 sd/source/ui/unoidl/unomodel.cxx|   28 ++--
 svx/source/table/cell.cxx   |8 +--
 svx/source/unodraw/unopool.cxx  |8 +--
 svx/source/unodraw/unoprov.cxx  |6 +-
 sw/source/core/unocore/unoframe.cxx |   12 ++---
 sw/source/core/unocore/unomap.cxx   |4 -
 sw/source/core/unocore/unomap1.cxx  |   26 +--
 sw/source/core/unocore/unomapproperties.hxx |   12 ++---
 sw/source/core/unocore/unoparagraph.cxx |5 --
 sw/source/core/unocore/unostyle.cxx |   26 ---
 sw/source/core/unocore/unotbl.cxx   |4 -
 18 files changed, 198 insertions(+), 123 deletions(-)

New commits:
commit ae5f89fdcccb2cf74256b04771249fc8afca8794
Author: Noel Grandin 
Date:   Wed Jan 31 09:11:09 2018 +0200

split out SFX_METRIC_ITEM into separate field

instead of overloading the nMemberId field
and thus fix various places that were effectively setting the METRIC
flag and causing a warning in SvxUnoConvertToMM

And fix bug in
sw/source/core/unocore/unomap.cxx
where the PropertyAttribute::READONLY was in the wrong place,
ever since
commit 84a3db80b4fd66c6854b3135b5f69b61fd828e62
Date:   Mon Sep 18 23:08:29 2000 +
initial import

Change-Id: Ifc2bf56709f19aea75300b2fda62ce551efc26af
Reviewed-on: https://gerrit.libreoffice.org/48950
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index 862a4f5caed5..01e014a47530 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -103,14 +103,14 @@ uno::Any SvxItemPropertySet::getPropertyValue( const 
SfxItemPropertySimpleEntry*
 pItem = &(pPool->GetDefaultItem( pMap->nWID ));
 
 const MapUnit eMapUnit = pPool ? 
pPool->GetMetric(static_cast(pMap->nWID)) : MapUnit::Map100thMM;
-sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
+sal_uInt8 nMemberId = pMap->nMemberId;
 if( eMapUnit == MapUnit::Map100thMM )
 nMemberId &= (~CONVERT_TWIPS);
 
 if(pItem)
 {
 pItem->QueryValue( aVal, nMemberId );
-if( pMap->nMemberId & SFX_METRIC_ITEM )
+if( pMap->nMoreFlags & PropertyMoreFlags::METRIC_ITEM )
 {
 if( eMapUnit != MapUnit::Map100thMM )
 {
@@ -166,7 +166,7 @@ void SvxItemPropertySet::setPropertyValue( const 
SfxItemPropertySimpleEntry* pMa
 const MapUnit eMapUnit = pPool ? 
pPool->GetMetric(static_cast(pMap->nWID)) : MapUnit::Map100thMM;
 
 // check for needed metric translation
-if( (pMap->nMemberId & SFX_METRIC_ITEM) && eMapUnit != 
MapUnit::Map100thMM )
+if( (pMap->nMoreFlags & PropertyMoreFlags::METRIC_ITEM) && eMapUnit != 
MapUnit::Map100thMM )
 {
 if ( !bDontConvertNegativeValues || SvxUnoCheckForPositiveValue( 
aValue ) )
 SvxUnoConvertFromMM( eMapUnit, aValue );
@@ -174,7 +174,7 @@ void SvxItemPropertySet::setPropertyValue( const 
SfxItemPropertySimpleEntry* pMa
 
 SfxPoolItem *pNewItem = pItem->Clone();
 
-sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
+sal_uInt8 nMemberId = pMap->nMemberId;
 if( eMapUnit == MapUnit::Map100thMM )
 nMemberId &= (~CONVERT_TWIPS);
 
@@ -198,7 +198,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const 
SfxItemPropertySimpleEntry*
 
 // No UsrAny detected yet, generate Default entry and return this
 const MapUnit eMapUnit = 
mrItemPool.GetMetric(static_cast(pMap->nWID));
-sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
+sal_uInt8 nMemberId = pMap->nMemberId;
 if( eMapUnit == MapUnit::Map100thMM )
 nMemberId &= (~CONVERT_TWIPS);
 uno::Any aVal;
@@ -222,10 +222,10 @@ uno::Any SvxItemPropertySet::getPropertyValue( const 
SfxItemPropertySimpleEntry*
 }
 }
 
-if( pMap->nMemberId & SFX_METRIC_ITEM )
+if( pMap->nMoreFlags & PropertyMoreFlags::METRIC_ITEM )
 {
 // check for needed metric translation
-if(pMap->nMemberId & SFX_METRIC_ITEM && eMapUnit != 
MapUnit::Map100thMM)
+if(pMap->nMoreFlags & PropertyMoreFlags::METRIC_ITEM && eMapUnit != 
MapUnit::Map100thMM)
 {
 SvxUnoConvertToMM( eMapUnit, aVal );
 }
@@ -299,6 +299,7 @@ void SvxUnoConvertToMM( const MapUnit 

[Libreoffice-commits] core.git: editeng/source extensions/test qadevOOo/tests

2018-01-31 Thread Andrea Gelmini
 editeng/source/editeng/impedit.cxx  |2 +-
 extensions/test/ole/StarBasic_OleClient/oleclient.bas   |4 ++--
 extensions/test/ole/VisualBasic/Module1.vb  |2 +-
 qadevOOo/tests/java/ifc/linguistic2/_XDictionaryList.java   |8 

 qadevOOo/tests/java/ifc/linguistic2/_XSearchableDictionaryList.java |4 ++--
 qadevOOo/tests/java/mod/_lng/DicList.java   |4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit b794ea5ba1408418aa3987d8538846890f6413d8
Author: Andrea Gelmini 
Date:   Wed Jan 31 14:56:23 2018 +0100

Fix typos

Complete commit 8310642c6c404ea501b8be5ae4d12860e1562ac9

It passed "make check"

Change-Id: If599bf7b66c972f225f88802d10c70bea4783a38
Reviewed-on: https://gerrit.libreoffice.org/48998
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index f7f17639c6eb..0d531faa8854 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -963,7 +963,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 
 if ( aEditCursor.Right() > aTmpVisArea.Right() )
 {
-// Scroll left, positiv
+// Scroll left, positive
 nDocDiffX = aEditCursor.Right() - aTmpVisArea.Right();
 // Can it be a little more?
 if ( aEditCursor.Right() < ( nMaxTextWidth - GetScrollDiffX() ) )
diff --git a/extensions/test/ole/StarBasic_OleClient/oleclient.bas 
b/extensions/test/ole/StarBasic_OleClient/oleclient.bas
index ed0b322a8eef..e640d434d240 100644
--- a/extensions/test/ole/StarBasic_OleClient/oleclient.bas
+++ b/extensions/test/ole/StarBasic_OleClient/oleclient.bas
@@ -216,7 +216,7 @@ inUnknown2 = inUnknown
 obj.inoutUnknown(inUnknown2)
 outUnknown = Nothing
 obj.inoutUnknown(outUnknown)
-inDecimal = CDec("18446744073709551615") 'highest positiv value of unsigne 
int64
+inDecimal = CDec("18446744073709551615") 'highest positive value of unsigned 
int64
 inDecimal2 = inDecimal
 obj.inoutDecimal(inDecimal2)
 outDecimal = 0
@@ -576,7 +576,7 @@ If Not IsNull(outObject) Then
Exit Function
 End If
 'Decimal passed by reference
-inrefDecimal = CDec("9223372036854775807") 'highest positiv value of int64
+inrefDecimal = CDec("9223372036854775807") 'highest positive value of int64
 obj.inrefDecimal(inrefDecimal)
 outrefDecimal = 0
 obj.outDecimal(outrefDecimal)
diff --git a/extensions/test/ole/VisualBasic/Module1.vb 
b/extensions/test/ole/VisualBasic/Module1.vb
index 03da7399ffd4..f4acd19170a6 100644
--- a/extensions/test/ole/VisualBasic/Module1.vb
+++ b/extensions/test/ole/VisualBasic/Module1.vb
@@ -291,7 +291,7 @@ Public Sub Main()
 retULong = outULong
 objOleTest.testinout_methodULong(retLong)
 objOleTest.testinout_methodULong(retLong)
-outHyper = CDec("9223372036854775807") 'highest positiv value of int64
+outHyper = CDec("9223372036854775807") 'highest positive value of int64
 retHyper = outHyper
 objOleTest.testinout_methodHyper(retHyper)
 objOleTest.testinout_methodHyper(retHyper)
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XDictionaryList.java 
b/qadevOOo/tests/java/ifc/linguistic2/_XDictionaryList.java
index 2df623330c61..edbdc1a86a22 100644
--- a/qadevOOo/tests/java/ifc/linguistic2/_XDictionaryList.java
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XDictionaryList.java
@@ -123,7 +123,7 @@ public class _XDictionaryList extends MultiMethodTest {
 
 oObj.flushEvents();
 oObj.addDictionary(xDic);
-xDic.add("Positiv", false, "");
+xDic.add("Positive", false, "");
 xDic.setActive(true);
 oObj.flushEvents();
 oObj.removeDictionary(xDic);
@@ -151,7 +151,7 @@ public class _XDictionaryList extends MultiMethodTest {
 
 oObj.flushEvents();
 oObj.addDictionary(xDic);
-xDic.add("Positiv", false,"");
+xDic.add("Positive", false,"");
 xDic.setActive(true);
 
 listenerCalled = false;
@@ -175,7 +175,7 @@ public class _XDictionaryList extends MultiMethodTest {
 short previous = oObj.getCount();
 addedDic = oObj.createDictionary("AddedDic",new 
Locale("en","US","WIN"),
 com.sun.star.linguistic2.DictionaryType.POSITIVE,"");
-addedDic.add("Positiv",false,"");
+addedDic.add("Positive",false,"");
 
 oObj.addDictionary(addedDic);
 
@@ -235,7 +235,7 @@ public class _XDictionaryList extends MultiMethodTest {
 oObj.beginCollectEvents();
 
 oObj.addDictionary(xDic);
-xDic.add("Positiv",false,"");
+xDic.add("Positive",false,"");
 xDic.setActive(true);
 
 oObj.removeDictionary(xDic);
diff --git 

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

2018-01-31 Thread Stephan Bergmann
 editeng/source/uno/unonrule.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3341c752024687e96b7aad2d19e04d65ee7e232e
Author: Stephan Bergmann 
Date:   Wed Jan 31 08:43:27 2018 +0100

SvxNumberFormat::SetAbsLSpace takes short

...so there appears to be no good reason to cast from sal_Int32 to 
sal_uInt16 first

Change-Id: I67384bc736685269acb6c2033b2c4edffd27a510
Reviewed-on: https://gerrit.libreoffice.org/48953
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index 0860a8cd4de2..d7364ad35619 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -397,7 +397,7 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex(const 
Sequence>= nMargin )
 {
-aFmt.SetAbsLSpace(static_cast(nMargin));
+aFmt.SetAbsLSpace(nMargin);
 continue;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-28 Thread Stephan Bergmann
 editeng/source/accessibility/AccessibleStaticTextBase.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7d9590897526e26a3c0a7a90504741d4c21070f1
Author: Stephan Bergmann 
Date:   Sun Jan 28 11:32:13 2018 +0100

Values need not be bounded by sal_uInt16, it appears

since ESelection's nStart/EndPos have been changed to sal_Int32 with
3cbfcee36dd16e451d76c561eaaaee0ff29b01a5 "xub_StrLen and tools/string.hxx 
final
straw".

Change-Id: Icc96355ff71d07cac5d6037c81b2523156384077
Reviewed-on: https://gerrit.libreoffice.org/48773
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx 
b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
index f22752627da3..f44d1482bb6d 100644
--- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
@@ -87,9 +87,9 @@ namespace accessibility
   sal_Int32 nEndPara, sal_Int32 nEndIndex )
 {
 DBG_ASSERT(nStartPara >= 0 &&
-   nStartIndex >= 0 && nStartIndex <= USHRT_MAX &&
+   nStartIndex >= 0 &&
nEndPara >= 0 &&
-   nEndIndex >= 0 && nEndIndex <= USHRT_MAX ,
+   nEndIndex >= 0,
"AccessibleStaticTextBase_Impl::MakeSelection: index value 
overflow");
 
 return ESelection(nStartPara, nStartIndex, nEndPara, nEndIndex);
@@ -301,7 +301,7 @@ namespace accessibility
 {
 // check overflow
 DBG_ASSERT(nCurrPara >= 0 &&
-   nFlatIndex - nCurrIndex + nCurrCount >= 0 && 
nFlatIndex - nCurrIndex + nCurrCount <= USHRT_MAX ,
+   nFlatIndex - nCurrIndex + nCurrCount >= 0,
"AccessibleStaticTextBase_Impl::Index2Internal: 
index value overflow");
 
 return EPosition(nCurrPara, nFlatIndex - nCurrIndex + 
nCurrCount);
@@ -313,7 +313,7 @@ namespace accessibility
 {
 // check overflow
 DBG_ASSERT(nCurrPara > 0 &&
-   nFlatIndex - nCurrIndex + nCurrCount >= 0 && nFlatIndex 
- nCurrIndex + nCurrCount <= USHRT_MAX ,
+   nFlatIndex - nCurrIndex + nCurrCount >= 0,
"AccessibleStaticTextBase_Impl::Index2Internal: index 
value overflow");
 
 return EPosition(nCurrPara-1, nFlatIndex - nCurrIndex + 
nCurrCount);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-28 Thread Stephan Bergmann
 editeng/source/items/frmitems.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 09a2eb4c26cb136c4b6933fb0c38613d407ea12d
Author: Stephan Bergmann 
Date:   Sun Jan 28 11:37:48 2018 +0100

USHRT_MAX -> SAL_MAX_UINT16

Change-Id: I9909d8e125a16f9494ce431b62baf5d2507ad80d
Reviewed-on: https://gerrit.libreoffice.org/48774
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 5205e32b86df..1e76f58d4faa 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -488,7 +488,7 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 case MID_R_REL_MARGIN:
 {
 sal_Int32 nRel = 0;
-if((rVal >>= nRel) && nRel >= 0 && nRel < USHRT_MAX)
+if((rVal >>= nRel) && nRel >= 0 && nRel < SAL_MAX_UINT16)
 {
 if(MID_L_REL_MARGIN== nMemberId)
 nPropLeftMargin = static_cast(nRel);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-28 Thread Stephan Bergmann
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |   56 ++--
 1 file changed, 28 insertions(+), 28 deletions(-)

New commits:
commit 0728732e45b6b8566699370a7288855925c013c5
Author: Stephan Bergmann 
Date:   Sun Jan 28 11:09:23 2018 +0100

AccessibleEditableTextPara::GetParagraphCount no longer restricted

...to sal_uInt16, after 2af1f5691e8d64afd5246d245d7876b5a2cd5cd8 "resolved
fdo#35756 import more than 64k HTML table cells".  Some checks against 
USHRT_MAX
had not been removed at all, while others had been changed to useless checks
against SAL_MAX_INT32.

Change-Id: If21d10426ee392ba3f0586dde766e3f7da99d214
Reviewed-on: https://gerrit.libreoffice.org/48769
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx 
b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 567e8f6d3b22..29fa9380eaf9 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -160,7 +160,7 @@ namespace accessibility
 
 css::lang::Locale AccessibleEditableTextPara::implGetLocale()
 {
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
SAL_MAX_INT32,
+DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::getLocale: paragraph index 
value overflow");
 
 // return locale of first character in the paragraph
@@ -200,7 +200,7 @@ namespace accessibility
 SvxTextForwarder&   rCacheTF = GetTextForwarder();
 const sal_Int32 nParaIndex = GetParagraphIndex();
 
-DBG_ASSERT(nParaIndex >= 0 && nParaIndex <= SAL_MAX_INT32,
+DBG_ASSERT(nParaIndex >= 0,
"AccessibleEditableTextPara::implGetLineBoundary: paragraph 
index value overflow");
 
 const sal_Int32 nTextLen = rCacheTF.GetTextLen( nParaIndex );
@@ -341,7 +341,7 @@ namespace accessibility
 // check overflow
 DBG_ASSERT(nStartEEIndex >= 0 &&
nEndEEIndex >= 0 &&
-   GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
SAL_MAX_INT32,
+   GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::MakeSelection: index value 
overflow");
 
 sal_Int32 nParaIndex = GetParagraphIndex();
@@ -535,7 +535,7 @@ namespace accessibility
 
 bool AccessibleEditableTextPara::HaveChildren()
 {
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
SAL_MAX_INT32,
+DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::HaveChildren: paragraph index 
value overflow");
 
 return GetTextForwarder().HaveImageBullet( GetParagraphIndex() );
@@ -614,7 +614,7 @@ namespace accessibility
 DBG_ASSERT(nIndex >= 0,
"AccessibleEditableTextPara::GetAttributeRun: index value 
overflow");
 
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
SAL_MAX_INT32,
+DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::getLocale: paragraph index 
value overflow");
 
 return GetTextForwarder().GetAttributeRun( nStartIndex,
@@ -997,7 +997,7 @@ namespace accessibility
 {
 SolarMutexGuard aGuard;
 
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
SAL_MAX_INT32,
+DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::contains: index value 
overflow");
 
 awt::Rectangle aTmpRect = getBounds();
@@ -1044,7 +1044,7 @@ namespace accessibility
 {
 SolarMutexGuard aGuard;
 
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
SAL_MAX_INT32,
+DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::getBounds: index value 
overflow");
 
 SvxTextForwarder& rCacheTF = GetTextForwarder();
@@ -1189,7 +1189,7 @@ namespace accessibility
 {
 SolarMutexGuard aGuard;
 
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
USHRT_MAX,
+DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::getCharacter: index value 
overflow");
 
 return OCommonAccessibleText::implGetCharacter( implGetText(), nIndex 
);
@@ -1294,7 +1294,7 @@ namespace accessibility
 {
 SolarMutexGuard aGuard;
 
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
USHRT_MAX,
+DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::getCharacterBounds: index 
value overflow");
 
 // #108900# Have position semantics now for nIndex, as
@@ -1327,7 +1327,7 @@ namespace accessibility
 {
 SolarMutexGuard aGuard;
 
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
USHRT_MAX,
+

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

2018-01-28 Thread Jochen Nitschke
 editeng/source/items/bulitem.cxx |   54 +++
 include/editeng/bulletitem.hxx   |3 --
 2 files changed, 21 insertions(+), 36 deletions(-)

New commits:
commit f1e910c5ee7e89379391ff260e4164a6d9d21bff
Author: Jochen Nitschke 
Date:   Sun Jan 28 21:28:28 2018 +0100

inline SvxBulletItem::SetDefaultFont_Impl and SetDefaults_Impl

use initializer lists in constructors

Change-Id: Ib3b836ba96046a5f3bca12ea7702247afe8eac3b
Reviewed-on: https://gerrit.libreoffice.org/48803
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index 206b32595f58..64eb82dba2f6 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -29,25 +29,32 @@
 #define BULITEM_VERSION (sal_uInt16(2))
 
 
-SvxBulletItem::SvxBulletItem( sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich )
+SvxBulletItem::SvxBulletItem( sal_uInt16 _nWhich )
+: SfxPoolItem(_nWhich)
+, aFont(OutputDevice::GetDefaultFont( DefaultFontType::FIXED, 
LANGUAGE_SYSTEM, GetDefaultFontFlags::NONE ))
+, nStart(1)
+, nStyle(SvxBulletStyle::N123)
+, nWidth(1200)  // 1.2cm
+, nScale(75)
+, cSymbol(' ')
 {
-SetDefaultFont_Impl();
-SetDefaults_Impl();
+aFont.SetAlignment(ALIGN_BOTTOM);
+aFont.SetTransparent( true );
 }
 
 
-SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem 
)
+SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem )
+: SfxPoolItem(rItem)
+, aFont(rItem.aFont)
+, pGraphicObject(rItem.pGraphicObject ? new GraphicObject( 
*rItem.pGraphicObject ) : nullptr)
+, aPrevText(rItem.aPrevText)
+, aFollowText(rItem.aFollowText)
+, nStart(rItem.nStart)
+, nStyle(rItem.nStyle)
+, nWidth(rItem.nWidth)
+, nScale(rItem.nScale)
+, cSymbol(rItem.cSymbol)
 {
-aFont   = rItem.aFont;
-if (rItem.pGraphicObject)
-pGraphicObject.reset( new GraphicObject( *rItem.pGraphicObject ) );
-aPrevText   = rItem.aPrevText;
-aFollowText = rItem.aFollowText;
-nStart  = rItem.nStart;
-nStyle  = rItem.nStyle;
-nWidth  = rItem.nWidth;
-nScale  = rItem.nScale;
-cSymbol = rItem.cSymbol;
 }
 
 
@@ -62,25 +69,6 @@ SfxPoolItem* SvxBulletItem::Clone( SfxItemPool * /*pPool*/ ) 
const
 }
 
 
-void SvxBulletItem::SetDefaultFont_Impl()
-{
-aFont = OutputDevice::GetDefaultFont( DefaultFontType::FIXED, 
LANGUAGE_SYSTEM, GetDefaultFontFlags::NONE );
-aFont.SetAlignment( ALIGN_BOTTOM);
-aFont.SetTransparent( true );
-}
-
-
-void SvxBulletItem::SetDefaults_Impl()
-{
-pGraphicObject  = nullptr;
-nWidth  = 1200;  // 1.2cm
-nStart  = 1;
-nStyle  = SvxBulletStyle::N123;
-cSymbol = ' ';
-nScale  = 75;
-}
-
-
 sal_uInt16 SvxBulletItem::GetVersion( sal_uInt16 /*nVersion*/ ) const
 {
 return BULITEM_VERSION;
diff --git a/include/editeng/bulletitem.hxx b/include/editeng/bulletitem.hxx
index 2b3109a4f6ed..ddcbb28ddf89 100644
--- a/include/editeng/bulletitem.hxx
+++ b/include/editeng/bulletitem.hxx
@@ -56,9 +56,6 @@ class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
 sal_uInt16  nScale;
 sal_Unicode cSymbol;
 
-voidSetDefaultFont_Impl();
-voidSetDefaults_Impl();
-
 public:
 explicit SvxBulletItem( sal_uInt16 nWhich );
 SvxBulletItem( const SvxBulletItem& );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-28 Thread Stephan Bergmann
 editeng/source/accessibility/AccessibleStaticTextBase.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e9b8d6f651dff18e93f26d9c885a7a735e841021
Author: Stephan Bergmann 
Date:   Sun Jan 28 11:25:10 2018 +0100

Remove useless checks against SAL_MAX_INT32

...changed from checks against USHRT_MAX in
2af1f5691e8d64afd5246d245d7876b5a2cd5cd8 "resolved fdo#35756 import more 
than
64k HTML table cells"

Change-Id: I32c0e1216d5ba6b1a899540dddade06b17ad0103
Reviewed-on: https://gerrit.libreoffice.org/48772
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx 
b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
index 10805ce72564..f22752627da3 100644
--- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
@@ -86,9 +86,9 @@ namespace accessibility
 ESelection MakeSelection( sal_Int32 nStartPara, sal_Int32 nStartIndex,
   sal_Int32 nEndPara, sal_Int32 nEndIndex )
 {
-DBG_ASSERT(nStartPara >= 0 && nStartPara <= SAL_MAX_INT32 &&
+DBG_ASSERT(nStartPara >= 0 &&
nStartIndex >= 0 && nStartIndex <= USHRT_MAX &&
-   nEndPara >= 0 && nEndPara <= SAL_MAX_INT32 &&
+   nEndPara >= 0 &&
nEndIndex >= 0 && nEndIndex <= USHRT_MAX ,
"AccessibleStaticTextBase_Impl::MakeSelection: index value 
overflow");
 
@@ -300,7 +300,7 @@ namespace accessibility
 if( nCurrIndex >= nFlatIndex )
 {
 // check overflow
-DBG_ASSERT(nCurrPara >= 0 && nCurrPara <= SAL_MAX_INT32 &&
+DBG_ASSERT(nCurrPara >= 0 &&
nFlatIndex - nCurrIndex + nCurrCount >= 0 && 
nFlatIndex - nCurrIndex + nCurrCount <= USHRT_MAX ,
"AccessibleStaticTextBase_Impl::Index2Internal: 
index value overflow");
 
@@ -312,7 +312,7 @@ namespace accessibility
 if( bExclusive && nCurrIndex == nFlatIndex )
 {
 // check overflow
-DBG_ASSERT(nCurrPara > 0 && nCurrPara <= SAL_MAX_INT32 &&
+DBG_ASSERT(nCurrPara > 0 &&
nFlatIndex - nCurrIndex + nCurrCount >= 0 && nFlatIndex 
- nCurrIndex + nCurrCount <= USHRT_MAX ,
"AccessibleStaticTextBase_Impl::Index2Internal: index 
value overflow");
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-28 Thread Stephan Bergmann
 editeng/source/uno/unoedprx.cxx |   51 ++--
 1 file changed, 18 insertions(+), 33 deletions(-)

New commits:
commit fe41d0ff8c426fe5934872de8b0dcb167cb636a2
Author: Stephan Bergmann 
Date:   Sun Jan 28 12:01:03 2018 +0100

Remove various more obsolete sal_uInt16 restrictions

...similar to bf7ea94632d33eb3ed3eae26bca36906eda15257
"SvxAccessibleTextIndex::mnEEIndex need not be bounded sal_uInt16"

Change-Id: I88d107ae1eb16c8fc3322f1c6318df62c079cf23
Reviewed-on: https://gerrit.libreoffice.org/48775
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx
index 24f95f6c03f8..c17c97971658 100644
--- a/editeng/source/uno/unoedprx.cxx
+++ b/editeng/source/uno/unoedprx.cxx
@@ -227,7 +227,7 @@ void SvxAccessibleTextIndex::SetIndex( sal_Int32 nIndex, 
const SvxTextForwarder&
 // calculate unknowns
 sal_Int32 nCurrField, nFieldCount = rTF.GetFieldCount( GetParagraph() );
 
-DBG_ASSERT(nIndex >= 0 && nIndex <= USHRT_MAX,
+DBG_ASSERT(nIndex >= 0,
"SvxAccessibleTextIndex::SetIndex: index value overflow");
 
 mnEEIndex = nIndex;
@@ -450,16 +450,14 @@ OUString SvxAccessibleTextAdapter::GetText( const 
ESelection& rSel ) const
 // trim field text, if necessary
 if( aStartIndex.InField() )
 {
-DBG_ASSERT(aStartIndex.GetFieldOffset() >= 0 &&
-   aStartIndex.GetFieldOffset() <= USHRT_MAX,
+DBG_ASSERT(aStartIndex.GetFieldOffset() >= 0,
"SvxAccessibleTextIndex::GetText: index value overflow");
 
 sStr = sStr.copy( aStartIndex.GetFieldOffset() );
 }
 if( aEndIndex.InField() && aEndIndex.GetFieldOffset() )
 {
-DBG_ASSERT(sStr.getLength() - (aEndIndex.GetFieldLen() - 
aEndIndex.GetFieldOffset()) >= 0 &&
-   sStr.getLength() - (aEndIndex.GetFieldLen() - 
aEndIndex.GetFieldOffset()) <= USHRT_MAX,
+DBG_ASSERT(sStr.getLength() - (aEndIndex.GetFieldLen() - 
aEndIndex.GetFieldOffset()) >= 0,
"SvxAccessibleTextIndex::GetText: index value overflow");
 
 sStr = sStr.copy(0, sStr.getLength() - (aEndIndex.GetFieldLen() - 
aEndIndex.GetFieldOffset()) );
@@ -473,8 +471,7 @@ OUString SvxAccessibleTextAdapter::GetText( const 
ESelection& rSel ) const
 // append trailing bullet
 sStr += aBulletInfo2.aText;
 
-DBG_ASSERT(sStr.getLength() - (aEndIndex.GetBulletLen() - 
aEndIndex.GetBulletOffset()) >= 0 &&
-   sStr.getLength() - (aEndIndex.GetBulletLen() - 
aEndIndex.GetBulletOffset()) <= USHRT_MAX,
+DBG_ASSERT(sStr.getLength() - (aEndIndex.GetBulletLen() - 
aEndIndex.GetBulletOffset()) >= 0,
"SvxAccessibleTextIndex::GetText: index value overflow");
 
 sStr = sStr.copy(0, sStr.getLength() - (aEndIndex.GetBulletLen() - 
aEndIndex.GetBulletOffset()) );
@@ -484,8 +481,7 @@ OUString SvxAccessibleTextAdapter::GetText( const 
ESelection& rSel ) const
 {
 OUString sBullet = aBulletInfo2.aText;
 
-DBG_ASSERT(sBullet.getLength() - (aEndIndex.GetBulletLen() - 
aEndIndex.GetBulletOffset()) >= 0 &&
-   sBullet.getLength() - (aEndIndex.GetBulletLen() - 
aEndIndex.GetBulletOffset()) <= USHRT_MAX,
+DBG_ASSERT(sBullet.getLength() - (aEndIndex.GetBulletLen() - 
aEndIndex.GetBulletOffset()) >= 0,
"SvxAccessibleTextIndex::GetText: index value overflow");
 
 sBullet = sBullet.copy(0, sBullet.getLength() - 
(aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) );
@@ -796,7 +792,7 @@ bool SvxAccessibleTextAdapter::GetIndexAtPoint( const 
Point& rPoint, sal_Int32&
 SvxAccessibleTextIndex aIndex;
 aIndex.SetEEIndex(nPara, nIndex, *this);
 
-DBG_ASSERT(aIndex.GetIndex() >= 0 && aIndex.GetIndex() <= USHRT_MAX,
+DBG_ASSERT(aIndex.GetIndex() >= 0,
"SvxAccessibleTextIndex::SetIndex: index value overflow");
 
 nIndex = aIndex.GetIndex();
@@ -822,8 +818,7 @@ bool SvxAccessibleTextAdapter::GetIndexAtPoint( const 
Point& rPoint, sal_Int32&
 Point aPoint = rPoint;
 aPoint.Move( -aBulletInfo.aBounds.Left(), 
-aBulletInfo.aBounds.Top() );
 
-DBG_ASSERT(aStringWrap.GetIndexAtPoint( aPoint ) >= 0 &&
-   aStringWrap.GetIndexAtPoint( aPoint ) <= USHRT_MAX,
+DBG_ASSERT(aStringWrap.GetIndexAtPoint( aPoint ) >= 0,
"SvxAccessibleTextIndex::SetIndex: index value 
overflow");
 
 nIndex = aStringWrap.GetIndexAtPoint( aPoint );
@@ -850,8 +845,7 @@ bool SvxAccessibleTextAdapter::GetIndexAtPoint( const 
Point& rPoint, sal_Int32&
 Point aPoint = rPoint;
 aPoint.Move( -aRect.Left(), -aRect.Top() );
 
-DBG_ASSERT(aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( rPoint ) 
>= 0 &&
-   

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

2018-01-28 Thread Stephan Bergmann
 editeng/source/accessibility/AccessibleImageBullet.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 57987270be5dcc22671a78f576f68d89c5f9e2d4
Author: Stephan Bergmann 
Date:   Sun Jan 28 11:21:54 2018 +0100

AccessibleImageBullet::GetParagraphCount no longer restricted to sal_uIn16,

after 2af1f5691e8d64afd5246d245d7876b5a2cd5cd8 "resolved fdo#35756 import 
more
than 64k HTML table cells"

Change-Id: Ie8fa2810c27ba36a032c6b5e125dc2aeddd63b44
Reviewed-on: https://gerrit.libreoffice.org/48771
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/accessibility/AccessibleImageBullet.cxx 
b/editeng/source/accessibility/AccessibleImageBullet.cxx
index 90bfa7eda5c7..a475af08b09a 100644
--- a/editeng/source/accessibility/AccessibleImageBullet.cxx
+++ b/editeng/source/accessibility/AccessibleImageBullet.cxx
@@ -174,7 +174,7 @@ namespace accessibility
 
 SolarMutexGuard aGuard;
 
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
USHRT_MAX,
+DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleImageBullet::getLocale: paragraph index value 
overflow");
 
 // return locale of first character in the paragraph
@@ -212,7 +212,7 @@ namespace accessibility
 
 SolarMutexGuard aGuard;
 
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
USHRT_MAX,
+DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::contains: index value 
overflow");
 
 awt::Rectangle aTmpRect = getBounds();
@@ -234,7 +234,7 @@ namespace accessibility
 
 SolarMutexGuard aGuard;
 
-DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
USHRT_MAX,
+DBG_ASSERT(GetParagraphIndex() >= 0,
"AccessibleEditableTextPara::getBounds: index value 
overflow");
 
 SvxTextForwarder& rCacheTF = GetTextForwarder();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-28 Thread Stephan Bergmann
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e120409015296ad8386502d61273c03c58eda3ad
Author: Stephan Bergmann 
Date:   Sun Jan 28 11:01:55 2018 +0100

nStart/EndEEIndex nned not be bounded by sal_uInt16

...it appears, since ESelection's nStart/EndPos have been changed to 
sal_Int32
with 3cbfcee36dd16e451d76c561eaaaee0ff29b01a5 "xub_StrLen and 
tools/string.hxx
final straw".

Change-Id: I3f3d77d6efeabef9f05b3a5233e0e5590b1ed365
Reviewed-on: https://gerrit.libreoffice.org/48767
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx 
b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 6f4aa8791ffd..c555deae0ab3 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -339,8 +339,8 @@ namespace accessibility
 ESelection AccessibleEditableTextPara::MakeSelection( sal_Int32 
nStartEEIndex, sal_Int32 nEndEEIndex )
 {
 // check overflow
-DBG_ASSERT(nStartEEIndex >= 0 && nStartEEIndex <= USHRT_MAX &&
-   nEndEEIndex >= 0 && nEndEEIndex <= USHRT_MAX &&
+DBG_ASSERT(nStartEEIndex >= 0 &&
+   nEndEEIndex >= 0 &&
GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
SAL_MAX_INT32,
"AccessibleEditableTextPara::MakeSelection: index value 
overflow");
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-28 Thread Stephan Bergmann
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2851dc3f5dc0f7a42f5938d9ff07c0b8a246b96e
Author: Stephan Bergmann 
Date:   Sun Jan 28 11:12:11 2018 +0100

Remove useless check against SAL_MAX_INT32

...changed from a check against USHRT_MAX in
3cbfcee36dd16e451d76c561eaaaee0ff29b01a5 "xub_StrLen and tools/string.hxx 
final
straw"

Change-Id: I8311803f9b5d1a78d8039d4810b0ae3cfdd27c53
Reviewed-on: https://gerrit.libreoffice.org/48770
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx 
b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index c555deae0ab3..567e8f6d3b22 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -611,7 +611,7 @@ namespace accessibility
 
 bool AccessibleEditableTextPara::GetAttributeRun( sal_Int32& nStartIndex, 
sal_Int32& nEndIndex, sal_Int32 nIndex )
 {
-DBG_ASSERT(nIndex >= 0 && nIndex <= SAL_MAX_INT32,
+DBG_ASSERT(nIndex >= 0,
"AccessibleEditableTextPara::GetAttributeRun: index value 
overflow");
 
 DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= 
SAL_MAX_INT32,
___
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

2018-01-28 Thread Stephan Bergmann
 editeng/source/uno/unoedprx.cxx |   16 
 include/editeng/unoedprx.hxx|2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit f7c4c6313dbe305d9dd2f7a0c49f436033bbf62e
Author: Stephan Bergmann 
Date:   Sun Jan 28 10:31:00 2018 +0100

SvxAccessibleTextIndex::mnEEIndex need not be bounded sal_uInt16

It was originally introduced with type USHORT
(a909acb7009acadffa53e74ea05ddb88803490f1 "#98735# Refactored
unoedit/unoedacc.cxx"), then shortly after changed to sal_Int32
(a0089a21f047ce8b5378b45f1535269e3600d681 "#98735# Fixed various off-by-one
mistakes"), presumably because it needed to hold values slightly larger than
USHRT_MAX.

But at least since the surrounding code has been changed to use sal_Int32
throughout (e.g., structs like EPosition and ESeleciton in
include/editeng/editdata.hxx with 3cbfcee36dd16e451d76c561eaaaee0ff29b01a5
"xub_StrLen and tools/string.hxx final straw"), there appears to be no more
reason to effectively restrict mnEEIndex to sal_uInt16 values.

Change-Id: I78f02be1f2736a626a836ac992230a74cc669fd3
Reviewed-on: https://gerrit.libreoffice.org/48766
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx
index d49032f00423..24f95f6c03f8 100644
--- a/editeng/source/uno/unoedprx.cxx
+++ b/editeng/source/uno/unoedprx.cxx
@@ -89,9 +89,9 @@ public:
 @param rTF
 The text forwarder to use in the calculations
  */
-void SetEEIndex( sal_uInt16 nEEIndex, const SvxTextForwarder& rTF );
-void SetEEIndex( sal_Int32 nPara, sal_uInt16 nEEIndex, const 
SvxTextForwarder& rTF ) { SetParagraph(nPara); SetEEIndex(nEEIndex, rTF); }
-sal_uInt16 GetEEIndex() const;
+void SetEEIndex( sal_Int32 nEEIndex, const SvxTextForwarder& rTF );
+void SetEEIndex( sal_Int32 nPara, sal_Int32 nEEIndex, const 
SvxTextForwarder& rTF ) { SetParagraph(nPara); SetEEIndex(nEEIndex, rTF); }
+sal_Int32 GetEEIndex() const;
 
 void SetFieldOffset( sal_Int32 nOffset, sal_Int32 nLen ) { mnFieldOffset = 
nOffset; mnFieldLen = nLen; }
 sal_Int32 GetFieldOffset() const { return mnFieldOffset; }
@@ -158,15 +158,15 @@ ESelection MakeEESelection( const SvxAccessibleTextIndex& 
rIndex )
rIndex.GetParagraph(), rIndex.GetEEIndex() + 1 );
 }
 
-sal_uInt16 SvxAccessibleTextIndex::GetEEIndex() const
+sal_Int32 SvxAccessibleTextIndex::GetEEIndex() const
 {
-DBG_ASSERT(mnEEIndex >= 0 && mnEEIndex <= USHRT_MAX,
+DBG_ASSERT(mnEEIndex >= 0,
"SvxAccessibleTextIndex::GetEEIndex: index value overflow");
 
-return static_cast< sal_uInt16 > (mnEEIndex);
+return mnEEIndex;
 }
 
-void SvxAccessibleTextIndex::SetEEIndex( sal_uInt16 nEEIndex, const 
SvxTextForwarder& rTF )
+void SvxAccessibleTextIndex::SetEEIndex( sal_Int32 nEEIndex, const 
SvxTextForwarder& rTF )
 {
 // reset
 mnFieldOffset = 0;
@@ -632,7 +632,7 @@ void SvxAccessibleTextAdapter::FieldClicked( const 
SvxFieldItem& rField, sal_Int
 mpTextForwarder->FieldClicked( rField, nPara, nPos );
 }
 
-sal_uInt16 SvxAccessibleTextAdapter::CalcEditEngineIndex( sal_Int32 nPara, 
sal_Int32 nLogicalIndex )
+sal_Int32 SvxAccessibleTextAdapter::CalcEditEngineIndex( sal_Int32 nPara, 
sal_Int32 nLogicalIndex )
 {
 assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder");
 
diff --git a/include/editeng/unoedprx.hxx b/include/editeng/unoedprx.hxx
index 39bc5f163b6d..559c0390294e 100644
--- a/include/editeng/unoedprx.hxx
+++ b/include/editeng/unoedprx.hxx
@@ -42,7 +42,7 @@ public:
 virtual voidRemoveAttribs( const ESelection& rSelection ) 
override;
 virtual voidGetPortions( sal_Int32 nPara, 
std::vector& rList ) const override;
 
-sal_uInt16  CalcEditEngineIndex( sal_Int32 nPara, sal_Int32 
nLogicalIndex );
+sal_Int32   CalcEditEngineIndex( sal_Int32 nPara, sal_Int32 
nLogicalIndex );
 
 virtual SfxItemStateGetItemState( const ESelection& rSel, sal_uInt16 
nWhich ) const override;
 virtual SfxItemStateGetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) 
const override;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/animations qadevOOo/tests sd/source UnoControls/source

2018-01-26 Thread Andrea Gelmini
 UnoControls/source/controls/progressmonitor.cxx  |2 +-
 editeng/source/lookuptree/Trie.cxx   |2 +-
 include/animations/animationnodehelper.hxx   |2 +-
 qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java |2 +-
 sd/source/ui/animations/CustomAnimationList.cxx  |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit ba8c04a6fc7d1931b4417af99aa0b45091747d83
Author: Andrea Gelmini 
Date:   Fri Jan 26 12:52:26 2018 +0100

Fix typos

Change-Id: I78025acb7e17d894252b19b351eeae7a27fc5e97
Reviewed-on: https://gerrit.libreoffice.org/48685
Tested-by: Jenkins 
Reviewed-by: Jens Carl 

diff --git a/UnoControls/source/controls/progressmonitor.cxx 
b/UnoControls/source/controls/progressmonitor.cxx
index 74e43d05dfb2..d7296e871639 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -487,7 +487,7 @@ void SAL_CALL ProgressMonitor::dispose ()
 removeControl ( xRef_Button );
 removeControl ( m_xProgressBar.get() );
 
-// do'nt use "...->clear ()" or "... = XFixedText ()"
+// don't use "...->clear ()" or "... = XFixedText ()"
 // when other hold a reference at this object !!!
 xRef_Topic_Top->dispose ();
 xRef_Text_Top->dispose  ();
diff --git a/editeng/source/lookuptree/Trie.cxx 
b/editeng/source/lookuptree/Trie.cxx
index 0badcd99703c..184330ef4f2f 100644
--- a/editeng/source/lookuptree/Trie.cxx
+++ b/editeng/source/lookuptree/Trie.cxx
@@ -104,7 +104,7 @@ void TrieNode::collectSuggestionsForCurrentNode(TrieNode* 
pCurrent, const OUStri
 {
 rSuggestionList.push_back(aStringPath);
 }
-// recursivly descend tree
+// recursively descend tree
 pCurrent->collectSuggestions(aStringPath, rSuggestionList);
 }
 
diff --git a/include/animations/animationnodehelper.hxx 
b/include/animations/animationnodehelper.hxx
index 364e0ad0847b..a72233a9d3ba 100644
--- a/include/animations/animationnodehelper.hxx
+++ b/include/animations/animationnodehelper.hxx
@@ -36,7 +36,7 @@ namespace anim
 // only a function pointer, and a thin templated wrapper around
 // that which converts member functions into that.
 
-/** pushes the given node to the given vector and recursivly calls itself 
for each child node.
+/** pushes the given node to the given vector and recursively calls itself 
for each child node.
 */
 inline void create_deep_vector( const css::uno::Reference< 
css::animations::XAnimationNode >& xNode,
 std::vector< css::uno::Reference< 
css::animations::XAnimationNode > >& rVector )
diff --git a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java 
b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java
index 1efea375cb35..99dc87240d01 100644
--- a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java
+++ b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java
@@ -159,7 +159,7 @@ public class SdXCustomPresentationAccess extends TestCase {
 tEnv.addObjRelation("INSTANCE" + n, oInstance);
 }
 } catch (com.sun.star.uno.Exception e) {
-log.println("Could't adding INSTANCEn: " + e);
+log.println("Couldn't adding INSTANCEn: " + e);
 }
 
 return tEnv;
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx 
b/sd/source/ui/animations/CustomAnimationList.cxx
index 58d6d6b475b1..b55f53e54022 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -69,7 +69,7 @@ using ::com::sun::star::beans::XPropertySetInfo;
 
 namespace sd {
 
-// go recursivly through all shapes in the given XShapes collection and return 
true as soon as the
+// go recursively through all shapes in the given XShapes collection and 
return true as soon as the
 // given shape is found. nIndex is incremented for each shape with the same 
shape type as the given
 // shape is found until the given shape is found.
 static bool getShapeIndex(  const Reference< XShapes >& xShapes, const 
Reference< XShape >& xShape, sal_Int32& nIndex )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-24 Thread Stephan Bergmann
 editeng/source/uno/unofield.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 13a1a7e1f2851e465898631fc7cc567624cd7dcf
Author: Stephan Bergmann 
Date:   Tue Jan 23 11:09:51 2018 +0100

Avoid upcoming GCC 8 -Werror=class-memaccess on css::util::DateTime

...whose ctor already zero-initializes all members, so the first two 
memsets are
unnecessary.  And spell the third memset as explicit assignments.

Change-Id: Ie5079711b152bac7f0a8d52d7889879157a35b5d
Reviewed-on: https://gerrit.libreoffice.org/48390
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 7cac637b05f5..29b84fd2833b 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -192,7 +192,6 @@ static SvxFileFormat setFileNameDisplayFormat( sal_Int16 
nFormat )
 static util::DateTime getDate( sal_Int32 nDate )
 {
 util::DateTime aDate;
-memset( , 0, sizeof( util::DateTime ) );
 
 Date aTempDate( nDate );
 
@@ -211,7 +210,6 @@ inline Date setDate( util::DateTime const & rDate )
 static util::DateTime getTime(sal_Int64 const nTime)
 {
 util::DateTime aTime;
-memset( , 0, sizeof( util::DateTime ) );
 
 tools::Time aTempTime( nTime );
 
@@ -259,7 +257,14 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) 
throw()
 {
 mpPropSet = ImplGetFieldItemPropertySet(mnServiceId);
 
-memset( &(mpImpl->maDateTime), 0, sizeof( util::DateTime ) );
+mpImpl->maDateTime.NanoSeconds = 0;
+mpImpl->maDateTime.Seconds = 0;
+mpImpl->maDateTime.Minutes = 0;
+mpImpl->maDateTime.Hours = 0;
+mpImpl->maDateTime.Day = 0;
+mpImpl->maDateTime.Month = 0;
+mpImpl->maDateTime.Year = 0;
+mpImpl->maDateTime.IsUTC = false;
 
 switch( nServiceId )
 {
___
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

2018-01-23 Thread Noel Grandin
 editeng/source/items/frmitems.cxx |   91 ++
 include/editeng/boxitem.hxx   |   26 +-
 2 files changed, 49 insertions(+), 68 deletions(-)

New commits:
commit 8eab42ddce2e9a01e65d82e2e5741a7d59fdd6ba
Author: Noel Grandin 
Date:   Wed Jan 17 10:18:28 2018 +0200

loplugin:useuniqueptr in SvxBoxItem

Change-Id: I0702a25c765fc8781b65320f44c0e0c3c56269a7
Reviewed-on: https://gerrit.libreoffice.org/48408
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 96785fef5c83..5205e32b86df 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1356,20 +1356,15 @@ SvxBoxItem::SvxBoxItem( const SvxBoxItem& rCpy ) :
 bRemoveAdjCellBorder ( rCpy.bRemoveAdjCellBorder )
 
 {
-pTop= rCpy.GetTop() ? new SvxBorderLine( *rCpy.GetTop() ): 
nullptr;
-pBottom = rCpy.GetBottom()  ? new SvxBorderLine( *rCpy.GetBottom() ) : 
nullptr;
-pLeft   = rCpy.GetLeft()? new SvxBorderLine( *rCpy.GetLeft() )   : 
nullptr;
-pRight  = rCpy.GetRight()   ? new SvxBorderLine( *rCpy.GetRight() )  : 
nullptr;
+pTop.reset(rCpy.GetTop() ? new SvxBorderLine( *rCpy.GetTop() )
: nullptr );
+pBottom.reset( rCpy.GetBottom()  ? new SvxBorderLine( *rCpy.GetBottom() ) 
: nullptr );
+pLeft.reset(   rCpy.GetLeft()? new SvxBorderLine( *rCpy.GetLeft() )   
: nullptr );
+pRight.reset(  rCpy.GetRight()   ? new SvxBorderLine( *rCpy.GetRight() )  
: nullptr );
 }
 
 
 SvxBoxItem::SvxBoxItem( const sal_uInt16 nId ) :
 SfxPoolItem( nId ),
-
-pTop( nullptr ),
-pBottom ( nullptr ),
-pLeft   ( nullptr ),
-pRight  ( nullptr ),
 nTopDist( 0 ),
 nBottomDist ( 0 ),
 nLeftDist   ( 0 ),
@@ -1381,10 +1376,6 @@ SvxBoxItem::SvxBoxItem( const sal_uInt16 nId ) :
 
 SvxBoxItem::~SvxBoxItem()
 {
-delete pTop;
-delete pBottom;
-delete pLeft;
-delete pRight;
 }
 
 
@@ -1403,9 +1394,9 @@ SvxBoxItem& SvxBoxItem::operator=( const SvxBoxItem& rBox 
)
 }
 
 
-inline bool CmpBrdLn( const SvxBorderLine* pBrd1, const SvxBorderLine* pBrd2 )
+inline bool CmpBrdLn( const std::unique_ptr & pBrd1, const 
SvxBorderLine* pBrd2 )
 {
-if( pBrd1 == pBrd2 )
+if( pBrd1.get() == pBrd2 )
 return true;
 if( pBrd1 == nullptr || pBrd2 == nullptr)
 return false;
@@ -2075,16 +2066,16 @@ const SvxBorderLine *SvxBoxItem::GetLine( 
SvxBoxItemLine nLine ) const
 switch ( nLine )
 {
 case SvxBoxItemLine::TOP:
-pRet = pTop;
+pRet = pTop.get();
 break;
 case SvxBoxItemLine::BOTTOM:
-pRet = pBottom;
+pRet = pBottom.get();
 break;
 case SvxBoxItemLine::LEFT:
-pRet = pLeft;
+pRet = pLeft.get();
 break;
 case SvxBoxItemLine::RIGHT:
-pRet = pRight;
+pRet = pRight.get();
 break;
 default:
 OSL_FAIL( "wrong line" );
@@ -2097,28 +2088,23 @@ const SvxBorderLine *SvxBoxItem::GetLine( 
SvxBoxItemLine nLine ) const
 
 void SvxBoxItem::SetLine( const SvxBorderLine* pNew, SvxBoxItemLine nLine )
 {
-SvxBorderLine* pTmp = pNew ? new SvxBorderLine( *pNew ) : nullptr;
+std::unique_ptr pTmp( pNew ? new SvxBorderLine( *pNew ) : 
nullptr );
 
 switch ( nLine )
 {
 case SvxBoxItemLine::TOP:
-delete pTop;
-pTop = pTmp;
+pTop = std::move( pTmp );
 break;
 case SvxBoxItemLine::BOTTOM:
-delete pBottom;
-pBottom = pTmp;
+pBottom = std::move( pTmp );
 break;
 case SvxBoxItemLine::LEFT:
-delete pLeft;
-pLeft = pTmp;
+pLeft = std::move( pTmp );
 break;
 case SvxBoxItemLine::RIGHT:
-delete pRight;
-pRight = pTmp;
+pRight = std::move( pTmp );
 break;
 default:
-delete pTmp;
 OSL_FAIL( "wrong line" );
 }
 }
@@ -2192,16 +2178,16 @@ sal_uInt16 SvxBoxItem::CalcLineWidth( SvxBoxItemLine 
nLine ) const
 switch ( nLine )
 {
 case SvxBoxItemLine::TOP:
-pTmp = pTop;
+pTmp = pTop.get();
 break;
 case SvxBoxItemLine::BOTTOM:
-pTmp = pBottom;
+pTmp = pBottom.get();
 break;
 case SvxBoxItemLine::LEFT:
-pTmp = pLeft;
+pTmp = pLeft.get();
 break;
 case SvxBoxItemLine::RIGHT:
-pTmp = pRight;
+pTmp = pRight.get();
 break;
 default:
 OSL_FAIL( "wrong line" );
@@ -2220,19 +2206,19 @@ sal_uInt16 SvxBoxItem::CalcLineSpace( SvxBoxItemLine 
nLine, bool bEvenIfNoLine )
 switch ( nLine )
 {
 case SvxBoxItemLine::TOP:
-pTmp = 

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

2018-01-22 Thread Stephan Bergmann
 editeng/source/accessibility/AccessibleStringWrap.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d93813d8e448395ff9b6ac7b755d8fad68ec61b6
Author: Stephan Bergmann 
Date:   Mon Jan 22 22:42:25 2018 +0100

OutputDevice::GetCaretPositions takes sal_Int32 nIndex parameter

...since 16b446937e026ff5edd097e99b8d9be6ba314562 "Use OUString / sal_Int32 
in
vcl(outdev3.cxx,textlayout.cxx)"

Change-Id: I9e77bf801c6d79e1993ac6ddecf740b3362aeafe
Reviewed-on: https://gerrit.libreoffice.org/48364
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/editeng/source/accessibility/AccessibleStringWrap.cxx 
b/editeng/source/accessibility/AccessibleStringWrap.cxx
index af55049458f0..64ea287dc9ff 100644
--- a/editeng/source/accessibility/AccessibleStringWrap.cxx
+++ b/editeng/source/accessibility/AccessibleStringWrap.cxx
@@ -38,7 +38,7 @@ AccessibleStringWrap::AccessibleStringWrap( OutputDevice& 
rDev, SvxFont& rFont,
 
 void AccessibleStringWrap::GetCharacterBounds( sal_Int32 nIndex, 
tools::Rectangle& rRect )
 {
-DBG_ASSERT(nIndex >= 0 && nIndex <= USHRT_MAX,
+DBG_ASSERT(nIndex >= 0,
"SvxAccessibleStringWrap::GetCharacterBounds: index value 
overflow");
 
 mrFont.SetPhysFont(  );
@@ -55,7 +55,7 @@ void AccessibleStringWrap::GetCharacterBounds( sal_Int32 
nIndex, tools::Rectangl
 else
 {
 long aXArray[2];
-mrDev.GetCaretPositions( maText, aXArray, static_cast< sal_uInt16 
>(nIndex), 1 );
+mrDev.GetCaretPositions( maText, aXArray, nIndex, 1 );
 rRect.Left() = 0;
 rRect.Top() = 0;
 rRect.SetSize( Size(mrDev.GetTextHeight(), labs(aXArray[0] - 
aXArray[1])) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-19 Thread Caolán McNamara
 editeng/source/editeng/impedit2.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 25d159dd764d917a04e46819bb8efcc2a6067cd6
Author: Caolán McNamara 
Date:   Thu Jan 18 21:09:53 2018 +

ofz#5477 if the para is already oversize, nums would go negative

Change-Id: I183e1377747f662da1204e90a24fb4f8f2268699
Reviewed-on: https://gerrit.libreoffice.org/48156
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index c5d8c2ad4830..a7e5ef0c9ceb 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2723,12 +2723,13 @@ EditPaM ImpEditEngine::ImpInsertText(const 
EditSelection& aCurSel, const OUStrin
 if ( nEnd > nStart )
 {
 OUString aLine = aText.copy( nStart, nEnd-nStart );
-sal_Int32 nChars = aPaM.GetNode()->Len() + aLine.getLength();
-if ( nChars > MAXCHARSINPARA )
+sal_Int32 nExistingChars = aPaM.GetNode()->Len();
+sal_Int32 nChars = nExistingChars + aLine.getLength();
+if (nChars > MAXCHARSINPARA)
 {
-sal_Int32 nMaxNewChars = MAXCHARSINPARA-aPaM.GetNode()->Len();
+sal_Int32 nMaxNewChars = std::max(0, MAXCHARSINPARA 
- nExistingChars);
 nEnd -= ( aLine.getLength() - nMaxNewChars ); // Then the 
characters end up in the next paragraph.
-aLine = aLine.copy( 0, nMaxNewChars );// Delete 
the Rest...
+aLine = aLine.copy( 0, nMaxNewChars );// Delete the 
Rest...
 }
 if ( IsUndoEnabled() && !IsInUndo() )
 InsertUndo(new EditUndoInsertChars(pEditEngine, 
CreateEPaM(aPaM), aLine));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-09 Thread Mark Hung
 editeng/source/editeng/editundo.cxx |4 +++-
 editeng/source/editeng/impedit.hxx  |2 +-
 editeng/source/editeng/impedit2.cxx |7 ---
 3 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 7d10477aa54536aeeb190d25979234ab732c1bcf
Author: Mark Hung 
Date:   Sun Dec 31 21:04:59 2017 +0800

tdf#99524 - allow backward connect paragraph to undo.

When pressing backspace, two paragaphs connected. The first paragraph
get the style of the second paragraph. However the ParaAttribsChanged()
doesn't update Outliner's nDepth because it is not in undo. So it create
incorrect undo information when user press enter later.

And during undo, the nDepth isn't updated because there is a check
to compare the number of paragraphs, so SetParaAttribs needs to be
called after ParagraphInserted.

Change-Id: I6a860514042240035cde95d64bdd1f374e05a94e
Reviewed-on: https://gerrit.libreoffice.org/47226
Tested-by: Jenkins 
Reviewed-by: Mark Hung 

diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index 6beb8617be28..13f066dafc02 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -253,7 +253,6 @@ void EditUndoConnectParas::Undo()
 GetEditEngine()->SetCallParaInsertedOrDeleted(false);
 
 EditPaM aPaM = GetEditEngine()->SplitContent(nNode, nSepPos);
-GetEditEngine()->SetParaAttribs( nNode, aLeftParaAttribs );
 
 GetEditEngine()->SetCallParaInsertedOrDeleted( bCall );
 if (GetEditEngine()->IsCallParaInsertedOrDeleted())
@@ -262,6 +261,9 @@ void EditUndoConnectParas::Undo()
 GetEditEngine()->SetParaAttribs( nNode+1, aRightParaAttribs );
 }
 
+// Calling SetParaAttribs is effective only after ParagraphInserted
+GetEditEngine()->SetParaAttribs( nNode, aLeftParaAttribs );
+
 if (GetEditEngine()->GetStyleSheetPool())
 {
 if ( !aLeftStyleName.isEmpty() )
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 698f16b60f3e..30694a1e5c1d 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -543,7 +543,7 @@ private:
 
 
 voidCursorMoved( const ContentNode* pPrevNode );
-voidParaAttribsChanged( ContentNode const * pNode );
+voidParaAttribsChanged( ContentNode const * pNode, bool 
bIgnoreUndoCheck = false );
 voidTextModified();
 voidCalcHeight( ParaPortion* pPortion );
 
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 8f2336c21b3b..f837b2a57cac 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -731,7 +731,7 @@ void ImpEditEngine::TextModified()
 }
 
 
-void ImpEditEngine::ParaAttribsChanged( ContentNode const * pNode )
+void ImpEditEngine::ParaAttribsChanged( ContentNode const * pNode, bool 
bIgnoreUndoCheck )
 {
 assert(pNode && "ParaAttribsChanged: Which one?");
 
@@ -743,7 +743,8 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode const * 
pNode )
 pPortion->MarkSelectionInvalid( 0 );
 
 sal_Int32 nPara = aEditDoc.GetPos( pNode );
-pEditEngine->ParaAttribsChanged( nPara );
+if ( bIgnoreUndoCheck || pEditEngine->IsInUndo() )
+pEditEngine->ParaAttribsChanged( nPara );
 
 ParaPortion* pNextPortion = GetParaPortions().SafeGetObject( nPara+1 );
 // => is formatted again anyway, if Invalid.
@@ -2261,7 +2262,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* 
pLeft, ContentNode* pR
 pLeft->GetCharAttribs().GetDefFont() = 
pRight->GetCharAttribs().GetDefFont();
 }
 
-ParaAttribsChanged( pLeft );
+ParaAttribsChanged( pLeft, true );
 
 // First search for Portions since pRight is gone after ConnectParagraphs.
 ParaPortion* pLeftPortion = FindParaPortion( pLeft );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-05 Thread Noel Grandin
 editeng/source/editeng/editdoc.cxx |9 -
 include/svl/itempool.hxx   |1 +
 svl/source/items/itempool.cxx  |   15 +++
 3 files changed, 24 insertions(+), 1 deletion(-)

New commits:
commit ec920ed0ecc9cb42b900138a299bf070dc86103c
Author: Noel Grandin 
Date:   Fri Jan 5 11:10:36 2018 +0200

Revert "GetTrueSlotId is dead"

This reverts commit 4f11182566b02f9f1c1821985a94b4b4de363fbb.

Turns out I was wrong, there are tons of place defining
slotid<->whichid mappings.

Change-Id: I2a124ecba02c45f14ee917727adb993c39994881
Reviewed-on: https://gerrit.libreoffice.org/47454
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 0896b62af791..07a495d2bb1f 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -886,7 +886,14 @@ void ConvertAndPutItems( SfxItemSet& rDest, const 
SfxItemSet& rSource, const Map
 {
 // If possible go through SlotID ...
 
-sal_uInt16 const nSourceWhich = nWhich;
+sal_uInt16 nSourceWhich = nWhich;
+sal_uInt16 nSlot = pDestPool->GetTrueSlotId( nWhich );
+if ( nSlot )
+{
+sal_uInt16 nW = pSourcePool->GetTrueWhich( nSlot );
+if ( nW )
+nSourceWhich = nW;
+}
 
 if ( rSource.GetItemState( nSourceWhich, false ) == SfxItemState::SET )
 {
diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx
index 5b1d8b9af27c..f4f5d86f3a08 100644
--- a/include/svl/itempool.hxx
+++ b/include/svl/itempool.hxx
@@ -186,6 +186,7 @@ public:
 sal_uInt16  GetWhich( sal_uInt16 nSlot, bool bDeep = 
true ) const;
 sal_uInt16  GetSlotId( sal_uInt16 nWhich ) const;
 sal_uInt16  GetTrueWhich( sal_uInt16 nSlot, bool bDeep 
= true ) const;
+sal_uInt16  GetTrueSlotId( sal_uInt16 nWhich ) const;
 
 static bool IsWhich(sal_uInt16 nId) {
 return nId && nId <= SFX_WHICH_MAX; }
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index e82a5ea4a496..4357342dd499 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -939,6 +939,21 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, 
bool bDeep ) const
 }
 
 
+sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich ) const
+{
+if ( !IsWhich(nWhich) )
+return 0;
+
+if ( !IsInRange( nWhich ) )
+{
+if ( pImpl->mpSecondary )
+return pImpl->mpSecondary->GetTrueSlotId(nWhich);
+assert(false && "unknown WhichId - cannot get slot-id");
+return 0;
+}
+return pItemInfos[nWhich - pImpl->mnStart]._nSID;
+}
+
 void SfxItemPool::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
 xmlTextWriterStartElement(pWriter, BAD_CAST("SfxItemPool"));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-04 Thread Noel Grandin
 editeng/source/editeng/editdoc.cxx |9 +
 include/svl/itempool.hxx   |1 -
 svl/source/items/itempool.cxx  |   15 ---
 3 files changed, 1 insertion(+), 24 deletions(-)

New commits:
commit 4f11182566b02f9f1c1821985a94b4b4de363fbb
Author: Noel Grandin 
Date:   Thu Jan 4 12:03:39 2018 +0200

GetTrueSlotId is dead

The only place is is used is ConvertAndPutItems.
Which only loops over EE_PARA* which ids.
But the only things which define slotid<->whichid mappings are XATTR*,
SDATTR*, SCHATTR*.
Which means that this code ConvertAndPutItems is dead, and that is the
last place using GetTrueSlotId.

Change-Id: I3037c25c2c15087572abacc9642970936824678d
Reviewed-on: https://gerrit.libreoffice.org/47377
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 07a495d2bb1f..0896b62af791 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -886,14 +886,7 @@ void ConvertAndPutItems( SfxItemSet& rDest, const 
SfxItemSet& rSource, const Map
 {
 // If possible go through SlotID ...
 
-sal_uInt16 nSourceWhich = nWhich;
-sal_uInt16 nSlot = pDestPool->GetTrueSlotId( nWhich );
-if ( nSlot )
-{
-sal_uInt16 nW = pSourcePool->GetTrueWhich( nSlot );
-if ( nW )
-nSourceWhich = nW;
-}
+sal_uInt16 const nSourceWhich = nWhich;
 
 if ( rSource.GetItemState( nSourceWhich, false ) == SfxItemState::SET )
 {
diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx
index f4f5d86f3a08..5b1d8b9af27c 100644
--- a/include/svl/itempool.hxx
+++ b/include/svl/itempool.hxx
@@ -186,7 +186,6 @@ public:
 sal_uInt16  GetWhich( sal_uInt16 nSlot, bool bDeep = 
true ) const;
 sal_uInt16  GetSlotId( sal_uInt16 nWhich ) const;
 sal_uInt16  GetTrueWhich( sal_uInt16 nSlot, bool bDeep 
= true ) const;
-sal_uInt16  GetTrueSlotId( sal_uInt16 nWhich ) const;
 
 static bool IsWhich(sal_uInt16 nId) {
 return nId && nId <= SFX_WHICH_MAX; }
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 4357342dd499..e82a5ea4a496 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -939,21 +939,6 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, 
bool bDeep ) const
 }
 
 
-sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich ) const
-{
-if ( !IsWhich(nWhich) )
-return 0;
-
-if ( !IsInRange( nWhich ) )
-{
-if ( pImpl->mpSecondary )
-return pImpl->mpSecondary->GetTrueSlotId(nWhich);
-assert(false && "unknown WhichId - cannot get slot-id");
-return 0;
-}
-return pItemInfos[nWhich - pImpl->mnStart]._nSID;
-}
-
 void SfxItemPool::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
 xmlTextWriterStartElement(pWriter, BAD_CAST("SfxItemPool"));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-04 Thread Mark Hung
 editeng/source/editeng/editundo.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 2dd45c0c62b3ef3d8057b3fc70af24ae11a3d01d
Author: Mark Hung 
Date:   Sun Dec 24 06:51:10 2017 +0800

tdf#114664 allow the splitted paragraph attributes to recover.

Calling the SetParaAttribs to the splitted paragraph is effective
only after ParagraphInserted is invoked.

Change-Id: I1c2a58bc40e2a84d7bed4d85918e1d0ecdbe267f
Reviewed-on: https://gerrit.libreoffice.org/47174
Tested-by: Jenkins 
Reviewed-by: Mark Hung 

diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index 2fa5364a4312..6beb8617be28 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -254,11 +254,13 @@ void EditUndoConnectParas::Undo()
 
 EditPaM aPaM = GetEditEngine()->SplitContent(nNode, nSepPos);
 GetEditEngine()->SetParaAttribs( nNode, aLeftParaAttribs );
-GetEditEngine()->SetParaAttribs( nNode+1, aRightParaAttribs );
 
 GetEditEngine()->SetCallParaInsertedOrDeleted( bCall );
 if (GetEditEngine()->IsCallParaInsertedOrDeleted())
+{
 GetEditEngine()->ParagraphInserted( nNode+1 );
+GetEditEngine()->SetParaAttribs( nNode+1, aRightParaAttribs );
+}
 
 if (GetEditEngine()->GetStyleSheetPool())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-04 Thread Mark Hung
 editeng/source/editeng/editeng.cxx |   29 +++--
 1 file changed, 15 insertions(+), 14 deletions(-)

New commits:
commit a16b44481e3c5582dfb581f769e07ab94e8ac44b
Author: Mark Hung 
Date:   Sat Dec 30 01:00:26 2017 +0800

tdf#114732 backspace can only make bullet invisible.

It toggled the bullet on unexptectedly before connecting
two paragraphs, which made undo recover the incorrect result.

Change-Id: I83104d72fef95d8bd95e8e0e3bca4a063b69a450
Reviewed-on: https://gerrit.libreoffice.org/47181
Tested-by: Jenkins 
Reviewed-by: Mark Hung 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 2a3ccb3d52bb..c896e9aeb2f7 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1121,28 +1121,29 @@ bool EditEngine::PostKeyEvent( const KeyEvent& 
rKeyEvent, EditView* pEditView, v
 if (pFmt && nCode == KEY_BACKSPACE &&
 !aCurSel.HasRange() && aCurSel.Min().GetIndex() == 0)
 {
-// if the bullet is still visible just do not paint it 
from
-// now on and that will be all. Otherwise continue as 
usual.
+// if the bullet is still visible, just make it 
invisible.
+// Otherwise continue as usual.
 
 
 sal_Int32 nPara = pImpEditEngine->GetEditDoc().GetPos( 
pNode );
 SfxBoolItem aBulletState( 
pImpEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) );
-bool bBulletIsVisible = aBulletState.GetValue();
 
-// just toggling EE_PARA_BULLETSTATE should be fine 
for both cases...
-aBulletState.SetValue( !bBulletIsVisible );
-SfxItemSet aSet( pImpEditEngine->GetParaAttribs( nPara 
) );
-aSet.Put( aBulletState );
-pImpEditEngine->SetParaAttribs( nPara, aSet );
+if ( aBulletState.GetValue() )
+{
+
+aBulletState.SetValue( false );
+SfxItemSet aSet( pImpEditEngine->GetParaAttribs( 
nPara ) );
+aSet.Put( aBulletState );
+pImpEditEngine->SetParaAttribs( nPara, aSet );
 
-// have this and the following paragraphs formatted 
and repainted.
-// (not painting a numbering in the list may cause the 
following
-// numberings to have different numbers than before 
and thus the
-// length may have changed as well )
-pImpEditEngine->FormatAndUpdate( 
pImpEditEngine->GetActiveView() );
+// have this and the following paragraphs 
formatted and repainted.
+// (not painting a numbering in the list may cause 
the following
+// numberings to have different numbers than 
before and thus the
+// length may have changed as well )
+pImpEditEngine->FormatAndUpdate( 
pImpEditEngine->GetActiveView() );
 
-if (bBulletIsVisible)   // bullet just turned 
invisible...
 break;
+}
 }
 
 sal_uInt8 nDel = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-01 Thread Szymon Kłos
 editeng/source/editeng/impedit2.cxx |7 +++---
 editeng/source/editeng/impedit3.cxx |   38 ++--
 2 files changed, 28 insertions(+), 17 deletions(-)

New commits:
commit a7e6e4b220089a2d8a58ff10393d598a8b796fa5
Author: Szymon Kłos 
Date:   Thu Dec 21 18:02:13 2017 +0100

tdf#114628 correct line spacing for impress

* use line spacing also for the first line
* correct spacing in case of > 100% proportional spacing

* impedit2.cxx only code readability change

Change-Id: I24832e7dc2fa8cfbb2f9cdfe7062e63f1729
Reviewed-on: https://gerrit.libreoffice.org/46925
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 
Tested-by: Szymon Kłos 

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 138e429a70f7..8f2336c21b3b 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3643,11 +3643,12 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* 
pPortion )
 aRange.Max() += rL.GetHeight();
 }
 
-if( ( rLSItem.GetInterLineSpaceRule() == 
SvxInterLineSpaceRule::Prop ) && rLSItem.GetPropLineSpace() &&
-( rLSItem.GetPropLineSpace() < 100 ) )
+sal_uInt16 nPropLineSpace = rLSItem.GetPropLineSpace();
+if ( ( rLSItem.GetInterLineSpaceRule() == 
SvxInterLineSpaceRule::Prop )
+&& nPropLineSpace && ( nPropLineSpace < 100 ) )
 {
 const EditLine& rL = pPortion->GetLines()[nFirstInvalid];
-long n = rL.GetTxtHeight() * ( 100L - 
rLSItem.GetPropLineSpace() );
+long n = rL.GetTxtHeight() * ( 100L - nPropLineSpace );
 n /= 100;
 aRange.Min() -= n;
 aRange.Max() += n;
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 3c990f25cb71..a0fb2db2a8ff 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1442,24 +1442,34 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
 }
 else if ( rLSItem.GetInterLineSpaceRule() == 
SvxInterLineSpaceRule::Prop )
 {
-if ( nPara || pLine->GetStartPortion() ) // Not the very first 
line
+// There are documents with PropLineSpace 0, why?
+// (cmc: re above question :-) such documents can be seen by 
importing a .ppt
+if ( rLSItem.GetPropLineSpace() && ( 
rLSItem.GetPropLineSpace() < 100 ) )
 {
-// There are documents with PropLineSpace 0, why?
-// (cmc: re above question :-) such documents can be seen 
by importing a .ppt
-if ( rLSItem.GetPropLineSpace() && ( 
rLSItem.GetPropLineSpace() != 100 ) )
+// Adapted code from sw/source/core/text/itrform2.cxx
+sal_uInt16 nPropLineSpace = rLSItem.GetPropLineSpace();
+sal_uInt16 nAscent = pLine->GetMaxAscent();
+sal_uInt16 nNewAscent = pLine->GetTxtHeight() * 
nPropLineSpace / 100 * 4 / 5; // 80%
+if ( !nAscent || nAscent > nNewAscent )
 {
-sal_uInt16 nTxtHeight = pLine->GetHeight();
-sal_Int32 nH = nTxtHeight;
-nH *= rLSItem.GetPropLineSpace();
-nH /= 100;
-// The Ascent has to be adjusted for the difference:
-long nDiff = pLine->GetHeight() - nH;
-if ( nDiff > pLine->GetMaxAscent() )
-nDiff = pLine->GetMaxAscent();
-pLine->SetMaxAscent( 
(sal_uInt16)(pLine->GetMaxAscent() - nDiff) );
-pLine->SetHeight( (sal_uInt16)nH, nTxtHeight );
+sal_uInt16 nHeight = pLine->GetHeight() * 
nPropLineSpace / 100;
+pLine->SetHeight( nHeight, pLine->GetTxtHeight() );
+pLine->SetMaxAscent( nNewAscent );
 }
 }
+else if ( rLSItem.GetPropLineSpace() && ( 
rLSItem.GetPropLineSpace() != 100 ) )
+{
+sal_uInt16 nTxtHeight = pLine->GetHeight();
+sal_Int32 nH = nTxtHeight;
+nH *= rLSItem.GetPropLineSpace();
+nH /= 100;
+// The Ascent has to be adjusted for the difference:
+long nDiff = pLine->GetHeight() - nH;
+if ( nDiff > pLine->GetMaxAscent() )
+nDiff = pLine->GetMaxAscent();
+pLine->SetMaxAscent( (sal_uInt16)( pLine->GetMaxAscent() - 
nDiff ) * 4 / 5 ); // 80%
+  

[Libreoffice-commits] core.git: editeng/source include/editeng include/oox include/svx oox/source sd/source svx/source sw/source xmloff/source

2017-12-25 Thread Caolán McNamara
 editeng/source/uno/unonrule.cxx |6 +-
 editeng/source/uno/unotext.cxx  |   20 +++---
 editeng/source/uno/unotext2.cxx |2 
 include/editeng/unonrule.hxx|6 +-
 include/editeng/unotext.hxx |   16 ++---
 include/oox/ppt/layoutfragmenthandler.hxx   |4 -
 include/oox/ppt/presentationfragmenthandler.hxx |2 
 include/svx/unomod.hxx  |2 
 include/svx/unopage.hxx |2 
 include/svx/unoshape.hxx|   40 ++---
 oox/source/drawingml/diagram/diagramfragmenthandler.cxx |2 
 oox/source/drawingml/diagram/diagramfragmenthandler.hxx |4 -
 oox/source/ppt/extdrawingfragmenthandler.cxx|1 
 oox/source/ppt/extdrawingfragmenthandler.hxx|2 
 oox/source/ppt/layoutfragmenthandler.cxx|4 -
 oox/source/ppt/presentationfragmenthandler.cxx  |8 +-
 oox/source/shape/ShapeDrawingFragmentHandler.cxx|6 +-
 oox/source/shape/ShapeDrawingFragmentHandler.hxx|2 
 sd/source/ui/inc/SdUnoDrawView.hxx  |2 
 sd/source/ui/inc/unomodel.hxx   |4 -
 sd/source/ui/inc/unopage.hxx|8 +-
 sd/source/ui/inc/unosrch.hxx|2 
 sd/source/ui/unoidl/SdUnoDrawView.cxx   |2 
 sd/source/ui/unoidl/unolayer.cxx|2 
 sd/source/ui/unoidl/unolayer.hxx|2 
 sd/source/ui/unoidl/unomodel.cxx|4 -
 sd/source/ui/unoidl/unoobj.cxx  |2 
 sd/source/ui/unoidl/unoobj.hxx  |2 
 sd/source/ui/unoidl/unopage.cxx |   10 +--
 sd/source/ui/unoidl/unopback.cxx|2 
 sd/source/ui/unoidl/unopback.hxx|2 
 sd/source/ui/unoidl/unopool.cxx |4 -
 sd/source/ui/unoidl/unosrch.cxx |2 
 svx/source/unodraw/UnoNameItemTable.hxx |2 
 svx/source/unodraw/shapeimpl.hxx|   10 +--
 svx/source/unodraw/tableshape.cxx   |2 
 svx/source/unodraw/unobtabl.cxx |4 -
 svx/source/unodraw/unodtabl.cxx |4 -
 svx/source/unodraw/unogtabl.cxx |4 -
 svx/source/unodraw/unohtabl.cxx |4 -
 svx/source/unodraw/unomod.cxx   |2 
 svx/source/unodraw/unopage.cxx  |2 
 svx/source/unodraw/unoshap2.cxx |   46 ++--
 svx/source/unodraw/unoshap3.cxx |   16 ++---
 svx/source/unodraw/unoshap4.cxx |   18 ++
 svx/source/unodraw/unoshape.cxx |6 +-
 svx/source/unodraw/unottabl.cxx |4 -
 sw/source/uibase/uno/unodefaults.cxx|6 +-
 sw/source/uibase/uno/unodefaults.hxx|2 
 xmloff/source/meta/MetaImportComponent.cxx  |4 -
 xmloff/source/text/XMLAutoTextEventImport.cxx   |2 
 xmloff/source/text/XMLAutoTextEventImport.hxx   |3 -
 52 files changed, 152 insertions(+), 168 deletions(-)

New commits:
commit 76e950bfafd8b44ee47d7a9573df1571652c52e1
Author: Caolán McNamara 
Date:   Fri Dec 22 10:50:40 2017 +

various coverity exception warnings

Change-Id: I7b3588ad42e17f2f363b6a247e318f23c95e578e
Reviewed-on: https://gerrit.libreoffice.org/46961
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index dfdc218ad1fc..9c0dca69df4c 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -85,7 +85,7 @@ unsigned short ConvertUnoAdjust( SvxAdjust eAdjust )
 
 UNO3_GETIMPLEMENTATION_IMPL( SvxUnoNumberingRules );
 
-SvxUnoNumberingRules::SvxUnoNumberingRules( const SvxNumRule& rRule ) throw()
+SvxUnoNumberingRules::SvxUnoNumberingRules(const SvxNumRule& rRule)
 : maRule( rRule )
 {
 }
@@ -473,7 +473,7 @@ const SvxNumRule& SvxGetNumRule( Reference< XIndexReplace > 
const & xRule )
 return pRule->getNumRule();
 }
 
-css::uno::Reference< css::container::XIndexReplace > SvxCreateNumRule( const 
SvxNumRule* pRule ) throw()
+css::uno::Reference< css::container::XIndexReplace > SvxCreateNumRule(const 
SvxNumRule* pRule)
 {
 DBG_ASSERT( pRule, "No default SvxNumRule!" );
 if( pRule )
@@ -539,7 +539,7 @@ Reference< XAnyCompare > SvxCreateNumRuleCompare() throw()
 return new 

[Libreoffice-commits] core.git: editeng/source forms/source include/editeng include/svx sc/source sd/source svx/source

2017-12-16 Thread Noel Grandin
 editeng/source/editeng/impedit2.cxx  |4 ++--
 editeng/source/editeng/impedit4.cxx  |   16 
 editeng/source/outliner/outliner.cxx |   17 +++--
 editeng/source/outliner/outlvw.cxx   |   13 +
 forms/source/richtext/richtextvclcontrol.cxx |   10 +-
 include/editeng/editdata.hxx |2 +-
 include/editeng/outliner.hxx |2 +-
 include/svx/svdotext.hxx |5 +++--
 include/svx/svdxcgv.hxx  |2 +-
 sc/source/filter/html/htmlpars.cxx   |4 ++--
 sc/source/filter/rtf/rtfparse.cxx|2 +-
 sc/source/ui/app/transobj.cxx|4 ++--
 sd/source/ui/func/fuinsfil.cxx   |   12 ++--
 sd/source/ui/view/outlnvsh.cxx   |2 +-
 sd/source/ui/view/sdview3.cxx|   10 +-
 svx/source/svdraw/svdotext.cxx   |4 ++--
 svx/source/svdraw/svdotxln.cxx   |2 +-
 svx/source/svdraw/svdxcgv.cxx|2 +-
 svx/source/table/tablertfimporter.cxx|2 +-
 19 files changed, 47 insertions(+), 68 deletions(-)

New commits:
commit 882cadaac40226ea9b5dbbceb7e82328d5a935ee
Author: Noel Grandin 
Date:   Fri Dec 15 16:10:33 2017 +0200

convert EETextFormat to scoped enum

and drop unused BIN constant

Change-Id: I4ecda96f39147f7e9bceb11ecdb4f0ffe42d2053
Reviewed-on: https://gerrit.libreoffice.org/46589
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index acd94199875e..1597764a4927 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3528,7 +3528,7 @@ EditSelection ImpEditEngine::PasteText( uno::Reference< 
datatransfer::XTransfera
 aData >>= aSeq;
 {
 SvMemoryStream aODFStream( aSeq.getArray(), 
aSeq.getLength(), StreamMode::READ );
-aNewSelection = Read( aODFStream, rBaseURL, EE_FORMAT_XML, 
rPaM );
+aNewSelection = Read( aODFStream, rBaseURL, 
EETextFormat::Xml, rPaM );
 }
 bDone = true;
 }
@@ -3560,7 +3560,7 @@ EditSelection ImpEditEngine::PasteText( uno::Reference< 
datatransfer::XTransfera
 aData >>= aSeq;
 {
 SvMemoryStream aRTFStream( aSeq.getArray(), 
aSeq.getLength(), StreamMode::READ );
-aNewSelection = Read( aRTFStream, rBaseURL, 
EE_FORMAT_RTF, rPaM );
+aNewSelection = Read( aRTFStream, rBaseURL, 
EETextFormat::Rtf, rPaM );
 }
 bDone = true;
 }
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 684cb969b04b..8a1e7a67d520 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -88,13 +88,13 @@ EditPaM ImpEditEngine::Read(SvStream& rInput, const 
OUString& rBaseURL, EETextFo
 bool _bUpdate = GetUpdateMode();
 SetUpdateMode( false );
 EditPaM aPaM;
-if ( eFormat == EE_FORMAT_TEXT )
+if ( eFormat == EETextFormat::Text )
 aPaM = ReadText( rInput, rSel );
-else if ( eFormat == EE_FORMAT_RTF )
+else if ( eFormat == EETextFormat::Rtf )
 aPaM = ReadRTF( rInput, rSel );
-else if ( eFormat == EE_FORMAT_XML )
+else if ( eFormat == EETextFormat::Xml )
 aPaM = ReadXML( rInput, rSel );
-else if ( eFormat == EE_FORMAT_HTML )
+else if ( eFormat == EETextFormat::Html )
 aPaM = ReadHTML( rInput, rBaseURL, rSel, pHTTPHeaderAttrs );
 else
 {
@@ -189,13 +189,13 @@ void ImpEditEngine::Write(SvStream& rOutput, EETextFormat 
eFormat, const EditSel
 
 if ( !rOutput.GetError() )
 {
-if ( eFormat == EE_FORMAT_TEXT )
+if ( eFormat == EETextFormat::Text )
 WriteText( rOutput, rSel );
-else if ( eFormat == EE_FORMAT_RTF )
+else if ( eFormat == EETextFormat::Rtf )
 WriteRTF( rOutput, rSel );
-else if ( eFormat == EE_FORMAT_XML )
+else if ( eFormat == EETextFormat::Xml )
 WriteXML( rOutput, rSel );
-else if ( eFormat == EE_FORMAT_HTML )
+else if ( eFormat == EETextFormat::Html )
 ;
 else
 {
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index d9985a5479ab..2e8d4aa9d7b3 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1081,7 +1081,7 @@ void Outliner::InvalidateBullet(sal_Int32 nPara)
 }
 }
 
-ErrCode Outliner::Read( SvStream& rInput, const OUString& rBaseURL, sal_uInt16 
eFormat, SvKeyValueIterator* pHTTPHeaderAttrs )
+ErrCode 

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

2017-12-14 Thread Michael Stahl
 editeng/source/editeng/impedit4.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 700e1e7fda6f0a415adbbd5bb190efa5c7435c4f
Author: Michael Stahl 
Date:   Thu Dec 14 16:49:45 2017 +0100

editeng: error: "remove_const_t" is not a member of "std"

Manual type inference was an interesting oxymoronic curiosity that
can probably only exist in C++, but it turns out our baseline
compilers don't even support it yet.

Change-Id: I3e9ac14e69c2c1288fa58a4279ede3202952b2fa

diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 448c6bafaf66..14b9bd3aab6b 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -316,7 +316,7 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, 
EditSelection aSel )
 nWhich = EE_CHAR_FONTINFO_CTL;
 
 auto const nFonts(aEditDoc.GetItemPool().GetItemCount2(nWhich));
-for (std::remove_const_t i = 0; i < nFonts; ++i)
+for (sal_uInt32 i = 0; i < nFonts; ++i)
 {
 SvxFontItem const*const pFontItem = static_cast(
 aEditDoc.GetItemPool().GetItem2(nWhich, i));
@@ -396,7 +396,7 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, 
EditSelection aSel )
 aColorList.push_back(rDefault.GetValue());
 }
 auto const nColors(aEditDoc.GetItemPool().GetItemCount2(EE_CHAR_COLOR));
-for (std::remove_const_t i = 0; i < nColors; ++i)
+for (sal_uInt32 i = 0; i < nColors; ++i)
 {
 SvxColorItem const*const 
pColorItem(aEditDoc.GetItemPool().GetItem2(EE_CHAR_COLOR, i));
 if (pColorItem && pColorItem->GetValue() != COL_AUTO) // may be null!
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-10 Thread Caolán McNamara
 editeng/source/items/textitem.cxx |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit afd1a6b516c634392b02beaed51e0ac2a9f877ce
Author: Caolán McNamara 
Date:   Sun Dec 10 20:29:18 2017 +

ofz#4582 Floating-point-exception

Change-Id: I808022d970dc6e35839a032f4ebf024a48fadd11

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index e9ec28a812ec..5642f002f7e6 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -875,26 +875,30 @@ static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 
nHeight, sal_uInt16 nProp, M
 switch( eProp )
 {
 case MapUnit::MapRelative:
-nRet *= 100;
-nRet /= nProp;
-break;
+if (nProp)
+{
+nRet *= 100;
+nRet /= nProp;
+}
+break;
 case MapUnit::MapPoint:
 {
 short nTemp = (short)nProp;
 nDiff = nTemp * 20;
 if(!bCoreInTwip)
 nDiff = (short)convertTwipToMm100((long)nDiff);
+break;
 }
-break;
 case MapUnit::Map100thMM:
 //then the core is surely also in 1/100 mm
 nDiff = (short)nProp;
-break;
+break;
 case MapUnit::MapTwip:
 // Here surely TWIP
 nDiff = ((short)nProp);
-break;
-default: ;//prevent warning
+break;
+default:
+break;
 }
 nRet = (nDiff < 0 || nRet >= static_cast(nDiff))
 ? nRet - nDiff : 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-05 Thread ekuiitr
 editeng/source/items/svxfont.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c7d3440fed86c7ef986cdaf57dfe2017325ff190
Author: ekuiitr 
Date:   Mon Dec 4 00:58:09 2017 +0530

tdf#96505 removed "L" literal

Change-Id: Ie12d65d0a8aaff3ede099e0301cafbc41ebdc2c6
Reviewed-on: https://gerrit.libreoffice.org/45736
Tested-by: Jenkins 
Reviewed-by: Mark Hung 
Reviewed-by: Mike Kaganski 

diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index 9714006eda2c..1895536c090d 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -322,8 +322,8 @@ void SvxFont::SetPhysFont( OutputDevice *pOut ) const
 {
 Font aNewFont( *this );
 Size aSize( aNewFont.GetFontSize() );
-aNewFont.SetFontSize( Size( aSize.Width() * nPropr / 100L,
-aSize.Height() * nPropr / 100L ) );
+aNewFont.SetFontSize( Size( aSize.Width() * nPropr / 100,
+aSize.Height() * nPropr / 100 ) );
 if ( !rCurrentFont.IsSameInstance( aNewFont ) )
 pOut->SetFont( aNewFont );
 }
@@ -516,7 +516,7 @@ void SvxFont::DrawPrev( OutputDevice *pOut, Printer* 
pPrinter,
 else
 nTmpEsc = nEsc;
 Size aSize = GetFontSize();
-aPos.Y() -= ( nTmpEsc * aSize.Height() ) / 100L;
+aPos.Y() -= ( nTmpEsc * aSize.Height() ) / 100;
 }
 Font aOldFont( ChgPhysFont( pOut ) );
 Font aOldPrnFont( ChgPhysFont( pPrinter ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-20 Thread Johnny_M
 editeng/source/items/numitem.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 0220520609b7e67fdbe22e641d9dd5c027ee3d75
Author: Johnny_M 
Date:   Sat Nov 18 22:51:54 2017 +0100

Translate German variable name

Change-Id: I70f9355bc7f219e8d6aaf9fb8ecc356e1a86d9da
Reviewed-on: https://gerrit.libreoffice.org/44921
Tested-by: Jenkins 
Reviewed-by: Jens Carl 

diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index cf26cb20231e..fbf89dceaef0 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -507,18 +507,18 @@ OUString SvxNumberFormat::CreateRomanString( sal_uLong 
nNo, bool bUpper )
 sal_uInt16 nMask = 1000;
 while( nMask )
 {
-sal_uInt8 nZahl = sal_uInt8(nNo / nMask);
+sal_uInt8 nNumber = sal_uInt8(nNo / nMask);
 sal_uInt8 nDiff = 1;
 nNo %= nMask;
 
-if( 5 < nZahl )
+if( 5 < nNumber )
 {
-if( nZahl < 9 )
+if( nNumber < 9 )
 sRet += OUString(*(cRomanArr-1));
 ++nDiff;
-nZahl -= 5;
+nNumber -= 5;
 }
-switch( nZahl )
+switch( nNumber )
 {
 case 3: { sRet += OUString(*cRomanArr); SAL_FALLTHROUGH; }
 case 2: { sRet += OUString(*cRomanArr); SAL_FALLTHROUGH; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sc/source

2017-11-13 Thread Caolán McNamara
 editeng/source/editeng/editeng.cxx |2 --
 sc/source/filter/rtf/eeimpars.cxx  |   11 ++-
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 79742eab111e5f3722075abc3cdb1333faacd076
Author: Caolán McNamara 
Date:   Mon Nov 13 15:03:04 2017 +

ofz#4202 Null-dereference READ

Change-Id: Ib9beadaea1bc6521faf7d8080d301e4b5451fb1d
Reviewed-on: https://gerrit.libreoffice.org/44685
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 3e3b691d207b..bb09af238d99 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1492,8 +1492,6 @@ EditTextObject* EditEngine::CreateTextObject()
 EditTextObject* EditEngine::CreateTextObject( const ESelection& rESelection )
 {
 EditSelection aSel( pImpEditEngine->CreateSel( rESelection ) );
-if (aSel.IsInvalid())
-return nullptr;
 return pImpEditEngine->CreateTextObject( aSel );
 }
 
diff --git a/sc/source/filter/rtf/eeimpars.cxx 
b/sc/source/filter/rtf/eeimpars.cxx
index cac30a4db058..89b8b088be0c 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -104,6 +104,15 @@ ErrCode ScEEImport::Read( SvStream& rStream, const 
OUString& rBaseURL )
 return nErr;
 }
 
+namespace
+{
+bool IsValidSel(const ScTabEditEngine& rEngine, const ESelection& rSel)
+{
+const auto nParaCount = rEngine.GetParagraphCount();
+return rSel.nStartPara < nParaCount && rSel.nEndPara < nParaCount;
+}
+}
+
 void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, 
SvNumberFormatter* pFormatter, bool bConvertDate )
 {
 std::unique_ptr pProgress( new ScProgress( 
mpDoc->GetDocumentShell(),
@@ -400,7 +409,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, 
double nOutputFactor, SvNu
 mpDoc->SetString(nCol, nRow, nTab, aStr, );
 }
 }
-else if (EditTextObject* pTextObject = 
mpEngine->CreateTextObject(pE->aSel))
+else if (EditTextObject* pTextObject = IsValidSel(*mpEngine, 
pE->aSel) ? mpEngine->CreateTextObject(pE->aSel) : nullptr)
 {
 // The cell will own the text object instance.
 mpDoc->SetEditText(ScAddress(nCol,nRow,nTab), pTextObject);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-11 Thread Caolán McNamara
 editeng/source/rtf/svxrtf.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 3c5addae5c1bb88c308dbacd545ca52d597e39fb
Author: Caolán McNamara 
Date:   Sat Nov 11 21:12:34 2017 +

ofz: Timeout give up earlier on SvParserState::Error

Change-Id: I191f935c11bc59e0b1a990ac5d3c38a49390afd1
Reviewed-on: https://gerrit.libreoffice.org/44644
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index 568abc078757..b62940dfc8b3 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -127,12 +127,13 @@ void SvxRTFParser::Continue( int nToken )
 {
 SvRTFParser::Continue( nToken );
 
-if( SvParserState::Pending != GetStatus() )
+SvParserState eStatus = GetStatus();
+if (eStatus != SvParserState::Pending && eStatus != SvParserState::Error)
 {
 SetAllAttrOfStk();
 //Regardless of what "color 0" is, word defaults to auto as the default 
colour.
 //e.g. see #i7713#
- }
+}
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-10 Thread Samuel Mehrbrodt
 editeng/source/editeng/editview.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit e4d1551697406bab0e9973bfa8ac012c48ff8eea
Author: Samuel Mehrbrodt 
Date:   Fri Nov 10 11:06:46 2017 +0100

tdf#113591 Fix crash when switching between Calc and other LO window

Need to get the ContentNode from EditDoc, as the selection might
have a pointer to an already deleted ContentNode.

Change-Id: I5c17be8ec2cbc57686eaf90e8b03c026aea7f28f
Reviewed-on: https://gerrit.libreoffice.org/44583
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 9a932217eb4f..d7539558ffbb 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -252,11 +252,13 @@ bool EditView::IsReadOnly() const
 
 void EditView::SetSelection( const ESelection& rESel )
 {
-// If someone has just left an empty attribute, and then the outliner
-// manipulates the selection:
+// If someone has just left an empty attribute, and then the outliner 
manipulates the
+// selection, call the CursorMoved method so that empty attributes get 
cleaned up.
 if ( !HasSelection() )
 {
-const ContentNode* pNode = 
pImpEditView->GetEditSelection().Max().GetNode();
+// tdf#113591 Get node from EditDoc, as the selection might have a 
pointer to an
+// already deleted node.
+const ContentNode* pNode = 
pImpEditView->pEditEngine->GetEditDoc().GetEndPaM().GetNode();
 pImpEditView->pEditEngine->CursorMoved( pNode );
 }
 EditSelection aNewSelection( 
pImpEditView->pEditEngine->pImpEditEngine->ConvertSelection(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sc/source

2017-11-10 Thread Caolán McNamara
 editeng/source/editeng/editeng.cxx |2 ++
 sc/source/filter/rtf/eeimpars.cxx  |4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit d64f6caf22715fb421f4b89820c0842b7cae6905
Author: Caolán McNamara 
Date:   Fri Nov 10 09:58:31 2017 +

ofz#4163 Null-dereference READ

Change-Id: I3d1ae5f55343b1b8ec3b0d79a56c9368385a0af8
Reviewed-on: https://gerrit.libreoffice.org/44581
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index bb09af238d99..3e3b691d207b 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1492,6 +1492,8 @@ EditTextObject* EditEngine::CreateTextObject()
 EditTextObject* EditEngine::CreateTextObject( const ESelection& rESelection )
 {
 EditSelection aSel( pImpEditEngine->CreateSel( rESelection ) );
+if (aSel.IsInvalid())
+return nullptr;
 return pImpEditEngine->CreateTextObject( aSel );
 }
 
diff --git a/sc/source/filter/rtf/eeimpars.cxx 
b/sc/source/filter/rtf/eeimpars.cxx
index f84cc987ef8d..cac30a4db058 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -400,10 +400,10 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, 
double nOutputFactor, SvNu
 mpDoc->SetString(nCol, nRow, nTab, aStr, );
 }
 }
-else
+else if (EditTextObject* pTextObject = 
mpEngine->CreateTextObject(pE->aSel))
 {
 // The cell will own the text object instance.
-mpDoc->SetEditText(ScAddress(nCol,nRow,nTab), 
mpEngine->CreateTextObject(pE->aSel));
+mpDoc->SetEditText(ScAddress(nCol,nRow,nTab), pTextObject);
 }
 if ( !pE->maImageList.empty() )
 bHasGraphics |= GraphicSize( nCol, nRow, pE );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-10 Thread Samuel Mehrbrodt
 editeng/source/editeng/editview.cxx |4 ++--
 editeng/source/editeng/impedit.cxx  |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 42344398a839eddf1b498c266d8fe8ac0b3bb6b6
Author: Samuel Mehrbrodt 
Date:   Wed Nov 8 10:34:22 2017 +0100

editeng: Simplify calls to HasSelection()

Change-Id: I424cd5aee41334aebfd9bc41e1f8a9aeb69b9827
Reviewed-on: https://gerrit.libreoffice.org/44582
Tested-by: Jenkins 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 0e9b9d23e8aa..9a932217eb4f 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -254,7 +254,7 @@ void EditView::SetSelection( const ESelection& rESel )
 {
 // If someone has just left an empty attribute, and then the outliner
 // manipulates the selection:
-if ( !pImpEditView->GetEditSelection().HasRange() )
+if ( !HasSelection() )
 {
 const ContentNode* pNode = 
pImpEditView->GetEditSelection().Max().GetNode();
 pImpEditView->pEditEngine->CursorMoved( pNode );
@@ -781,7 +781,7 @@ void EditView::TransliterateText( TransliterationFlags 
nTransliterationMode )
 
 void EditView::CompleteAutoCorrect( vcl::Window const * pFrameWin )
 {
-if ( !pImpEditView->HasSelection() && 
pImpEditView->pEditEngine->pImpEditEngine->GetStatus().DoAutoCorrect() )
+if ( !HasSelection() && 
pImpEditView->pEditEngine->pImpEditEngine->GetStatus().DoAutoCorrect() )
 {
 pImpEditView->DrawSelectionXOR();
 EditSelection aSel = pImpEditView->GetEditSelection();
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index f613f419b74b..1cadc38a7539 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1542,7 +1542,7 @@ bool ImpEditView::IsBulletArea( const Point& rPos, 
sal_Int32* pPara )
 
 void ImpEditView::CutCopy( css::uno::Reference< 
css::datatransfer::clipboard::XClipboard > const & rxClipboard, bool bCut )
 {
-if ( rxClipboard.is() && GetEditSelection().HasRange() )
+if ( rxClipboard.is() && HasSelection() )
 {
 uno::Reference xData = 
pEditEngine->CreateTransferable( GetEditSelection() );
 
@@ -1848,7 +1848,7 @@ void ImpEditView::dragGestureRecognized(const 
css::datatransfer::dnd::DragGestur
 EditSelection aCopySel( GetEditSelection() );
 aCopySel.Adjust( pEditEngine->GetEditDoc() );
 
-if ( GetEditSelection().HasRange() && bClickedInSelection )
+if ( HasSelection() && bClickedInSelection )
 {
 pDragAndDropInfo.reset(new DragAndDropInfo());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-08 Thread Caolán McNamara
 editeng/source/editeng/eertfpar.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 74564900e73e7d9ffc7acabe047ae151c3e02abf
Author: Caolán McNamara 
Date:   Wed Nov 8 11:15:11 2017 +

ofz#4121 Floating-point-exception

Change-Id: I32b52f1e2419ca56db0f4ee92cea39cec047c1c1
Reviewed-on: https://gerrit.libreoffice.org/44455
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/editeng/eertfpar.cxx 
b/editeng/source/editeng/eertfpar.cxx
index 7affd086df70..428e76cc5e32 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -340,13 +340,17 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType 
 )
 {
 // the correct one
 long nEsc = static_cast(pItem)->GetEsc();
-
+long nEscFontHeight = 0;
 if( ( DFLT_ESC_AUTO_SUPER != nEsc ) && ( DFLT_ESC_AUTO_SUB != nEsc ) )
 {
 nEsc *= 10; //HalfPoints => Twips was embezzled in RTFITEM.CXX!
 SvxFont aFont;
 mpEditEngine->SeekCursor(aStartPaM.GetNode(), 
aStartPaM.GetIndex()+1, aFont);
-nEsc = nEsc * 100 / aFont.GetFontSize().Height();
+nEscFontHeight = aFont.GetFontSize().Height();
+}
+if (nEscFontHeight)
+{
+nEsc = nEsc * 100 / nEscFontHeight;
 
 SvxEscapementItem aEscItem( (short) nEsc, static_cast(pItem)->GetProportionalHeight(), EE_CHAR_ESCAPEMENT );
 rSet.GetAttrSet().Put( aEscItem );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-06 Thread Caolán McNamara
 editeng/source/rtf/svxrtf.cxx |6 +-
 include/svtools/svparser.hxx  |1 +
 svtools/source/svrtf/parrtf.cxx   |8 +++-
 svtools/source/svrtf/svparser.cxx |5 +
 4 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit e4551b905e12aa92b7509d9b994bfae5dec3d8e0
Author: Caolán McNamara 
Date:   Mon Nov 6 12:57:57 2017 +

ofz infinite loop

Change-Id: Iae9faaa86e4b3edb9a1fdfe9c6b67eee211c19a9
Reviewed-on: https://gerrit.libreoffice.org/44361
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index f84a30ff026c..568abc078757 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -294,8 +294,11 @@ void SvxRTFParser::ReadStyleTable()
 bIsInReadStyleTab = true;
 bChkStyleAttr = false;  // Do not check Attribute against the Styles
 
-while( _nOpenBrakets && IsParserWorking() )
+bool bLooping = false;
+
+while (_nOpenBrakets && IsParserWorking() && !bLooping)
 {
+auto nCurrentTokenIndex = m_nTokenIndex;
 int nToken = GetNextToken();
 switch( nToken )
 {
@@ -378,6 +381,7 @@ void SvxRTFParser::ReadStyleTable()
 }
 break;
 }
+bLooping = nCurrentTokenIndex == m_nTokenIndex;
 }
 pStyle.reset(); // Delete the Last Style
 SkipToken();// the closing brace is evaluated "above"
diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
index 5ab0df9fca01..2d3eaeeaf254 100644
--- a/include/svtools/svparser.hxx
+++ b/include/svtools/svparser.hxx
@@ -54,6 +54,7 @@ protected:
 sal_uLong   nlLinePos;  // current column number
 
 std::unique_ptr pImplData; // internal data
+longm_nTokenIndex;  // current token index to detect 
loops for seeking backwards
 longnTokenValue;// additional value (RTF)
 boolbTokenHasValue; // indicates whether nTokenValue 
is valid
 SvParserState   eState; // status also in derived classes
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index cd2b4537c0dc..bcdb67b4600e 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -600,8 +600,12 @@ void SvRTFParser::Continue( int nToken )
 if( !nToken )
 nToken = GetNextToken();
 
-while( IsParserWorking() )
+bool bLooping = false;
+
+while (IsParserWorking() && !bLooping)
 {
+auto nCurrentTokenIndex = m_nTokenIndex;
+
 SaveState( nToken );
 switch( nToken )
 {
@@ -658,6 +662,8 @@ NEXTTOKEN:
 SaveState( 0 ); // processed till here,
 // continue with new token!
 nToken = GetNextToken();
+
+bLooping = nCurrentTokenIndex == m_nTokenIndex;
 }
 if( SvParserState::Accepted == eState && 0 < nOpenBrakets )
 eState = SvParserState::Error;
diff --git a/svtools/source/svrtf/svparser.cxx 
b/svtools/source/svrtf/svparser.cxx
index 2d1be0e3e405..bfcc511a8490 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -76,6 +76,7 @@ SvParser::SvParser( SvStream& rIn, sal_uInt8 nStackSize )
 , nlLineNr( 1 )
 , nlLinePos( 1 )
 , pImplData( nullptr )
+, m_nTokenIndex(0)
 , nTokenValue( 0 )
 , bTokenHasValue( false )
 , eState( SvParserState::NotStarted )
@@ -476,6 +477,7 @@ T SvParser::GetNextToken()
 bTokenHasValue = pTokenStackPos->bTokenHasValue;
 aToken = pTokenStackPos->sToken;
 nRet = pTokenStackPos->nTokenId;
+++m_nTokenIndex;
 }
 // no, now push actual value on stack
 else if( SvParserState::Working == eState )
@@ -484,6 +486,7 @@ T SvParser::GetNextToken()
 pTokenStackPos->nTokenValue = nTokenValue;
 pTokenStackPos->bTokenHasValue = bTokenHasValue;
 pTokenStackPos->nTokenId = nRet;
+++m_nTokenIndex;
 }
 else if( SvParserState::Accepted != eState && SvParserState::Pending != 
eState )
 eState = SvParserState::Error;   // an error occurred
@@ -502,6 +505,8 @@ T SvParser::SkipToken( short nCnt )   // "skip" n 
Tokens backward
 nTmp = nTokenStackSize;
 nTokenStackPos = sal_uInt8(nTmp);
 
+m_nTokenIndex -= nTmp;
+
 // restore values
 aToken = pTokenStackPos->sToken;
 nTokenValue = pTokenStackPos->nTokenValue;
___
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

2017-11-06 Thread Noel Grandin
 editeng/source/items/numitem.cxx |6 +++---
 include/editeng/numitem.hxx  |4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit de05d4ee53b5ff0e7404058cef6d3a311e6b35e4
Author: Noel Grandin 
Date:   Mon Nov 6 08:26:34 2017 +0200

convert GetNumStr from sal_uLong->sal_Int32

the code was truncating the param to sal_Int32 anyway

Change-Id: I743b60097df937c16c995e2e6deacc12cf12e5e9
Reviewed-on: https://gerrit.libreoffice.org/44341
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 24a612f93d4c..6e0d175f029d 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -98,7 +98,7 @@ SvxNumberType::~SvxNumberType()
 xFormatter = nullptr;
 }
 
-OUString SvxNumberType::GetNumStr( sal_uLong nNo ) const
+OUString SvxNumberType::GetNumStr( sal_Int32 nNo ) const
 {
 LanguageTag aLang = utl::ConfigManager::IsAvoidConfig() ?
 LanguageTag("en-US") :
@@ -106,7 +106,7 @@ OUString SvxNumberType::GetNumStr( sal_uLong nNo ) const
 return GetNumStr( nNo, aLang.getLocale() );
 }
 
-OUString SvxNumberType::GetNumStr( sal_uLong nNo, const css::lang::Locale& 
rLocale ) const
+OUString SvxNumberType::GetNumStr( sal_Int32 nNo, const css::lang::Locale& 
rLocale ) const
 {
 lcl_getFormatter(xFormatter);
 if(!xFormatter.is())
@@ -131,7 +131,7 @@ OUString SvxNumberType::GetNumStr( sal_uLong nNo, const 
css::lang::Locale& rLoca
 pValues[0].Name = "NumberingType";
 pValues[0].Value <<= (sal_uInt16)nNumType;
 pValues[1].Name = "Value";
-pValues[1].Value <<= (sal_Int32)nNo;
+pValues[1].Value <<= nNo;
 
 try
 {
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index c898e3dc8045..177a360d8b41 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -66,8 +66,8 @@ public:
 SvxNumberType(const SvxNumberType& rType);
 ~SvxNumberType();
 
-OUStringGetNumStr( sal_uLong nNo ) const;
-OUStringGetNumStr( sal_uLong nNo, const css::lang::Locale& rLocale 
) const;
+OUStringGetNumStr( sal_Int32 nNo ) const;
+OUStringGetNumStr( sal_Int32 nNo, const css::lang::Locale& rLocale 
) const;
 
 voidSetNumberingType(SvxNumType nSet) {nNumType = nSet;}
 SvxNumType  GetNumberingType() const {return nNumType;}
___
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 offapi/com sd/source

2017-11-01 Thread Tomaž Vajngerl
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |3 
 editeng/source/items/CustomPropertyField.cxx|   19 +++--
 editeng/source/items/flditem.cxx|   11 +++
 editeng/source/uno/unofield.cxx |   41 
 include/editeng/CustomPropertyField.hxx |   18 +++--
 include/editeng/unonames.hxx|6 +
 offapi/com/sun/star/text/textfield/Type.idl |4 -
 sd/source/ui/app/sdmod2.cxx |   16 
 sd/source/ui/unoidl/unomodel.cxx|6 +
 sd/source/ui/view/drviews2.cxx  |   14 ++--
 10 files changed, 114 insertions(+), 24 deletions(-)

New commits:
commit 2884d57d4717afc3c31baee0ebc4a3e8b1c1d2f2
Author: Tomaž Vajngerl 
Date:   Mon Oct 30 12:21:49 2017 +0900

TSCP: Support DocInfo.Custom field for ODP file format

Impress has a limited support for fields - this includes support
for DocInfo.Custom field, which shows the user defined custom
fields that are used in TSCP. This commit adds minimal support
(only what is needed for TSCP) for DocInfo.Custom field but only
supports string fields for now. It is not possible to add the field
manually, at least not until the full support is added.

Change-Id: Ib3b73ab22fd4fe65ab6fb5173fe035a3359deea5
Reviewed-on: https://gerrit.libreoffice.org/44041
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx 
b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index a8e7a90017ed..b7931eef21c4 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -901,6 +901,9 @@ namespace
 case text::textfield::Type::DOCINFO_TITLE:
 strFldType = "file name";
 break;
+case text::textfield::Type::DOCINFO_CUSTOM:
+strFldType = "custom document property";
+break;
 default:
 break;
 }
diff --git a/editeng/source/items/CustomPropertyField.cxx 
b/editeng/source/items/CustomPropertyField.cxx
index 7145bc72c650..70a6a40197b2 100644
--- a/editeng/source/items/CustomPropertyField.cxx
+++ b/editeng/source/items/CustomPropertyField.cxx
@@ -22,9 +22,10 @@ CustomPropertyField::CustomPropertyField()
 : SvxFieldData()
 {}
 
-CustomPropertyField::CustomPropertyField(OUString const & rKey)
+CustomPropertyField::CustomPropertyField(OUString const & rName, OUString 
const & rCurrentPresentation)
 : SvxFieldData()
-, msKey(rKey)
+, msName(rName)
+, msCurrentPresentation(rCurrentPresentation)
 {}
 
 CustomPropertyField::~CustomPropertyField()
@@ -34,7 +35,7 @@ SV_IMPL_PERSIST1(CustomPropertyField);
 
 SvxFieldData* CustomPropertyField::Clone() const
 {
-return new CustomPropertyField(msKey);
+return new CustomPropertyField(msName, msCurrentPresentation);
 }
 
 bool CustomPropertyField::operator==(const SvxFieldData& rOther) const
@@ -43,7 +44,8 @@ bool CustomPropertyField::operator==(const SvxFieldData& 
rOther) const
 return false;
 
 const CustomPropertyField& rOtherField = static_cast(rOther);
-return (msKey == rOtherField.msKey);
+return (msName   == rOtherField.msName &&
+msCurrentPresentation == rOtherField.msCurrentPresentation);
 }
 
 MetaAction* CustomPropertyField::createBeginComment() const
@@ -51,8 +53,10 @@ MetaAction* CustomPropertyField::createBeginComment() const
 return new MetaCommentAction("FIELD_SEQ_BEGIN");
 }
 
-OUString 
CustomPropertyField::GetFormatted(uno::Reference 
const & xDocumentProperties) const
+OUString 
CustomPropertyField::GetFormatted(uno::Reference 
const & xDocumentProperties)
 {
+if (msName.isEmpty())
+return OUString();
 if (!xDocumentProperties.is())
 return OUString();
 uno::Reference xPropertyContainer = 
xDocumentProperties->getUserDefinedProperties();
@@ -61,10 +65,11 @@ OUString 
CustomPropertyField::GetFormatted(uno::Reference xPropertySet(xPropertyContainer, 
uno::UNO_QUERY);
 if (!xPropertySet.is())
 return OUString();
-uno::Any aAny = xPropertySet->getPropertyValue(msKey);
+uno::Any aAny = xPropertySet->getPropertyValue(msName);
 if (!aAny.has())
 return OUString();
-return aAny.get();
+msCurrentPresentation = aAny.get();
+return msCurrentPresentation;
 }
 
 } // end editeng namespace
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index bbdd2b7036d0..4435fcf490b9 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -24,6 +24,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -216,6 +217,16 

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

2017-10-31 Thread Caolán McNamara
 editeng/source/uno/unoipset.cxx |   16 ++--
 include/tools/helpers.hxx   |   18 +-
 sw/source/filter/xml/xmlimp.cxx |   20 +---
 3 files changed, 24 insertions(+), 30 deletions(-)

New commits:
commit 013618308c2d24702de18c12922931b130b6fade
Author: Caolán McNamara 
Date:   Tue Oct 31 08:54:42 2017 +

ofz#3934 Integer-overflow

Change-Id: I2c58cca6f01d7c50244dfec6acdfaa988cdbaa07
Reviewed-on: https://gerrit.libreoffice.org/44102
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index cc2a5c6c1861..8d4b41e4ffb1 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -19,9 +19,8 @@
 
 #include 
 #include 
-
 #include 
-
+#include 
 #include 
 #include 
 #include 
@@ -272,9 +271,6 @@ uno::Reference< beans::XPropertySetInfo > const &  
SvxItemPropertySet::getProper
 #ifndef TWIPS_TO_MM
 #define TWIPS_TO_MM(val) ((val * 127 + 36) / 72)
 #endif
-#ifndef MM_TO_TWIPS
-#define MM_TO_TWIPS(val) ((val * 72 + 63) / 127)
-#endif
 
 /** converts the given any with a metric to 100th/mm if needed */
 void SvxUnoConvertToMM( const MapUnit eSourceMapUnit, uno::Any & rMetric ) 
throw()
@@ -324,19 +320,19 @@ void SvxUnoConvertFromMM( const MapUnit 
eDestinationMapUnit, uno::Any & rMetric
 switch( rMetric.getValueTypeClass() )
 {
 case uno::TypeClass_BYTE:
-rMetric <<= 
(sal_Int8)(MM_TO_TWIPS(*o3tl::forceAccess(rMetric)));
+rMetric <<= 
(sal_Int8)(sanitiseMm100ToTwip(*o3tl::forceAccess(rMetric)));
 break;
 case uno::TypeClass_SHORT:
-rMetric <<= 
(sal_Int16)(MM_TO_TWIPS(*o3tl::forceAccess(rMetric)));
+rMetric <<= 
(sal_Int16)(sanitiseMm100ToTwip(*o3tl::forceAccess(rMetric)));
 break;
 case uno::TypeClass_UNSIGNED_SHORT:
-rMetric <<= 
(sal_uInt16)(MM_TO_TWIPS(*o3tl::forceAccess(rMetric)));
+rMetric <<= 
(sal_uInt16)(sanitiseMm100ToTwip(*o3tl::forceAccess(rMetric)));
 break;
 case uno::TypeClass_LONG:
-rMetric <<= 
(sal_Int32)(MM_TO_TWIPS(*o3tl::forceAccess(rMetric)));
+rMetric <<= 
(sal_Int32)(sanitiseMm100ToTwip(*o3tl::forceAccess(rMetric)));
 break;
 case uno::TypeClass_UNSIGNED_LONG:
-rMetric <<= 
(sal_uInt32)(MM_TO_TWIPS(*o3tl::forceAccess(rMetric)));
+rMetric <<= 
(sal_uInt32)(sanitiseMm100ToTwip(*o3tl::forceAccess(rMetric)));
 break;
 default:
 OSL_FAIL("AW: Missing unit translation to 100th mm!");
diff --git a/include/tools/helpers.hxx b/include/tools/helpers.hxx
index 30064cf93fc6..8325f095bad8 100644
--- a/include/tools/helpers.hxx
+++ b/include/tools/helpers.hxx
@@ -11,7 +11,7 @@
 
 #include 
 #include 
-
+#include 
 #include 
 #include 
 
@@ -55,6 +55,22 @@ inline long FRound( double fVal )
 return fVal > 0.0 ? static_cast( fVal + 0.5 ) : -static_cast( 
-fVal + 0.5 );
 }
 
+// return (n >= 0)? (n*72+63)/127: (n*72-63)/127;
+inline sal_Int64 sanitiseMm100ToTwip(sal_Int64 n)
+{
+if (n >= 0)
+{
+if (o3tl::checked_multiply(n, 72, n) || 
o3tl::checked_add(n, 63, n))
+n = SAL_MAX_INT64;
+}
+else
+{
+if (o3tl::checked_multiply(n, 72, n) || 
o3tl::checked_sub(n, 63, n))
+n = SAL_MIN_INT64;
+}
+return n / 127;
+}
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index f2f583fbf63e..f46cf200a416 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -70,6 +70,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -972,25 +973,6 @@ SvXMLImportContext *SwXMLImport::CreateFontDeclsContext(
 return pFSContext;
 }
 
-namespace
-{
-// return (n >= 0)? (n*72+63)/127: (n*72-63)/127;
-sal_Int64 sanitiseMm100ToTwip(sal_Int64 n)
-{
-if (n >= 0)
-{
-if (o3tl::checked_multiply(n, 72, n) || 
o3tl::checked_add(n, 63, n))
-n = SAL_MAX_INT64;
-}
-else
-{
-if (o3tl::checked_multiply(n, 72, n) || 
o3tl::checked_sub(n, 63, n))
-n = SAL_MIN_INT64;
-}
-return n / 127;
-}
-}
-
 void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & 
aViewProps)
 {
 if (IsInsertMode() || IsStylesOnlyMode() || IsBlockMode() || 
m_bOrganizerMode || !GetModel().is() )
___
Libreoffice-commits mailing list

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

2017-10-24 Thread Stephan Bergmann
 editeng/source/items/paraitem.cxx |2 +-
 editeng/source/items/textitem.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a2d814ac1d7beb6fbe4b9cb7b75814f4b08b8e59
Author: Stephan Bergmann 
Date:   Tue Oct 24 20:48:35 2017 +0200

loplugin:implicitboolconversion

("explicit conversion (NoOp) from 'const bool' to 'bool' implicitly cast 
back to
'const bool'", seen now with a recent trunk Clang 6, and with experimentally
enabling -std=gnu++17 for the LO build; not sure what caused this to be
triggered only now for me)

Change-Id: I5310961b1d50870d3ae06554e4cb37e12ac68151

diff --git a/editeng/source/items/paraitem.cxx 
b/editeng/source/items/paraitem.cxx
index d44253facaa8..52a8287cfecd 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -572,7 +572,7 @@ boolSvxHyphenZoneItem::QueryValue( uno::Any& rVal, 
sal_uInt8 nMemberId ) con
 switch(nMemberId)
 {
 case  MID_IS_HYPHEN:
-rVal <<= (bool)bHyphen;
+rVal <<= bHyphen;
 break;
 case MID_HYPHEN_MIN_LEAD:
 rVal <<= (sal_Int16)nMinLead;
diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 56b07c8e3588..f8cd6f193301 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -2496,7 +2496,7 @@ bool SvxTwoLinesItem::QueryValue( css::uno::Any& rVal,
 switch( nMemberId )
 {
 case MID_TWOLINES:
-rVal <<= (bool) bOn;
+rVal <<= bOn;
 break;
 case MID_START_BRACKET:
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-10-19 Thread Noel Grandin
 editeng/source/lookuptree/Trie.cxx |   45 +
 1 file changed, 12 insertions(+), 33 deletions(-)

New commits:
commit 856df6d40690500453092419b2c71e91e2c5de25
Author: Noel Grandin 
Date:   Wed Oct 18 11:29:15 2017 +0200

use std::unique_ptr in TrieNode

Change-Id: I1482f846370e0b8e6f76d46fc5020e2dcb152223
Reviewed-on: https://gerrit.libreoffice.org/43495
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/lookuptree/Trie.cxx 
b/editeng/source/lookuptree/Trie.cxx
index b661d6d81010..0badcd99703c 100644
--- a/editeng/source/lookuptree/Trie.cxx
+++ b/editeng/source/lookuptree/Trie.cxx
@@ -22,12 +22,10 @@ struct TrieNode final
 
 sal_Unicode mCharacter;
 boolmMarker;
-std::vector  mChildren;
-TrieNode*   mLatinArray[LATIN_ARRAY_SIZE];
-
+std::vector  mChildren;
+std::unique_ptr mLatinArray[LATIN_ARRAY_SIZE];
 
 explicit TrieNode(sal_Unicode aCharacter = '\0');
-~TrieNode();
 
 void  markWord();
 TrieNode* findChild(sal_Unicode aCharacter);
@@ -41,26 +39,12 @@ TrieNode::TrieNode(sal_Unicode aCharacter) :
 mCharacter(aCharacter),
 mMarker(false)
 {
-for (TrieNode* & i : mLatinArray)
+for (auto & i : mLatinArray)
 {
 i = nullptr;
 }
 }
 
-TrieNode::~TrieNode()
-{
-vector::iterator iNode;
-for(iNode = mChildren.begin(); iNode != mChildren.end(); ++iNode)
-{
-delete *iNode;
-}
-
-for (TrieNode* i : mLatinArray)
-{
-delete i;
-}
-}
-
 void TrieNode::markWord()
 {
 mMarker = true;
@@ -71,11 +55,11 @@ void TrieNode::addNewChild(TrieNode* pChild)
 if (pChild->mCharacter >= 'a' &&
 pChild->mCharacter <= 'z')
 {
-mLatinArray[pChild->mCharacter - u'a'] = pChild;
+mLatinArray[pChild->mCharacter - u'a'].reset(pChild);
 }
 else
 {
-mChildren.push_back(pChild);
+mChildren.push_back(std::unique_ptr(pChild));
 }
 }
 
@@ -84,16 +68,13 @@ TrieNode* TrieNode::findChild(sal_Unicode aInputCharacter)
 if (aInputCharacter >= 'a' &&
 aInputCharacter <= 'z')
 {
-return mLatinArray[aInputCharacter - u'a'];
+return mLatinArray[aInputCharacter - u'a'].get();
 }
 
-vector::iterator iNode;
-
-for(iNode = mChildren.begin(); iNode != mChildren.end(); ++iNode)
+for(auto const & pCurrent : mChildren)
 {
-TrieNode* pCurrent = *iNode;
 if ( pCurrent->mCharacter == aInputCharacter )
-return pCurrent;
+return pCurrent.get();
 }
 
 return nullptr;
@@ -102,19 +83,17 @@ TrieNode* TrieNode::findChild(sal_Unicode aInputCharacter)
 void TrieNode::collectSuggestions(const OUString& sPath, vector& 
rSuggestionList)
 {
 // first traverse nodes for alphabet characters
-for (TrieNode* pCurrent : mLatinArray)
+for (auto const & pCurrent : mLatinArray)
 {
 if (pCurrent != nullptr)
-collectSuggestionsForCurrentNode(pCurrent, sPath, rSuggestionList);
+collectSuggestionsForCurrentNode(pCurrent.get(), sPath, 
rSuggestionList);
 }
 
 // traverse nodes for other characters
-vector::iterator iNode;
-for(iNode = mChildren.begin(); iNode != mChildren.end(); ++iNode)
+for(auto const & pCurrent : mChildren)
 {
-TrieNode* pCurrent = *iNode;
 if (pCurrent != nullptr)
-collectSuggestionsForCurrentNode(pCurrent, sPath, rSuggestionList);
+collectSuggestionsForCurrentNode(pCurrent.get(), sPath, 
rSuggestionList);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-10-17 Thread Armin Le Grand
 editeng/source/editeng/impedit3.cxx |   89 
 1 file changed, 70 insertions(+), 19 deletions(-)

New commits:
commit 8fa7d052e772ebdb612e596cf06bf57bf88da12f
Author: Armin Le Grand 
Date:   Tue Oct 17 17:04:03 2017 +0200

EditEngine: Enhance visualization of URLs

When URLs get layouted Multi-Lined from the EditEngine,
a rough 'guess' how many chars per line should be used
was in place up to now. This could lead to lines being
too short or being longer than the available space, also
looked ugly. Layouting now using the needed space properly.
Also adapted vertical (for horizontal text) space usage,
with multiple lines the space was 'compressed' and wrong
calculated.

Change-Id: I7255e3e65c85a3a50497b771ed2ca1ef5d97c0dd
Reviewed-on: https://gerrit.libreoffice.org/43464
Tested-by: Jenkins 
Reviewed-by: Armin Le Grand 

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index f68f2eff166a..0a5bd8490809 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1045,32 +1045,77 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
 OUString aFieldValue = cChar ? OUString(cChar) : 
static_cast(pNextFeature)->GetFieldValue();
 if ( bCalcCharPositions || !pPortion->HasValidSize() )
 {
-pPortion->GetSize() = aTmpFont.QuickGetTextSize( 
GetRefDevice(), aFieldValue, 0, aFieldValue.getLength() );
+// get size, but also DXArray to allow length 
information in line breaking below
+const sal_Int32 nLength(aFieldValue.getLength());
+std::unique_ptr pTmpDXArray(new 
long[nLength]);
+pPortion->GetSize() = 
aTmpFont.QuickGetTextSize(GetRefDevice(), aFieldValue, 0, 
aFieldValue.getLength(), pTmpDXArray.get());
+
 // So no scrolling for oversized fields
 if ( pPortion->GetSize().Width() > nXWidth )
 {
-sal_Int32 nWidthOrg = 
pPortion->GetSize().Width();
-sal_Int32 nChars= 
aFieldValue.getLength();
-sal_Int32 nApproxWC = nXWidth / ( 
nWidthOrg / nChars );
-ExtraPortionInfo *pExtraInfo= 
pPortion->GetExtraInfos();
-if( !nApproxWC ) nApproxWC++;
-if( pExtraInfo == nullptr )
+// create ExtraPortionInfo on-demand, flush 
lineBreaksList
+ExtraPortionInfo *pExtraInfo = 
pPortion->GetExtraInfos();
+
+if(nullptr == pExtraInfo)
 {
 pExtraInfo = new ExtraPortionInfo();
 pExtraInfo->nOrgWidth = nXWidth;
-pPortion->SetExtraInfos( pExtraInfo );
+pPortion->SetExtraInfos(pExtraInfo);
 }
 else
 {
 pExtraInfo->lineBreaksList.clear();
 }
 
-pPortion->GetSize().Width() = nXWidth;
-
-while( nChars > 0 )
+// iterate over CellBreaks using 
XBreakIterator to be on the
+// safe side with international texts/charSets
+Reference < i18n::XBreakIterator > 
xBreakIterator(ImplGetBreakIterator());
+const sal_Int32 
nTextLength(aFieldValue.getLength());
+const lang::Locale 
aLocale(GetLocale(EditPaM(pNode, nPortionStart)));
+sal_Int32 nDone(0);
+sal_Int32 nNextCellBreak(
+xBreakIterator->nextCharacters(
+aFieldValue,
+0,
+aLocale,
+
css::i18n::CharacterIteratorMode::SKIPCELL,
+0,
+nDone));
+sal_Int32 nLastCellBreak(0);
+sal_Int32 nLineStartX(0);
+
+// always add 1st line break (safe, we already 
know we are larger than nXWidth)
+

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

2017-10-16 Thread Tomaž Vajngerl
 editeng/source/editeng/editview.cxx |   10 ++
 include/editeng/editview.hxx|1 +
 2 files changed, 11 insertions(+)

New commits:
commit 92fad9596efb5ecbc756bdcc5f53ea4a417ece62
Author: Tomaž Vajngerl 
Date:   Tue Sep 19 15:09:54 2017 +0200

editeng: add function to insert parargaph break to the EditView

Change-Id: I06ab56967f25e6f9170cfbeb391110b55ddb18f6
Reviewed-on: https://gerrit.libreoffice.org/43359
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 76692f6ab18d..bc59c9b97273 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1155,6 +1155,16 @@ void EditView::SelectCurrentWord( sal_Int16 nWordType )
 ShowCursor( true, false );
 }
 
+void EditView::InsertParaBreak()
+{
+pImpEditView->pEditEngine->UndoActionStart(EDITUNDO_INSERT);
+pImpEditView->DeleteSelected();
+EditPaM 
aPaM(pImpEditView->pEditEngine->InsertParaBreak(pImpEditView->GetEditSelection()));
+pImpEditView->pEditEngine->UndoActionEnd();
+pImpEditView->SetEditSelection(EditSelection(aPaM, aPaM));
+pImpEditView->pEditEngine->FormatAndUpdate(this);
+}
+
 void EditView::InsertField( const SvxFieldItem& rFld )
 {
 EditEngine* pEE = pImpEditView->pEditEngine;
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 79af335b3db4..6e566be7be7d 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -187,6 +187,7 @@ public:
 vcl::Cursor*GetCursor() const;
 
 voidInsertText( const OUString& rNew, bool bSelect = false );
+voidInsertParaBreak();
 
 boolPostKeyEvent( const KeyEvent& rKeyEvent, vcl::Window const 
* pFrameWin = nullptr );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source sd/qa sd/source

2017-10-14 Thread Henry Castro
 editeng/source/editeng/impedit5.cxx  |   10 +
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   21 +++
 sd/source/ui/docshell/docshel3.cxx   |   17 +++--
 sd/source/ui/docshell/docshell.cxx   |   49 +--
 4 files changed, 91 insertions(+), 6 deletions(-)

New commits:
commit 59e9d163345e7a9eb68c1bae273593cd70c61153
Author: Henry Castro 
Date:   Fri Oct 13 20:47:29 2017 -0400

sd lok: fix spell checking languages in Impress

Change-Id: I133c9b91521fa7f2b5f7e3a47396f7efa31e1a86
Reviewed-on: https://gerrit.libreoffice.org/43382
Tested-by: Jenkins 
Reviewed-by: Henry Castro 

diff --git a/editeng/source/editeng/impedit5.cxx 
b/editeng/source/editeng/impedit5.cxx
index 5ba3549c9360..170bccec2676 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -684,6 +684,7 @@ void ImpEditEngine::RemoveCharAttribs( sal_Int32 nPara, 
sal_uInt16 nWhich, bool
 
 void ImpEditEngine::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
 {
+bool bCheckLanguage = false;
 ContentNode* pNode = aEditDoc.GetObject( nPara );
 
 if ( !pNode )
@@ -704,7 +705,16 @@ void ImpEditEngine::SetParaAttribs( sal_Int32 nPara, const 
SfxItemSet& rSet )
 InsertUndo(new EditUndoSetParaAttribs(pEditEngine, nPara, 
pNode->GetContentAttribs().GetItems(), rSet));
 }
 }
+
+bCheckLanguage = ( rSet.GetItemState( EE_CHAR_LANGUAGE ) == 
SfxItemState::SET ) ||
+ ( rSet.GetItemState( EE_CHAR_LANGUAGE_CJK ) == 
SfxItemState::SET ) ||
+ ( rSet.GetItemState( EE_CHAR_LANGUAGE_CTL ) == 
SfxItemState::SET );
+
 pNode->GetContentAttribs().GetItems().Set( rSet );
+
+if ( bCheckLanguage && pNode->GetWrongList() )
+pNode->GetWrongList()->ResetInvalidRange(0, pNode->Len());
+
 if ( aStatus.UseCharAttribs() )
 pNode->CreateDefFont();
 
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index c72b42a5ac5b..1e3d54e7e6d1 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -102,6 +103,7 @@ public:
 void testCommentCallbacks();
 void testMultiViewInsertDeletePage();
 void testDisableUndoRepair();
+void testLanguageStatus();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -139,6 +141,7 @@ public:
 CPPUNIT_TEST(testCommentCallbacks);
 CPPUNIT_TEST(testMultiViewInsertDeletePage);
 CPPUNIT_TEST(testDisableUndoRepair);
+CPPUNIT_TEST(testLanguageStatus);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -1827,6 +1830,24 @@ void SdTiledRenderingTest::testDisableUndoRepair()
 }
 }
 
+void SdTiledRenderingTest::testLanguageStatus()
+{
+// Load the document.
+comphelper::LibreOfficeKit::setActive();
+createDoc("dummy.odp");
+SfxViewShell* pView1 = SfxViewShell::Current();
+SfxLokHelper::createView();
+SfxViewShell* pView2 = SfxViewShell::Current();
+{
+std::unique_ptr pItem1;
+std::unique_ptr pItem2;
+pView1->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, 
pItem1);
+pView2->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, 
pItem2);
+CPPUNIT_ASSERT(dynamic_cast< const SfxStringListItem* >(pItem1.get()));
+CPPUNIT_ASSERT(dynamic_cast< const SfxStringListItem* >(pItem2.get()));
+}
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/ui/docshell/docshel3.cxx 
b/sd/source/ui/docshell/docshel3.cxx
index db099f07ce45..463c2273ee00 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -120,7 +120,8 @@ static void lcl_setLanguage( const SdDrawDocument *pDoc, 
const OUString 
 for( size_t nObj = 0; nObj < nObjCount; ++nObj )
 {
 SdrObject *pObj = pPage->GetObj( nObj );
-lcl_setLanguageForObj( pObj, nLang, bLanguageNone );
+if (pObj->GetObjIdentifier() != OBJ_PAGE)
+lcl_setLanguageForObj( pObj, nLang, bLanguageNone );
 }
 }
 }
@@ -296,6 +297,7 @@ void DrawDocShell::Execute( SfxRequest& rReq )
 const OUString aDocumentLangPrefix("Default_");
 const OUString aStrNone("LANGUAGE_NONE");
 const OUString aStrResetLangs("RESET_LANGUAGES");
+SdDrawDocument* pDoc = mpViewShell->GetDoc();
 sal_Int32 nPos = -1;
 if (-1 != (nPos = aNewLangTxt.indexOf( 
aDocumentLangPrefix )))
 {
@@ -306,11 +308,18 @@ void DrawDocShell::Execute( SfxRequest& 

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

2017-10-05 Thread Michael Stahl
 editeng/source/rtf/rtfitem.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 34f4446b0a5e04465216ff4ec2547aa82e0f06c2
Author: Michael Stahl 
Date:   Thu Oct 5 22:26:53 2017 +0200

editeng: fix assert about wrong EE_PARA_OUTLLEVEL item

It's a SfxInt16Item in DefItems::DefItems().

Change-Id: I01644b0b9d689d4d8756c52f1c2868f03b3037a5

diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index 6913497186f8..290c90686229 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -307,7 +307,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet )
 case RTF_LEVEL:
 if( aPardMap.nOutlineLvl )
 {
-pSet->Put( SfxUInt16Item( aPardMap.nOutlineLvl,
+pSet->Put( SfxInt16Item( aPardMap.nOutlineLvl,
 (sal_uInt16)nTokenValue ));
 }
 break;
___
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 svx/sdi

2017-10-05 Thread Michael Stahl
 editeng/source/items/textitem.cxx |3 +++
 include/editeng/udlnitem.hxx  |4 
 svx/sdi/svx.sdi   |4 ++--
 svx/sdi/svxitems.sdi  |3 ++-
 4 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 03041e0f8d8385847c2e77fcaf08c1d33cad938f
Author: Michael Stahl 
Date:   Thu Oct 5 14:18:51 2017 +0200

tdf#112817 editeng,svx: fix SvxUnderlineItem/SvxOverlineItem SDI

This was asserting because the superclass SvxTextLineItem
was instantiated instead of the specific subclasses.

Change-Id: If26847b8fa96dbf00062ba8372fe58e58c786782

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index be0d87401bec..56b07c8e3588 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -105,6 +105,8 @@ SfxPoolItem* SvxPostureItem::CreateDefault() { return new 
SvxPostureItem(ITALIC_
 SfxPoolItem* SvxWeightItem::CreateDefault() {return new 
SvxWeightItem(WEIGHT_NORMAL, 0);}
 SfxPoolItem* SvxFontHeightItem::CreateDefault() {return new 
SvxFontHeightItem(240, 100, 0);}
 SfxPoolItem* SvxTextLineItem::CreateDefault() {return new 
SvxTextLineItem(LINESTYLE_NONE, 0);}
+SfxPoolItem* SvxUnderlineItem::CreateDefault() {return new 
SvxUnderlineItem(LINESTYLE_NONE, 0);}
+SfxPoolItem* SvxOverlineItem::CreateDefault() {return new 
SvxOverlineItem(LINESTYLE_NONE, 0);}
 SfxPoolItem* SvxCrossedOutItem::CreateDefault() {return new 
SvxCrossedOutItem(STRIKEOUT_NONE, 0);}
 SfxPoolItem* SvxShadowedItem::CreateDefault() {return new 
SvxShadowedItem(false, 0);}
 SfxPoolItem* SvxAutoKernItem::CreateDefault() {return new 
SvxAutoKernItem(false, 0);}
@@ -1234,6 +1236,7 @@ bool SvxTextLineItem::operator==( const SfxPoolItem& 
rItem ) const
 
 // class SvxUnderlineItem 
 
+
 SvxUnderlineItem::SvxUnderlineItem( const FontLineStyle eSt, const sal_uInt16 
nId )
 : SvxTextLineItem( eSt, nId )
 {
diff --git a/include/editeng/udlnitem.hxx b/include/editeng/udlnitem.hxx
index 694e92ba43b6..94fcfe06f9b8 100644
--- a/include/editeng/udlnitem.hxx
+++ b/include/editeng/udlnitem.hxx
@@ -85,6 +85,8 @@ public:
 class EDITENG_DLLPUBLIC SvxUnderlineItem : public SvxTextLineItem
 {
 public:
+static SfxPoolItem* CreateDefault();
+
 SvxUnderlineItem( const FontLineStyle eSt,
   const sal_uInt16 nId );
 
@@ -100,6 +102,8 @@ public:
 class EDITENG_DLLPUBLIC SvxOverlineItem : public SvxTextLineItem
 {
 public:
+static SfxPoolItem* CreateDefault();
+
 SvxOverlineItem( const FontLineStyle eSt,
  const sal_uInt16 nId );
 
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 9b9c45297574..932aef3cb2c2 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -8561,7 +8561,7 @@ SfxVoidItem TwainTransfer SID_TWAIN_TRANSFER
 ]
 
 
-SvxTextLineItem Underline SID_ATTR_CHAR_UNDERLINE
+SvxUnderlineItem Underline SID_ATTR_CHAR_UNDERLINE
 
 [
 AutoUpdate = TRUE,
@@ -8580,7 +8580,7 @@ SvxTextLineItem Underline SID_ATTR_CHAR_UNDERLINE
 ]
 
 
-SvxTextLineItem Overline SID_ATTR_CHAR_OVERLINE
+SvxOverlineItem Overline SID_ATTR_CHAR_OVERLINE
 
 [
 AutoUpdate = TRUE,
diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index 3d264f483dc2..12946d433f16 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -225,7 +225,8 @@ struct SvxTextLine
 BOOLHasColorMID_TL_HASCOLOR;
 INT32   Color   MID_TL_COLOR;
 };
-item SvxTextLine SvxTextLineItem;
+item SvxTextLine SvxUnderlineItem;
+item SvxTextLine SvxOverlineItem;
 
 struct SvxBrush
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source forms/source include/editeng sc/source sd/source starmath/source svx/source sw/source

2017-09-29 Thread Noel Grandin
 editeng/source/editeng/impedit.cxx   |4 ++--
 editeng/source/uno/unoforou.cxx  |2 +-
 editeng/source/uno/unotext.cxx   |2 +-
 editeng/source/uno/unotext2.cxx  |4 ++--
 forms/source/richtext/richtextimplcontrol.cxx|2 +-
 include/editeng/editdata.hxx |   17 +
 sc/source/ui/drawfunc/drtxtob.cxx|2 +-
 sc/source/ui/view/gridwin.cxx|4 ++--
 sd/source/ui/view/Outliner.cxx   |4 ++--
 starmath/source/edit.cxx |2 +-
 svx/source/accessibility/AccessibleTextHelper.cxx|2 +-
 svx/source/svdraw/textchaincursor.cxx|4 ++--
 svx/source/svdraw/textchainflow.cxx  |2 +-
 svx/source/table/tablecontroller.cxx |2 +-
 sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx |2 +-
 sw/source/uibase/docvw/edtwin.cxx|2 +-
 16 files changed, 29 insertions(+), 28 deletions(-)

New commits:
commit 8a8864aeb710e4d17852dc9c0e02b03804a8bf3c
Author: Noel Grandin 
Date:   Thu Sep 28 13:06:51 2017 +0200

convert IsEqual/etc methods on ESelection to operators

Change-Id: Ia8424e701b6f22d0536ee7f3bdb0ecaaed94a3b9
Reviewed-on: https://gerrit.libreoffice.org/42904
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index aaf24df25f18..f765ed5cd800 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1935,7 +1935,7 @@ void ImpEditView::dragDropEnd( const 
css::datatransfer::dnd::DragSourceDropEvent
 ESelection aToBeDelSel = pDragAndDropInfo->aBeginDragSel;
 ESelection aNewSel( pDragAndDropInfo->aDropSel.nEndPara, 
pDragAndDropInfo->aDropSel.nEndPos,
 pDragAndDropInfo->aDropSel.nEndPara, 
pDragAndDropInfo->aDropSel.nEndPos );
-bool bBeforeSelection = aDropPos.IsLess( 
pDragAndDropInfo->aBeginDragSel );
+bool bBeforeSelection = aDropPos < 
pDragAndDropInfo->aBeginDragSel;
 sal_Int32 nParaDiff = pDragAndDropInfo->aBeginDragSel.nEndPara 
- pDragAndDropInfo->aBeginDragSel.nStartPara;
 if ( bBeforeSelection )
 {
@@ -2192,7 +2192,7 @@ void ImpEditView::dragOver(const 
css::datatransfer::dnd::DropTargetDragEvent& rD
 ESelection aDestSel( aP.nPara, aP.nIndex, aP.nPara, aP.nIndex);
 ESelection aCurSel = pEditEngine->pImpEditEngine->CreateESel( 
GetEditSelection() );
 aCurSel.Adjust();
-if ( !aDestSel.IsLess( aCurSel ) && !aDestSel.IsGreater( 
aCurSel ) )
+if ( !(aDestSel < aCurSel) && !(aDestSel > aCurSel) )
 {
 bAccept = false;
 }
diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx
index 64336df2d146..2c0bde9c2849 100644
--- a/editeng/source/uno/unoforou.cxx
+++ b/editeng/source/uno/unoforou.cxx
@@ -101,7 +101,7 @@ SfxItemSet SvxOutlinerForwarder::GetAttribs( const 
ESelection& rSel, EditEngineA
 if( mpAttribsCache && ( EditEngineAttribs::All == nOnlyHardAttrib ) )
 {
 // have we the correct set in cache?
-if( 
const_cast(this)->maAttribCacheSelection.IsEqual(rSel) )
+if( maAttribCacheSelection == rSel )
 {
 // yes! just return the cache
 return *mpAttribsCache;
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index ebc6ee10fba9..b52836cc7b38 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1955,7 +1955,7 @@ void SAL_CALL SvxUnoTextBase::setString( const OUString& 
aString )
 uno::Reference< container::XEnumeration > SAL_CALL 
SvxUnoTextBase::createEnumeration()
 {
 SolarMutexGuard aGuard;
-if( maSelection.IsEqual(ESelection(0,0,0,0)) || 
maSelection.IsEqual(ESelection(EE_PARA_MAX_COUNT,0,0,0)) )
+if( maSelection == ESelection(0,0,0,0) || maSelection == 
ESelection(EE_PARA_MAX_COUNT,0,0,0) )
 {
 ESelection aSelection;
 ::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index e647433ebf9c..cf3564d7cbef 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -66,7 +66,7 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( 
const SvxUnoTextBase
 if( pIterContent && (pIterContent->mnParagraph == currentPara) 
)
 {
 ESelection aIterSel = pIterContent->GetSelection();
-if( aIterSel.IsEqual( 

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

2017-09-29 Thread Noel Grandin
 editeng/source/items/paraitem.cxx |2 +-
 include/editeng/tstpitem.hxx  |   22 --
 2 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 2149bbfd2798cb5ed065ea25387616261a840634
Author: Noel Grandin 
Date:   Thu Sep 28 13:40:12 2017 +0200

rename SvxTabStop::IsEqual to operator==

Change-Id: I98f8db6e80d6a5dc30826ec755deb9432f809e92
Reviewed-on: https://gerrit.libreoffice.org/42907
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/paraitem.cxx 
b/editeng/source/items/paraitem.cxx
index 66adce966e62..d44253facaa8 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -922,7 +922,7 @@ bool SvxTabStopItem::operator==( const SfxPoolItem& rAttr ) 
const
 return false;
 
 for ( sal_uInt16 i = 0; i < Count(); ++i )
-if( !(*this)[i].IsEqual( rTSI[i] ) )
+if( (*this)[i] != rTSI[i] )
 return false;
 return true;
 }
diff --git a/include/editeng/tstpitem.hxx b/include/editeng/tstpitem.hxx
index c5ba30035058..34c65604bc8c 100644
--- a/include/editeng/tstpitem.hxx
+++ b/include/editeng/tstpitem.hxx
@@ -35,10 +35,10 @@
 class EDITENG_DLLPUBLIC SvxTabStop
 {
 private:
-sal_Int32 nTabPos;
-
+sal_Int32   nTabPos;
 SvxTabAdjusteAdjustment;
-mutable sal_Unicode m_cDecimal;
+mutable sal_Unicode
+m_cDecimal;
 sal_Unicode cFill;
 
 void fillDecimal() const;
@@ -50,11 +50,11 @@ public:
 const sal_Unicode cDec = cDfltDecimalChar,
 const sal_Unicode cFil = cDfltFillChar );
 
-sal_Int32& GetTabPos() { return nTabPos; }
-sal_Int32  GetTabPos() const { return nTabPos; }
+sal_Int32&GetTabPos() { return nTabPos; }
+sal_Int32 GetTabPos() const { return nTabPos; }
 
-SvxTabAdjust&   GetAdjustment() { return eAdjustment; }
-SvxTabAdjustGetAdjustment() const { return eAdjustment; }
+SvxTabAdjust& GetAdjustment() { return eAdjustment; }
+SvxTabAdjust  GetAdjustment() const { return eAdjustment; }
 
 sal_Unicode&  GetDecimal() { fillDecimal(); return m_cDecimal; }
 sal_Unicode   GetDecimal() const { fillDecimal(); return m_cDecimal; }
@@ -62,15 +62,17 @@ public:
 sal_Unicode&  GetFill() { return cFill; }
 sal_Unicode   GetFill() const { return cFill; }
 
-// the "old" operator==()
-bool  IsEqual( const SvxTabStop& rTS ) const
+bool  operator==( const SvxTabStop& rTS ) const
 {
 return ( nTabPos == rTS.nTabPos &&
  eAdjustment == rTS.eAdjustment &&
  m_cDecimal== rTS.m_cDecimal&&
  cFill   == rTS.cFill );
 }
-
+bool  operator!=( const SvxTabStop& rTS ) const
+{
+return !operator==(rTS);
+}
 // For the SortedArray:
 booloperator <( const SvxTabStop& rTS ) const
 { return nTabPos < rTS.nTabPos; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-09-22 Thread Jan Holesovsky
 editeng/source/editeng/editview.cxx  |6 +-
 sw/source/uibase/uiview/viewling.cxx |   10 --
 2 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 551e639f467813e52ff4301822b6a7f8778a2ef4
Author: Jan Holesovsky 
Date:   Thu Sep 21 22:08:46 2017 +0200

lok: Don't freeze the LibreOfficeKit via the spell-checking popup menu.

Change-Id: I045ed919daeefca612d7908dd7de50c36536c9a0
Reviewed-on: https://gerrit.libreoffice.org/42608
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/42627
Tested-by: Jenkins 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index b74f76e35001..76692f6ab18d 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1023,7 +1023,11 @@ void EditView::ExecuteSpellPopup( const Point& 
rPosPixel, LinkpEditEngine->pImpEditEngine->CreateEPaM(aPaM);
 EPaM aP2 = 
pImpEditView->pEditEngine->pImpEditEngine->CreateEPaM(aPaM2);
 
-sal_uInt16 nId = aPopupMenu->Execute( pImpEditView->GetWindow(), 
aTempRect, PopupMenuFlags::NoMouseUpClose );
+sal_uInt16 nId = 0;
+// TODO for LOK, we'll need to convert the spelling popup menu to
+// something much more sfx2-based & non-modal...
+if (!comphelper::LibreOfficeKit::isActive())
+nId = aPopupMenu->Execute( pImpEditView->GetWindow(), aTempRect, 
PopupMenuFlags::NoMouseUpClose );
 
 aPaM2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP2);
 aPaM = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP);
diff --git a/sw/source/uibase/uiview/viewling.cxx 
b/sw/source/uibase/uiview/viewling.cxx
index dbdeef511e3e..dc220a5bb684 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -712,9 +713,14 @@ bool SwView::ExecSpellPopup(const Point& rPt)
 
 OUString sMenuName  = bUseGrammarContext ?
 OUString("private:resource/GrammarContextMenu") : 
OUString("private:resource/SpellContextMenu");
-if (TryContextMenuInterception(xPopup->GetMenu(), sMenuName, 
pMenu, aEvent))
-{
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+// TODO for LOK, we'll need to convert the spelling popup 
menu to
+// something much more sfx2-based & non-modal...
+}
+else if (TryContextMenuInterception(xPopup->GetMenu(), 
sMenuName, pMenu, aEvent))
+{
 //! happy hacking for context menu modifying extensions of 
this
 //! 'custom made' menu... *sigh* (code copied from sfx2 
and framework)
 if ( pMenu )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source filter/source include/editeng oox/source sc/source sd/inc sd/source

2017-09-18 Thread Noel Grandin
 editeng/source/items/flditem.cxx |   43 +---
 editeng/source/uno/unofield.cxx  |7 +--
 filter/source/msfilter/svdfppt.cxx   |   16 +++
 filter/source/svg/svgexport.cxx  |   74 +--
 filter/source/svg/svgfilter.hxx  |5 +-
 include/editeng/flditem.hxx  |   29 +++--
 oox/source/export/drawingml.cxx  |   13 +++---
 sc/source/ui/unoobj/fielduno.cxx |2 
 sd/inc/sdpage.hxx|4 +
 sd/source/core/sdpage.cxx|6 +-
 sd/source/filter/eppt/eppt.cxx   |8 +--
 sd/source/filter/ppt/pptin.cxx   |3 -
 sd/source/ui/app/sdmod2.cxx  |3 -
 sd/source/ui/app/sdpopup.cxx |   16 +++
 sd/source/ui/dlg/dlgfield.cxx|   18 
 sd/source/ui/dlg/headerfooterdlg.cxx |   56 ++
 sd/source/ui/unoidl/unomodel.cxx |4 +
 sd/source/ui/unoidl/unopage.cxx  |9 +++-
 18 files changed, 171 insertions(+), 145 deletions(-)

New commits:
commit 7d14555ef7e867c5b1a0e195e3ef056885697c59
Author: Noel Grandin 
Date:   Fri Sep 15 13:55:39 2017 +0200

convert SvxDateFormat to scoped enum

And simplify the code in sd/headerfooterdlg, no
need for the complex encoding of date and time when we
can just index into a static array.

Change-Id: I677400bf1f956c81eba665b71dbda9183b63f55c
Reviewed-on: https://gerrit.libreoffice.org/42346
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 50061b0d4bef..f69fcf4fbb12 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -71,7 +71,8 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 SvxDateField* pData = new SvxDateField(aDate, bIsFixed 
? SvxDateType::Fix : SvxDateType::Var);
 sal_Int32 nNumFmt = -1;
 xPropSet->getPropertyValue(UNO_TC_PROP_NUMFORMAT) >>= 
nNumFmt;
-if (nNumFmt >= SVXDATEFORMAT_APPDEFAULT && nNumFmt <= 
SVXDATEFORMAT_F)
+if (static_cast(nNumFmt) >= 
SvxDateFormat::AppDefault &&
+static_cast(nNumFmt) <= 
SvxDateFormat::F)
 
pData->SetFormat(static_cast(nNumFmt));
 
 return pData;
@@ -314,7 +315,7 @@ SvxDateField::SvxDateField()
 {
 nFixDate = Date( Date::SYSTEM ).GetDate();
 eType = SvxDateType::Var;
-eFormat = SVXDATEFORMAT_STDSMALL;
+eFormat = SvxDateFormat::StdSmall;
 }
 
 
@@ -358,50 +359,50 @@ OUString SvxDateField::GetFormatted( SvNumberFormatter& 
rFormatter, LanguageType
 
 OUString SvxDateField::GetFormatted( Date const & aDate, SvxDateFormat 
eFormat, SvNumberFormatter& rFormatter, LanguageType eLang )
 {
-if ( eFormat == SVXDATEFORMAT_SYSTEM )
+if ( eFormat == SvxDateFormat::System )
 {
-OSL_FAIL( "SVXDATEFORMAT_SYSTEM not implemented!" );
-eFormat = SVXDATEFORMAT_STDSMALL;
+OSL_FAIL( "SvxDateFormat::System not implemented!" );
+eFormat = SvxDateFormat::StdSmall;
 }
-else if ( eFormat == SVXDATEFORMAT_APPDEFAULT )
+else if ( eFormat == SvxDateFormat::AppDefault )
 {
-OSL_FAIL( "SVXDATEFORMAT_APPDEFAULT: take them from where? ");
-eFormat = SVXDATEFORMAT_STDSMALL;
+OSL_FAIL( "SvxDateFormat::AppDefault: take them from where? ");
+eFormat = SvxDateFormat::StdSmall;
 }
 
 sal_uInt32 nFormatKey;
 
 switch( eFormat )
 {
-case SVXDATEFORMAT_STDSMALL:
+case SvxDateFormat::StdSmall:
 // short
 nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYSTEM_SHORT, 
eLang );
 break;
-case SVXDATEFORMAT_STDBIG:
+case SvxDateFormat::StdBig:
 // long
 nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYSTEM_LONG, eLang 
);
 break;
-case SVXDATEFORMAT_A:
+case SvxDateFormat::A:
 // 13.02.96
 nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYS_DDMMYY, eLang 
);
 break;
-case SVXDATEFORMAT_B:
+case SvxDateFormat::B:
 // 13.02.1996
 nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYS_DDMM, 
eLang );
 break;
-case SVXDATEFORMAT_C:
+case SvxDateFormat::C:
 // 13. Feb 1996
 nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYS_DMMM, 
eLang );
 break;
-case SVXDATEFORMAT_D:
+case SvxDateFormat::D:
 // 13. February 1996
 nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYS_D, 
eLang );
 break;
-case SVXDATEFORMAT_E:
+case SvxDateFormat::E:
 // The, 13. February 1996
 nFormatKey = 

[Libreoffice-commits] core.git: editeng/source filter/source include/editeng oox/source sc/source sd/source

2017-09-16 Thread Noel Grandin
 editeng/source/items/flditem.cxx |   35 ++-
 editeng/source/uno/unofield.cxx  |9 +
 filter/source/msfilter/svdfppt.cxx   |   12 ++--
 filter/source/svg/svgexport.cxx  |   14 +++---
 include/editeng/flditem.hxx  |   29 +++--
 oox/source/export/drawingml.cxx  |   25 +++--
 sc/source/ui/unoobj/fielduno.cxx |2 +-
 sd/source/filter/eppt/eppt.cxx   |8 
 sd/source/filter/ppt/pptin.cxx   |2 +-
 sd/source/ui/app/sdpopup.cxx |   22 +++---
 sd/source/ui/dlg/dlgfield.cxx|   24 
 sd/source/ui/dlg/headerfooterdlg.cxx |   12 ++--
 12 files changed, 101 insertions(+), 93 deletions(-)

New commits:
commit f1c166244f9828e7a383539aa763507e45ef
Author: Noel Grandin 
Date:   Fri Sep 15 11:32:16 2017 +0200

convert SvxTimeFormat to scoped enum

and make the numerators look more like our internal formatting codes

Change-Id: I3b3d448cec913e72c7ffb6cc3e7754241af36d93
Reviewed-on: https://gerrit.libreoffice.org/42345
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index dab1ad10c484..50061b0d4bef 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -89,7 +89,8 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 
 sal_Int32 nNumFmt = -1;
 xPropSet->getPropertyValue(UNO_TC_PROP_NUMFORMAT) >>= 
nNumFmt;
-if (nNumFmt >= SVXTIMEFORMAT_APPDEFAULT && nNumFmt <= 
SVXTIMEFORMAT_AM_HMSH)
+if (static_cast(nNumFmt) >= 
SvxTimeFormat::AppDefault &&
+static_cast(nNumFmt) <= 
SvxTimeFormat::HH12_MM_SS_00_AMPM)
 
pData->SetFormat(static_cast(nNumFmt));
 
 return pData;
@@ -595,7 +596,7 @@ SvxExtTimeField::SvxExtTimeField()
 : m_nFixTime( tools::Time(tools::Time::SYSTEM).GetTime() )
 {
 eType = SvxTimeType::Var;
-eFormat = SVXTIMEFORMAT_STANDARD;
+eFormat = SvxTimeFormat::Standard;
 }
 
 
@@ -639,13 +640,13 @@ OUString SvxExtTimeField::GetFormatted( tools::Time const 
& aTime, SvxTimeFormat
 {
 switch( eFormat )
 {
-case SVXTIMEFORMAT_SYSTEM :
-OSL_FAIL( "SVXTIMEFORMAT_SYSTEM: not implemented" );
-eFormat = SVXTIMEFORMAT_STANDARD;
+case SvxTimeFormat::System :
+OSL_FAIL( "SvxTimeFormat::System: not implemented" );
+eFormat = SvxTimeFormat::Standard;
 break;
-case SVXTIMEFORMAT_APPDEFAULT :
-OSL_FAIL( "SVXTIMEFORMAT_APPDEFAULT: not implemented" );
-eFormat = SVXTIMEFORMAT_STANDARD;
+case SvxTimeFormat::AppDefault :
+OSL_FAIL( "SvxTimeFormat::AppDefault: not implemented" );
+eFormat = SvxTimeFormat::Standard;
 break;
 default: ;//prevent warning
 }
@@ -654,10 +655,10 @@ OUString SvxExtTimeField::GetFormatted( tools::Time const 
& aTime, SvxTimeFormat
 
 switch( eFormat )
 {
-case SVXTIMEFORMAT_12_HM:
+case SvxTimeFormat::HH12_MM:
 nFormatKey = rFormatter.GetFormatIndex( NF_TIME_HHMMAMPM, eLang );
 break;
-case SVXTIMEFORMAT_12_HMSH:
+case SvxTimeFormat::HH12_MM_SS_00:
 {
 // no builtin format available, try to insert or reuse
 OUString aFormatCode( "HH:MM:SS.00 AM/PM" );
@@ -665,26 +666,26 @@ OUString SvxExtTimeField::GetFormatted( tools::Time const 
& aTime, SvxTimeFormat
 short nType;
 rFormatter.PutandConvertEntry( aFormatCode, nCheckPos, nType,
nFormatKey, LANGUAGE_ENGLISH_US, 
eLang );
-DBG_ASSERT( nCheckPos == 0, "SVXTIMEFORMAT_12_HMSH: could not 
insert format code" );
+DBG_ASSERT( nCheckPos == 0, "SvxTimeFormat::HH12_MM_SS_00: could 
not insert format code" );
 if ( nCheckPos )
 {
 nFormatKey = rFormatter.GetFormatIndex( NF_TIME_HH_MMSS00, 
eLang );
 }
 break;
 }
-case SVXTIMEFORMAT_24_HM:
+case SvxTimeFormat::HH24_MM:
 nFormatKey = rFormatter.GetFormatIndex( NF_TIME_HHMM, eLang );
 break;
-case SVXTIMEFORMAT_24_HMSH:
+case SvxTimeFormat::HH24_MM_SS_00:
 nFormatKey = rFormatter.GetFormatIndex( NF_TIME_HH_MMSS00, eLang );
 break;
-case SVXTIMEFORMAT_12_HMS:
+case SvxTimeFormat::HH12_MM_SS:
 nFormatKey = rFormatter.GetFormatIndex( NF_TIME_HHMMSSAMPM, eLang 
);
 break;
-case SVXTIMEFORMAT_24_HMS:
+case SvxTimeFormat::HH24_MM_SS:
 

[Libreoffice-commits] core.git: editeng/source filter/source include/editeng sc/source sd/source

2017-09-16 Thread Noel Grandin
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |4 ++--
 editeng/source/items/flditem.cxx|6 +++---
 editeng/source/uno/unofield.cxx |4 ++--
 filter/source/msfilter/svdfppt.cxx  |2 +-
 include/editeng/flditem.hxx |5 -
 sc/source/ui/unoobj/fielduno.cxx|4 ++--
 sd/source/ui/app/sdpopup.cxx|8 
 sd/source/ui/dlg/dlgfield.cxx   |6 +++---
 sd/source/ui/view/drviews2.cxx  |2 +-
 sd/source/ui/view/outlnvs2.cxx  |2 +-
 10 files changed, 23 insertions(+), 20 deletions(-)

New commits:
commit 2ba9f793c7e80a3bed9aceb3281d55ddc7957f85
Author: Noel Grandin 
Date:   Fri Sep 15 10:40:55 2017 +0200

convert SvxTimeType to scoped enum

Change-Id: Ic5ca8c50ccd74837cd0521a13e1f5eaa8e326ff3
Reviewed-on: https://gerrit.libreoffice.org/42344
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx 
b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 073547645c08..7357d0681f5a 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -890,9 +890,9 @@ namespace
 const SvxExtTimeField* pTimeField = static_cast< const 
SvxExtTimeField* >(ree.pFieldItem->GetField());
 if (pTimeField)
 {
-if (pTimeField->GetType() == SVXTIMETYPE_FIX)
+if (pTimeField->GetType() == SvxTimeType::Fix)
 strFldType = "time (fixed)";
-else if (pTimeField->GetType() == SVXTIMETYPE_VAR)
+else if (pTimeField->GetType() == SvxTimeType::Var)
 strFldType = "time (variable)";
 }
 break;
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index d6d2bda1a29b..dab1ad10c484 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -85,7 +85,7 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 bool bIsFixed = false;
 xPropSet->getPropertyValue(UNO_TC_PROP_IS_FIXED) >>= 
bIsFixed;
 
-SvxExtTimeField* pData = new SvxExtTimeField(aTime, 
bIsFixed ? SVXTIMETYPE_FIX : SVXTIMETYPE_VAR);
+SvxExtTimeField* pData = new SvxExtTimeField(aTime, 
bIsFixed ? SvxTimeType::Fix : SvxTimeType::Var);
 
 sal_Int32 nNumFmt = -1;
 xPropSet->getPropertyValue(UNO_TC_PROP_NUMFORMAT) >>= 
nNumFmt;
@@ -594,7 +594,7 @@ SV_IMPL_PERSIST1( SvxExtTimeField );
 SvxExtTimeField::SvxExtTimeField()
 : m_nFixTime( tools::Time(tools::Time::SYSTEM).GetTime() )
 {
-eType = SVXTIMETYPE_VAR;
+eType = SvxTimeType::Var;
 eFormat = SVXTIMEFORMAT_STANDARD;
 }
 
@@ -628,7 +628,7 @@ bool SvxExtTimeField::operator==( const SvxFieldData& 
rOther ) const
 OUString SvxExtTimeField::GetFormatted( SvNumberFormatter& rFormatter, 
LanguageType eLang ) const
 {
 tools::Time aTime( tools::Time::EMPTY );
-if ( eType == SVXTIMETYPE_FIX )
+if ( eType == SvxTimeType::Fix )
 aTime.SetTime(m_nFixTime);
 else
 aTime = tools::Time( tools::Time::SYSTEM ); // current time
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 5642daf850e8..e97c3d3c0e0e 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -333,7 +333,7 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< 
text::XTextRange > const & xAn
 case text::textfield::Type::EXTENDED_TIME:
 mpImpl->mbBoolean2 = false;
 mpImpl->maDateTime = getTime( static_cast(pData)->GetFixTime() );
-mpImpl->mbBoolean1 = static_cast(pData)->GetType() == SVXTIMETYPE_FIX;
+mpImpl->mbBoolean1 = static_cast(pData)->GetType() == SvxTimeType::Fix;
 mpImpl->mnInt32 = static_cast(pData)->GetFormat();
 break;
 
@@ -400,7 +400,7 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const 
throw()
 if( mnServiceId != text::textfield::Type::TIME && mnServiceId != 
text::textfield::Type::DATE )
 {
 tools::Time aTime( setTime( mpImpl->maDateTime ) );
-pData = new SvxExtTimeField( aTime, 
mpImpl->mbBoolean1?SVXTIMETYPE_FIX:SVXTIMETYPE_VAR );
+pData = new SvxExtTimeField( aTime, 
mpImpl->mbBoolean1?SvxTimeType::Fix:SvxTimeType::Var );
 
 if( mpImpl->mnInt32 >= SVXTIMEFORMAT_APPDEFAULT && 
mpImpl->mnInt32 <= 

[Libreoffice-commits] core.git: editeng/source include/editeng sc/source sd/source

2017-09-15 Thread Noel Grandin
 editeng/source/items/flditem.cxx  |4 ++--
 editeng/source/uno/unofield.cxx   |4 ++--
 include/editeng/flditem.hxx   |7 +--
 sc/source/filter/excel/xihelper.cxx   |2 +-
 sc/source/ui/pagedlg/scuitphfedit.cxx |8 
 sc/source/ui/unoobj/fielduno.cxx  |2 +-
 sd/source/ui/app/sdmod2.cxx   |2 +-
 sd/source/ui/app/sdpopup.cxx  |6 +++---
 sd/source/ui/dlg/dlgfield.cxx |6 +++---
 9 files changed, 22 insertions(+), 19 deletions(-)

New commits:
commit e45f61a5906cb84cdd895ef00648d5b7a6468ac5
Author: Noel Grandin 
Date:   Fri Sep 15 10:26:42 2017 +0200

convert SvxFileType to scoped enum

Change-Id: Iec1c67f7f0f9b2244b1d6ef52921ddd09f944fbb
Reviewed-on: https://gerrit.libreoffice.org/42314
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index b4cf848c0ef2..4c3f7f5d9f94 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -146,7 +146,7 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 
 // pass fixed attribute to constructor
 return new SvxExtFileField(
-aPresentation, bIsFixed ? SVXFILETYPE_FIX : 
SVXFILETYPE_VAR, eFmt);
+aPresentation, bIsFixed ? SvxFileType::Fix : 
SvxFileType::Var, eFmt);
 }
 case text::textfield::Type::AUTHOR:
 {
@@ -709,7 +709,7 @@ SV_IMPL_PERSIST1( SvxExtFileField );
 
 SvxExtFileField::SvxExtFileField()
 {
-eType = SVXFILETYPE_VAR;
+eType = SvxFileType::Var;
 eFormat = SvxFileFormat::PathFull;
 }
 
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 9416300a6fa7..ec4e45ad93f2 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -347,7 +347,7 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< 
text::XTextRange > const & xAn
 
 case text::textfield::Type::EXTENDED_FILE:
 mpImpl->msString1 = static_cast(pData)->GetFile();
-mpImpl->mbBoolean1 = static_cast(pData)->GetType() == SVXFILETYPE_FIX;
+mpImpl->mbBoolean1 = static_cast(pData)->GetType() == SvxFileType::Fix;
 mpImpl->mnInt16 = getFileNameDisplayFormat(static_cast(pData)->GetFormat());
 break;
 
@@ -441,7 +441,7 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const 
throw()
 {
 // #92009# pass fixed attribute to constructor
 pData = new SvxExtFileField( mpImpl->msString1,
- mpImpl->mbBoolean1 ? SVXFILETYPE_FIX : 
SVXFILETYPE_VAR,
+ mpImpl->mbBoolean1 ? SvxFileType::Fix : 
SvxFileType::Var,
  setFileNameDisplayFormat(mpImpl->mnInt16 
) );
 break;
 }
diff --git a/include/editeng/flditem.hxx b/include/editeng/flditem.hxx
index 7d2d9cb689c3..faccf33224b9 100644
--- a/include/editeng/flditem.hxx
+++ b/include/editeng/flditem.hxx
@@ -289,7 +289,10 @@ public:
 };
 
 
-enum SvxFileType { SVXFILETYPE_FIX, SVXFILETYPE_VAR };
+enum class SvxFileType {
+Fix,
+Var
+};
 enum class SvxFileFormat {
 NameAndExt = 0, // File name with Extension
 PathFull,   // full path
@@ -309,7 +312,7 @@ public:
 SV_DECL_PERSIST1( SvxExtFileField, 
css::text::textfield::Type::EXTENDED_FILE )
 SvxExtFileField();
 explicitSvxExtFileField( const OUString& rString,
-SvxFileType eType = SVXFILETYPE_VAR,
+SvxFileType eType = SvxFileType::Var,
 SvxFileFormat eFormat = 
SvxFileFormat::PathFull );
 
 const OUString& GetFile() const { return aFile; }
diff --git a/sc/source/filter/excel/xihelper.cxx 
b/sc/source/filter/excel/xihelper.cxx
index 0f22e713be37..3d6e2e49e749 100644
--- a/sc/source/filter/excel/xihelper.cxx
+++ b/sc/source/filter/excel/xihelper.cxx
@@ -354,7 +354,7 @@ void XclImpHFConverter::ParseString( const OUString& 
rHFString )
 }
 break;
 case 'F':   // file name
-InsertField( SvxFieldItem( SvxExtFileField( 
EMPTY_OUSTRING, SVXFILETYPE_VAR, SvxFileFormat::NameAndExt ), EE_FEATURE_FIELD 
) );
+InsertField( SvxFieldItem( SvxExtFileField( 
EMPTY_OUSTRING, SvxFileType::Var, SvxFileFormat::NameAndExt ), EE_FEATURE_FIELD 
) );
 break;
 
 case 'U':   // underline
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx 
b/sc/source/ui/pagedlg/scuitphfedit.cxx
index ad51a27d77c7..5965e048bb5e 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ 

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

2017-09-15 Thread Noel Grandin
 editeng/source/items/flditem.cxx  |   26 +-
 editeng/source/uno/unofield.cxx   |   16 
 include/editeng/flditem.hxx   |   13 +++--
 sc/source/core/tool/editutil.cxx  |2 +-
 sc/source/filter/excel/xehelper.cxx   |8 
 sc/source/filter/excel/xihelper.cxx   |2 +-
 sc/source/ui/pagedlg/scuitphfedit.cxx |8 
 sc/source/ui/unoobj/fielduno.cxx  |   18 +-
 8 files changed, 47 insertions(+), 46 deletions(-)

New commits:
commit 2b825fe7f525ac017966044a1400d9095c8b7986
Author: Noel Grandin 
Date:   Fri Sep 15 10:21:51 2017 +0200

convert SvxFileFormat to scoped enum

Change-Id: Ia75c86a89c89bb22759e1d588ce603701cb7fad5
Reviewed-on: https://gerrit.libreoffice.org/42313
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index bf9baf91d4ce..b4cf848c0ef2 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -135,12 +135,12 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 
xPropSet->getPropertyValue(UNO_TC_PROP_CURRENT_PRESENTATION) >>= aPresentation;
 xPropSet->getPropertyValue(UNO_TC_PROP_FILE_FORMAT) >>= 
nFmt;
 
-SvxFileFormat eFmt = SVXFILEFORMAT_NAME_EXT;
+SvxFileFormat eFmt = SvxFileFormat::NameAndExt;
 switch (nFmt)
 {
-case text::FilenameDisplayFormat::FULL: eFmt = 
SVXFILEFORMAT_FULLPATH; break;
-case text::FilenameDisplayFormat::PATH: eFmt = 
SVXFILEFORMAT_PATH; break;
-case text::FilenameDisplayFormat::NAME: eFmt = 
SVXFILEFORMAT_NAME; break;
+case text::FilenameDisplayFormat::FULL: eFmt = 
SvxFileFormat::PathFull; break;
+case text::FilenameDisplayFormat::PATH: eFmt = 
SvxFileFormat::PathOnly; break;
+case text::FilenameDisplayFormat::NAME: eFmt = 
SvxFileFormat::NameOnly; break;
 default:;
 }
 
@@ -710,7 +710,7 @@ SV_IMPL_PERSIST1( SvxExtFileField );
 SvxExtFileField::SvxExtFileField()
 {
 eType = SVXFILETYPE_VAR;
-eFormat = SVXFILEFORMAT_FULLPATH;
+eFormat = SvxFileFormat::PathFull;
 }
 
 
@@ -767,22 +767,22 @@ OUString SvxExtFileField::GetFormatted() const
 {
 switch( eFormat )
 {
-case SVXFILEFORMAT_FULLPATH:
+case SvxFileFormat::PathFull:
 aString = aURLObj.getFSysPath(FSysStyle::Detect);
 break;
 
-case SVXFILEFORMAT_PATH:
+case SvxFileFormat::PathOnly:
 aURLObj.removeSegment(INetURLObject::LAST_SEGMENT, false);
 // #101742# Leave trailing slash at the pathname
 aURLObj.setFinalSlash();
 aString = aURLObj.getFSysPath(FSysStyle::Detect);
 break;
 
-case SVXFILEFORMAT_NAME:
+case SvxFileFormat::NameOnly:
 aString = 
aURLObj.getBase(INetURLObject::LAST_SEGMENT,true,INetURLObject::DecodeMechanism::Unambiguous);
 break;
 
-case SVXFILEFORMAT_NAME_EXT:
+case SvxFileFormat::NameAndExt:
 aString = 
aURLObj.getName(INetURLObject::LAST_SEGMENT,true,INetURLObject::DecodeMechanism::Unambiguous);
 break;
 }
@@ -791,22 +791,22 @@ OUString SvxExtFileField::GetFormatted() const
 {
 switch( eFormat )
 {
-case SVXFILEFORMAT_FULLPATH:
+case SvxFileFormat::PathFull:
 aString = aURLObj.GetMainURL( 
INetURLObject::DecodeMechanism::ToIUri );
 break;
 
-case SVXFILEFORMAT_PATH:
+case SvxFileFormat::PathOnly:
 aURLObj.removeSegment(INetURLObject::LAST_SEGMENT, false);
 // #101742# Leave trailing slash at the pathname
 aURLObj.setFinalSlash();
 aString = aURLObj.GetMainURL( 
INetURLObject::DecodeMechanism::ToIUri );
 break;
 
-case SVXFILEFORMAT_NAME:
+case SvxFileFormat::NameOnly:
 aString = aURLObj.getBase();
 break;
 
-case SVXFILEFORMAT_NAME_EXT:
+case SvxFileFormat::NameAndExt:
 aString = aURLObj.getName();
 break;
 }
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 94bef5cdae11..9416300a6fa7 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -154,10 +154,10 @@ static sal_Int16 getFileNameDisplayFormat( SvxFileFormat 
nFormat )
 {
 switch( nFormat )
 {
-case SVXFILEFORMAT_NAME_EXT:return 

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

2017-09-15 Thread Noel Grandin
 editeng/source/items/flditem.cxx |2 +-
 editeng/source/uno/unofield.cxx  |4 ++--
 include/editeng/flditem.hxx  |6 --
 sd/source/ui/app/sdmod2.cxx  |2 +-
 sd/source/ui/app/sdpopup.cxx |6 +++---
 sd/source/ui/dlg/dlgfield.cxx|6 +++---
 6 files changed, 14 insertions(+), 12 deletions(-)

New commits:
commit 359201c9b4ad26fd445688de2c9a1d15f253d37d
Author: Noel Grandin 
Date:   Fri Sep 15 09:55:22 2017 +0200

convert SvxAuthorType to scoped enum

Change-Id: I990eb35c883ddd417751487435556f584e956374
Reviewed-on: https://gerrit.libreoffice.org/42312
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 05146abce0e4..bf9baf91d4ce 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -179,7 +179,7 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 
 // #92009# pass fixed attribute to constructor
 SvxAuthorField* pData = new SvxAuthorField(
-aFirstName, aLastName, OUString(), bIsFixed ? 
SVXAUTHORTYPE_FIX : SVXAUTHORTYPE_VAR);
+aFirstName, aLastName, OUString(), bIsFixed ? 
SvxAuthorType::Fix : SvxAuthorType::Var);
 
 if (!bIsFixed)
 {
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 985dbddb3306..94bef5cdae11 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -356,7 +356,7 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< 
text::XTextRange > const & xAn
 mpImpl->msString2  = static_cast(pData)->GetFormatted();
 mpImpl->mnInt16= sal::static_int_cast< sal_Int16 >(
 static_cast(pData)->GetFormat());
-mpImpl->mbBoolean1 = static_cast(pData)->GetType() == SVXAUTHORTYPE_FIX;
+mpImpl->mbBoolean1 = static_cast(pData)->GetType() == SvxAuthorType::Fix;
 mpImpl->mbBoolean2 = static_cast(pData)->GetFormat() != SvxAuthorFormat::ShortName;
 break;
 
@@ -474,7 +474,7 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const 
throw()
 
 // #92009# pass fixed attribute to constructor
 pData = new SvxAuthorField( aFirstName, aLastName, "",
-mpImpl->mbBoolean1 ? SVXAUTHORTYPE_FIX : 
SVXAUTHORTYPE_VAR );
+mpImpl->mbBoolean1 ? SvxAuthorType::Fix : 
SvxAuthorType::Var );
 
 if( !mpImpl->mbBoolean2 )
 {
diff --git a/include/editeng/flditem.hxx b/include/editeng/flditem.hxx
index b86916aa59f2..50956528dcef 100644
--- a/include/editeng/flditem.hxx
+++ b/include/editeng/flditem.hxx
@@ -327,7 +327,9 @@ public:
 };
 
 
-enum SvxAuthorType { SVXAUTHORTYPE_FIX, SVXAUTHORTYPE_VAR };
+enum class SvxAuthorType {
+Fix, Var
+};
 enum class SvxAuthorFormat {
 FullName,   // full name
 LastName,   // Only Last name
@@ -350,7 +352,7 @@ public:
 const OUString& rFirstName,
 const OUString& rLastName,
 const OUString& rShortName,
-SvxAuthorType eType = SVXAUTHORTYPE_VAR,
+SvxAuthorType eType = SvxAuthorType::Var,
 SvxAuthorFormat eFormat = 
SvxAuthorFormat::FullName );
 
 SvxAuthorType   GetType() const { return eType; }
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 954c49cf09db..293f7672948f 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -202,7 +202,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, 
pInfo, void)
 }
 else if( (pAuthorField = dynamic_cast< const SvxAuthorField* >( pField )) 
!= nullptr  )
 {
-if( pAuthorField->GetType() != SVXAUTHORTYPE_FIX )
+if( pAuthorField->GetType() != SvxAuthorType::Fix )
 {
 SvtUserOptions aUserOptions;
 SvxAuthorField aAuthorField(
diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx
index 0f0efa786622..7bb783418831 100644
--- a/sd/source/ui/app/sdpopup.cxx
+++ b/sd/source/ui/app/sdpopup.cxx
@@ -143,7 +143,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage )
 const SvxAuthorField* pAuthorField = static_cast(pField);
 SvxAuthorField aAuthorField( *pAuthorField );
 
-if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX )
+if( pAuthorField->GetType() == SvxAuthorType::Fix )
 CheckItem( 1 );
 else
 CheckItem( 2 );
@@ -280,9 +280,9 @@ SvxFieldData* SdFieldPopup::GetField()
 sal_uInt16 i;
 
 if( IsItemChecked( 1 ) )
-eType = SVXAUTHORTYPE_FIX;
+eType = 

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

2017-09-15 Thread Noel Grandin
 editeng/source/items/flditem.cxx |   13 +++--
 editeng/source/uno/unofield.cxx  |9 +
 include/editeng/flditem.hxx  |   13 +++--
 3 files changed, 19 insertions(+), 16 deletions(-)

New commits:
commit 4da85bf822dcce7da6c2243b408652af8eb55b71
Author: Noel Grandin 
Date:   Fri Sep 15 09:50:54 2017 +0200

convert SvxAuthorFormat to scoped enum

Change-Id: I5553ea640a4483c98ec5f5240594e30a72c968f8
Reviewed-on: https://gerrit.libreoffice.org/42311
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index b16c0da747b6..05146abce0e4 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -185,9 +185,10 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 {
 if (!bFullName)
 {
-pData->SetFormat(SVXAUTHORFORMAT_SHORTNAME);
+pData->SetFormat(SvxAuthorFormat::ShortName);
 }
-else if (nFmt >= SVXAUTHORFORMAT_FULLNAME && nFmt <= 
SVXAUTHORFORMAT_SHORTNAME)
+else if (static_cast(nFmt) >= 
SvxAuthorFormat::FullName &&
+ static_cast(nFmt) <= 
SvxAuthorFormat::ShortName)
 {
 
pData->SetFormat(static_cast(nFmt));
 }
@@ -860,18 +861,18 @@ OUString SvxAuthorField::GetFormatted() const
 
 switch( eFormat )
 {
-case SVXAUTHORFORMAT_FULLNAME:
+case SvxAuthorFormat::FullName:
 aString = aFirstName + " " + aName;
 break;
-case SVXAUTHORFORMAT_NAME:
+case SvxAuthorFormat::LastName:
 aString = aName;
 break;
 
-case SVXAUTHORFORMAT_FIRSTNAME:
+case SvxAuthorFormat::FirstName:
 aString = aFirstName;
 break;
 
-case SVXAUTHORFORMAT_SHORTNAME:
+case SvxAuthorFormat::ShortName:
 aString = aShortName;
 break;
 }
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index e6357f0e4969..985dbddb3306 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -272,7 +272,7 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) 
throw()
 break;
 
 case text::textfield::Type::AUTHOR:
-mpImpl->mnInt16 = SVXAUTHORFORMAT_FULLNAME;
+mpImpl->mnInt16 = static_cast(SvxAuthorFormat::FullName);
 mpImpl->mbBoolean1 = false;
 mpImpl->mbBoolean2 = true;
 break;
@@ -357,7 +357,7 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< 
text::XTextRange > const & xAn
 mpImpl->mnInt16= sal::static_int_cast< sal_Int16 >(
 static_cast(pData)->GetFormat());
 mpImpl->mbBoolean1 = static_cast(pData)->GetType() == SVXAUTHORTYPE_FIX;
-mpImpl->mbBoolean2 = static_cast(pData)->GetFormat() != SVXAUTHORFORMAT_SHORTNAME;
+mpImpl->mbBoolean2 = static_cast(pData)->GetFormat() != SvxAuthorFormat::ShortName;
 break;
 
 case text::textfield::Type::MEASURE:
@@ -478,9 +478,10 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const 
throw()
 
 if( !mpImpl->mbBoolean2 )
 {
-static_cast(pData)->SetFormat( 
SVXAUTHORFORMAT_SHORTNAME );
+static_cast(pData)->SetFormat( 
SvxAuthorFormat::ShortName );
 }
-else if( mpImpl->mnInt16 >= SVXAUTHORFORMAT_FULLNAME && 
mpImpl->mnInt16 <= SVXAUTHORFORMAT_SHORTNAME )
+else if( static_cast(mpImpl->mnInt16) >= 
SvxAuthorFormat::FullName &&
+ static_cast(mpImpl->mnInt16) <= 
SvxAuthorFormat::ShortName )
 {
 static_cast(pData)->SetFormat( (SvxAuthorFormat) 
mpImpl->mnInt16 );
 }
diff --git a/include/editeng/flditem.hxx b/include/editeng/flditem.hxx
index d4962fb2ff9c..b86916aa59f2 100644
--- a/include/editeng/flditem.hxx
+++ b/include/editeng/flditem.hxx
@@ -328,11 +328,12 @@ public:
 
 
 enum SvxAuthorType { SVXAUTHORTYPE_FIX, SVXAUTHORTYPE_VAR };
-enum SvxAuthorFormat {  SVXAUTHORFORMAT_FULLNAME = 0, // full name
-SVXAUTHORFORMAT_NAME,   // Only Last name
-SVXAUTHORFORMAT_FIRSTNAME,  // Only first name
-SVXAUTHORFORMAT_SHORTNAME   // Initials
-};
+enum class SvxAuthorFormat {
+FullName,   // full name
+LastName,   // Only Last name
+FirstName,  // Only first name
+ShortName   // Initials
+};
 
 class EDITENG_DLLPUBLIC SvxAuthorField : public SvxFieldData
 {
@@ -350,7 +351,7 @@ public:
 const OUString& rLastName,
   

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

2017-09-15 Thread Noel Grandin
 editeng/source/items/flditem.cxx |6 +++---
 editeng/source/uno/unofield.cxx  |6 +++---
 include/editeng/measfld.hxx  |2 +-
 svx/source/svdraw/svdomeas.cxx   |   14 +++---
 4 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit fda59e9768bc8643ea36bda1539f22928b7946cf
Author: Noel Grandin 
Date:   Fri Sep 15 09:29:37 2017 +0200

convert SdrMeasureFieldKind to scoped enum

Change-Id: I8896d46623843d3fe341c057d7ee0376a99f4741
Reviewed-on: https://gerrit.libreoffice.org/42310
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 138a10e557a0..b16c0da747b6 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -197,11 +197,11 @@ SvxFieldData* SvxFieldData::Create(const 
uno::Reference& xTe
 }
 case text::textfield::Type::MEASURE:
 {
-SdrMeasureFieldKind eKind = SDRMEASUREFIELD_VALUE;
+SdrMeasureFieldKind eKind = SdrMeasureFieldKind::Value;
 sal_Int16 nTmp = -1;
 xPropSet->getPropertyValue(UNO_TC_PROP_MEASURE_KIND) >>= 
nTmp;
-if (nTmp == static_cast(SDRMEASUREFIELD_UNIT) ||
-nTmp == 
static_cast(SDRMEASUREFIELD_ROTA90BLANCS))
+if (nTmp == 
static_cast(SdrMeasureFieldKind::Unit) ||
+nTmp == 
static_cast(SdrMeasureFieldKind::Rotate90Blanks))
 eKind = static_cast(nTmp);
 
 return new SdrMeasureField(eKind);
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index b6d6da1dfb79..e6357f0e4969 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -278,7 +278,7 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) 
throw()
 break;
 
 case text::textfield::Type::MEASURE:
-mpImpl->mnInt16 = SDRMEASUREFIELD_VALUE;
+mpImpl->mnInt16 = static_cast(SdrMeasureFieldKind::Value);
 break;
 
 default:
@@ -490,8 +490,8 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const 
throw()
 
 case text::textfield::Type::MEASURE:
 {
-SdrMeasureFieldKind eKind = SDRMEASUREFIELD_VALUE;
-if( mpImpl->mnInt16 == (sal_Int16)SDRMEASUREFIELD_UNIT || 
mpImpl->mnInt16 == (sal_Int16)SDRMEASUREFIELD_ROTA90BLANCS )
+SdrMeasureFieldKind eKind = SdrMeasureFieldKind::Value;
+if( mpImpl->mnInt16 == (sal_Int16)SdrMeasureFieldKind::Unit || 
mpImpl->mnInt16 == (sal_Int16)SdrMeasureFieldKind::Rotate90Blanks )
 eKind = (SdrMeasureFieldKind) mpImpl->mnInt16;
 pData = new SdrMeasureField( eKind);
 break;
diff --git a/include/editeng/measfld.hxx b/include/editeng/measfld.hxx
index f29ae7e9f314..6422afb07753 100644
--- a/include/editeng/measfld.hxx
+++ b/include/editeng/measfld.hxx
@@ -35,7 +35,7 @@
 
 class SdrMeasureObj;
 
-enum SdrMeasureFieldKind 
{SDRMEASUREFIELD_VALUE,SDRMEASUREFIELD_UNIT,SDRMEASUREFIELD_ROTA90BLANCS};
+enum class SdrMeasureFieldKind { Value, Unit, Rotate90Blanks };
 
 class EDITENG_DLLPUBLIC SdrMeasureField: public SvxFieldData {
 SdrMeasureFieldKind eMeasureFieldKind;
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index f2ea26644eb1..b81fadca3811 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -92,7 +92,7 @@ OUString 
SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
 
 switch(eMeasureFieldKind)
 {
-case SDRMEASUREFIELD_VALUE:
+case SdrMeasureFieldKind::Value:
 {
 if(pModel)
 {
@@ -160,7 +160,7 @@ OUString 
SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
 
 break;
 }
-case SDRMEASUREFIELD_UNIT:
+case SdrMeasureFieldKind::Unit:
 {
 if(bShowUnit)
 {
@@ -178,7 +178,7 @@ OUString 
SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
 
 break;
 }
-case SDRMEASUREFIELD_ROTA90BLANCS:
+case SdrMeasureFieldKind::Rotate90Blanks:
 {
 if(bTextRota90)
 {
@@ -580,11 +580,11 @@ void SdrMeasureObj::UndirtyText() const
 OutlinerParaObject* pOutlinerParaObject = 
SdrTextObj::GetOutlinerParaObject();
 if(pOutlinerParaObject==nullptr)
 {
-
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_ROTA90BLANCS),
 EE_FEATURE_FIELD), ESelection(0,0));
-
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_VALUE), 
EE_FEATURE_FIELD),ESelection(0,1));
+
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SdrMeasureFieldKind::Rotate90Blanks),
 

[Libreoffice-commits] core.git: editeng/source filter/source forms/source formula/source fpicker/source framework/source

2017-09-11 Thread Noel Grandin
 editeng/source/editeng/editobj.cxx  |4 -
 editeng/source/editeng/edtspell.cxx |2 
 editeng/source/editeng/impedit.cxx  |2 
 editeng/source/editeng/impedit2.cxx |8 +-
 editeng/source/editeng/impedit3.cxx |2 
 editeng/source/editeng/impedit4.cxx |4 -
 editeng/source/uno/unotext2.cxx |6 +-
 filter/source/config/cache/filtercache.cxx  |   44 
 filter/source/flash/swfwriter2.cxx  |   14 ++---
 filter/source/msfilter/escherex.cxx |6 +-
 filter/source/msfilter/msdffimp.cxx |8 +-
 filter/source/svg/svgexport.cxx |2 
 filter/source/svg/svgreader.cxx |6 +-
 forms/source/component/DatabaseForm.cxx |   24 
 forms/source/component/ListBox.cxx  |4 -
 forms/source/solar/control/navtoolbar.cxx   |2 
 forms/source/xforms/binding.cxx |8 +-
 formula/source/ui/dlg/FormulaHelper.cxx |6 +-
 fpicker/source/office/RemoteFilesDialog.cxx |4 -
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |   24 
 framework/source/services/autorecovery.cxx  |6 +-
 21 files changed, 92 insertions(+), 94 deletions(-)

New commits:
commit 9c5c905680f7cb58eb3d0fbf25725a50c17896da
Author: Noel Grandin 
Date:   Mon Sep 11 08:54:58 2017 +0200

clang-tidy modernize-use-emplace in editeng..framework

Change-Id: I7739c4f77c856d34f8484754244df13d8fef840e
Reviewed-on: https://gerrit.libreoffice.org/42151
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/editobj.cxx 
b/editeng/source/editeng/editobj.cxx
index a20217749d46..549d8cee1992 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -924,7 +924,7 @@ void EditTextObjectImpl::GetAllSections( 
std::vector& rAttrs )
 if (rBorders.size() == 1 && rBorders[0] == 0)
 {
 // Empty paragraph. Push an empty section.
-aAttrs.push_back(editeng::Section(nPara, 0, 0));
+aAttrs.emplace_back(nPara, 0, 0);
 continue;
 }
 
@@ -934,7 +934,7 @@ void EditTextObjectImpl::GetAllSections( 
std::vector& rAttrs )
 for (++itBorder; itBorder != itBorderEnd; ++itBorder, nPrev = nCur)
 {
 nCur = *itBorder;
-aAttrs.push_back(editeng::Section(nPara, nPrev, nCur));
+aAttrs.emplace_back(nPara, nPrev, nCur);
 }
 }
 
diff --git a/editeng/source/editeng/edtspell.cxx 
b/editeng/source/editeng/edtspell.cxx
index c2810f49ed07..47603ca1a039 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -428,7 +428,7 @@ void WrongList::InsertWrong( size_t nStart, size_t nEnd )
 if (nPos != maRanges.end())
 maRanges.insert(nPos, editeng::MisspellRange(nStart, nEnd));
 else
-maRanges.push_back(editeng::MisspellRange(nStart, nEnd));
+maRanges.emplace_back(nStart, nEnd);
 
 SAL_WARN_IF(DbgIsBuggy(), "editeng", "InsertWrong: WrongList broken!");
 }
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index f0f80b4f700d..aaf24df25f18 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -451,7 +451,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, 
vcl::Region* pRegion,
 if (bMm100ToTwip)
 rRectangle = OutputDevice::LogicToLogic(rRectangle, 
MapUnit::Map100thMM, MapUnit::MapTwip);
 rRectangle.Move(aOrigin.getX(), aOrigin.getY());
-v.push_back(rRectangle.toString().getStr());
+v.emplace_back(rRectangle.toString().getStr());
 }
 sRectangle = comphelper::string::join("; ", v);
 }
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index adf436e894b7..1e020d6d5ac3 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1672,7 +1672,7 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara )
 
 sal_Int32 nPos = 0;
 short nScriptType = _xBI->getScriptType( aText, nPos );
-rTypes.push_back( ScriptTypePosInfo( nScriptType, nPos, nTextLen ) );
+rTypes.emplace_back( nScriptType, nPos, nTextLen );
 nPos = _xBI->endOfScript( aText, nPos, nScriptType );
 while ( ( nPos != (-1) ) && ( nPos < nTextLen ) )
 {
@@ -1699,7 +1699,7 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara )
 break;
 }
 }
-   

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

2017-08-23 Thread Eike Rathke
 editeng/source/misc/svxacorr.cxx |   28 +++-
 1 file changed, 15 insertions(+), 13 deletions(-)

New commits:
commit 311be7d70146e4963e4dfd1f39d6c71d45d241ca
Author: Eike Rathke 
Date:   Wed Aug 23 17:52:02 2017 +0200

Related: tdf#108795 never use an unresolved LANGUAGE_SYSTEM in 
SvxAutoCorrect

Substitute with the current work locale, using MsLangId::getSystemLanguage()
instead was also wrong.

Change-Id: I55db3bc1f76329320afc1f366d7426a8c2f66fb2
Reviewed-on: https://gerrit.libreoffice.org/41476
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 51571e1af1ca..a430c4835446 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -203,6 +203,16 @@ static const LanguageTag& GetAppLang()
 {
 return Application::GetSettings().GetLanguageTag();
 }
+
+/// Never use an unresolved LANGUAGE_SYSTEM.
+static LanguageType GetDocLanguage( const SvxAutoCorrDoc& rDoc, sal_Int32 nPos 
)
+{
+LanguageType eLang = rDoc.GetLanguage( nPos );
+if (eLang == LANGUAGE_SYSTEM)
+eLang = GetAppLang().getLanguageType(); // the current work locale
+return eLang;
+}
+
 static LocaleDataWrapper& GetLocaleDataWrapper( LanguageType nLang )
 {
 static LocaleDataWrapper aLclDtWrp( GetAppLang() );
@@ -1165,7 +1175,7 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 sal_Unicode cInsChar, bool bSttQuote,
 bool bIns )
 {
-LanguageType eLang = rDoc.GetLanguage( nInsPos );
+const LanguageType eLang = GetDocLanguage( rDoc, nInsPos );
 sal_Unicode cRet = GetQuote( cInsChar, bSttQuote, eLang );
 
 OUString sChg( cInsChar );
@@ -1178,8 +1188,6 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 
 if( '\"' == cInsChar )
 {
-if( LANGUAGE_SYSTEM == eLang )
-eLang = GetAppLang().getLanguageType();
 if( eLang.anyOf(
 LANGUAGE_FRENCH,
 LANGUAGE_FRENCH_BELGIAN,
@@ -1205,15 +1213,13 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, 
sal_Int32 nInsPos,
 OUString SvxAutoCorrect::GetQuote( SvxAutoCorrDoc const & rDoc, sal_Int32 
nInsPos,
 sal_Unicode cInsChar, bool bSttQuote )
 {
-LanguageType eLang = rDoc.GetLanguage( nInsPos );
+const LanguageType eLang = GetDocLanguage( rDoc, nInsPos );
 sal_Unicode cRet = GetQuote( cInsChar, bSttQuote, eLang );
 
 OUString sRet = OUString(cRet);
 
 if( '\"' == cInsChar )
 {
-if( LANGUAGE_SYSTEM == eLang )
-eLang = GetAppLang().getLanguageType();
 if( eLang.anyOf(
  LANGUAGE_FRENCH,
  LANGUAGE_FRENCH_BELGIAN,
@@ -1274,7 +1280,7 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, 
const OUString& rTxt,
 if ( IsAutoCorrFlag( AddNonBrkSpace ) )
 {
 if ( NeedsHardspaceAutocorr( cChar ) &&
-FnAddNonBrkSpace( rDoc, rTxt, nInsPos, rDoc.GetLanguage( 
nInsPos ), io_bNbspRunNext ) )
+FnAddNonBrkSpace( rDoc, rTxt, nInsPos, GetDocLanguage( 
rDoc, nInsPos ), io_bNbspRunNext ) )
 {
 ;
 }
@@ -1331,9 +1337,7 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, 
const OUString& rTxt,
 if( !nPos && !IsWordDelim( rTxt[ 0 ]))
 --nCapLttrPos;  // begin of paragraph and no blank
 
-LanguageType eLang = rDoc.GetLanguage( nCapLttrPos );
-if( LANGUAGE_SYSTEM == eLang )
-eLang = MsLangId::getSystemLanguage();
+const LanguageType eLang = GetDocLanguage( rDoc, nCapLttrPos );
 CharClass& rCC = GetCharClass( eLang );
 
 // no symbol characters
@@ -1544,9 +1548,7 @@ bool SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc 
const & rDoc,
 if( 3 > nEnde - nCapLttrPos )
 return false;
 
-LanguageType eLang = rDoc.GetLanguage( nCapLttrPos );
-if( LANGUAGE_SYSTEM == eLang )
-eLang = MsLangId::getSystemLanguage();
+const LanguageType eLang = GetDocLanguage( rDoc, nCapLttrPos );
 
 SvxAutoCorrect* pThis = const_cast(this);
 CharClass& rCC = pThis->GetCharClass( eLang );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-08-22 Thread Michael Stahl
 editeng/source/items/frmitems.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f53c9922c653123b43e039ff70bbd515c97db252
Author: Michael Stahl 
Date:   Tue Aug 22 22:52:00 2017 +0200

editeng: warning C4701 potentially uninitialized local var

Change-Id: I611f0b5652722f0de38dfb82440823b832a6029c

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index fb3d120d8ab7..c2bfc5e290fb 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2037,7 +2037,7 @@ SfxPoolItem* SvxBoxItem::Create( SvStream& rStrm, 
sal_uInt16 nIVersion ) const
 SvxBoxItemLine aLineMap[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
SvxBoxItemLine::RIGHT, SvxBoxItemLine::BOTTOM };
 
-sal_Int8 cLine;
+sal_Int8 cLine(0);
 while (rStrm.good())
 {
 rStrm.ReadSChar( cLine );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-08-22 Thread Michael Stahl
 editeng/source/items/frmitems.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2f2a56f91e0057ad502b4586714eb3c14fc069af
Author: Michael Stahl 
Date:   Tue Aug 22 17:22:32 2017 +0200

editeng: avoid infinite loop in SvxBoxItem::Create

Apparently a sw unit test randomly read a partially written autotbl.fmt
and the stream has m_isEof = true.

Change-Id: Iacfbc42e83be6320d4aa695a5df4264f1db0b021

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index dc506afa7d4e..fb3d120d8ab7 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2038,7 +2038,7 @@ SfxPoolItem* SvxBoxItem::Create( SvStream& rStrm, 
sal_uInt16 nIVersion ) const
SvxBoxItemLine::RIGHT, SvxBoxItemLine::BOTTOM };
 
 sal_Int8 cLine;
-while( true )
+while (rStrm.good())
 {
 rStrm.ReadSChar( cLine );
 
___
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 svx/source

2017-08-22 Thread Jochen Nitschke
 editeng/source/items/textitem.cxx|   14 --
 include/editeng/editids.hrc  |1 -
 include/editeng/scripttypeitem.hxx   |   18 +-
 svx/source/svdraw/svdedxv.cxx|5 -
 svx/source/table/tablecontroller.cxx |5 -
 5 files changed, 1 insertion(+), 42 deletions(-)

New commits:
commit 728e42a9dae8305f6f92628d6d9ba616baaf0426
Author: Jochen Nitschke 
Date:   Mon Aug 21 23:32:51 2017 +0200

drop unused SvxScriptTypeItem

apparently there was never a user for this item since initial commit
in the year 2000. SvxScriptSetItem gets the ScriptType by parameter
see GetItemOfScript and PutItemForScriptType.

remove SID_ATTR_CHAR_SCRIPTTYPE and don't put the item in any set.
keep the gap in the ID range because it's not part of any range
and there are already other gaps.

Change-Id: Iee24f13b329593af2dc5548d8b6bc2282c2dc5b3
Reviewed-on: https://gerrit.libreoffice.org/41423
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 24c33bc36aa2..7395c40c50e4 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -2913,19 +2913,6 @@ bool SvxCharReliefItem::QueryValue( css::uno::Any& rVal,
 }
 
 /*
-|*class SvxScriptTypeItemItem
-*/
-
-SvxScriptTypeItem::SvxScriptTypeItem( SvtScriptType nType )
-: SfxUInt16Item( SID_ATTR_CHAR_SCRIPTTYPE, static_cast(nType) )
-{
-}
-SfxPoolItem* SvxScriptTypeItem::Clone( SfxItemPool * ) const
-{
-return new SvxScriptTypeItem( static_cast(GetValue()) );
-}
-
-/*
 |*class SvxScriptSetItem
 */
 
@@ -2938,7 +2925,6 @@ SvxScriptSetItem::SvxScriptSetItem( sal_uInt16 nSlotId, 
SfxItemPool& rPool )
 GetItemSet().MergeRange( nLatin, nLatin );
 GetItemSet().MergeRange( nAsian, nAsian );
 GetItemSet().MergeRange( nComplex, nComplex );
-GetItemSet().MergeRange( SID_ATTR_CHAR_SCRIPTTYPE, 
SID_ATTR_CHAR_SCRIPTTYPE );
 }
 
 SfxPoolItem* SvxScriptSetItem::Clone( SfxItemPool * ) const
diff --git a/include/editeng/editids.hrc b/include/editeng/editids.hrc
index c99144a397bd..f728255f4285 100644
--- a/include/editeng/editids.hrc
+++ b/include/editeng/editids.hrc
@@ -100,7 +100,6 @@
 #define SID_ATTR_CHAR_TWO_LINES ( SID_SVX_START + 897 )
 #define SID_ATTR_CHAR_CJK_RUBY  ( SID_SVX_START + 898 )
 #define SID_ATTR_CHAR_EMPHASISMARK  ( SID_SVX_START + 899 )
-#define SID_ATTR_CHAR_SCRIPTTYPE( SID_SVX_START + 900 )
 #define SID_ATTR_PARA_SCRIPTSPACE   ( SID_SVX_START + 901 )
 #define SID_ATTR_PARA_HANGPUNCTUATION   ( SID_SVX_START + 902 )
 #define SID_ATTR_PARA_FORBIDDEN_RULES   ( SID_SVX_START + 903 )
diff --git a/include/editeng/scripttypeitem.hxx 
b/include/editeng/scripttypeitem.hxx
index 4d86b9e81359..49c3945ca7d7 100644
--- a/include/editeng/scripttypeitem.hxx
+++ b/include/editeng/scripttypeitem.hxx
@@ -19,26 +19,10 @@
 #ifndef INCLUDED_EDITENG_SCRIPTTYPEITEM_HXX
 #define INCLUDED_EDITENG_SCRIPTTYPEITEM_HXX
 
-#include 
 #include 
+#include 
 #include 
 
-// class SvxScriptTypeItem --
-
-/* [Description]
-
-This item describes the script type of the selected text and is only
-used for the user interface.
-*/
-
-class EDITENG_DLLPUBLIC SvxScriptTypeItem : public SfxUInt16Item
-{
-public:
-explicit SvxScriptTypeItem( SvtScriptType nType = SvtScriptType::LATIN );
-virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
-
-};
-
 class EDITENG_DLLPUBLIC SvxScriptSetItem : public SfxSetItem
 {
 public:
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 5734295acb47..ab28ff0c69c0 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -33,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -2027,14 +2026,10 @@ bool SdrObjEditView::GetAttributes(SfxItemSet& 
rTargetSet, bool bOnlyHardAttr) c
 // add object attributes
 rTargetSet.Put( mxTextEditObj->GetMergedItemSet() );
 
-if( mxTextEditObj->GetOutlinerParaObject() )
-rTargetSet.Put( SvxScriptTypeItem( 
mxTextEditObj->GetOutlinerParaObject()->GetTextObject().GetScriptType() ) );
-
 if(pTextEditOutlinerView)
 {
 // FALSE= regard InvalidItems as "holes," not as Default
 rTargetSet.Put(pTextEditOutlinerView->GetAttribs(), false);
-rTargetSet.Put( 

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

2017-08-14 Thread Varun Dhall
 editeng/source/editeng/editdoc.cxx |   50 -
 1 file changed, 50 deletions(-)

New commits:
commit ec2abbca3d9befc4192452555a9433d267a47d58
Author: Varun Dhall 
Date:   Sun Aug 13 03:55:03 2017 +0530

Removing unused SetVersionMap from editeng

Change-Id: I04b2cb17271365a7967e51c7d551f538ee9a5c68
Reviewed-on: https://gerrit.libreoffice.org/41102
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index e443e81f53d1..36c101fa8146 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -216,49 +216,6 @@ const SfxItemInfo aItemInfos[EDITITEMCOUNT] = {
 { SID_ATTR_CHAR_CHARSETCOLOR, true },  // EE_FEATURE_NOTCONV
 };
 
-const sal_uInt16 aV1Map[] = {
-3999, 4001, 4002, 4003, 4004, 4005, 4006,
-4007, 4008, 4009, 4010, 4011, 4012, 4013, 4017, 4018, 4019 // MI: 4019?
-};
-
-const sal_uInt16 aV2Map[] = {
-3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009,
-4010, 4011, 4012, 4013, 4014, 4015, 4016, 4018, 4019, 4020
-};
-
-const sal_uInt16 aV3Map[] = {
-3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007,
-4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019,
-4020, 4021
-};
-
-const sal_uInt16 aV4Map[] = {
-3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003,
-4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013,
-4014, 4015, 4016, 4017, 4018,
-/* CJK Items inserted here: EE_CHAR_LANGUAGE - EE_CHAR_XMLATTRIBS */
-4034, 4035, 4036, 4037
-};
-
-const sal_uInt16 aV5Map[] = {
-3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003,
-4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013,
-4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023,
-4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033,
-/* EE_CHAR_OVERLINE inserted here */
-4035, 4036, 4037, 4038
-};
-
-const sal_uInt16 aV6Map[] = {
-3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003,
-4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013,
-4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023,
-4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033,
-4035, 4036, 4037, 4038,
-/* EE_CHAR_GRABBAG inserted here */
-4039
-};
-
 EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, 
sal_Int32 nS, sal_Int32 nE )
 {
 // Create a new attribute in the pool
@@ -3068,13 +3025,6 @@ EditEngineItemPool::EditEngineItemPool( bool 
bPersistenRefCounts )
 : SfxItemPool( "EditEngineItemPool", EE_ITEMS_START, EE_ITEMS_END,
 aItemInfos, nullptr, bPersistenRefCounts )
 {
-SetVersionMap( 1, 3999, 4015, aV1Map );
-SetVersionMap( 2, 3999, 4019, aV2Map );
-SetVersionMap( 3, 3997, 4020, aV3Map );
-SetVersionMap( 4, 3994, 4022, aV4Map );
-SetVersionMap( 5, 3994, 4037, aV5Map );
-SetVersionMap( 6, 3994, 4038, aV6Map );
-
 m_xDefItems = EditDLL::Get().GetGlobalData()->GetDefItems();
 SetDefaults(m_xDefItems->getDefaults());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-08-13 Thread Noel Grandin
 editeng/source/editeng/impedit.cxx |8 +++-
 include/vcl/settings.hxx   |2 +-
 sc/source/ui/app/inputwin.cxx  |9 -
 sc/source/ui/view/gridwin.cxx  |   11 ++-
 vcl/source/control/edit.cxx|7 +++
 vcl/source/edit/textview.cxx   |   10 +-
 vcl/source/window/winproc.cxx  |2 ++
 7 files changed, 44 insertions(+), 5 deletions(-)

New commits:
commit 5b3b0a91edc4c468c7c9c132cd066c0d25de9706
Author: Noel Grandin 
Date:   Sun Aug 13 13:37:28 2017 +0200

tdf#110988 Middle click does not paste primary selection

regression from commit 65b7b6322b662785bf032e66c76abc36c9a2bb0e
"loplugin:unusedenumconstants read-only constants in vcl"

Change-Id: I262dd4c9cd1dc6eca82521f5fd9fbfc952fb7745
Reviewed-on: https://gerrit.libreoffice.org/4
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index b670682104f4..f0f80b4f700d 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1349,7 +1349,13 @@ bool ImpEditView::MouseButtonUp( const MouseEvent& 
rMouseEvent )
 nExtraCursorFlags = GetCursorFlags::NONE;
 bClickedInSelection = false;
 
-if ( rMouseEvent.IsLeft() && GetEditSelection().HasRange() )
+if ( rMouseEvent.IsMiddle() && !bReadOnly &&
+ ( 
GetWindow()->GetSettings().GetMouseSettings().GetMiddleButtonAction() == 
MouseMiddleButtonAction::PasteSelection ) )
+{
+Reference 
aClipBoard(GetWindow()->GetPrimarySelection());
+Paste( aClipBoard );
+}
+else if ( rMouseEvent.IsLeft() && GetEditSelection().HasRange() )
 {
 Reference 
aClipBoard(GetWindow()->GetPrimarySelection());
 CutCopy( aClipBoard, false );
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 8dcaa4ceacfc..097605e7c251 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -79,7 +79,7 @@ namespace o3tl
 
 enum class MouseMiddleButtonAction
 {
-Nothing, AutoScroll
+Nothing, AutoScroll, PasteSelection
 };
 
 enum class MouseWheelBehaviour
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 7d0b7fa036fd..f60937c047f0 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1349,7 +1349,14 @@ void ScTextWnd::MouseButtonUp( const MouseEvent& rMEvt )
 if (mpEditView)
 if (mpEditView->MouseButtonUp( rMEvt ))
 {
-SC_MOD()->InputSelection( mpEditView.get() );
+if ( rMEvt.IsMiddle() &&
+ GetSettings().GetMouseSettings().GetMiddleButtonAction() 
== MouseMiddleButtonAction::PasteSelection )
+{
+//  EditView may have pasted from selection
+SC_MOD()->InputChanged( mpEditView.get() );
+}
+else
+SC_MOD()->InputSelection( mpEditView.get() );
 }
 }
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 3bcec4d4ac86..23edbf1b28bb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1818,7 +1818,16 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& 
rMEvt )
 SCROW   nEditRow;
 pViewData->GetEditView( eWhich, pEditView, nEditCol, nEditRow );
 pEditView->MouseButtonUp( rMEvt );
-pScMod->InputSelection( pEditView );// parentheses etc.
+
+if ( rMEvt.IsMiddle() &&
+ GetSettings().GetMouseSettings().GetMiddleButtonAction() == 
MouseMiddleButtonAction::PasteSelection )
+{
+//  EditView may have pasted from selection
+pScMod->InputChanged( pEditView );
+}
+else
+pScMod->InputSelection( pEditView );// parentheses etc.
+
 pViewData->GetView()->InvalidateAttribs();
 rBindings.Invalidate( SID_HYPERLINK_GETLINK );
 bEEMouse = false;
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 69cc50abf549..95c079c4a7c2 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1361,6 +1361,13 @@ void Edit::MouseButtonUp( const MouseEvent& rMEvt )
 ImplSetCursorPos( nCharPos, false );
 mbClickedInSelection = false;
 }
+else if ( rMEvt.IsMiddle() && !mbReadOnly &&
+  ( GetSettings().GetMouseSettings().GetMiddleButtonAction() == 
MouseMiddleButtonAction::PasteSelection ) )
+{
+css::uno::Reference 
aSelection(Window::GetPrimarySelection());
+ImplPaste( aSelection );
+ImplModified();
+}
 }
 
 void Edit::Tracking( const TrackingEvent& rTEvt )
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index ae9fac5aba7f..7c528430b151 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -734,7 +734,15 

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

2017-08-11 Thread Andrea Gelmini
 editeng/source/editeng/impedit.cxx |2 +-
 editeng/source/editeng/impedit.hxx |2 +-
 include/editeng/editview.hxx   |2 +-
 include/svx/svdedxv.hxx|2 +-
 svx/source/svdraw/svdedxv.cxx  |6 +++---
 5 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 5f740414d37729b293709a70619caab39a02eb7a
Author: Andrea Gelmini 
Date:   Fri Aug 11 11:23:37 2017 +0200

Fix typos

Change-Id: Ia36c8abe91e8c2ac46498e88def59a9887711ba1
Reviewed-on: https://gerrit.libreoffice.org/41014
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index aa2a257c5343..b670682104f4 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -207,7 +207,7 @@ void ImpEditView::SelectionChanged()
 // This can be safely assumed due to the EditView only being capable of 
painting the
 // selection in XOR until today.
 // This also means that all places calling DrawSelectionXOR are thoroughly 
weighted
-// and choosen to make this fragile XOR-paint water-proof and thus contain some
+// and chosen to make this fragile XOR-paint water-proof and thus contain some
 // information in this sense.
 // Someone thankfully expanded it to collect the SelectionRectangles when 
called with
 // the Region*, see GetSelectionRectangles below.
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 3c1d2e78a0c6..9bcab368ee80 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -262,7 +262,7 @@ private:
 // and the direct repaint of the Window-plugged EditView will be 
suppressed.
 // Instead, a consumer that has registered using a EditViewCallbacks
 // incarnation has to handle that. Used e.g. to represent the edited text
-// in Draw/Impres in an OverlayObject which avoids evtl. expensive full
+// in Draw/Impress in an OverlayObject which avoids evtl. expensive full
 // repaints of the EditView(s)
 const EditViewCallbacks* mpEditViewCallbacks;
 
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 84e41d4af2f2..79af335b3db4 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -81,7 +81,7 @@ enum class ScrollRangeCheck
 };
 
 // Helper class that allows to set a callback at the EditView. When
-// set, Invalidates and repains are suppressed at the EditView, but
+// set, Invalidates and repaints are suppressed at the EditView, but
 // EditViewInvalidate() will be triggered to allow the consumer to
 // react itself as needed.
 // Also Selection visualization is suppressed and EditViewSelectionChange
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 6cfb22128e08..b55385e77d17 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -69,7 +69,7 @@ class SVX_DLLPUBLIC SdrObjEditView: public SdrGlueEditView, 
public EditViewCallb
 virtual void EditViewSelectionChange() const override;
 
 // The OverlayObjects used for visualizing active TextEdit (currently
-// using TextEditOverlayObject, but not limitied to it
+// using TextEditOverlayObject, but not limited to it
 sdr::overlay::OverlayObjectList   maTEOverlayGroup;
 
 protected:
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 7cd8dc363b4b..57b80c89b002 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -367,7 +367,7 @@ namespace
 and thus avoiding potentially expensive repaints by using the
 automatically buffered Overlay mechanism.
 
-It buffers as amuch as possible locally and *only* triggers a real
+It buffers as much as possible locally and *only* triggers a real
 change (see call to objectChange()) when really needed.
  */
 class TextEditOverlayObject : public sdr::overlay::OverlayObject
@@ -531,7 +531,7 @@ namespace
 
 // active Outliner is always in unified oriented coordinate system 
(currently)
 // so just translate to TopLeft of visible Range. Keep in mind 
that top-left
-// depends on vertical text and top-to-bottom text attribures
+// depends on vertical text and top-to-bottom text attributes
 const tools::Rectangle aVisArea(mrOutlinerView.GetVisArea());
 const bool bVerticalWriting(pSdrOutliner->IsVertical());
 const bool bTopToBottom(pSdrOutliner->IsTopToBottom());
@@ -655,7 +655,7 @@ void SdrObjEditView::TextEditDrawing(SdrPaintWindow& 
rPaintWindow) const
 {
 // adapt all TextEditOverlayObject(s), so call EditViewInvalidate()
 // to update accordingly (will update selection, too). Suppress new
-// stuff when LibreOficeKit is active
+// stuff when LibreOfficeKit is active
 EditViewInvalidate();
 

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

2017-08-09 Thread Varun Dhall
 editeng/source/editeng/editobj.cxx|  362 --
 editeng/source/editeng/editobj2.hxx   |2 
 include/editeng/editobj.hxx   |2 
 sc/inc/attrib.hxx |7 
 sc/source/core/data/attrib.cxx|  192 -
 sc/source/ui/condformat/condformatdlgitem.cxx |5 
 sc/source/ui/inc/condformatdlgitem.hxx|1 
 7 files changed, 571 deletions(-)

New commits:
commit 9cc75c52369d6656a5812e950641d4b9b6d0cc35
Author: Varun Dhall 
Date:   Tue Aug 8 23:42:02 2017 +0530

Removing unused SfxItemPool serialisation from sc

Change-Id: Ib8686d06f8cd477ff4fce948b0ac9c3fe463b129
Reviewed-on: https://gerrit.libreoffice.org/40901
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/editeng/source/editeng/editobj.cxx 
b/editeng/source/editeng/editobj.cxx
index 14eebcfbcf45..f5122fec09eb 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -393,36 +393,6 @@ SvtScriptType EditTextObject::GetScriptType() const
 }
 
 
-EditTextObject* EditTextObject::Create( SvStream& rIStream )
-{
-sal_uInt64 const nStartPos = rIStream.Tell();
-
-// First check what type of Object...
-sal_uInt16 nWhich;
-rIStream.ReadUInt16( nWhich );
-
-sal_uInt32 nStructSz;
-rIStream.ReadUInt32( nStructSz );
-
-if (nWhich != EE_FORMAT_BIN)
-{
-// Unknown object we no longer support.
-rIStream.SetError(EE_READWRITE_WRONGFORMAT);
-return nullptr;
-}
-
-if ( rIStream.GetError() )
-return nullptr;
-
-EditTextObject* pTxtObj = new EditTextObject(nullptr);
-pTxtObj->mpImpl->CreateData(rIStream);
-
-// Make sure that the stream is left at the correct place.
-std::size_t nFullSz = sizeof( nWhich ) + sizeof( nStructSz ) + nStructSz;
-rIStream.Seek( nStartPos + nFullSz );
-return pTxtObj;
-}
-
 EditTextObject* EditTextObject::Clone() const
 {
 return new EditTextObject(*this);
@@ -1089,338 +1059,6 @@ void EditTextObjectImpl::ChangeStyleSheetName( 
SfxStyleFamily eFamily,
 ImpChangeStyleSheets( rOldName, eFamily, rNewName, eFamily );
 }
 
-
-namespace {
-
-class FindAttribByChar
-{
-sal_uInt16 mnWhich;
-sal_Int32 mnChar;
-public:
-FindAttribByChar(sal_uInt16 nWhich, sal_Int32 nChar) : mnWhich(nWhich), 
mnChar(nChar) {}
-bool operator() (const std::unique_ptr& rAttr) const
-{
-return (rAttr->GetItem()->Which() == mnWhich) && (rAttr->GetStart() <= 
mnChar) && (rAttr->GetEnd() > mnChar);
-}
-};
-
-}
-
-void EditTextObjectImpl::CreateData( SvStream& rIStream )
-{
-rIStream.ReadUInt16( nVersion );
-
-// The text object was first created with the current setting of
-// pTextObjectPool.
-bool bOwnerOfCurrent = bOwnerOfPool;
-bool b;
-rIStream.ReadCharAsBool( b );
-bOwnerOfPool = b;
-
-if ( bOwnerOfCurrent && !bOwnerOfPool )
-{
-// A global Pool was used, but not handed over to me, but I need it!
-OSL_FAIL( "Give me the global TextObjectPool!" );
-return;
-}
-else if ( !bOwnerOfCurrent && bOwnerOfPool )
-{
-// A global Pool should be used, but this Textobject has its own.
-pPool = EditEngine::CreatePool();
-}
-
-if ( bOwnerOfPool )
-GetPool()->Load( rIStream );
-
-// CharSet, in which it was saved:
-sal_uInt16 nCharSet;
-rIStream.ReadUInt16( nCharSet );
-
-rtl_TextEncoding eSrcEncoding = GetSOLoadTextEncoding( 
(rtl_TextEncoding)nCharSet );
-
-// The number of paragraphs ...
-sal_uInt16 nParagraphs(0);
-rIStream.ReadUInt16( nParagraphs );
-
-const size_t nMinParaRecordSize = 6 + eSrcEncoding == 
RTL_TEXTENCODING_UNICODE ? 4 : 2;
-const size_t nMaxParaRecords = rIStream.remainingSize() / 
nMinParaRecordSize;
-if (nParagraphs > nMaxParaRecords)
-{
-SAL_WARN("editeng", "Parsing error: " << nMaxParaRecords <<
- " max possible entries, but " << nParagraphs<< " claimed, 
truncating");
-nParagraphs = nMaxParaRecords;
-}
-
-// The individual paragraphs ...
-for ( sal_uLong nPara = 0; nPara < nParagraphs; nPara++ )
-{
-ContentInfo* pC = CreateAndInsertContent();
-
-// The Text...
-OString aByteString = 
read_uInt16_lenPrefixed_uInt8s_ToOString(rIStream);
-pC->SetText(OStringToOUString(aByteString, eSrcEncoding));
-
-// StyleName and Family...
-pC->SetStyle(rIStream.ReadUniOrByteString(eSrcEncoding));
-sal_uInt16 nStyleFamily(0);
-rIStream.ReadUInt16( nStyleFamily );
-pC->SetFamily((SfxStyleFamily)nStyleFamily);
-
-// Paragraph attributes ...
-pC->GetParaAttribs().Load( rIStream );
-
-// The number of attributes ...
-sal_uInt16 nTmp16(0);
-rIStream.ReadUInt16( nTmp16 );
-size_t nAttribs = 

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

2017-08-07 Thread Varun Dhall
 editeng/source/editeng/editdoc.cxx   |   20 -
 editeng/source/editeng/editdoc.hxx   |2 
 editeng/source/editeng/editobj.cxx   |  172 
 editeng/source/editeng/editobj2.hxx  |1 
 editeng/source/items/bulitem.cxx |  118 ---
 editeng/source/items/flditem.cxx |   36 ---
 editeng/source/items/frmitems.cxx|  308 -
 editeng/source/items/justifyitem.cxx |8 
 editeng/source/items/numitem.cxx |   12 -
 editeng/source/items/optitems.cxx|   19 -
 editeng/source/items/paraitem.cxx|  221 -
 editeng/source/items/textitem.cxx|  325 ---
 editeng/source/items/writingmodeitem.cxx |   12 -
 include/editeng/autokernitem.hxx |2 
 include/editeng/blinkitem.hxx|2 
 include/editeng/boxitem.hxx  |2 
 include/editeng/bulletitem.hxx   |3 
 include/editeng/charreliefitem.hxx   |2 
 include/editeng/charrotateitem.hxx   |4 
 include/editeng/charscaleitem.hxx|2 
 include/editeng/charsetcoloritem.hxx |2 
 include/editeng/cmapitem.hxx |2 
 include/editeng/colritem.hxx |2 
 include/editeng/emphasismarkitem.hxx |2 
 include/editeng/escapementitem.hxx   |2 
 include/editeng/flditem.hxx  |2 
 include/editeng/forbiddenruleitem.hxx|1 
 include/editeng/fwdtitem.hxx |2 
 include/editeng/hngpnctitem.hxx  |1 
 include/editeng/hyphenzoneitem.hxx   |2 
 include/editeng/justifyitem.hxx  |1 
 include/editeng/kernitem.hxx |2 
 include/editeng/langitem.hxx |2 
 include/editeng/lrspitem.hxx |2 
 include/editeng/lspcitem.hxx |2 
 include/editeng/nhypitem.hxx |2 
 include/editeng/nlbkitem.hxx |2 
 include/editeng/numitem.hxx  |2 
 include/editeng/opaqitem.hxx |2 
 include/editeng/optitems.hxx |2 
 include/editeng/orphitem.hxx |2 
 include/editeng/paravertalignitem.hxx|2 
 include/editeng/pbinitem.hxx |2 
 include/editeng/pgrditem.hxx |1 
 include/editeng/prntitem.hxx |2 
 include/editeng/protitem.hxx |2 
 include/editeng/prszitem.hxx |2 
 include/editeng/rsiditem.hxx |1 
 include/editeng/scriptspaceitem.hxx  |1 
 include/editeng/sizeitem.hxx |2 
 include/editeng/spltitem.hxx |2 
 include/editeng/tstpitem.hxx |2 
 include/editeng/twolinesitem.hxx |2 
 include/editeng/ulspitem.hxx |2 
 include/editeng/widwitem.hxx |2 
 include/editeng/writingmodeitem.hxx  |2 
 include/editeng/wrlmitem.hxx |2 
 57 files changed, 1339 deletions(-)

New commits:
commit 1e4b1e4a1aca3b333820b0a865997e6f62e80064
Author: Varun Dhall 
Date:   Wed Jul 26 01:13:31 2017 +0530

Removing unused SfxItemPool serialisation from editeng

Change-Id: I051201c272b7acdd48d54cc0c230f8b432196188
Reviewed-on: https://gerrit.libreoffice.org/40429
Reviewed-by: Michael Stahl 
Tested-by: Jenkins 

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index c324c8c35708..e443e81f53d1 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -3084,24 +3084,4 @@ EditEngineItemPool::~EditEngineItemPool()
 ClearDefaults();
 }
 
-SvStream& EditEngineItemPool::Store( SvStream& rStream ) const
-{
-// for a 3.1 export a hack has to be installed, as in there is a BUG in
-// SfxItemSet::Load, but not subsequently after 3.1.
-
-// The selected range must be kept after Store, because itemsets are not
-// stored until then...
-
-long nVersion = rStream.GetVersion();
-bool b31Format = nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 );
-
-EditEngineItemPool* pThis = const_cast(this);
-if ( b31Format )
-pThis->SetStoringRange( 3997, 4022 );
-else
-pThis->SetStoringRange( EE_ITEMS_START, EE_ITEMS_END );
-
-return SfxItemPool::Store( rStream );
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index a2a8549ec632..40cbcd1ea720 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -839,8 +839,6 @@ public:
 EditEngineItemPool(bool bPersistenRefCounts);
 protected:
 virtual ~EditEngineItemPool() override;
-public:
-virtual SvStream&   Store(SvStream& rStream) const override;
 };
 
 #endif // INCLUDED_EDITENG_SOURCE_EDITENG_EDITDOC_HXX
diff --git 

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

2017-08-07 Thread Varun Dhall
 editeng/source/editeng/editobj.cxx  |   22 --
 editeng/source/editeng/eeobj.cxx|   11 +++
 editeng/source/editeng/eeobj.hxx|3 -
 editeng/source/editeng/impedit.hxx  |2 -
 editeng/source/editeng/impedit2.cxx |   55 +++-
 editeng/source/editeng/impedit4.cxx |   24 ---
 include/editeng/editobj.hxx |2 -
 7 files changed, 16 insertions(+), 103 deletions(-)

New commits:
commit 4aef9f5e330a4228b2355fa97900dcede3e375c4
Author: Varun Dhall 
Date:   Mon Jul 24 19:46:37 2017 +0530

EditEngine: Removing BIN format

Change-Id: I2752af754316e1402aa51b97895bcf0bf915676f
Reviewed-on: https://gerrit.libreoffice.org/40372
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/editeng/source/editeng/editobj.cxx 
b/editeng/source/editeng/editobj.cxx
index c3ac63cd6d61..50e516351503 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -393,28 +393,6 @@ SvtScriptType EditTextObject::GetScriptType() const
 }
 
 
-void EditTextObject::Store( SvStream& rOStream ) const
-{
-if ( rOStream.GetError() )
-return;
-
-sal_uInt64 const nStartPos = rOStream.Tell();
-
-sal_uInt16 nWhich = static_cast(EE_FORMAT_BIN);
-rOStream.WriteUInt16( nWhich );
-
-sal_uInt32 nStructSz = 0;
-rOStream.WriteUInt32( nStructSz );
-
-mpImpl->StoreData(rOStream);
-
-sal_uInt64 const nEndPos = rOStream.Tell();
-nStructSz = nEndPos - nStartPos - sizeof( nWhich ) - sizeof( nStructSz );
-rOStream.Seek( nStartPos + sizeof( nWhich ) );
-rOStream.WriteUInt32( nStructSz );
-rOStream.Seek( nEndPos );
-}
-
 EditTextObject* EditTextObject::Create( SvStream& rIStream )
 {
 sal_uInt64 const nStartPos = rIStream.Tell();
diff --git a/editeng/source/editeng/eeobj.cxx b/editeng/source/editeng/eeobj.cxx
index 83055dd4b2fc..e498b7f4332b 100644
--- a/editeng/source/editeng/eeobj.cxx
+++ b/editeng/source/editeng/eeobj.cxx
@@ -52,13 +52,13 @@ uno::Any EditDataObject::getTransferData( const 
datatransfer::DataFlavor& rFlavo
 {
 aAny <<= GetString();
 }
-else if ( ( nT == SotClipboardFormatId::EDITENGINE ) || ( nT == 
SotClipboardFormatId::RTF ) || ( nT == SotClipboardFormatId::RICHTEXT ) || ( nT 
== SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT ) )
+else if ( ( nT == SotClipboardFormatId::RTF ) || ( nT == 
SotClipboardFormatId::RICHTEXT ) || ( nT == 
SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT ) )
 {
 // No RTF on demand any more:
 // 1) Was not working, because I had to flush() the clipboard 
immediately anyway
 // 2) Don't have the old pool defaults and the StyleSheetPool here.
 
-SvMemoryStream* pStream = ( nT == SotClipboardFormatId::EDITENGINE ) ? 
() : ( (nT == SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT ) ? 
() : () );
+SvMemoryStream* pStream = (nT == 
SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT ) ? () : 
();
 pStream->Seek( STREAM_SEEK_TO_END );
 sal_Int32 nLen = pStream->Tell();
 if (nLen < 0) { abort(); }
@@ -79,12 +79,11 @@ uno::Any EditDataObject::getTransferData( const 
datatransfer::DataFlavor& rFlavo
 
 uno::Sequence< datatransfer::DataFlavor > 
EditDataObject::getTransferDataFlavors(  )
 {
-uno::Sequence< datatransfer::DataFlavor > aDataFlavors(5);
-SotExchange::GetFormatDataFlavor( SotClipboardFormatId::EDITENGINE, 
aDataFlavors.getArray()[0] );
+uno::Sequence< datatransfer::DataFlavor > aDataFlavors(4);
+SotExchange::GetFormatDataFlavor( 
SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT, aDataFlavors.getArray()[0] );
 SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, 
aDataFlavors.getArray()[1] );
 SotExchange::GetFormatDataFlavor( SotClipboardFormatId::RTF, 
aDataFlavors.getArray()[2] );
 SotExchange::GetFormatDataFlavor( SotClipboardFormatId::RICHTEXT, 
aDataFlavors.getArray()[3] );
-SotExchange::GetFormatDataFlavor( 
SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT, aDataFlavors.getArray()[4] );
 
 return aDataFlavors;
 }
@@ -95,7 +94,7 @@ sal_Bool EditDataObject::isDataFlavorSupported( const 
datatransfer::DataFlavor&
 
 SotClipboardFormatId nT = SotExchange::GetFormat( rFlavor );
 if ( ( nT == SotClipboardFormatId::STRING ) || ( nT == 
SotClipboardFormatId::RTF ) || ( nT == SotClipboardFormatId::RICHTEXT )
-|| ( nT == SotClipboardFormatId::EDITENGINE ) || ( nT == 
SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT ) )
+|| ( nT == SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT ) )
 bSupported = true;
 
 return bSupported;
diff --git a/editeng/source/editeng/eeobj.hxx b/editeng/source/editeng/eeobj.hxx
index f515aa938715..bc7fd6669a33 100644
--- a/editeng/source/editeng/eeobj.hxx
+++ b/editeng/source/editeng/eeobj.hxx
@@ -28,18 +28,15 @@
 class EditDataObject :  public 
::cppu::WeakImplHelper
 {
 

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

2017-07-28 Thread Noel Grandin
 editeng/source/editeng/editeng.cxx |2 -
 editeng/source/editeng/editview.cxx|4 +-
 editeng/source/editeng/fieldupdater.cxx|4 +-
 editeng/source/editeng/impedit.cxx |2 -
 editeng/source/editeng/impedit.hxx |4 +-
 editeng/source/editeng/impedit2.cxx|2 -
 editeng/source/items/numitem.cxx   |4 +-
 editeng/source/items/optitems.cxx  |2 -
 editeng/source/misc/SvXMLAutoCorrectExport.cxx |4 +-
 editeng/source/misc/SvXMLAutoCorrectExport.hxx |4 +-
 editeng/source/misc/splwrap.cxx|2 -
 editeng/source/misc/svxacorr.cxx   |6 +--
 editeng/source/misc/unolingu.cxx   |2 -
 editeng/source/outliner/outlin2.cxx|   16 +-
 editeng/source/outliner/outliner.cxx   |   16 +-
 editeng/source/outliner/outlvw.cxx |8 ++---
 editeng/source/outliner/overflowingtxt.cxx |   18 +--
 editeng/source/outliner/paralist.cxx   |   19 +--
 editeng/source/outliner/paralist.hxx   |   16 +-
 editeng/source/uno/unofield.cxx|2 -
 editeng/source/uno/unofored.cxx|2 -
 editeng/source/uno/unofored_internal.hxx   |2 -
 editeng/source/uno/unoforou.cxx|2 -
 editeng/source/uno/unotext.cxx |6 +--
 include/editeng/editeng.hxx|2 -
 include/editeng/editview.hxx   |4 +-
 include/editeng/fieldupdater.hxx   |2 -
 include/editeng/numitem.hxx|4 +-
 include/editeng/optitems.hxx   |2 -
 include/editeng/outliner.hxx   |   40 -
 include/editeng/overflowingtxt.hxx |   18 +--
 include/editeng/splwrap.hxx|2 -
 include/editeng/svxacorr.hxx   |6 +--
 include/editeng/unolingu.hxx   |2 -
 include/editeng/unotext.hxx|6 +--
 sd/source/ui/view/outlview.cxx |2 -
 36 files changed, 118 insertions(+), 121 deletions(-)

New commits:
commit 32894034ea7b283d6c60cb77ef5d8b43a9c15d65
Author: Noel Grandin 
Date:   Fri Jul 28 12:07:49 2017 +0200

loplugin:constparams in editeng

Change-Id: Ice32a16d14d0132a19e8209d311bb799fd7ee0c8
Reviewed-on: https://gerrit.libreoffice.org/40526
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 71cf7d36f347..63fce03390de 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -953,7 +953,7 @@ void EditEngine::SetInSelectionMode(bool b)
 pImpEditEngine->bInSelection = b;
 }
 
-bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, 
vcl::Window* pFrameWin )
+bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, 
vcl::Window const * pFrameWin )
 {
 DBG_ASSERT( pEditView, "no View - no cookie !" );
 
diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 6ff7bd229ba3..4bcc257fc0e4 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -407,7 +407,7 @@ void EditView::InsertText( const OUString& rStr, bool 
bSelect )
 pEE->FormatAndUpdate( this );
 }
 
-bool EditView::PostKeyEvent( const KeyEvent& rKeyEvent, vcl::Window* pFrameWin 
)
+bool EditView::PostKeyEvent( const KeyEvent& rKeyEvent, vcl::Window const * 
pFrameWin )
 {
 return pImpEditView->PostKeyEvent( rKeyEvent, pFrameWin );
 }
@@ -748,7 +748,7 @@ void EditView::TransliterateText( TransliterationFlags 
nTransliterationMode )
 }
 }
 
-void EditView::CompleteAutoCorrect( vcl::Window* pFrameWin )
+void EditView::CompleteAutoCorrect( vcl::Window const * pFrameWin )
 {
 if ( !pImpEditView->HasSelection() && 
pImpEditView->pEditEngine->pImpEditEngine->GetStatus().DoAutoCorrect() )
 {
diff --git a/editeng/source/editeng/fieldupdater.cxx 
b/editeng/source/editeng/fieldupdater.cxx
index d2253d51e1ef..d986fa1f6e4e 100644
--- a/editeng/source/editeng/fieldupdater.cxx
+++ b/editeng/source/editeng/fieldupdater.cxx
@@ -23,7 +23,7 @@ class FieldUpdaterImpl
 {
 EditTextObjectImpl& mrObj;
 public:
-explicit FieldUpdaterImpl(EditTextObject& rObj) : mrObj(*rObj.mpImpl) {}
+explicit FieldUpdaterImpl(EditTextObject const & rObj) : 
mrObj(*rObj.mpImpl) {}
 FieldUpdaterImpl(const FieldUpdaterImpl& r) : mrObj(r.mrObj) {}
 
 void updateTableFields(int nTab)
@@ -57,7 +57,7 @@ public:
 }
 };
 
-FieldUpdater::FieldUpdater(EditTextObject& rObj) : mpImpl(new 
FieldUpdaterImpl(rObj)) {}
+FieldUpdater::FieldUpdater(EditTextObject const & rObj) : mpImpl(new 
FieldUpdaterImpl(rObj)) {}
 

[Libreoffice-commits] core.git: editeng/source include/editeng include/svl sc/source svl/source

2017-07-27 Thread Eike Rathke
 editeng/source/editeng/editobj.cxx  |   18 ++
 editeng/source/editeng/editobj2.hxx |3 ++-
 include/editeng/editobj.hxx |7 +++
 include/svl/itemset.hxx |   14 ++
 sc/source/core/data/global.cxx  |   19 +--
 svl/source/items/itemset.cxx|   12 ++--
 6 files changed, 48 insertions(+), 25 deletions(-)

New commits:
commit 238de04de6c8b67f74c75514b86c08bf888feb48
Author: Eike Rathke 
Date:   Thu Jul 27 16:58:59 2017 +0200

Ditch use of EditTextObject::Store() in ScGlobal::EETextObjEqual()

This was the last incarnation of SfxItem binary stream serialization that 
is to
be eliminated after clipboard use is gone.

The "full" EditTextObject::operator==() in EditTextObjectImpl::operator==(),
and via ContentInfo::operator==() in SfxItemSet::operator==(), also compare 
the
SfxItemPool pointers which gets in the way here (not stored to stream hence
didn't matter and maybe the reason for not having switched EETextObjEqual() 
to
use operator==() back in the days).

Introduce *::Equals() functions that do not compare pool pointers and let
SfxItemSet::Equals() in that case not assume it would be operating on one 
pool
only.

Change-Id: Ifff939a92101c7f74695b676a45a7fdbb4f1d7f6
Reviewed-on: https://gerrit.libreoffice.org/40492
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 

diff --git a/editeng/source/editeng/editobj.cxx 
b/editeng/source/editeng/editobj.cxx
index 3a7036b05fb8..c3ac63cd6d61 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -225,13 +225,13 @@ void ContentInfo::Dump() const
 }
 #endif
 
-bool ContentInfo::operator==( const ContentInfo& rCompare ) const
+bool ContentInfo::Equals( const ContentInfo& rCompare, bool bComparePool ) 
const
 {
 if( (maText == rCompare.maText) &&
 (aStyle == rCompare.aStyle ) &&
 (maCharAttribs.size() == rCompare.maCharAttribs.size()) &&
 (eFamily == rCompare.eFamily ) &&
-(aParaAttribs == rCompare.aParaAttribs ) )
+aParaAttribs.Equals( rCompare.aParaAttribs, bComparePool ) )
 {
 for (size_t i = 0, n = maCharAttribs.size(); i < n; ++i)
 {
@@ -455,6 +455,11 @@ bool EditTextObject::operator==( const EditTextObject& 
rCompare ) const
 return mpImpl->operator==(*rCompare.mpImpl);
 }
 
+bool EditTextObject::Equals( const EditTextObject& rCompare, bool bComparePool 
) const
+{
+return mpImpl->Equals(*rCompare.mpImpl, bComparePool);
+}
+
 // #i102062#
 bool EditTextObject::isWrongListEqual(const EditTextObject& rCompare) const
 {
@@ -1612,11 +1617,16 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream 
)
 
 bool EditTextObjectImpl::operator==( const EditTextObjectImpl& rCompare ) const
 {
+return Equals( rCompare, true);
+}
+
+bool EditTextObjectImpl::Equals( const EditTextObjectImpl& rCompare, bool 
bComparePool ) const
+{
 if( this ==  )
 return true;
 
 if( ( aContents.size() != rCompare.aContents.size() ) ||
-( pPool != rCompare.pPool ) ||
+( bComparePool && pPool != rCompare.pPool ) ||
 ( nMetric != rCompare.nMetric ) ||
 ( nUserType!= rCompare.nUserType ) ||
 ( nScriptType != rCompare.nScriptType ) ||
@@ -1626,7 +1636,7 @@ bool EditTextObjectImpl::operator==( const 
EditTextObjectImpl& rCompare ) const
 
 for (size_t i = 0, n = aContents.size(); i < n; ++i)
 {
-if (!(*(aContents[i]) == *(rCompare.aContents[i])))
+if (!(aContents[i]->Equals( *(rCompare.aContents[i]), bComparePool)))
 return false;
 }
 
diff --git a/editeng/source/editeng/editobj2.hxx 
b/editeng/source/editeng/editobj2.hxx
index 460a891f7632..21e91dcec7b8 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -163,7 +163,7 @@ public:
 
 const WrongList* GetWrongList() const;
 void SetWrongList( WrongList* p );
-bool operator==( const ContentInfo& rCompare ) const;
+bool Equals( const ContentInfo& rCompare, bool bComparePool ) const;
 
 // #i102062#
 bool isWrongListEqual(const ContentInfo& rCompare) const;
@@ -272,6 +272,7 @@ public:
 void StoreUnicodeStrings( bool b ) { bStoreUnicodeStrings = b; }
 
 bool operator==( const EditTextObjectImpl& rCompare ) const;
+bool Equals( const EditTextObjectImpl& rCompare, bool bComparePool ) const;
 
 // #i102062#
 bool isWrongListEqual(const EditTextObjectImpl& rCompare) const;
diff --git a/include/editeng/editobj.hxx b/include/editeng/editobj.hxx
index 68aa86c7c20e..2807aa96a962 100644
--- a/include/editeng/editobj.hxx
+++ b/include/editeng/editobj.hxx
@@ -133,6 +133,13 @@ public:
 
 bool operator==( const EditTextObject& rCompare ) const;
 
+/** Compare possibly ignoring SfxItemPool pointer.
+@param 

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

2017-07-27 Thread Jochen Nitschke
 editeng/source/items/flditem.cxx|2 +-
 sw/inc/dbfld.hxx|6 +++---
 sw/source/core/access/accpara.cxx   |4 ++--
 sw/source/core/fields/dbfld.cxx |6 +++---
 sw/source/ui/dbui/dbinsdlg.cxx  |   12 ++--
 sw/source/ui/fldui/flddinf.cxx  |4 ++--
 sw/source/ui/fldui/fldpage.cxx  |2 +-
 sw/source/ui/fldui/fldpage.hxx  |2 +-
 sw/source/ui/frmdlg/cption.cxx  |4 ++--
 sw/source/uibase/fldui/fldmgr.cxx   |   16 
 sw/source/uibase/inc/fldmgr.hxx |   14 +++---
 sw/source/uibase/inc/numfmtlb.hxx   |6 +++---
 sw/source/uibase/shells/textfld.cxx |6 +++---
 sw/source/uibase/utlui/numfmtlb.cxx |   16 
 14 files changed, 50 insertions(+), 50 deletions(-)

New commits:
commit 7f381be4d3261149a5b54048f9605fab0340c221
Author: Jochen Nitschke 
Date:   Sun Jul 23 22:05:40 2017 +0200

replace sal_uLong variables with sal_uInt32 for SvNumberFormatter IDs

Replace the stopgap type sal_uLong as SvNumberFormatter
format index uses sal_uInt32.

SwInsertDBColAutoPilot uses format indices from SvNumberFormatter and
from the property "FormatKey" which is stored as sal_Int32 but ctor
guards against negative values.

Change type of loop variable in SwCaptionDialog to avoid narrowing
in GetFormatStr/GetFormatKey.

Change-Id: I79980696c07760f7ff026bb1bacf0e069363898c
Reviewed-on: https://gerrit.libreoffice.org/40464
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 50dc38219431..7612621b6678 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -439,7 +439,7 @@ OUString SvxDateField::GetFormatted( Date const & aDate, 
SvxDateFormat eFormat,
 eFormat = SVXDATEFORMAT_STDSMALL;
 }
 
-sal_uLong nFormatKey;
+sal_uInt32 nFormatKey;
 
 switch( eFormat )
 {
diff --git a/sw/inc/dbfld.hxx b/sw/inc/dbfld.hxx
index 753d119e8aa6..62318b162b34 100644
--- a/sw/inc/dbfld.hxx
+++ b/sw/inc/dbfld.hxx
@@ -66,7 +66,7 @@ class SW_DLLPUBLIC SwDBField : public SwValueField
 virtual SwField*Copy() const override;
 
 public:
-SwDBField(SwDBFieldType*, sal_uLong nFormat = 0);
+SwDBField(SwDBFieldType*, sal_uInt32 nFormat = 0);
 virtual ~SwDBField() override;
 
 virtual SwFieldType*ChgTyp( SwFieldType* ) override;
@@ -127,7 +127,7 @@ protected:
 const SwDBData& GetDBData() const {return aDBData;}
 SwDBData&   GetDBData() {return aDBData;}
 
-SwDBNameInfField(SwFieldType* pTyp, const SwDBData& rDBData, sal_uLong 
nFormat = 0);
+SwDBNameInfField(SwFieldType* pTyp, const SwDBData& rDBData, sal_uInt32 
nFormat = 0);
 
 public:
 /// DBName
@@ -267,7 +267,7 @@ class SW_DLLPUBLIC SwDBSetNumberField : public 
SwDBNameInfField
 {
 longnNumber;
 public:
-SwDBSetNumberField(SwDBSetNumberFieldType*, const SwDBData& rDBData, 
sal_uLong nFormat = 0);
+SwDBSetNumberField(SwDBSetNumberFieldType*, const SwDBData& rDBData, 
sal_uInt32 nFormat = 0);
 
 virtual OUString Expand() const override;
 virtual SwField* Copy() const override;
diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 320ace28ff50..3631e5f62f4d 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1473,7 +1473,7 @@ OUString 
SwAccessibleParagraph::GetFieldTypeNameAtIndex(sal_Int32 nIndex)
 break;
 case SwFieldIds::JumpEdit:
 {
-const sal_uInt16 nFormat= pField->GetFormat();
+const sal_uInt32 nFormat= pField->GetFormat();
 const sal_uInt16 nSize = 
aMgr.GetFormatCount(pField->GetTypeId(), false);
 if (nFormat < nSize)
 {
@@ -1534,7 +1534,7 @@ OUString 
SwAccessibleParagraph::GetFieldTypeNameAtIndex(sal_Int32 nIndex)
 if (nWhich == SwFieldIds::DocInfo)
 {
 strTypeName = sEntry;
-sal_uInt32 nSize = 
aMgr.GetFormatCount(pField->GetTypeId(), false);
+sal_uInt16 nSize = 
aMgr.GetFormatCount(pField->GetTypeId(), false);
 const sal_uInt16 nExSub = pField->GetSubType() & 
0xff00;
 if (nSize > 0 && nExSub > 0)
 {
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index 0df616a710cc..d77b6d25927b 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -167,7 +167,7 @@ bool SwDBFieldType::PutValue( const uno::Any& rAny, 
sal_uInt16 nWhichId )
 
 // database field
 
-SwDBField::SwDBField(SwDBFieldType* pTyp, sal_uLong nFormat)
+SwDBField::SwDBField(SwDBFieldType* pTyp, 

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

2017-07-26 Thread Eike Rathke
 editeng/source/editeng/editobj.cxx  |   22 +-
 editeng/source/editeng/editobj2.hxx |   12 
 2 files changed, 33 insertions(+), 1 deletion(-)

New commits:
commit 1279043814865cd48c3b577c5e21db0b93d5c24c
Author: Eike Rathke 
Date:   Wed Jul 26 17:03:46 2017 +0200

Restore and fix and fix harder the EditTextObject::operator==()

... chaining down to EditTextObjectImpl::operator==() that compared 
unique_ptr
instead of content with ContentInfo::operator==() that needed to use
XEditAttribute::operator==() instead of comparing pointers. That resulted in
always false..

Wrong as a chain of

commit 5a7a4325eca58c253270d4e9d327042a9ee2c5f0
Date:   Tue Nov 10 14:59:05 2015 +0200

editeng: boost::ptr_vector->std::vector

and

commit 4ff5a5558472beee85eb1234dcc2aa2ed9000f6c
Date:   Tue Jan 19 15:17:30 2016 +0200

loplugin:unusedmethods

Plus XEditAttribute::operator==() was wrong since

commit 71158788efb32ffc3bac5154c38ca5d79525155c
Date:   Thu May 4 08:11:41 2006 +

INTEGRATION: CWS impressc03u3 (1.8.40); FILE MERGED
2006/04/27 12:33:10 cl 1.8.40.1: #i64360# fixed operator==

that (to fix a crash comparing items of different types) changed

-( (pItem == rCompare.pItem) || (*pItem == *rCompare.pItem));
+( (pItem == rCompare.pItem) ||
+( pItem->Which() != rCompare.pItem->Which()) ||
+(*pItem == *rCompare.pItem));

so returning true if Which-IDs differed, instead of

+((pItem == rCompare.pItem) ||
+ ((pItem->Which() == rCompare.pItem->Which()) &&
+  (*pItem == *rCompare.pItem)));

Change-Id: I8300c04001e98cb71e520bbe2c180aec0c0a
Reviewed-on: https://gerrit.libreoffice.org/40455
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 

diff --git a/editeng/source/editeng/editobj.cxx 
b/editeng/source/editeng/editobj.cxx
index 34eacc474167..3a7036b05fb8 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -225,6 +225,26 @@ void ContentInfo::Dump() const
 }
 #endif
 
+bool ContentInfo::operator==( const ContentInfo& rCompare ) const
+{
+if( (maText == rCompare.maText) &&
+(aStyle == rCompare.aStyle ) &&
+(maCharAttribs.size() == rCompare.maCharAttribs.size()) &&
+(eFamily == rCompare.eFamily ) &&
+(aParaAttribs == rCompare.aParaAttribs ) )
+{
+for (size_t i = 0, n = maCharAttribs.size(); i < n; ++i)
+{
+if (!(*(maCharAttribs[i]) == *(rCompare.maCharAttribs[i])))
+return false;
+}
+
+return true;
+}
+
+return false;
+}
+
 EditTextObject::EditTextObject( SfxItemPool* pPool ) :
 mpImpl(new EditTextObjectImpl(this, pPool))
 {
@@ -1606,7 +1626,7 @@ bool EditTextObjectImpl::operator==( const 
EditTextObjectImpl& rCompare ) const
 
 for (size_t i = 0, n = aContents.size(); i < n; ++i)
 {
-if (aContents[i] != rCompare.aContents[i])
+if (!(*(aContents[i]) == *(rCompare.aContents[i])))
 return false;
 }
 
diff --git a/editeng/source/editeng/editobj2.hxx 
b/editeng/source/editeng/editobj2.hxx
index 928f4ba12b84..460a891f7632 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -69,8 +69,19 @@ public:
 
 bool IsFeature() const;
 void SetItem(const SfxPoolItem& rNew);
+
+inline bool operator==( const XEditAttribute& rCompare ) const;
 };
 
+inline bool XEditAttribute::operator==( const XEditAttribute& rCompare ) const
+{
+return  (nStart == rCompare.nStart) &&
+(nEnd == rCompare.nEnd) &&
+((pItem == rCompare.pItem) ||
+ ((pItem->Which() == rCompare.pItem->Which()) &&
+  (*pItem == *rCompare.pItem)));
+}
+
 struct XParaPortion
 {
 longnHeight;
@@ -152,6 +163,7 @@ public:
 
 const WrongList* GetWrongList() const;
 void SetWrongList( WrongList* p );
+bool operator==( const ContentInfo& rCompare ) const;
 
 // #i102062#
 bool isWrongListEqual(const ContentInfo& rCompare) const;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-23 Thread Jochen Nitschke
 editeng/source/editeng/editdoc.hxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 741d794adc0fabbcfb9ef847ad0369d7281b964d
Author: Jochen Nitschke 
Date:   Sun Jul 23 02:04:33 2017 +0200

editeng: remove bogus copy ctor

default copy ctor and assignment is deleted because AttribsType
(vector) can't be copied

Change-Id: Ifb95298591c3f0ed5eb04a119efeb065a3eb8705
Reviewed-on: https://gerrit.libreoffice.org/40330
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 6a3a700df70e..a2a8549ec632 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -192,8 +192,6 @@ private:
 SvxFont aDefFont;  // faster than ever from the pool!
 boolbHasEmptyAttribs;
 
-CharAttribList( const CharAttribList& ) {}
-
 public:
 CharAttribList();
 ~CharAttribList();
___
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 lingucomponent/source

2017-07-22 Thread Noel Grandin
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |4 -
 editeng/source/accessibility/AccessibleParaManager.cxx  |2 
 editeng/source/editeng/editdoc.cxx  |6 -
 editeng/source/editeng/editdoc.hxx  |4 -
 editeng/source/editeng/editeng.cxx  |   12 +--
 editeng/source/editeng/editundo.cxx |4 -
 editeng/source/editeng/editview.cxx |2 
 editeng/source/editeng/eertfpar.cxx |2 
 editeng/source/editeng/eertfpar.hxx |2 
 editeng/source/editeng/impedit.cxx  |8 +-
 editeng/source/editeng/impedit.hxx  |   40 ++--
 editeng/source/editeng/impedit2.cxx |   14 ++--
 editeng/source/editeng/impedit3.cxx |8 +-
 editeng/source/editeng/impedit4.cxx |8 +-
 editeng/source/editeng/impedit5.cxx |2 
 editeng/source/items/flditem.cxx|6 -
 editeng/source/misc/svxacorr.cxx|6 -
 include/editeng/AccessibleEditableTextPara.hxx  |2 
 include/editeng/editeng.hxx |   12 +--
 include/editeng/editview.hxx|2 
 include/editeng/flditem.hxx |6 -
 include/editeng/svxacorr.hxx|2 
 lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx   |6 -
 lingucomponent/source/hyphenator/hyphen/hyphenimp.hxx   |6 -
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx |6 -
 lingucomponent/source/thesaurus/libnth/nthesimp.hxx |6 -
 26 files changed, 89 insertions(+), 89 deletions(-)

New commits:
commit c82cf38427c47f60ba6cc6a008c9f60fb488dae9
Author: Noel Grandin 
Date:   Fri Jul 21 17:06:07 2017 +0200

loplugin:constparams in editeng,lingucomponent

Change-Id: I99d9153e3fd1fead34c856ac68a120bb06a003d3
Reviewed-on: https://gerrit.libreoffice.org/40296
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx 
b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index a23dfecff852..bedc5da073ce 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -543,7 +543,7 @@ namespace accessibility
 return GetTextForwarder().HaveImageBullet( GetParagraphIndex() );
 }
 
-tools::Rectangle AccessibleEditableTextPara::LogicToPixel( const 
tools::Rectangle& rRect, const MapMode& rMapMode, SvxViewForwarder& rForwarder )
+tools::Rectangle AccessibleEditableTextPara::LogicToPixel( const 
tools::Rectangle& rRect, const MapMode& rMapMode, SvxViewForwarder const & 
rForwarder )
 {
 // convert to screen coordinates
 return tools::Rectangle( rForwarder.LogicToPixel( rRect.TopLeft(), 
rMapMode ),
@@ -848,7 +848,7 @@ namespace accessibility
 
 namespace
 {
-OUString GetFieldTypeNameFromField(EFieldInfo )
+OUString GetFieldTypeNameFromField(EFieldInfo const )
 {
 OUString strFldType;
 sal_Int32 nFieldType = -1;
diff --git a/editeng/source/accessibility/AccessibleParaManager.cxx 
b/editeng/source/accessibility/AccessibleParaManager.cxx
index 6acfee2abd8c..db535ac7cd40 100644
--- a/editeng/source/accessibility/AccessibleParaManager.cxx
+++ b/editeng/source/accessibility/AccessibleParaManager.cxx
@@ -295,7 +295,7 @@ namespace accessibility
 mnEventId( nEventId ),
 mrNewValue( rNewValue ),
 mrOldValue( rOldValue ) {}
-void operator()( ::accessibility::AccessibleEditableTextPara& rPara )
+void operator()( ::accessibility::AccessibleEditableTextPara const & 
rPara )
 {
 rPara.FireEvent( mnEventId, mrNewValue, mrOldValue );
 }
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 6d655349c392..c324c8c35708 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1166,14 +1166,14 @@ void EditPaM::SetNode(ContentNode* p)
 pNode = p;
 }
 
-bool EditPaM::DbgIsBuggy( EditDoc& rDoc )
+bool EditPaM::DbgIsBuggy( EditDoc const & rDoc )
 {
 return !pNode ||
rDoc.GetPos( pNode ) >= rDoc.Count() ||
nIndex > pNode->Len();
 }
 
-bool EditSelection::DbgIsBuggy( EditDoc& rDoc )
+bool EditSelection::DbgIsBuggy( EditDoc const & rDoc )
 {
 return aStartPaM.DbgIsBuggy( rDoc ) || aEndPaM.DbgIsBuggy( rDoc );
 }
@@ -2003,7 +2003,7 @@ public:
 
 struct ClearSpellErrorsHandler
 {
-void operator() (std::unique_ptr& rNode)
+void operator() (std::unique_ptr const & rNode)
  

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

2017-07-07 Thread Varun Dhall
 editeng/source/xml/xmltxtimp.cxx |   23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

New commits:
commit 9479171a09ba4c73afa8b40a5c2590df3b6d5415
Author: Varun Dhall 
Date:   Thu Jul 6 20:49:03 2017 +0530

EditEngine: Added para break/connect during ODF paste

Change-Id: I6ff7fb81425b7788da27ca297d5f08b80b96f795
Reviewed-on: https://gerrit.libreoffice.org/39662
Reviewed-by: Michael Stahl 
Tested-by: Jenkins 

diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx
index fd757e86493c..54fe45c5ec97 100644
--- a/editeng/source/xml/xmltxtimp.cxx
+++ b/editeng/source/xml/xmltxtimp.cxx
@@ -37,10 +37,12 @@
 #include 
 #include "editsource.hxx"
 #include "editxml.hxx"
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 using namespace com::sun::star;
 using namespace com::sun::star::document;
@@ -148,9 +150,17 @@ void SvxReadXML( EditEngine& rEditEngine, SvStream& 
rStream, const ESelection& r
 };
 static SvxItemPropertySet aSvxXMLTextImportComponentPropertySet( 
SvxXMLTextImportComponentPropertyMap, EditEngine::GetGlobalItemPool() );
 
+ assert(!rSel.HasRange());
+//get the initial para count before paste
+sal_uInt32 initialParaCount = rEditEngine.GetEditDoc().Count();
+//insert para breaks before inserting the copied text
+rEditEngine.InsertParaBreak( rEditEngine.CreateSelection( rSel ).Max() );
+rEditEngine.InsertParaBreak( rEditEngine.CreateSelection( rSel ).Max() );
+
+ESelection aSel(rSel.nStartPara+1, 0, rSel.nEndPara+1, 0);
 uno::Reference xParent;
 SvxUnoText* pUnoText = new SvxUnoText( , 
, xParent );
-pUnoText->SetSelection( rSel );
+pUnoText->SetSelection( aSel );
 uno::Reference xText( pUnoText );
 
 try
@@ -206,6 +216,17 @@ void SvxReadXML( EditEngine& rEditEngine, SvStream& 
rStream, const ESelection& r
 xParser->parseStream( aParserInput );
 }
 while(false);
+
+//remove the extra para breaks
+EditDoc& pDoc = rEditEngine.GetEditDoc();
+rEditEngine.ParaAttribsToCharAttribs( pDoc.GetObject( rSel.nEndPara ) 
);
+rEditEngine.ConnectParagraphs( pDoc.GetObject( rSel.nEndPara ),
+pDoc.GetObject( rSel.nEndPara + 1 ), true );
+rEditEngine.ParaAttribsToCharAttribs( pDoc.GetObject( pDoc.Count() - 
initialParaCount + aSel.nEndPara - 2 ) );
+rEditEngine.ConnectParagraphs( pDoc.GetObject( pDoc.Count() - 
initialParaCount + aSel.nEndPara - 2 ),
+pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara -1 
), true );
+rEditEngine.ConnectParagraphs( pDoc.GetObject( pDoc.Count() - 
initialParaCount + aSel.nEndPara - 2 ),
+pDoc.GetObject( pDoc.Count() - initialParaCount + aSel.nEndPara -1 
), true );
 }
 catch( const uno::Exception& )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-06 Thread Varun Dhall
 editeng/source/xml/xmltxtexp.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a62c9ecfc27a375cddb2beefba4b5af9bd4f7727
Author: Varun Dhall 
Date:   Thu Jul 6 20:23:10 2017 +0530

EditEngine: Added warning for xml export exception

Change-Id: I8709e6656ff753cdd833ee3622a922126161fc2d
Reviewed-on: https://gerrit.libreoffice.org/39660
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx
index 42f01b7514da..9b9a60d77079 100644
--- a/editeng/source/xml/xmltxtexp.cxx
+++ b/editeng/source/xml/xmltxtexp.cxx
@@ -368,9 +368,9 @@ void SvxWriteXML( EditEngine& rEditEngine, SvStream& 
rStream, const ESelection&
 }
 while( false );
 }
-catch( const uno::Exception& )
+catch( const uno::Exception& e )
 {
-OSL_FAIL("exception during xml export");
+SAL_WARN("editeng", "exception during xml export: " << e.Message);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-06 Thread dcvb
 editeng/source/accessibility/AccessibleStaticTextBase.cxx |   15 --
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 1dea7fb6be5f1ba64f680e3ad885afa1c99030bf
Author: dcvb 
Date:   Thu Jul 6 10:04:39 2017 +0200

make binary functor unary, related tdf#108782

PropertyValueEqualFunctor was only used as unary functor with
std::bind2nd

Change-Id: Ic91e49de360e04ec5250f2d63f49163a8e7c7b92
Reviewed-on: https://gerrit.libreoffice.org/39624
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx 
b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
index e607d30a6a4f..2fca44ce48c3 100644
--- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
@@ -64,14 +64,17 @@ namespace accessibility
 {
 typedef std::vector< beans::PropertyValue > PropertyValueVector;
 
-class PropertyValueEqualFunctor : public std::binary_function< 
beans::PropertyValue, beans::PropertyValue, bool >
+class PropertyValueEqualFunctor
 {
+const beans::PropertyValue& m_rPValue;
+
 public:
-PropertyValueEqualFunctor()
+explicit PropertyValueEqualFunctor(const beans::PropertyValue& rPValue)
+: m_rPValue(rPValue)
 {}
-bool operator() ( const beans::PropertyValue& lhs, const 
beans::PropertyValue& rhs ) const
+bool operator() ( const beans::PropertyValue& rhs ) const
 {
-return ( lhs.Name == rhs.Name && lhs.Value == rhs.Value );
+return ( m_rPValue.Name == rhs.Name && m_rPValue.Value == 
rhs.Value );
 }
 };
 sal_Unicode const cNewLine(0x0a);
@@ -915,7 +918,7 @@ namespace accessibility
 {
 const beans::PropertyValue* pItr = aSeq.getConstArray();
 const beans::PropertyValue* pEnd  = pItr + aSeq.getLength();
-const beans::PropertyValue* pFind = std::find_if( pItr, pEnd, 
std::bind2nd( PropertyValueEqualFunctor(), std::cref( *aItr ) ) );
+const beans::PropertyValue* pFind = std::find_if( pItr, pEnd, 
PropertyValueEqualFunctor(*aItr) );
 if ( pFind != pEnd )
 {
 aIntersectionVec.push_back( *pFind );
@@ -953,7 +956,7 @@ namespace accessibility
 {
 const beans::PropertyValue* pItr = 
aIntersectionSeq.getConstArray();
 const beans::PropertyValue* pEnd  = pItr + 
aIntersectionSeq.getLength();
-bool bNone = std::none_of( pItr, pEnd, std::bind2nd( 
PropertyValueEqualFunctor(), std::cref( pDefAttr[i] ) ) );
+bool bNone = std::none_of( pItr, pEnd, PropertyValueEqualFunctor( 
pDefAttr[i] ) );
 if ( bNone && pDefAttr[i].Handle != 0)
 {
 aDiffVec.push_back( pDefAttr[i] );
___
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 sc/source sd/source sw/source

2017-07-06 Thread Caolán McNamara
 editeng/source/editeng/eerdll.cxx|2 +-
 editeng/source/misc/forbiddencharacterstable.cxx |9 +++--
 include/editeng/forbiddencharacterstable.hxx |4 +++-
 sc/source/ui/docshell/docsh2.cxx |2 +-
 sc/source/ui/unoobj/forbiuno.cxx |2 +-
 sd/source/core/drawdoc.cxx   |2 +-
 sw/source/core/doc/DocumentSettingManager.cxx|4 ++--
 7 files changed, 16 insertions(+), 9 deletions(-)

New commits:
commit 6549993b17feb1423c76b5237f086e6f35346a2c
Author: Caolán McNamara 
Date:   Wed Jul 5 15:40:00 2017 +0100

ensure safe GlobalEditData release of xForbiddenCharsTable

ensure that when the editeng GlobalEditData dtor is called
that the vtable of the xForbiddenCharsTable shared_ptr will
point to functions that are callable from editeng.

otherwise a shared_ptr created in the sw uwriter cppunit test,
but now belonging to GlobalEditData, will have deleter entries
pointing to functions in uwriter that have been unloaded and
are not available anymore

Change-Id: I375a84156c0b1a0f8b24194fc07f0c512f556dbc
Reviewed-on: https://gerrit.libreoffice.org/39605
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/editeng/eerdll.cxx 
b/editeng/source/editeng/eerdll.cxx
index 04ae2c953bf5..2027cab81a50 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -179,7 +179,7 @@ std::shared_ptr GlobalEditData::GetDefItems()
 std::shared_ptr const & 
GlobalEditData::GetForbiddenCharsTable()
 {
 if (!xForbiddenCharsTable)
-xForbiddenCharsTable.reset(new 
SvxForbiddenCharactersTable(::comphelper::getProcessComponentContext()));
+xForbiddenCharsTable = 
SvxForbiddenCharactersTable::makeForbiddenCharactersTable(::comphelper::getProcessComponentContext());
 return xForbiddenCharsTable;
 }
 
diff --git a/editeng/source/misc/forbiddencharacterstable.cxx 
b/editeng/source/misc/forbiddencharacterstable.cxx
index f52c90eb2b86..563461b75c24 100644
--- a/editeng/source/misc/forbiddencharacterstable.cxx
+++ b/editeng/source/misc/forbiddencharacterstable.cxx
@@ -25,9 +25,14 @@
 
 #include 
 
-SvxForbiddenCharactersTable::SvxForbiddenCharactersTable( const 
css::uno::Reference< css::uno::XComponentContext >& rxContext)
+SvxForbiddenCharactersTable::SvxForbiddenCharactersTable(const 
css::uno::Reference< css::uno::XComponentContext >& rxContext)
+: m_xContext(rxContext)
 {
-m_xContext = rxContext;
+}
+
+std::shared_ptr 
SvxForbiddenCharactersTable::makeForbiddenCharactersTable(const 
css::uno::Reference< css::uno::XComponentContext>& rxContext)
+{
+return std::shared_ptr(new 
SvxForbiddenCharactersTable(rxContext));
 }
 
 const css::i18n::ForbiddenCharacters* 
SvxForbiddenCharactersTable::GetForbiddenCharacters( LanguageType nLanguage, 
bool bGetDefault )
diff --git a/include/editeng/forbiddencharacterstable.hxx 
b/include/editeng/forbiddencharacterstable.hxx
index 6923f550070d..156bd85bfacd 100644
--- a/include/editeng/forbiddencharacterstable.hxx
+++ b/include/editeng/forbiddencharacterstable.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com {
 namespace sun {
@@ -41,9 +42,10 @@ public:
 private:
 MapmaMap;
 css::uno::Reference< css::uno::XComponentContext > m_xContext;
+SvxForbiddenCharactersTable(const css::uno::Reference< 
css::uno::XComponentContext >& rxContext);
 
 public:
-SvxForbiddenCharactersTable( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext);
+static std::shared_ptr 
makeForbiddenCharactersTable(const 
css::uno::Reference& rxContext);
 
 Map&GetMap() { return maMap; }
 const css::i18n::ForbiddenCharacters* GetForbiddenCharacters( LanguageType 
nLanguage, bool bGetDefault );
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 4055666e2201..2ae71b4f101d 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -128,7 +128,7 @@ void ScDocShell::InitItems()
 if (aLocales.getLength())
 {
 std::shared_ptr xForbiddenTable(
-new 
SvxForbiddenCharactersTable(comphelper::getProcessComponentContext()));
+
SvxForbiddenCharactersTable::makeForbiddenCharactersTable(comphelper::getProcessComponentContext()));
 
 const lang::Locale* pLocales = aLocales.getConstArray();
 for (sal_Int32 i = 0; i < aLocales.getLength(); i++)
diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx
index 732487b0defc..d177ac1be7e3 100644
--- a/sc/source/ui/unoobj/forbiuno.cxx
+++ b/sc/source/ui/unoobj/forbiuno.cxx
@@ -35,7 +35,7 @@ static std::shared_ptr 

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

2017-07-06 Thread Caolán McNamara
 editeng/source/editeng/editeng.cxx|2 +-
 editeng/source/editeng/eerdll.cxx |8 +++-
 editeng/source/editeng/eerdll2.hxx|6 +++---
 editeng/source/editeng/impedit.hxx|6 +++---
 editeng/source/editeng/impedit2.cxx   |8 
 editeng/source/outliner/outlin2.cxx   |4 ++--
 editeng/source/uno/UnoForbiddenCharsTable.cxx |   14 +++---
 include/editeng/UnoForbiddenCharsTable.hxx|7 +++
 include/editeng/editeng.hxx   |2 +-
 include/editeng/forbiddencharacterstable.hxx  |2 +-
 include/editeng/outliner.hxx  |2 +-
 include/svx/svdmodel.hxx  |6 +++---
 sc/inc/document.hxx   |6 +++---
 sc/source/core/data/documen9.cxx  |4 ++--
 sc/source/ui/docshell/docsh2.cxx  |8 
 sc/source/ui/unoobj/forbiuno.cxx  |9 -
 sd/source/core/drawdoc.cxx|2 +-
 svx/source/svdraw/svdmodel.cxx|4 ++--
 sw/inc/IDocumentSettingAccess.hxx |6 +++---
 sw/source/core/doc/DocumentSettingManager.cxx |   20 
 sw/source/core/inc/DocumentSettingManager.hxx |6 +++---
 sw/source/uibase/uno/unotxdoc.cxx |2 +-
 22 files changed, 63 insertions(+), 71 deletions(-)

New commits:
commit 12a3f5cefeaeb842507dd8038597fb77ca929dd1
Author: Caolán McNamara 
Date:   Tue Jul 4 15:05:34 2017 +0100

rework as a shared_ptr

mostly to try and track down a crash on exit of sw uwriter under
windows

Change-Id: Id67e93863056da319dd8225038d60a7f5783b103
Reviewed-on: https://gerrit.libreoffice.org/39604
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 7b3040092e90..e5727ee0ba9b 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2174,7 +2174,7 @@ void EditEngine::SetAllMisspellRanges( const 
std::vectorSetAllMisspellRanges(rRanges);
 }
 
-void EditEngine::SetForbiddenCharsTable( const 
rtl::Reference& xForbiddenChars )
+void EditEngine::SetForbiddenCharsTable(const 
std::shared_ptr& xForbiddenChars)
 {
 ImpEditEngine::SetForbiddenCharsTable( xForbiddenChars );
 }
diff --git a/editeng/source/editeng/eerdll.cxx 
b/editeng/source/editeng/eerdll.cxx
index 8176096afafc..04ae2c953bf5 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -176,12 +176,10 @@ std::shared_ptr GlobalEditData::GetDefItems()
 return xDefItems;
 }
 
-rtl::Reference const & 
GlobalEditData::GetForbiddenCharsTable()
+std::shared_ptr const & 
GlobalEditData::GetForbiddenCharsTable()
 {
-if ( !xForbiddenCharsTable.is() )
-{
-xForbiddenCharsTable = new SvxForbiddenCharactersTable( 
::comphelper::getProcessComponentContext() );
-}
+if (!xForbiddenCharsTable)
+xForbiddenCharsTable.reset(new 
SvxForbiddenCharactersTable(::comphelper::getProcessComponentContext()));
 return xForbiddenCharsTable;
 }
 
diff --git a/editeng/source/editeng/eerdll2.hxx 
b/editeng/source/editeng/eerdll2.hxx
index 6ef3c20d1d92..b8ff6773e716 100644
--- a/editeng/source/editeng/eerdll2.hxx
+++ b/editeng/source/editeng/eerdll2.hxx
@@ -55,13 +55,13 @@ class GlobalEditData
 private:
 css::uno::Reference< css::linguistic2::XLanguageGuessing >  
xLanguageGuesser;
 std::weak_ptr m_xDefItems;
-rtl::Reference xForbiddenCharsTable;
+std::shared_ptr xForbiddenCharsTable;
 
 public:
 std::shared_ptr GetDefItems();
 
-rtl::Reference const & 
GetForbiddenCharsTable();
-voidSetForbiddenCharsTable( 
rtl::Reference const & xForbiddenChars ) { 
xForbiddenCharsTable = xForbiddenChars; }
+std::shared_ptr const & 
GetForbiddenCharsTable();
+void
SetForbiddenCharsTable(std::shared_ptr const & 
xForbiddenChars ) { xForbiddenCharsTable = xForbiddenChars; }
 css::uno::Reference< css::linguistic2::XLanguageGuessing > const & 
GetLanguageGuesser();
 };
 
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 303920f6a3b0..cd78e2a916ce 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -498,7 +498,7 @@ private:
 Link   maBeginDropHdl;
 Link   maEndDropHdl;
 
-rtl::Reference xForbiddenCharsTable;
+std::shared_ptr xForbiddenCharsTable;
 
 boolbKernAsianPunctuation:1;
 boolbAddExtLeading:1;
@@ -1014,8 +1014,8 @@ public:
 voidSetAddExtLeading( bool b );
 boolIsAddExtLeading() const { return bAddExtLeading; }
 
-rtl::Reference GetForbiddenCharsTable() const;
-static 

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

2017-07-05 Thread Caolán McNamara
 editeng/source/editeng/editdoc.cxx |5 -
 editeng/source/editeng/editdoc.hxx |   13 +-
 editeng/source/editeng/eerdll.cxx  |  166 ++---
 editeng/source/editeng/eerdll2.hxx |   18 ++--
 include/svl/itempool.hxx   |3 
 svl/source/items/itempool.cxx  |5 -
 6 files changed, 110 insertions(+), 100 deletions(-)

New commits:
commit 9eed346b0b745f0598eefc572c789d58353b5e31
Author: Caolán McNamara 
Date:   Fri Jun 16 14:13:33 2017 +0100

crash on exit of cppunit tests

rework EditEngineItemPools own their default items
and use a global weak_ptr to share them between instances

Change-Id: Ifda3619a175eba3fcad81918c71b16a4d6dd663a
Reviewed-on: https://gerrit.libreoffice.org/38885
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index cdd538a39f23..911073fa4eb6 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -3075,12 +3075,13 @@ EditEngineItemPool::EditEngineItemPool( bool 
bPersistenRefCounts )
 SetVersionMap( 5, 3994, 4037, aV5Map );
 SetVersionMap( 6, 3994, 4038, aV6Map );
 
-std::vector* ppDefItems = 
EditDLL::Get().GetGlobalData()->GetDefItems();
-SetDefaults( ppDefItems );
+m_xDefItems = EditDLL::Get().GetGlobalData()->GetDefItems();
+SetDefaults(m_xDefItems->getDefaults());
 }
 
 EditEngineItemPool::~EditEngineItemPool()
 {
+ClearDefaults();
 }
 
 SvStream& EditEngineItemPool::Store( SvStream& rStream ) const
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 0984a6ffe9fa..5f490173a0e8 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -24,6 +24,7 @@
 
 #include "editattr.hxx"
 #include "edtspell.hxx"
+#include "eerdll2.hxx"
 #include 
 #include 
 #include 
@@ -832,18 +833,16 @@ inline EditCharAttrib* 
GetAttrib(CharAttribList::AttribsType& rAttribs, sal_Int3
 
 void CheckOrderedList(const CharAttribList::AttribsType& rAttribs, bool 
bStart);
 
-
-// class EditEngineItemPool
-
 class EditEngineItemPool : public SfxItemPool
 {
+private:
+std::shared_ptr m_xDefItems;
 public:
-EditEngineItemPool( bool bPersistenRefCounts );
+EditEngineItemPool(bool bPersistenRefCounts);
 protected:
-virtual ~EditEngineItemPool() override;
+virtual ~EditEngineItemPool() override;
 public:
-
-virtual SvStream&   Store( SvStream& rStream ) const override;
+virtual SvStream&   Store(SvStream& rStream) const override;
 };
 
 #endif // INCLUDED_EDITENG_SOURCE_EDITENG_EDITDOC_HXX
diff --git a/editeng/source/editeng/eerdll.cxx 
b/editeng/source/editeng/eerdll.cxx
index 1cb7387c563f..8176096afafc 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+
 #include 
 
 #include 
@@ -84,96 +85,95 @@ EditDLL& EditDLL::Get()
 return theEditDLL::get();
 }
 
-GlobalEditData::GlobalEditData() :
-ppDefItems(nullptr)
-{ }
+DefItems::DefItems()
+{
+ppDefItems = new std::vector(EDITITEMCOUNT);
+std::vector& rDefItems = *ppDefItems;
+
+// Paragraph attributes:
+SvxNumRule aDefaultNumRule( SvxNumRuleFlags::NONE, 0, false );
+
+rDefItems[0]  = new SvxFrameDirectionItem( 
SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR );
+rDefItems[1]  = new SvXMLAttrContainerItem( EE_PARA_XMLATTRIBS );
+rDefItems[2]  = new SvxHangingPunctuationItem(false, 
EE_PARA_HANGINGPUNCTUATION);
+rDefItems[3]  = new SvxForbiddenRuleItem(true, EE_PARA_FORBIDDENRULES);
+rDefItems[4]  = new SvxScriptSpaceItem( true, EE_PARA_ASIANCJKSPACING );
+rDefItems[5]  = new SvxNumBulletItem( aDefaultNumRule, EE_PARA_NUMBULLET );
+rDefItems[6]  = new SfxBoolItem( EE_PARA_HYPHENATE, false );
+rDefItems[7]  = new SfxBoolItem( EE_PARA_BULLETSTATE, true );
+rDefItems[8]  = new SvxLRSpaceItem( EE_PARA_OUTLLRSPACE );
+rDefItems[9]  = new SfxInt16Item( EE_PARA_OUTLLEVEL, -1 );
+rDefItems[10] = new SvxBulletItem( EE_PARA_BULLET );
+rDefItems[11] = new SvxLRSpaceItem( EE_PARA_LRSPACE );
+rDefItems[12] = new SvxULSpaceItem( EE_PARA_ULSPACE );
+rDefItems[13] = new SvxLineSpacingItem( 0, EE_PARA_SBL );
+rDefItems[14] = new SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST );
+rDefItems[15] = new SvxTabStopItem( 0, 0, SvxTabAdjust::Left, EE_PARA_TABS 
);
+rDefItems[16] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, 
EE_PARA_JUST_METHOD );
+rDefItems[17] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, 
EE_PARA_VER_JUST );
+
+// Character attributes:
+rDefItems[18] = new SvxColorItem( Color( COL_AUTO ), EE_CHAR_COLOR );
+rDefItems[19] = new SvxFontItem( EE_CHAR_FONTINFO );
+rDefItems[20] = new 

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

2017-07-01 Thread Aron Budea
 editeng/source/misc/svxacorr.cxx |2 +-
 include/editeng/svxacorr.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 51f616ddd7a2e3310e1b30dbd73d90e5138980ea
Author: Aron Budea 
Date:   Fri Jun 30 23:57:35 2017 +0200

tdf#108622: use correct type for last check timestamp during autocorrect

It's only supposed to check the files once every 2-mins, with
mismatching type that happens each time.

Change-Id: Ie9243cf928d952e28989dd981508de86cb7dbddb
Reviewed-on: https://gerrit.libreoffice.org/39428
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index b5dd3a1233cd..3c832486a04e 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1571,7 +1571,7 @@ bool SvxAutoCorrect::CreateLanguageFile( const 
LanguageTag& rLanguageTag, bool b
 
 tools::Time nMinTime( 0, 2 ), nAktTime( tools::Time::SYSTEM ), 
nLastCheckTime( tools::Time::EMPTY );
 
-std::map::iterator nFndPos = 
aLastFileTable.find(rLanguageTag);
+auto nFndPos = aLastFileTable.find(rLanguageTag);
 if(nFndPos != aLastFileTable.end() &&
(nLastCheckTime.SetTime(nFndPos->second), nLastCheckTime < nAktTime) &&
nAktTime - nLastCheckTime < nMinTime)
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 10df11213dd3..1cc14c0214ae 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -233,7 +233,7 @@ class EDITENG_DLLPUBLIC SvxAutoCorrect
 
 // all languages in a table
 std::map 
m_aLangTable;
-std::map aLastFileTable;
+std::map aLastFileTable;
 std::unique_ptr pCharClass;
 
 bool bRunNext;
___
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

2017-06-30 Thread Varun Dhall
 editeng/source/uno/unotext.cxx  |   19 +++--
 editeng/source/uno/unotext2.cxx |  149 ++--
 include/editeng/unotext.hxx |   45 ++--
 3 files changed, 118 insertions(+), 95 deletions(-)

New commits:
commit 3c1fc723ff622d8a541fa26a3397ca4258332e4a
Author: Varun Dhall 
Date:   Thu Jun 22 11:24:10 2017 +0530

EditEngine: Changing export selection for copy/paste

Change-Id: I6f52f30eff76de5f0d641271ce3ea36ced572cc4
Reviewed-on: https://gerrit.libreoffice.org/39083
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 058e56ad7d9f..dcfdd72eace9 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1955,13 +1955,18 @@ void SAL_CALL SvxUnoTextBase::setString( const 
OUString& aString )
 uno::Reference< container::XEnumeration > SAL_CALL 
SvxUnoTextBase::createEnumeration()
 {
 SolarMutexGuard aGuard;
-
-ESelection aSelection;
-::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
-SetSelection( aSelection );
-
-uno::Reference< container::XEnumeration > xEnum( 
static_cast(new SvxUnoTextContentEnumeration( *this 
)) );
-return xEnum;
+if( maSelection.IsEqual(ESelection(0,0,0,0)) || 
maSelection.IsEqual(ESelection(EE_PARA_MAX_COUNT,0,0,0)) )
+{
+ESelection aSelection;
+::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
+uno::Reference< container::XEnumeration > xEnum( 
static_cast( new SvxUnoTextContentEnumeration( *this, 
aSelection ) ) );
+return xEnum;
+}
+else
+{
+uno::Reference< container::XEnumeration > xEnum( 
static_cast( new SvxUnoTextContentEnumeration( *this, 
maSelection ) ) );
+return xEnum;
+}
 }
 
 // XElementAccess ( container::XEnumerationAccess )
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index 5f012775bfde..6f16b855e751 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -39,13 +39,48 @@ using namespace ::com::sun::star;
 // SvxUnoTextContentEnumeration
 
 
-SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const 
SvxUnoTextBase& _rText ) throw()
-: mrText( _rText )
+SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const 
SvxUnoTextBase& _rText, const ESelection& rSel ) throw()
+: mrText( _rText ),
+  maSelection( rSel )
 {
 mxParentText = const_cast(&_rText);
 if( mrText.GetEditSource() )
 mpEditSource.reset( mrText.GetEditSource()->Clone() );
 mnNextParagraph = 0;
+for( sal_Int32 currentPara = 0; currentPara < 
mrText.GetEditSource()->GetTextForwarder()->GetParagraphCount(); currentPara++ )
+{
+if( currentPara>=maSelection.nStartPara && 
currentPara<=maSelection.nEndPara )
+{
+const SvxUnoTextRangeBaseList& rRanges( mpEditSource->getRanges() 
);
+SvxUnoTextContent* pContent = nullptr;
+sal_Int32 nStartPos = 0;
+sal_Int32 nEndPos = 
mrText.GetEditSource()->GetTextForwarder()->GetTextLen( currentPara );
+if( currentPara == maSelection.nStartPara )
+nStartPos = nStartPos>maSelection.nStartPos ? nStartPos : 
maSelection.nStartPos;
+if( currentPara == maSelection.nEndPara )
+nEndPos = nEndPos( ( *aIter ) );
+if( pIterContent && (pIterContent->mnParagraph == currentPara) 
)
+{
+ESelection aIterSel = pIterContent->GetSelection();
+if( aIterSel.IsEqual( aCurrentParaSel ) )
+{
+pContent = pIterContent;
+maContents.push_back( pContent );
+}
+}
+}
+if( pContent == nullptr )
+{
+pContent = new SvxUnoTextContent( mrText, currentPara );
+pContent->SetSelection( aCurrentParaSel );
+maContents.push_back( pContent );
+}
+}
+}
 }
 
 SvxUnoTextContentEnumeration::~SvxUnoTextContentEnumeration() throw()
@@ -56,8 +91,8 @@ SvxUnoTextContentEnumeration::~SvxUnoTextContentEnumeration() 
throw()
 sal_Bool SAL_CALL SvxUnoTextContentEnumeration::hasMoreElements()
 {
 SolarMutexGuard aGuard;
-if( mpEditSource && mpEditSource->GetTextForwarder() )
-return mnNextParagraph < 
mpEditSource->GetTextForwarder()->GetParagraphCount();
+if( mpEditSource && !maContents.empty() )
+return (unsigned)mnNextParagraph < maContents.size();
 else
 return false;
 }
@@ -69,23 +104,8 @@ uno::Any SvxUnoTextContentEnumeration::nextElement()
 if(!hasMoreElements())
 throw container::NoSuchElementException();
 
-

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

2017-06-28 Thread Stephan Bergmann
 editeng/source/editeng/impedit.hxx  |2 +-
 editeng/source/editeng/impedit4.cxx |6 ++
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit d7436b75a915f9f018d3722f62301d1f42dc3bcc
Author: Stephan Bergmann 
Date:   Wed Jun 28 13:58:54 2017 +0200

In ImpEditEngine::ReplaceTextOnly, nLen has always been ignored

...ever since the code's introduction with
afb2f41ca982b7e0cbc8a5b4952ea3edfbb2a883 "cws sw33bf08: #i113584#, #i113587#
transliteration fixed"

Change-Id: I9881ed1585857a95d2d8dd83ebf5d68d989e2c1d

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index ce505dcb8ef9..fb26e2f5f7ac 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -999,7 +999,7 @@ public:
 voidSetAutoCompleteText(const OUString& rStr, bool 
bUpdateTipWindow);
 
 EditSelection   TransliterateText( const EditSelection& rSelection, 
TransliterationFlags nTransliterationMode );
-short   ReplaceTextOnly( ContentNode* pNode, sal_Int32 
nCurrentStart, sal_Int32 nLen, const OUString& rText, const css::uno::Sequence< 
sal_Int32 >& rOffsets );
+short   ReplaceTextOnly( ContentNode* pNode, sal_Int32 
nCurrentStart, const OUString& rText, const css::uno::Sequence< sal_Int32 >& 
rOffsets );
 
 voidSetAsianCompressionMode( CharCompressType n );
 CharCompressTypeGetAsianCompressionMode() const { return 
nAsianCompressionMode; }
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 4918ee36a370..15de52f9517b 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2985,7 +2985,7 @@ EditSelection ImpEditEngine::TransliterateText( const 
EditSelection& rSelection,
 // Change text without losing the attributes
 const sal_Int32 nDiffs =
 ReplaceTextOnly( rData.aSelection.Min().GetNode(),
-rData.nStart, rData.nLen, rData.aNewText, 
rData.aOffsets );
+rData.nStart, rData.aNewText, rData.aOffsets );
 
 // adjust selection in end node to possibly changed size
 if (aSel.Max().GetNode() == rData.aSelection.Max().GetNode())
@@ -3020,12 +3020,10 @@ EditSelection ImpEditEngine::TransliterateText( const 
EditSelection& rSelection,
 
 short ImpEditEngine::ReplaceTextOnly(
 ContentNode* pNode,
-sal_Int32 nCurrentStart, sal_Int32 nLen,
+sal_Int32 nCurrentStart,
 const OUString& rNewText,
 const uno::Sequence< sal_Int32 >& rOffsets )
 {
-(void)  nLen;
-
 // Change text without losing the attributes
 sal_Int32 nCharsAfterTransliteration = rOffsets.getLength();
 const sal_Int32* pOffsets = rOffsets.getConstArray();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-06-28 Thread Stephan Bergmann
 editeng/source/items/frmitems.cxx |4 ++--
 editeng/source/items/paraitem.cxx |2 +-
 editeng/source/items/textitem.cxx |6 +++---
 editeng/source/rtf/rtfitem.cxx|6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit d358fc1a455de153a197081948a271f612a495c3
Author: Stephan Bergmann 
Date:   Wed Jun 28 10:24:53 2017 +0200

-Werror=ignored-qualifiers (GCC 8)

Change-Id: I2a43ce3ca6af87ac53dd534c0c37150a000e7013

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index b98cd2507942..28c56dcd3bf6 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1562,7 +1562,7 @@ sal_uInt16 SvxShadowItem::GetEnumValue() const
 
 void SvxShadowItem::SetEnumValue( sal_uInt16 nVal )
 {
-SetLocation( (const SvxShadowLocation)nVal );
+SetLocation( (SvxShadowLocation)nVal );
 }
 
 void SvxShadowItem::dumpAsXml(xmlTextWriterPtr pWriter) const
@@ -3021,7 +3021,7 @@ SfxPoolItem* SvxFormatBreakItem::Create( SvStream& rStrm, 
sal_uInt16 nVersion )
 rStrm.ReadSChar( eBreak );
 if( FMTBREAK_NOAUTO > nVersion )
 rStrm.ReadSChar( bDummy );
-return new SvxFormatBreakItem( (const SvxBreak)eBreak, Which() );
+return new SvxFormatBreakItem( (SvxBreak)eBreak, Which() );
 }
 
 
diff --git a/editeng/source/items/paraitem.cxx 
b/editeng/source/items/paraitem.cxx
index 71db51db0178..164b00a2d92c 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -444,7 +444,7 @@ sal_uInt16 SvxAdjustItem::GetEnumValue() const
 
 void SvxAdjustItem::SetEnumValue( sal_uInt16 nVal )
 {
-SetAdjust( (const SvxAdjust)nVal );
+SetAdjust( (SvxAdjust)nVal );
 }
 
 
diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index bb6b66e2ad31..690b54a8d55e 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -468,7 +468,7 @@ SfxPoolItem* SvxPostureItem::Create(SvStream& rStrm, 
sal_uInt16) const
 {
 sal_uInt8 nPosture;
 rStrm.ReadUChar( nPosture );
-return new SvxPostureItem( (const FontItalic)nPosture, Which() );
+return new SvxPostureItem( (FontItalic)nPosture, Which() );
 }
 
 
@@ -2099,7 +2099,7 @@ SfxPoolItem* SvxCaseMapItem::Create(SvStream& rStrm, 
sal_uInt16) const
 {
 sal_uInt8 cMap;
 rStrm.ReadUChar( cMap );
-return new SvxCaseMapItem( (const SvxCaseMap)cMap, Which() );
+return new SvxCaseMapItem( (SvxCaseMap)cMap, Which() );
 }
 
 
@@ -2275,7 +2275,7 @@ sal_uInt16 SvxEscapementItem::GetEnumValue() const
 
 void SvxEscapementItem::SetEnumValue( sal_uInt16 nVal )
 {
-SetEscapement( (const SvxEscapement)nVal );
+SetEscapement( (SvxEscapement)nVal );
 }
 
 bool SvxEscapementItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index 71a831752a24..4ce7e8cfb5c0 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -441,7 +441,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet )
 if( nTokenValue > 200 ) // Data value for PropLnSp
 nTokenValue = 200;  // is one BYTE !!!
 
-aLSpace.SetPropLineSpace( (const sal_uInt8)nTokenValue );
+aLSpace.SetPropLineSpace( (sal_uInt8)nTokenValue );
 aLSpace.SetLineSpaceRule( SvxLineSpaceRule::Auto );
 
 pSet->Put( aLSpace );
@@ -479,7 +479,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet )
 CalcValue();
 
 if (eLnSpc != SvxLineSpaceRule::Auto)
-aLSpace.SetLineHeight( (const sal_uInt16)nTokenValue );
+aLSpace.SetLineHeight( (sal_uInt16)nTokenValue );
 
 aLSpace.SetLineSpaceRule(eLnSpc);
 pSet->Put(aLSpace);
@@ -660,7 +660,7 @@ SET_FONTALIGNMENT:
 //   if( IsCalcValue() )
 //   CalcValue();
 SvxFontHeightItem aTmpItem(
-(const sal_uInt16)nTokenValue, 100,
+(sal_uInt16)nTokenValue, 100,
 SID_ATTR_CHAR_FONTHEIGHT );
 SetScriptAttr( eCharType, *pSet, aTmpItem );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-06-19 Thread Caolán McNamara
 editeng/source/misc/svxacorr.cxx |   22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 0a9e57785e3a391cea1aa74b87afc6e2c2c0a398
Author: Caolán McNamara 
Date:   Mon Jun 19 14:07:46 2017 +0100

rename IsAutoCapitalizeWordDelim to NonFieldWordDelim

Change-Id: If8fb8f5e51bba8e631a6fc5db54487b418c19e05

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index e0472dd7caea..c7ec14cb0be6 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -105,18 +105,18 @@ static const sal_Char
 
 OUString EncryptBlockName_Imp(const OUString& rName);
 
-static inline bool IsWordDelim( const sal_Unicode c )
+static inline bool NonFieldWordDelim( const sal_Unicode c )
 {
 return ' ' == c || '\t' == c || 0x0a == c ||
-cNonBreakingSpace == c || 0x2011 == c || 0x1 == c;
+cNonBreakingSpace == c || 0x2011 == c;
 }
 
-static inline bool IsAutoCapitalizeWordDelim( const sal_Unicode c )
+static inline bool IsWordDelim( const sal_Unicode c )
 {
-return ' ' == c || '\t' == c || 0x0a == c ||
-cNonBreakingSpace == c || 0x2011 == c;
+return c == 0x1 || NonFieldWordDelim(c);
 }
 
+
 static inline bool IsLowerLetter( sal_Int32 nCharType )
 {
 return CharClass::isLetterType( nCharType ) &&
@@ -882,9 +882,9 @@ bool SvxAutoCorrect::FnCapitalStartSentence( 
SvxAutoCorrDoc& rDoc,
 
 if( !bAtStart ) // Still no beginning of a paragraph?
 {
-if (IsAutoCapitalizeWordDelim(*pStr))
+if (NonFieldWordDelim(*pStr))
 {
-while (!(bAtStart = (pStart == pStr--)) && 
IsAutoCapitalizeWordDelim(*pStr))
+while (!(bAtStart = (pStart == pStr--)) && 
NonFieldWordDelim(*pStr))
 ;
 }
 // Asian full stop, full width full stop, full width exclamation mark
@@ -915,7 +915,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( 
SvxAutoCorrDoc& rDoc,
 
 do {// overwrite all blanks
 --pStr;
-if (!IsAutoCapitalizeWordDelim(*pStr))
+if (!NonFieldWordDelim(*pStr))
 break;
 bAtStart = (pStart == pStr);
 } while( !bAtStart );
@@ -1011,7 +1011,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( 
SvxAutoCorrDoc& rDoc,
 else
 bAlphaFnd = true;
 }
-else if (bAlphaFnd || IsAutoCapitalizeWordDelim(*pTmpStr))
+else if (bAlphaFnd || NonFieldWordDelim(*pTmpStr))
 break;
 
 if( pTmpStr == pStart )
@@ -1027,7 +1027,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( 
SvxAutoCorrDoc& rDoc,
 bool bNumericOnly = '0' <= *(pStr+1) && *(pStr+1) <= '9';
 
 // Search for the beginning of the word
-while (!IsAutoCapitalizeWordDelim(*pStr))
+while (!NonFieldWordDelim(*pStr))
 {
 if( bNumericOnly && rCC.isLetter( aText, pStr - pStart ) )
 bNumericOnly = false;
@@ -1041,7 +1041,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( 
SvxAutoCorrDoc& rDoc,
 if( bNumericOnly )  // consists of only numbers, then not
 return false;
 
-if (IsAutoCapitalizeWordDelim(*pStr))
+if (NonFieldWordDelim(*pStr))
 ++pStr;
 
 OUString sWord;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-06-13 Thread Stephan Bergmann
 editeng/source/editeng/impedit.hxx  |2 +-
 editeng/source/editeng/impedit2.cxx |4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit a109a9ef744a7ed36c5084cb26f033ba52b3c3ad
Author: Stephan Bergmann 
Date:   Tue Jun 13 11:20:36 2017 +0200

Use unique_ptr for ImpEditEngine::pEmptyItemSet

Change-Id: I1d7757eafb52fc3cc7d7e1cb02cced0a6004a304

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 6b2b28ad6680..ecf51531c585 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -427,7 +427,7 @@ private:
 svtools::ColorConfig maColorConfig;
 mutable SvtCTLOptions*  pCTLOptions;
 
-SfxItemSet* pEmptyItemSet;
+std::unique_ptr pEmptyItemSet;
 EditUndoManager*pUndoManager;
 ESelection* pUndoMarkSelection;
 
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index d649b88e7a12..048f330e18c8 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -113,7 +113,6 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* 
pItemPool ) :
 pEditEngine = pEE;
 pRefDev = nullptr;
 pVirtDev= nullptr;
-pEmptyItemSet   = nullptr;
 pActiveView = nullptr;
 pSpellInfo  = nullptr;
 pConvInfo   = nullptr;
@@ -194,7 +193,6 @@ ImpEditEngine::~ImpEditEngine()
 SetUpdateMode( false );
 
 Dispose();
-delete pEmptyItemSet;
 // it's only legal to delete the pUndoManager if it was created by
 // ImpEditEngine; if it was set by SetUndoManager() it must be cleared
 // before destroying the ImpEditEngine!
@@ -701,7 +699,7 @@ const SfxItemSet& ImpEditEngine::GetEmptyItemSet()
 {
 if ( !pEmptyItemSet )
 {
-pEmptyItemSet = new SfxItemSet( aEditDoc.GetItemPool(), 
EE_ITEMS_START, EE_ITEMS_END );
+pEmptyItemSet = o3tl::make_unique( aEditDoc.GetItemPool(), 
EE_ITEMS_START, EE_ITEMS_END );
 for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; 
nWhich++)
 {
 pEmptyItemSet->ClearItem( nWhich );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/svl include/svx sc/inc sc/qa sc/source svl/source svx/source

2017-06-13 Thread Stephan Bergmann
 editeng/source/items/textitem.cxx |3 ++-
 include/svl/poolitem.hxx  |2 +-
 include/svx/pageitem.hxx  |6 +-
 include/svx/xflasit.hxx   |6 +-
 include/svx/xlnasit.hxx   |5 -
 sc/inc/patattr.hxx|4 ++--
 sc/qa/unit/ucalc_formula.cxx  |3 ++-
 sc/source/core/data/docpool.cxx   |   11 ---
 sc/source/core/data/document.cxx  |3 ++-
 sc/source/core/data/patattr.cxx   |   18 ++
 sc/source/ui/docshell/docsh6.cxx  |   11 ++-
 sc/source/ui/view/viewfunc.cxx|6 +++---
 svl/source/items/sitem.cxx|   10 +++---
 svx/source/items/pageitem.cxx |8 ++--
 svx/source/xoutdev/xattr.cxx  |   25 +++--
 svx/source/xoutdev/xexch.cxx  |9 ++---
 svx/source/xoutdev/xpool.cxx  |   13 +
 17 files changed, 93 insertions(+), 50 deletions(-)

New commits:
commit 5389b44827393c80df27e429ba446971a0d7a696
Author: Stephan Bergmann 
Date:   Tue Jun 13 10:46:16 2017 +0200

Let SfxSetItem ctor take SfxItemSet by unique_ptr

Change-Id: I219dd03477862169cd50eecc14822f6a023f879a

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 72de8968f410..c6882ca85ca2 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3258,7 +3259,7 @@ SfxPoolItem* SvxScriptTypeItem::Clone( SfxItemPool * ) 
const
 */
 
 SvxScriptSetItem::SvxScriptSetItem( sal_uInt16 nSlotId, SfxItemPool& rPool )
-: SfxSetItem( nSlotId, new SfxItemSet( rPool,
+: SfxSetItem( nSlotId, o3tl::make_unique( rPool,
 SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONT ))
 {
 sal_uInt16 nLatin, nAsian, nComplex;
diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx
index 2eefbf1f66cf..b2a05b993f4a 100644
--- a/include/svl/poolitem.hxx
+++ b/include/svl/poolitem.hxx
@@ -272,7 +272,7 @@ class SVL_DLLPUBLIC SfxSetItem: public SfxPoolItem
 SfxSetItem & operator=( const SfxSetItem& ) = delete;
 
 public:
-SfxSetItem( sal_uInt16 nWhich, SfxItemSet *pSet );
+SfxSetItem( sal_uInt16 nWhich, 
std::unique_ptr & );
 SfxSetItem( sal_uInt16 nWhich, const SfxItemSet 
 );
 SfxSetItem( const SfxSetItem&, SfxItemPool *pPool 
= nullptr );
 virtual ~SfxSetItem() override;
diff --git a/include/svx/pageitem.hxx b/include/svx/pageitem.hxx
index 0a322a6a08d0..80277b7d3d3f 100644
--- a/include/svx/pageitem.hxx
+++ b/include/svx/pageitem.hxx
@@ -19,6 +19,10 @@
 #ifndef INCLUDED_SVX_PAGEITEM_HXX
 #define INCLUDED_SVX_PAGEITEM_HXX
 
+#include 
+
+#include 
+
 #include 
 #include 
 #include 
@@ -99,7 +103,7 @@ class SVX_DLLPUBLIC SvxSetItem: public SfxSetItem
 public:
 SvxSetItem( const sal_uInt16 nId, const SfxItemSet& rSet );
 SvxSetItem( const SvxSetItem& rItem );
-SvxSetItem( const sal_uInt16 nId, SfxItemSet* pSet );
+SvxSetItem( const sal_uInt16 nId, std::unique_ptr&& pSet );
 
 virtual SfxPoolItem*Clone( SfxItemPool *pPool = nullptr ) const 
override;
 
diff --git a/include/svx/xflasit.hxx b/include/svx/xflasit.hxx
index 73ceb0c3f1ab..62419e2cb462 100644
--- a/include/svx/xflasit.hxx
+++ b/include/svx/xflasit.hxx
@@ -20,6 +20,10 @@
 #ifndef INCLUDED_SVX_XFLASIT_HXX
 #define INCLUDED_SVX_XFLASIT_HXX
 
+#include 
+
+#include 
+
 #include 
 #include 
 
@@ -27,7 +31,7 @@
 class SVX_DLLPUBLIC XFillAttrSetItem : public SfxSetItem
 {
 public:
-XFillAttrSetItem(SfxItemSet* pItemSet );
+XFillAttrSetItem(std::unique_ptr&& 
pItemSet );
 XFillAttrSetItem(SfxItemPool* pItemPool);
 XFillAttrSetItem(const XFillAttrSetItem& rAttr);
 XFillAttrSetItem(const XFillAttrSetItem& rAttr,
diff --git a/include/svx/xlnasit.hxx b/include/svx/xlnasit.hxx
index 9b82ddef18e4..1643c223e23d 100644
--- a/include/svx/xlnasit.hxx
+++ b/include/svx/xlnasit.hxx
@@ -20,6 +20,9 @@
 #ifndef INCLUDED_SVX_XLNASIT_HXX
 #define INCLUDED_SVX_XLNASIT_HXX
 
+#include 
+
+#include 
 
 #include 
 #include 
@@ -28,7 +31,7 @@
 class SVX_DLLPUBLIC XLineAttrSetItem : public SfxSetItem
 {
 public:
-XLineAttrSetItem(SfxItemSet* pItemSet );
+XLineAttrSetItem(std::unique_ptr&& 
pItemSet );
 XLineAttrSetItem(SfxItemPool* pItemPool);
 XLineAttrSetItem(const XLineAttrSetItem& rAttr);
 XLineAttrSetItem(const XLineAttrSetItem& rAttr,
diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index 05bfc926c6ac..964b4a4eeba4 100644
--- 

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

2017-06-07 Thread Varun Dhall
 editeng/source/xml/xmltxtimp.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 65f98346c2edc983421643a7f5c32313b45934e0
Author: Varun Dhall 
Date:   Fri Jun 2 20:03:25 2017 +0530

EditEngine Creating SvXMLImportContext for ODF

Change-Id: I4083658db6068122b423fe5ec7a568fa222b4e80
Reviewed-on: https://gerrit.libreoffice.org/38358
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx
index 23fc2bec007f..fd757e86493c 100644
--- a/editeng/source/xml/xmltxtimp.cxx
+++ b/editeng/source/xml/xmltxtimp.cxx
@@ -103,10 +103,27 @@ public:
 const css::uno::Reference< css::uno::XComponentContext >& rContext,
 const uno::Reference< XText > & rText );
 
+virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
+const OUString& rLocalName, const uno::Reference< 
xml::sax::XAttributeList >& xAttrList )  override;
+
 private:
 const uno::Reference< XText > mxText;
 };
 
+SvXMLImportContext *SvxXMLXTextImportComponent::CreateContext( sal_uInt16 
nPrefix, const OUString& rLocalName, const uno::Reference< 
xml::sax::XAttributeList >& xAttrList )
+{
+SvXMLImportContext* pContext = nullptr;
+
+if(XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( rLocalName, 
XML_DOCUMENT_CONTENT ) )
+{
+pContext = new SvxXMLTextImportContext( *this, nPrefix, rLocalName, 
xAttrList, mxText );
+}
+
+if( nullptr == pContext )
+pContext = new SvXMLImportContext( *this, nPrefix, rLocalName );
+
+return pContext;
+}
 
 SvxXMLXTextImportComponent::SvxXMLXTextImportComponent(
 const css::uno::Reference< css::uno::XComponentContext >& xContext,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-06-07 Thread Varun Dhall
 editeng/source/editeng/editeng.cxx  |2 +-
 editeng/source/editeng/impedit.hxx  |2 +-
 editeng/source/editeng/impedit2.cxx |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit fec801d6d980f9bd277051ec07b55b8f2845ccc0
Author: Varun Dhall 
Date:   Thu Jun 1 02:46:28 2017 +0530

EditEngine Renamed InsertText to PasteText

The multiple overloads of InsertText cause pain in debugging

Change-Id: Icb5b40c23ae85e198d57f3054bc07a8c7eb05f55
Reviewed-on: https://gerrit.libreoffice.org/38286
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 438608fa9948..714c4db704dc 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -801,7 +801,7 @@ EditSelection EditEngine::InsertText(
 uno::Reference const & rxDataObj,
 const OUString& rBaseURL, const EditPaM& rPaM, bool bUseSpecial)
 {
-return pImpEditEngine->InsertText(rxDataObj, rBaseURL, rPaM, bUseSpecial);
+return pImpEditEngine->PasteText(rxDataObj, rBaseURL, rPaM, bUseSpecial);
 }
 
 EditPaM EditEngine::EndOfWord(const EditPaM& rPaM)
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index d0b17654d17e..6b2b28ad6680 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -548,7 +548,7 @@ private:
 
 EditTextObject* CreateTextObject(EditSelection aSelection, 
SfxItemPool*, bool bAllowBigObjects = false, sal_Int32 nBigObjStart = 0);
 EditSelection   InsertTextObject( const EditTextObject&, EditPaM aPaM 
);
-EditSelection   InsertText( css::uno::Reference< 
css::datatransfer::XTransferable > const & rxDataObj, const OUString& rBaseURL, 
const EditPaM& rPaM, bool bUseSpecial );
+EditSelection   PasteText( css::uno::Reference< 
css::datatransfer::XTransferable > const & rxDataObj, const OUString& rBaseURL, 
const EditPaM& rPaM, bool bUseSpecial );
 
 voidCheckPageOverflow();
 
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index d30bfb9d5b7a..d649b88e7a12 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3512,7 +3512,7 @@ uno::Reference< datatransfer::XTransferable > 
ImpEditEngine::CreateTransferable(
 return xDataObj;
 }
 
-EditSelection ImpEditEngine::InsertText( uno::Reference< 
datatransfer::XTransferable > const & rxDataObj, const OUString& rBaseURL, 
const EditPaM& rPaM, bool bUseSpecial )
+EditSelection ImpEditEngine::PasteText( uno::Reference< 
datatransfer::XTransferable > const & rxDataObj, const OUString& rBaseURL, 
const EditPaM& rPaM, bool bUseSpecial )
 {
 EditSelection aNewSelection( rPaM );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-06-07 Thread Varun Dhall
 editeng/source/editeng/impedit2.cxx |   50 ++--
 1 file changed, 37 insertions(+), 13 deletions(-)

New commits:
commit b863b1cb9c72d04933e6f9d3c361b8ebf9399cfd
Author: Varun Dhall 
Date:   Wed May 31 21:03:33 2017 +0530

EditEngine Implementing Paste for XML from clipboard

Change-Id: Ia820a29bec8a6b102fb78cf325577b731a12c3c4
Reviewed-on: https://gerrit.libreoffice.org/38282
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 6346589c0d3b..d30bfb9d5b7a 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3522,25 +3522,54 @@ EditSelection ImpEditEngine::InsertText( 
uno::Reference< datatransfer::XTransfer
 datatransfer::DataFlavor aFlavor;
 bool bDone = false;
 
+char* ODF_XML_Env = getenv ("ODF_TEXT_FLAT_XML_ENV");
+
 if ( bUseSpecial )
 {
 // BIN
 SotExchange::GetFormatDataFlavor( SotClipboardFormatId::EDITENGINE, 
aFlavor );
 if ( rxDataObj->isDataFlavorSupported( aFlavor ) )
 {
-try
+if ( ODF_XML_Env == nullptr )
 {
-uno::Any aData = rxDataObj->getTransferData( aFlavor );
-uno::Sequence< sal_Int8 > aSeq;
-aData >>= aSeq;
+try
+{
+uno::Any aData = rxDataObj->getTransferData( aFlavor );
+uno::Sequence< sal_Int8 > aSeq;
+aData >>= aSeq;
+{
+SvMemoryStream aBinStream( aSeq.getArray(), 
aSeq.getLength(), StreamMode::READ );
+aNewSelection = Read( aBinStream, rBaseURL, 
EE_FORMAT_BIN, rPaM );
+}
+bDone = true;
+}
+catch( const css::uno::Exception& )
 {
-SvMemoryStream aBinStream( aSeq.getArray(), 
aSeq.getLength(), StreamMode::READ );
-aNewSelection = Read( aBinStream, rBaseURL, EE_FORMAT_BIN, 
rPaM );
 }
-bDone = true;
 }
-catch( const css::uno::Exception& )
+}
+
+if ( !bDone )
+{
+// XML
+SotExchange::GetFormatDataFlavor( 
SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT, aFlavor );
+if ( rxDataObj->isDataFlavorSupported( aFlavor ) )
 {
+try
+{
+uno::Any aData = rxDataObj->getTransferData( aFlavor );
+uno::Sequence< sal_Int8 > aSeq;
+aData >>= aSeq;
+{
+SvMemoryStream aODFStream( aSeq.getArray(), 
aSeq.getLength(), StreamMode::READ );
+aNewSelection = Read( aODFStream, rBaseURL, 
EE_FORMAT_XML, rPaM );
+}
+bDone = true;
+}
+catch( const css::uno::Exception& e)
+{
+SAL_WARN( "editeng", "Unable to paste 
EDITENGINE_ODF_TEXT_FLAT " << e.Message );
+}
 }
 }
 
@@ -3575,11 +3604,6 @@ EditSelection ImpEditEngine::InsertText( uno::Reference< 
datatransfer::XTransfer
 }
 }
 }
-if ( !bDone )
-{
-// XML ?
-// Currently, there is nothing like "The" XML format, StarOffice 
doesn't offer plain XML in Clipboard...
-}
 }
 if ( !bDone )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/xmloff svx/source xmloff/source

2017-06-07 Thread Varun Dhall
 editeng/source/editeng/eeobj.hxx|2 ++
 editeng/source/editeng/impedit2.cxx |   16 
 editeng/source/xml/xmltxtexp.cxx|6 +++---
 include/xmloff/xmlexp.hxx   |3 ++-
 svx/source/xml/xmlxtexp.cxx |3 +--
 xmloff/source/core/xmlexp.cxx   |5 +++--
 6 files changed, 27 insertions(+), 8 deletions(-)

New commits:
commit 0703af9e782f1e03c243ee886d1301e80817aad8
Author: Varun Dhall 
Date:   Wed May 24 21:13:09 2017 +0530

Exporting EditEngine document into a buffer with ODF Filter

Change-Id: Ib0304de5d873ac833dcc121235b8de494a1bb3bf
Reviewed-on: https://gerrit.libreoffice.org/37999
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/editeng/source/editeng/eeobj.hxx b/editeng/source/editeng/eeobj.hxx
index 30c90c4d299b..f515aa938715 100644
--- a/editeng/source/editeng/eeobj.hxx
+++ b/editeng/source/editeng/eeobj.hxx
@@ -30,6 +30,7 @@ class EditDataObject :  public 
::cppu::WeakImplHelper
 #include 
 
+#include 
+#include 
+
 using namespace ::com::sun::star;
 
 static sal_uInt16 lcl_CalcExtraSpace( ParaPortion*, const SvxLineSpacingItem& 
rLSItem )
@@ -3473,6 +3476,19 @@ uno::Reference< datatransfer::XTransferable > 
ImpEditEngine::CreateTransferable(
 WriteRTF( pDataObj->GetRTFStream(), aSelection );
 pDataObj->GetRTFStream().Seek( 0 );
 
+WriteXML( pDataObj->GetODFStream(), aSelection );
+pDataObj->GetODFStream().Seek( 0 );
+
+//Dumping the ODFStream to a XML file for testing purpose
+/*
+std::filebuf afilebuf;
+afilebuf.open ("gsoc17_clipboard_test.xml",std::ios::out);
+std::ostream os();
+os.write((const char*)(pDataObj->GetODFStream().GetBuffer()), 
pDataObj->GetODFStream().remainingSize());
+afilebuf.close();
+*/
+//dumping ends
+
 if ( ( aSelection.Min().GetNode() == aSelection.Max().GetNode() )
 && ( aSelection.Max().GetIndex() == 
(aSelection.Min().GetIndex()+1) ) )
 {
diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx
index dc21c86c9eb0..c78bf1d0d862 100644
--- a/editeng/source/xml/xmltxtexp.cxx
+++ b/editeng/source/xml/xmltxtexp.cxx
@@ -308,9 +308,10 @@ SvxXMLTextExportComponent::SvxXMLTextExportComponent(
 const ESelection& rSel,
 const OUString& rFileName,
 const css::uno::Reference< css::xml::sax::XDocumentHandler > & xHandler)
-:   SvXMLExport( xContext, "", rFileName, xHandler, 
(static_cast(new SvxSimpleUnoModel())), FUNIT_CM )
+:   SvXMLExport( xContext, "", rFileName, xHandler, 
(static_cast(new SvxSimpleUnoModel())), FUNIT_CM,
+SvXMLExportFlags::OASIS  |  SvXMLExportFlags::AUTOSTYLES  |  
SvXMLExportFlags::CONTENT )
 {
-SvxEditEngineSource aEditSource( pEditEngine );
+SvxEditEngineSource aEditSource( pEditEngine );
 
 static const SfxItemPropertyMapEntry 
SvxXMLTextExportComponentPropertyMap[] =
 {
@@ -328,7 +329,6 @@ SvxXMLTextExportComponent::SvxXMLTextExportComponent(
 pUnoText->SetSelection( rSel );
 mxText = pUnoText;
 
-setExportFlags( SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT );
 }
 
 void SvxWriteXML( EditEngine& rEditEngine, SvStream& rStream, const 
ESelection& rSel )
diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index cb134c747193..c8d0ffe41524 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -281,7 +281,8 @@ public:
 const OUString& rFileName,
 const css::uno::Reference< css::xml::sax::XDocumentHandler > & 
rHandler,
 const css::uno::Reference< css::frame::XModel > &,
-FieldUnit const eDefaultFieldUnit );
+FieldUnit const eDefaultFieldUnit,
+SvXMLExportFlags nExportFlag );
 
 virtual ~SvXMLExport() override;
 
diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx
index 62732b87671d..a3c4bb3c97c7 100644
--- a/svx/source/xml/xmlxtexp.cxx
+++ b/svx/source/xml/xmlxtexp.cxx
@@ -139,7 +139,7 @@ SvxXMLXTableExportComponent::SvxXMLXTableExportComponent(
 const uno::Reference & rHandler,
 const uno::Reference& xTable,
 uno::Reference& xGrfResolver )
-:   SvXMLExport(rContext, "", rFileName, rHandler, nullptr, FUNIT_100TH_MM),
+:   SvXMLExport(rContext, "", rFileName, rHandler, nullptr, FUNIT_100TH_MM, 
SvXMLExportFlags::NONE),
 mxTable( xTable )
 {
 
@@ -149,7 +149,6 @@ SvxXMLXTableExportComponent::SvxXMLXTableExportComponent(
 GetNamespaceMap_().Add( GetXMLToken(XML_NP_XLINK), 
GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK );
 GetNamespaceMap_().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG),  
XML_NAMESPACE_SVG );
 SetGraphicResolver( xGrfResolver );
-setExportFlags( SvXMLExportFlags::NONE );
 }
 
 SvxXMLXTableExportComponent::~SvxXMLXTableExportComponent()
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index bfb18b8e0853..f139fafbea65 100644
--- 

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

2017-06-07 Thread Varun Dhall
 editeng/source/editeng/eeobj.cxx |9 +
 include/sot/formats.hxx  |3 ++-
 sot/source/base/exchange.cxx |3 ++-
 3 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 223a04e77fe9702eb167e69165ec57c46512a845
Author: Varun Dhall 
Date:   Tue May 30 23:35:57 2017 +0530

EditEngine Exporting flat XML from actual clipboard

Allowing export of EditEngine document into flat XML from actual clipboard
by modifying SotClipboardFormatId

Change-Id: I9c7dfd3ca428d0fa355bd3dfb7bfa0f0e30dada6
Reviewed-on: https://gerrit.libreoffice.org/38226
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/editeng/source/editeng/eeobj.cxx b/editeng/source/editeng/eeobj.cxx
index 0c6bd1246c7c..1daac5eb10ed 100644
--- a/editeng/source/editeng/eeobj.cxx
+++ b/editeng/source/editeng/eeobj.cxx
@@ -53,13 +53,13 @@ uno::Any EditDataObject::getTransferData( const 
datatransfer::DataFlavor& rFlavo
 {
 aAny <<= GetString();
 }
-else if ( ( nT == SotClipboardFormatId::EDITENGINE ) || ( nT == 
SotClipboardFormatId::RTF ) || ( nT == SotClipboardFormatId::RICHTEXT ) )
+else if ( ( nT == SotClipboardFormatId::EDITENGINE ) || ( nT == 
SotClipboardFormatId::RTF ) || ( nT == SotClipboardFormatId::RICHTEXT ) || ( nT 
== SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT ) )
 {
 // No RTF on demand any more:
 // 1) Was not working, because I had to flush() the clipboard 
immediately anyway
 // 2) Don't have the old pool defaults and the StyleSheetPool here.
 
-SvMemoryStream* pStream = ( nT == SotClipboardFormatId::EDITENGINE ) ? 
() : ();
+SvMemoryStream* pStream = ( nT == SotClipboardFormatId::EDITENGINE ) ? 
() : ( (nT == SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT ) ? 
() : () );
 pStream->Seek( STREAM_SEEK_TO_END );
 sal_Int32 nLen = pStream->Tell();
 if (nLen < 0) { abort(); }
@@ -80,11 +80,12 @@ uno::Any EditDataObject::getTransferData( const 
datatransfer::DataFlavor& rFlavo
 
 uno::Sequence< datatransfer::DataFlavor > 
EditDataObject::getTransferDataFlavors(  )
 {
-uno::Sequence< datatransfer::DataFlavor > aDataFlavors(4);
+uno::Sequence< datatransfer::DataFlavor > aDataFlavors(5);
 SotExchange::GetFormatDataFlavor( SotClipboardFormatId::EDITENGINE, 
aDataFlavors.getArray()[0] );
 SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, 
aDataFlavors.getArray()[1] );
 SotExchange::GetFormatDataFlavor( SotClipboardFormatId::RTF, 
aDataFlavors.getArray()[2] );
 SotExchange::GetFormatDataFlavor( SotClipboardFormatId::RICHTEXT, 
aDataFlavors.getArray()[3] );
+SotExchange::GetFormatDataFlavor( 
SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT, aDataFlavors.getArray()[4] );
 
 return aDataFlavors;
 }
@@ -95,7 +96,7 @@ sal_Bool EditDataObject::isDataFlavorSupported( const 
datatransfer::DataFlavor&
 
 SotClipboardFormatId nT = SotExchange::GetFormat( rFlavor );
 if ( ( nT == SotClipboardFormatId::STRING ) || ( nT == 
SotClipboardFormatId::RTF ) || ( nT == SotClipboardFormatId::RICHTEXT )
-|| ( nT == SotClipboardFormatId::EDITENGINE ) )
+|| ( nT == SotClipboardFormatId::EDITENGINE ) || ( nT == 
SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT ) )
 bSupported = true;
 
 return bSupported;
diff --git a/include/sot/formats.hxx b/include/sot/formats.hxx
index 482f65bad44f..17a9adb5d11a 100644
--- a/include/sot/formats.hxx
+++ b/include/sot/formats.hxx
@@ -173,8 +173,9 @@ enum class SotClipboardFormatId : sal_uLong
 MATHML = 143,
 JPEG   = 144,
 RICHTEXT   = 145,
+EDITENGINE_ODF_TEXT_FLAT = 146,
 // the point at which we start allocating "runtime" format IDs
-USER_END  = RICHTEXT
+USER_END  = EDITENGINE_ODF_TEXT_FLAT
 };
 
 /** Make it easier to iterate over format IDs */
diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx
index 943fbbe7c303..286f4c7e49e2 100644
--- a/sot/source/base/exchange.cxx
+++ b/sot/source/base/exchange.cxx
@@ -203,7 +203,8 @@ namespace
 /*142 SotClipboardFormatId::STARWRITERGLOB_8_TEMPLATE*/  { 
MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII, "Writer/Global 8 
Template", ::UnoType::get() },
 /*143 SotClipboardFormatId::MATHML*/   { "application/mathml+xml", 
"MathML", &::cppu::UnoType>::get() },
 /*144 SotClipboardFormatId::JPEG*/ { "image/jpeg", "JPEG Bitmap", 
::UnoType::get() },
-/*145 SotClipboardFormatId::RICHTEXT*/ { "text/richtext", 
"Richtext Format", ::UnoType::get() }
+/*145 SotClipboardFormatId::RICHTEXT*/ { "text/richtext", 
"Richtext Format", ::UnoType::get() },
+/*146 SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT*/ { 
"application/vnd.oasis.opendocument.text-flat-xml", "EditEngine ODF", 

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

2017-06-04 Thread Jochen Nitschke
 editeng/source/editeng/editobj.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 453ce05c3951b6459a6450e6ac09377f70ecbc16
Author: Jochen Nitschke 
Date:   Sun Jun 4 11:33:31 2017 +0200

tdf#108324 fix crash: paste from textframe

rAttr references *pC->maCharAttribs[nAttr].get() and assignment of
a unique_ptr is essentially a reset, invalidating the reference.

regression of commitdd891ec422fb35eada219ca7adddbd60d69f1fb7
cppcheck: memleak (false positive)
but manage ownership from start

Change-Id: Ica81f0af18e11b32d2f97045961630858c78e9af
Reviewed-on: https://gerrit.libreoffice.org/38382
Tested-by: Jenkins 
Reviewed-by: Jochen Nitschke 

diff --git a/editeng/source/editeng/editobj.cxx 
b/editeng/source/editeng/editobj.cxx
index b215865d0ee3..ed1fdb06136e 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1429,9 +1429,8 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream )
 aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) 
);
 
 // Replace the existing attribute with a new one.
-pC->maCharAttribs[nAttr] =
-
std::unique_ptr(CreateAttrib(aNewFontItem, rAttr.GetStart(), 
rAttr.GetEnd()));
 pPool->Remove(*rAttr.GetItem());
+pC->maCharAttribs[nAttr].reset(CreateAttrib(aNewFontItem, 
rAttr.GetStart(), rAttr.GetEnd()));
 
 XEditAttribute* pNewAttr = pC->maCharAttribs[nAttr].get();
 for ( sal_Int32 nChar = pNewAttr->GetStart(); nChar < 
pNewAttr->GetEnd(); nChar++ )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source eventattacher/source extensions/source extensions/test

2017-05-20 Thread Johnny_M
 editeng/source/editeng/editdbg.cxx  |2 
+-
 editeng/source/editeng/eehtml.cxx   |4 
++--
 editeng/source/editeng/eertfpar.cxx |2 
+-
 editeng/source/editeng/impedit2.cxx |4 
++--
 editeng/source/items/svxitems.src   |2 
+-
 editeng/source/misc/svxacorr.cxx|2 
+-
 editeng/source/uno/unonrule.cxx |4 
++--
 eventattacher/source/eventattacher.cxx  |2 
+-
 extensions/source/bibliography/toolbar.cxx  |2 
+-
 extensions/source/propctrlr/formcomponenthandler.cxx|4 
++--
 extensions/test/ole/AxTestComponents/AxTestComponents.idl   |2 
+-
 extensions/test/ole/EventListenerSample/EventListener/EventListener.idl |2 
+-
 extensions/test/ole/EventListenerSample/EventListener/EvtListener.cpp   |2 
+-
 extensions/test/ole/EventListenerSample/EventListener/EvtListener.h |2 
+-
 14 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit f46e8802c2639cd56b65b35b5eea3a248437dbe4
Author: Johnny_M 
Date:   Fri May 19 19:55:00 2017 +0200

Translate German comments and debug strings (leftovers in e... dirs)

Translates all (leftovers) found using a custom regex, in directories not
shown by /bin/find-german-comments and beginning with "e".

Additionally, following is translated:
- A help string in 
/extensions/test/ole/EventListenerSample/EventListener/EventListener.idl

Change-Id: Iff521ae1c4a616ed5a4ca79641a5cee6f380bee0
Reviewed-on: https://gerrit.libreoffice.org/37836
Reviewed-by: Chris Sherlock 
Tested-by: Chris Sherlock 

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 6c2d0c58770c..6bdb9455ddb3 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -418,7 +418,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool 
bInfoBox )
 for ( sal_Int32 nLine = 0; nLine < pPPortion->GetLines().Count(); 
nLine++ )
 {
 EditLine& rLine = pPPortion->GetLines()[nLine];
-fprintf( fp, "\nZeile %" SAL_PRIdINT32 ":\tStart: %" SAL_PRIdINT32 
",\tEnd: %" SAL_PRIdINT32, nLine, rLine.GetStart(), rLine.GetEnd() );
+fprintf( fp, "\nLine %" SAL_PRIdINT32 ":\tStart: %" SAL_PRIdINT32 
",\tEnd: %" SAL_PRIdINT32, nLine, rLine.GetStart(), rLine.GetEnd() );
 fprintf( fp, "\t\tPortions: %" SAL_PRIdINT32 " - %" SAL_PRIdINT32 
".\tHight: %i, Ascent=%i", rLine.GetStartPortion(), rLine.GetEndPortion(), 
rLine.GetHeight(), rLine.GetMaxAscent() );
 }
 
diff --git a/editeng/source/editeng/eehtml.cxx 
b/editeng/source/editeng/eehtml.cxx
index e625669aea00..0b6dfd182af0 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -54,7 +54,7 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, const 
OUString& rBaseURL, SvKeyVa
 DBG_ASSERT( !IsSwitchToUCS2(), "EditHTMLParserEditHTMLParser: Switch 
to UCS2?" );
 
 // Although the real default encoding is ISO8859-1, we use MS-1252
-// als default encoding.
+// as default encoding.
 SetSrcEncoding( GetExtendedCompatibilityTextEncoding(  
RTL_TEXTENCODING_ISO_8859_1 ) );
 
 // If the file starts with a BOM, switch to UCS2.
@@ -443,7 +443,7 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 // misc
 case HtmlTokenId::DIRLIST_ON:
 case HtmlTokenId::DIRLIST_OFF:
-case HtmlTokenId::FOOTNOTE_ON:  //! land so im Text
+case HtmlTokenId::FOOTNOTE_ON:  //! they land so in the text
 case HtmlTokenId::FOOTNOTE_OFF:
 case HtmlTokenId::MENULIST_ON:
 case HtmlTokenId::MENULIST_OFF:
diff --git a/editeng/source/editeng/eertfpar.cxx 
b/editeng/source/editeng/eertfpar.cxx
index 88c0499eb9c2..96aac57b553d 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -344,7 +344,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType  
)
 
 if( SfxItemState::SET == rSet.GetAttrSet().GetItemState( 
EE_CHAR_ESCAPEMENT, false,  ))
 {
-// die richtige
+// the correct one
 long nEsc = static_cast(pItem)->GetEsc();
 
 if( ( DFLT_ESC_AUTO_SUPER != nEsc ) && ( DFLT_ESC_AUTO_SUB != nEsc ) )
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 950a5bf79f1b..366e4f09ed6c 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -370,7 +370,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
 }
 else if ( rCEvt.GetCommand() == CommandEventId::EndExtTextInput )
   

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

2017-05-20 Thread Markus Mohrhard
 editeng/source/editeng/impedit.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 25e8148a1bdf37b57938c255235eb48d98abbfc6
Author: Markus Mohrhard 
Date:   Sat May 20 10:02:56 2017 +0200

no need for std::unique_ptr::reset in destructor

Change-Id: Id8628ae1e1d17dedf1c06d6a3d44d8be40be4cef

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 94599ab5ea5b..62cde1a44171 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -108,7 +108,6 @@ ImpEditView::~ImpEditView()
 delete pCursor;
 delete pBackgroundColor;
 delete pPointer;
-pDragAndDropInfo.reset();
 }
 
 void ImpEditView::SetBackgroundColor( const Color& rColor )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-20 Thread Julien Nabet
 editeng/source/editeng/impedit.cxx |   23 +--
 editeng/source/editeng/impedit.hxx |2 +-
 2 files changed, 10 insertions(+), 15 deletions(-)

New commits:
commit 417f65de89edfdafa24e49955109b5a58d37b151
Author: Julien Nabet 
Date:   Sat May 20 07:43:09 2017 +0200

convert to use std::unique_ptr

Change-Id: I37f8469fa4f41ac052d811ef56ad4bddfac6a7d1
Reviewed-on: https://gerrit.libreoffice.org/37848
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 10c7e9650fba..94599ab5ea5b 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -85,7 +85,6 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, 
vcl::Window* pWindo
 nExtraCursorFlags   = GetCursorFlags::NONE;
 nCursorBidiLevel= CURSOR_BIDILEVEL_DONTKNOW;
 pCursor = nullptr;
-pDragAndDropInfo= nullptr;
 bReadOnly   = false;
 bClickedInSelection = false;
 eSelectionMode  = EESelectionMode::TxtOnly;
@@ -109,7 +108,7 @@ ImpEditView::~ImpEditView()
 delete pCursor;
 delete pBackgroundColor;
 delete pPointer;
-delete pDragAndDropInfo;
+pDragAndDropInfo.reset();
 }
 
 void ImpEditView::SetBackgroundColor( const Color& rColor )
@@ -1765,8 +1764,7 @@ void ImpEditView::dragGestureRecognized(const 
css::datatransfer::dnd::DragGestur
 
 SolarMutexGuard aVclGuard;
 
-delete pDragAndDropInfo;
-pDragAndDropInfo = nullptr;
+pDragAndDropInfo.reset();
 
 Point aMousePosPixel( rDGE.DragOriginX, rDGE.DragOriginY );
 
@@ -1775,7 +1773,7 @@ void ImpEditView::dragGestureRecognized(const 
css::datatransfer::dnd::DragGestur
 
 if ( GetEditSelection().HasRange() && bClickedInSelection )
 {
-pDragAndDropInfo = new DragAndDropInfo();
+pDragAndDropInfo.reset(new DragAndDropInfo());
 }
 else
 {
@@ -1786,7 +1784,7 @@ void ImpEditView::dragGestureRecognized(const 
css::datatransfer::dnd::DragGestur
 const SvxFieldItem* pField = GetField( aMousePos, ,  );
 if ( pField )
 {
-pDragAndDropInfo = new DragAndDropInfo();
+pDragAndDropInfo.reset(new DragAndDropInfo());
 pDragAndDropInfo->pField = pField;
 ContentNode* pNode = pEditEngine->GetEditDoc().GetObject( nPara );
 aCopySel = EditSelection( EditPaM( pNode, nPos ), EditPaM( pNode, 
nPos+1 ) );
@@ -1797,7 +1795,7 @@ void ImpEditView::dragGestureRecognized(const 
css::datatransfer::dnd::DragGestur
 }
 else if ( IsBulletArea( aMousePos,  ) )
 {
-pDragAndDropInfo = new DragAndDropInfo();
+pDragAndDropInfo.reset(new DragAndDropInfo());
 pDragAndDropInfo->bOutlinerMode = true;
 EditPaM aStartPaM( pEditEngine->GetEditDoc().GetObject( nPara ), 0 
);
 EditPaM aEndPaM( aStartPaM );
@@ -1929,8 +1927,7 @@ void ImpEditView::dragDropEnd( const 
css::datatransfer::dnd::DragSourceDropEvent
 
 HideDDCursor();
 ShowCursor( DoAutoScroll(), true );
-delete pDragAndDropInfo;
-pDragAndDropInfo = nullptr;
+pDragAndDropInfo.reset();
 pEditEngine->GetEndDropHdl().Call(GetEditViewPtr());
 }
 }
@@ -2000,8 +1997,7 @@ void ImpEditView::drop( const 
css::datatransfer::dnd::DropTargetDropEvent& rDTDE
 
 if ( !pDragAndDropInfo->bStarterOfDD )
 {
-delete pDragAndDropInfo;
-pDragAndDropInfo = nullptr;
+pDragAndDropInfo.reset();
 }
 
 rDTDE.Context->dropComplete( bChanges );
@@ -2013,7 +2009,7 @@ void ImpEditView::dragEnter( const 
css::datatransfer::dnd::DropTargetDragEnterEv
 SolarMutexGuard aVclGuard;
 
 if ( !pDragAndDropInfo )
-pDragAndDropInfo = new DragAndDropInfo( );
+pDragAndDropInfo.reset(new DragAndDropInfo());
 
 pDragAndDropInfo->bHasValidData = false;
 
@@ -2043,8 +2039,7 @@ void ImpEditView::dragExit( const 
css::datatransfer::dnd::DropTargetEvent& )
 
 if ( pDragAndDropInfo && !pDragAndDropInfo->bStarterOfDD )
 {
-delete pDragAndDropInfo;
-pDragAndDropInfo = nullptr;
+pDragAndDropInfo.reset();
 }
 }
 
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index a125a97e34f0..dc5f9ac7af3c 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -238,7 +238,7 @@ private:
 VclPtr   pOutWin;
 EditView::OutWindowSetaOutWindowSet;
 Pointer*  pPointer;
-DragAndDropInfo*  pDragAndDropInfo;
+std::unique_ptr  pDragAndDropInfo;
 
 css::uno::Reference< css::datatransfer::dnd::XDragSourceListener > 
mxDnDListener;
 
___
Libreoffice-commits mailing list

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

2017-05-19 Thread Julien Nabet
 editeng/source/editeng/impedit.cxx |1 +
 editeng/source/editeng/impedit.hxx |4 
 2 files changed, 5 insertions(+)

New commits:
commit ba9b44270b56dfc6c416a55686d855a5b3c3c866
Author: Julien Nabet 
Date:   Thu May 18 23:25:32 2017 +0200

fix gdi resource leak (editeng/impedit)

Change-Id: Ia2d9ad88b5bcc2adf7f28ac7833132c04045d55b
Reviewed-on: https://gerrit.libreoffice.org/37790
Reviewed-by: Markus Mohrhard 
Tested-by: Jenkins 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 86b71d6dba26..10c7e9650fba 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1765,6 +1765,7 @@ void ImpEditView::dragGestureRecognized(const 
css::datatransfer::dnd::DragGestur
 
 SolarMutexGuard aVclGuard;
 
+delete pDragAndDropInfo;
 pDragAndDropInfo = nullptr;
 
 Point aMousePosPixel( rDGE.DragOriginX, rDGE.DragOriginY );
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index bb8f4e894a49..a125a97e34f0 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -137,6 +137,10 @@ struct DragAndDropInfo
 bHasValidData = false; bUndoAction = false; bOutlinerMode = false;
 nSensibleRange = 0; nCursorWidth = 0; pField = nullptr; 
nOutlinerDropDest = 0; bDragAccepted = false;
 }
+~DragAndDropInfo()
+{
+pBackground.disposeAndClear();
+}
 };
 
 struct ImplIMEInfos
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


<    2   3   4   5   6   7   8   9   10   11   >