[Libreoffice-commits] core.git: sal/osl

2017-07-07 Thread Chris Sherlock
 sal/osl/unx/file.cxx |1 -
 sal/osl/w32/file.cxx |3 ---
 2 files changed, 4 deletions(-)

New commits:
commit 7b4f4f15971047664fa278fff96b959d53b272b3
Author: Chris Sherlock 
Date:   Wed Jul 5 11:51:08 2017 +1000

osl: followup to 7c6ccc42 for w32/unx file.cxx

As pointed out by sberg, either the issue is a programming error that
needs an assert, or the issue is unusual and should just generated a
warning, but never both.

Change-Id: I07ae1e99597cd6c342791aa268b2240db987ae91
Reviewed-on: https://gerrit.libreoffice.org/39514
Tested-by: Jenkins 
Reviewed-by: Chris Sherlock 

diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 6d8aba858d95..d9d6710388db 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -201,7 +201,6 @@ FileHandle_Impl::Allocator::~Allocator()
 void FileHandle_Impl::Allocator::allocate(sal_uInt8 **ppBuffer, size_t *pnSize)
 {
 SAL_WARN_IF((!ppBuffer) || (!pnSize), "sal.osl", 
"FileHandle_Impl::Allocator::allocate(): contract violation");
-assert(ppBuffer && pnSize);
 if ((ppBuffer) && (pnSize))
 {
 *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache));
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx
index 43f04ba92310..f49076ed4970 100644
--- a/sal/osl/w32/file.cxx
+++ b/sal/osl/w32/file.cxx
@@ -181,7 +181,6 @@ FileHandle_Impl::Allocator::~Allocator()
 void FileHandle_Impl::Allocator::allocate (sal_uInt8 **ppBuffer, SIZE_T * 
pnSize)
 {
 SAL_WARN_IF((!ppBuffer) || (!pnSize), "sal.osl", 
"FileHandle_Impl::Allocator::allocate(): contract violation");
-assert((ppBuffer) && (pnSize));
 *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache));
 
 *pnSize = m_bufsiz;
@@ -197,14 +196,12 @@ FileHandle_Impl::Guard::Guard(LPCRITICAL_SECTION pMutex)
 : m_mutex (pMutex)
 {
 SAL_WARN_IF(!(m_mutex), "sal.osl", "FileHandle_Impl::Guard::Guard(): null 
pointer.");
-assert(m_mutex);
 ::EnterCriticalSection (m_mutex);
 }
 
 FileHandle_Impl::Guard::~Guard()
 {
 SAL_WARN_IF(!(m_mutex), "sal.osl", "FileHandle_Impl::Guard::~Guard(): null 
pointer.");
-assert(m_mutex);
 ::LeaveCriticalSection (m_mutex);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Julien Nabet
 connectivity/source/commontools/dbtools.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 3329d2205ed3246c56da1bd859acaaf590dd6e71
Author: Julien Nabet 
Date:   Fri Jul 7 21:55:41 2017 +0200

No language driver in header for dBASEIII/Plus

See http://dbase.free.fr/tlcharge/structure%20tables.pdf

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

diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 23905d80f14a..c89a9578e5db 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -2033,7 +2033,11 @@ namespace dbase
 {
 switch (nType)
 {
+// dBaseIII header doesn't contain language driver ID
+// See http://dbase.free.fr/tlcharge/structure%20tables.pdf
 case dBaseIII:
+case dBaseIIIMemo:
+break;
 case dBaseIV:
 case dBaseV:
 case VisualFoxPro:
@@ -2041,7 +2045,6 @@ namespace dbase
 case dBaseFS:
 case dBaseFSMemo:
 case dBaseIVMemoSQL:
-case dBaseIIIMemo:
 case FoxProMemo:
 {
 if (nCodepage != 0x00)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Changes to 'refs/tags/2.1.2-7'

2017-07-07 Thread Pranav Kant
Tag '2.1.2-7' created by Andras Timar  at 
2017-07-07 20:38 +

2.1.2-7

Changes since 2.1.2-6:
---
 0 files changed
---
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'refs/tags/2.1.2-7' - 0 commits -

2017-07-07 Thread Unknown
Rebased ref, commits from common ancestor:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd' - wsd/Admin.cpp

2017-07-07 Thread Pranav Kant
 wsd/Admin.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9d29240d467923aa5d332f37c799410eeffb777d
Author: Pranav Kant 
Date:   Sat Jul 8 01:52:46 2017 +0530

Update the iterator too

Change-Id: Ia715fa11eb21a25935a2075d09c674bd45472e96
(cherry picked from commit 5ef7606316c44e5a180ff43cf9f779cf2d24399b)
Reviewed-on: https://gerrit.libreoffice.org/39711
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index 3cffc82b..39c8618d 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -456,7 +456,7 @@ void Admin::triggerMemoryCleanup(size_t totalMem)
 LOG_DBG("OOM: Killing saved document with DocKey " << 
docIt->_docKey);
 LOOLWSD::closeDocument(docIt->_docKey, "oom");
 memToFree -= docIt->_mem;
-docList.erase(docIt);
+docIt = docList.erase(docIt);
 }
 else
 ++docIt;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: wsd/Admin.cpp

2017-07-07 Thread Pranav Kant
 wsd/Admin.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5ef7606316c44e5a180ff43cf9f779cf2d24399b
Author: Pranav Kant 
Date:   Sat Jul 8 01:52:46 2017 +0530

Update the iterator too

Change-Id: Ia715fa11eb21a25935a2075d09c674bd45472e96

diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index b1de0ba6..ab99a059 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -559,7 +559,7 @@ void Admin::triggerMemoryCleanup(size_t totalMem)
 LOG_DBG("OOM: Killing saved document with DocKey " << 
docIt->_docKey);
 LOOLWSD::closeDocument(docIt->_docKey, "oom");
 memToFree -= docIt->_mem;
-docList.erase(docIt);
+docIt = docList.erase(docIt);
 }
 else
 ++docIt;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/comphelper

2017-07-07 Thread Arnaud Versini
 include/comphelper/accessiblecontexthelper.hxx |   35 ++---
 1 file changed, 4 insertions(+), 31 deletions(-)

New commits:
commit e36e5dcc908bd996fba7012fa793ff094b1fb0c4
Author: Arnaud Versini 
Date:   Sun Jul 2 10:57:42 2017 +0200

comphelper : Simplify guards in OAccessibleContextHelper.

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

diff --git a/include/comphelper/accessiblecontexthelper.hxx 
b/include/comphelper/accessiblecontexthelper.hxx
index 1cc27da80b3e..c29f61ff3bb0 100644
--- a/include/comphelper/accessiblecontexthelper.hxx
+++ b/include/comphelper/accessiblecontexthelper.hxx
@@ -48,6 +48,7 @@ namespace comphelper
 :public ::cppu::BaseMutex
 ,public OAccessibleContextHelper_Base
 {
+friend class OContextEntryGuard;
 private:
 std::unique_ptrm_pImpl;
 
@@ -103,21 +104,6 @@ namespace comphelper
 */
 virtual css::lang::Locale SAL_CALL getLocale(  ) override;
 
-public:
-// helper struct for granting selective access rights
-struct OAccessControl
-{
-friend class OContextEntryGuard;
-friend class OContextHelper_Impl;
-friend class OExternalLockGuard;
-private:
-OAccessControl() { }
-};
-
-// ensures that the object is alive
-inline  voidensureAlive( const OAccessControl& ) const;
-inline  ::osl::Mutex&   GetMutex( const OAccessControl& );
-
 protected:
 // OComponentHelper
 virtual void SAL_CALL disposing() override;
@@ -162,21 +148,8 @@ namespace comphelper
 };
 
 
-inline  void OAccessibleContextHelper::ensureAlive( const OAccessControl& 
) const
-{
-ensureAlive();
-}
-
-
-inline  ::osl::Mutex& OAccessibleContextHelper::GetMutex( const 
OAccessControl& )
-{
-return GetMutex();
-}
-
-
 //= OContextEntryGuard
 
-typedef ::osl::ClearableMutexGuard  OContextEntryGuard_Base;
 /** helper class for guarding the entry into OAccessibleContextHelper 
methods.
 
 The class has two responsibilities:
@@ -189,7 +162,7 @@ namespace comphelper
 you derived class.
 
 */
-class OContextEntryGuard : public OContextEntryGuard_Base
+class OContextEntryGuard : public ::osl::ClearableMutexGuard
 {
 public:
 /** constructs the guard
@@ -206,9 +179,9 @@ namespace comphelper
 
 
 inline OContextEntryGuard::OContextEntryGuard( OAccessibleContextHelper* 
_pContext  )
-:OContextEntryGuard_Base( _pContext->GetMutex( 
OAccessibleContextHelper::OAccessControl() ) )
+: ::osl::ClearableMutexGuard( _pContext->GetMutex() )
 {
-_pContext->ensureAlive( OAccessibleContextHelper::OAccessControl() );
+_pContext->ensureAlive();
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source comphelper/source connectivity/source dbaccess/source extensions/source sw/source

2017-07-07 Thread Jochen Nitschke
 chart2/qa/extras/chart2export.cxx |1 -
 chart2/source/controller/main/DrawCommandDispatch.cxx |2 +-
 comphelper/source/property/property.cxx   |4 ++--
 connectivity/source/commontools/dbtools.cxx   |4 ++--
 connectivity/source/commontools/dbtools2.cxx  |2 +-
 dbaccess/source/ui/misc/UITools.cxx   |4 ++--
 extensions/source/propctrlr/cellbindinghelper.cxx |2 +-
 sw/source/core/unocore/unochart.cxx   |   17 ++---
 8 files changed, 15 insertions(+), 21 deletions(-)

New commits:
commit c5e4534808c03ce30c7b3e4bbed38ed5fca2d77f
Author: Jochen Nitschke 
Date:   Thu Jul 6 19:36:34 2017 +0200

remove nullptr checks on STL search result iterators

results are in the range of first_iterator to last_iterator.
If one of those is nullptr the algorithm would fail anyway.

This removes some impossible checks in
sw/source/core/unocore/unochart.cxx:
SwChartDataProvider::detectArguments.
A sorted range still holds the same values and has
the same length as the original range.
Replacing raw pointers eases reading this code.

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

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 89ae67d570d6..11f37235835b 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -205,7 +205,6 @@ OUString findChartFile(const OUString& rDir, 
uno::Reference< container::XNameAcc
 uno::Sequence aNames = xNames->getElementNames();
 OUString* pElement = std::find_if(aNames.begin(), aNames.end(), 
CheckForChartName(rDir));
 
-CPPUNIT_ASSERT(pElement);
 CPPUNIT_ASSERT(pElement != aNames.end());
 return *pElement;
 }
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx 
b/chart2/source/controller/main/DrawCommandDispatch.cxx
index cded08bb68c8..d990e351bbd1 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -363,7 +363,7 @@ void DrawCommandDispatch::execute( const OUString& 
rCommand, const Sequence< bea
 
[&sKeyModifier](const beans::PropertyValue& lhs)
 {return 
lhs.Name == sKeyModifier;} );
 sal_Int16 nKeyModifier = 0;
-if ( pKeyModifier != pEnd && pKeyModifier && ( 
pKeyModifier->Value >>= nKeyModifier ) && nKeyModifier == KEY_MOD1 )
+if ( pKeyModifier != pEnd && ( pKeyModifier->Value >>= 
nKeyModifier ) && nKeyModifier == KEY_MOD1 )
 {
 if ( eDrawMode == CHARTDRAW_INSERT )
 {
diff --git a/comphelper/source/property/property.cxx 
b/comphelper/source/property/property.cxx
index d5ddc9a9ab7b..a0083908246f 100644
--- a/comphelper/source/property/property.cxx
+++ b/comphelper/source/property/property.cxx
@@ -149,7 +149,7 @@ void RemoveProperty(Sequence& _rProps, const 
OUString& _rPropName)
 Property aNameProp(_rPropName, 0, Type(), 0);
 const Property* pResult = std::lower_bound(pProperties, pProperties + 
nLen, aNameProp, PropertyCompareByName());
 
-if ( pResult && (pResult != pProperties + nLen) && (pResult->Name == 
_rPropName) )
+if ( pResult != _rProps.end() && pResult->Name == _rPropName )
 {
 OSL_ENSURE(pResult->Name.equals(_rPropName), "::RemoveProperty 
Properties not sorted");
 removeElementAt(_rProps, pResult - pProperties);
@@ -166,7 +166,7 @@ void ModifyPropertyAttributes(Sequence& seqProps, 
const OUString& sPro
 Property aNameProp(sPropName, 0, Type(), 0);
 Property* pResult = std::lower_bound(pProperties, pProperties + nLen, 
aNameProp, PropertyCompareByName());
 
-if ( pResult && (pResult != pProperties + nLen) && (pResult->Name == 
sPropName) )
+if ( (pResult != seqProps.end()) && (pResult->Name == sPropName) )
 {
 pResult->Attributes |= nAddAttrib;
 pResult->Attributes &= ~nRemoveAttrib;
diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 109217552183..23905d80f14a 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -962,8 +962,8 @@ try
 Property* pResult = std::lower_bound(
 pNewProps, pNewProps + nNewLen, pOldProps[i], 
::comphelper::PropertyCompareByName());
 
-if (pResult
-&& ( pResult != pNewProps + nNewLen && pResult->Name == 
pOldProps[i].Name )
+if (   ( pResult != aNewProperties.end() )
+&& ( pResult->Name == pOldProps[i].Name )
 && ( (pResult->Attributes & PropertyAttribute::READONLY) == 0 )

[Libreoffice-commits] core.git: sal/osl

2017-07-07 Thread Chris Sherlock
 sal/osl/unx/file_misc.cxx |   32 ++--
 1 file changed, 18 insertions(+), 14 deletions(-)

New commits:
commit 6c4224b7ac9d8b016759ae8b5c0afdbef473a16f
Author: Chris Sherlock 
Date:   Wed Jul 5 12:46:33 2017 +1000

tdf#43157 - osl: convert OSL_ASSERT in unx/file_misc.cxx

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

diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 9f5905b36d9d..28f8edc04b59 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -45,6 +45,7 @@
 #include 
 
 #include 
+#include 
 
 #ifdef ANDROID
 #include 
@@ -226,11 +227,10 @@ oslFileError SAL_CALL osl_openDirectory(rtl_uString* 
ustrDirectoryURL, oslDirect
 
 oslFileError SAL_CALL osl_closeDirectory(oslDirectory pDirectory)
 {
+SAL_WARN_IF(!pDirectory, "sal.file", "pDirectory is nullptr");
 oslDirectoryImpl* pDirImpl = static_cast(pDirectory);
 oslFileError err = osl_File_E_None;
 
-OSL_ASSERT(pDirectory);
-
 if (!pDirImpl)
 return osl_File_E_INVAL;
 
@@ -280,14 +280,14 @@ static struct dirent* osl_readdir_impl_(DIR* pdir, bool 
bFilterLocalAndParentDir
 oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory pDirectory,
 oslDirectoryItem* pItem, SAL_UNUSED_PARAMETER sal_uInt32 /*uHint*/)
 {
+SAL_WARN_IF(!pDirectory, "sal.file", "pDirectory is nullptr");
+SAL_WARN_IF(!pItem, "sal.file", "pItem is nullptr");
+
 oslDirectoryImpl* pDirImpl = static_cast(pDirectory);
 rtl_uString* ustrFileName = nullptr;
 rtl_uString* ustrFilePath = nullptr;
 struct dirent* pEntry;
 
-OSL_ASSERT(pDirectory);
-OSL_ASSERT(pItem);
-
 if ((pDirectory == nullptr) || (pItem == nullptr))
 return osl_File_E_INVAL;
 
@@ -321,7 +321,7 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory 
pDirectory,
 /* convert file name to unicode */
 rtl_string2UString(&ustrFileName, pEntry->d_name, strlen(pEntry->d_name),
osl_getThreadTextEncoding(), 
OSTRING_TO_OUSTRING_CVTFLAGS);
-OSL_ASSERT(ustrFileName);
+assert(ustrFileName);
 
 #endif
 
@@ -347,10 +347,12 @@ oslFileError SAL_CALL 
osl_getNextDirectoryItem(oslDirectory pDirectory,
 
 oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString* ustrFileURL, 
oslDirectoryItem* pItem)
 {
+SAL_WARN_IF((!ustrFileURL) || (ustrFileURL->length == 0), "sal.file", 
"Invalid file URL");
+SAL_WARN_IF(!pItem, "sal.file", "pItem is nullptr");
+
 rtl_uString* ustrSystemPath = nullptr;
 oslFileError osl_error = osl_File_E_INVAL;
 
-OSL_ASSERT((ustrFileURL) && (pItem));
 if ((!ustrFileURL) || (ustrFileURL->length == 0) || (!pItem))
 return osl_File_E_INVAL;
 
@@ -405,7 +407,8 @@ oslFileError osl_createDirectoryWithFlags(
 char path[PATH_MAX];
 oslFileError eRet;
 
-OSL_ASSERT( ustrDirectoryURL );
+SAL_WARN_IF((!ustrDirectoryURL) || (ustrDirectoryURL->length == 0),
+"sal.file", "Invalid directory URL");
 
 /* convert directory url to system path */
 eRet = FileURLToPath( path, PATH_MAX, ustrDirectoryURL );
@@ -425,7 +428,8 @@ oslFileError SAL_CALL osl_removeDirectory( rtl_uString* 
ustrDirectoryURL )
 char path[PATH_MAX];
 oslFileError eRet;
 
-OSL_ASSERT( ustrDirectoryURL );
+SAL_WARN_IF((!ustrDirectoryURL) || (ustrDirectoryURL->length == 0),
+"sal.file", "Invalid directory URL");
 
 /* convert directory url to system path */
 eRet = FileURLToPath( path, PATH_MAX, ustrDirectoryURL );
@@ -582,8 +586,8 @@ oslFileError SAL_CALL osl_moveFile( rtl_uString* 
ustrFileURL, rtl_uString* ustrD
 char destPath[PATH_MAX];
 oslFileError eRet;
 
-OSL_ASSERT( ustrFileURL );
-OSL_ASSERT( ustrDestURL );
+SAL_WARN_IF((!ustrFileURL) || (ustrFileURL->length == 0), "sal.file", 
"Invalid source file URL");
+SAL_WARN_IF((!ustrDestURL) || (ustrDestURL->length == 0), "sal.file", 
"Invalid destination file URL");
 
 /* convert source url to system path */
 eRet = FileURLToPath( srcPath, PATH_MAX, ustrFileURL );
@@ -609,8 +613,8 @@ oslFileError SAL_CALL osl_copyFile( rtl_uString* 
ustrFileURL, rtl_uString* ustrD
 char destPath[PATH_MAX];
 oslFileError eRet;
 
-OSL_ASSERT( ustrFileURL );
-OSL_ASSERT( ustrDestURL );
+SAL_WARN_IF((!ustrFileURL) || (ustrFileURL->length == 0), "sal.file", 
"Invalid source file URL");
+SAL_WARN_IF((!ustrDestURL) || (ustrDestURL->length == 0), "sal.file", 
"Invalid destination file URL");
 
 /* convert source url to system path */
 eRet = FileURLToPath( srcPath, PATH_MAX, ustrFileURL );
@@ -635,7 +639,7 @@ oslFileError SAL_CALL osl_removeFile( rtl_uString* 
ustrFileURL )
 char path[PATH_MAX];
 oslFileError eRet;
 
-OSL_ASSERT( ustrFileURL );
+SAL_WARN_IF((!ustrFileURL) || (ustrFileURL->length == 0), "sal.file", 
"Invalid file URL");

[Libreoffice-commits] core.git: sal/osl

2017-07-07 Thread Chris Sherlock
 sal/osl/unx/file_misc.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 20c749d87c2b45f3b905f6d73bc5bc9a8c09a17c
Author: Chris Sherlock 
Date:   Wed Jul 5 12:25:06 2017 +1000

osl: unx osl_getDirectoryItem() cleanup

Whitespacing made consistent in function, and switch to more conventional
nullptr testing style.

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

diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 4b6c9e12b8fd..9f5905b36d9d 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -345,13 +345,13 @@ oslFileError SAL_CALL 
osl_getNextDirectoryItem(oslDirectory pDirectory,
 return osl_File_E_None;
 }
 
-oslFileError SAL_CALL osl_getDirectoryItem( rtl_uString* ustrFileURL, 
oslDirectoryItem* pItem )
+oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString* ustrFileURL, 
oslDirectoryItem* pItem)
 {
 rtl_uString* ustrSystemPath = nullptr;
-oslFileError osl_error  = osl_File_E_INVAL;
+oslFileError osl_error = osl_File_E_INVAL;
 
-OSL_ASSERT((nullptr != ustrFileURL) && (nullptr != pItem));
-if ((ustrFileURL == nullptr) || (ustrFileURL->length == 0) || (pItem == 
nullptr))
+OSL_ASSERT((ustrFileURL) && (pItem));
+if ((!ustrFileURL) || (ustrFileURL->length == 0) || (!pItem))
 return osl_File_E_INVAL;
 
 osl_error = osl_getSystemPathFromFileURL_Ex(ustrFileURL, &ustrSystemPath);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sal/osl

2017-07-07 Thread Chris Sherlock
 sal/osl/unx/file_misc.cxx |   47 +++---
 1 file changed, 24 insertions(+), 23 deletions(-)

New commits:
commit 00def4025b5fd95b0fc8d88fbbb9477526e8b12e
Author: Chris Sherlock 
Date:   Wed Jul 5 12:19:01 2017 +1000

osl: unx osl_getNextDirectoryItem() cleanup

I could not easily tell on first reading this function if Directory was
a pointer or not (it is), so changed name to pDirectory). The signature
was too long, so fixed this, whitespacing was inconsistent so small
change there. Also converted to more contentional testing of nullptr.

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

diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 5ff4d62bb4d2..4b6c9e12b8fd 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -277,21 +277,22 @@ static struct dirent* osl_readdir_impl_(DIR* pdir, bool 
bFilterLocalAndParentDir
 return pdirent;
 }
 
-oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory Directory, 
oslDirectoryItem* pItem, SAL_UNUSED_PARAMETER sal_uInt32 /*uHint*/)
+oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory pDirectory,
+oslDirectoryItem* pItem, SAL_UNUSED_PARAMETER sal_uInt32 /*uHint*/)
 {
-oslDirectoryImpl* pDirImpl = static_cast(Directory);
-rtl_uString*  ustrFileName = nullptr;
-rtl_uString*  ustrFilePath = nullptr;
-struct dirent*pEntry;
+oslDirectoryImpl* pDirImpl = static_cast(pDirectory);
+rtl_uString* ustrFileName = nullptr;
+rtl_uString* ustrFilePath = nullptr;
+struct dirent* pEntry;
 
-OSL_ASSERT(Directory);
+OSL_ASSERT(pDirectory);
 OSL_ASSERT(pItem);
 
-if ((Directory == nullptr) || (pItem == nullptr))
+if ((pDirectory == nullptr) || (pItem == nullptr))
 return osl_File_E_INVAL;
 
 #ifdef ANDROID
-if( pDirImpl->eKind == oslDirectoryImpl::KIND_ASSETS )
+if(pDirImpl->eKind == oslDirectoryImpl::KIND_ASSETS)
 {
 pEntry = lo_apk_readdir(pDirImpl->pApkDirStruct);
 }
@@ -301,34 +302,34 @@ oslFileError SAL_CALL 
osl_getNextDirectoryItem(oslDirectory Directory, oslDirect
 pEntry = osl_readdir_impl_(pDirImpl->pDirStruct, true);
 }
 
-if (pEntry == nullptr)
+if (!pEntry)
 return osl_File_E_NOENT;
 
 #if defined(MACOSX)
 
 // convert decomposed filename to precomposed unicode
 char composed_name[BUFSIZ];
-CFMutableStringRef strRef = CFStringCreateMutable (nullptr, 0 );
-CFStringAppendCString( strRef, pEntry->d_name, kCFStringEncodingUTF8 );  
//UTF8 is default on Mac OSX
-CFStringNormalize( strRef, kCFStringNormalizationFormC );
-CFStringGetCString( strRef, composed_name, BUFSIZ, kCFStringEncodingUTF8 );
-CFRelease( strRef );
-rtl_string2UString( &ustrFileName, composed_name, strlen( composed_name),
-osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS );
+CFMutableStringRef strRef = CFStringCreateMutable(nullptr, 0 );
+CFStringAppendCString(strRef, pEntry->d_name, kCFStringEncodingUTF8);  // 
UTF8 is default on Mac OSX
+CFStringNormalize(strRef, kCFStringNormalizationFormC);
+CFStringGetCString(strRef, composed_name, BUFSIZ, kCFStringEncodingUTF8);
+CFRelease(strRef);
+rtl_string2UString(&ustrFileName, composed_name, strlen(composed_name),
+   osl_getThreadTextEncoding(), 
OSTRING_TO_OUSTRING_CVTFLAGS);
 
 #else  // not MACOSX
 /* convert file name to unicode */
-rtl_string2UString( &ustrFileName, pEntry->d_name, strlen( pEntry->d_name 
),
-osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS );
-OSL_ASSERT(ustrFileName != nullptr);
+rtl_string2UString(&ustrFileName, pEntry->d_name, strlen(pEntry->d_name),
+   osl_getThreadTextEncoding(), 
OSTRING_TO_OUSTRING_CVTFLAGS);
+OSL_ASSERT(ustrFileName);
 
 #endif
 
 osl_systemPathMakeAbsolutePath(pDirImpl->ustrPath, ustrFileName, 
&ustrFilePath);
-rtl_uString_release( ustrFileName );
+rtl_uString_release(ustrFileName);
 
-DirectoryItem_Impl * pImpl = static_cast< DirectoryItem_Impl* >(*pItem);
-if (pImpl != nullptr)
+DirectoryItem_Impl* pImpl = static_cast< DirectoryItem_Impl* >(*pItem);
+if (pImpl)
 {
 pImpl->release();
 pImpl = nullptr;
@@ -339,7 +340,7 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory 
Directory, oslDirect
 pImpl = new DirectoryItem_Impl(ustrFilePath);
 #endif /* _DIRENT_HAVE_D_TYPE */
 *pItem = pImpl;
-rtl_uString_release( ustrFilePath );
+rtl_uString_release(ustrFilePath);
 
 return osl_File_E_None;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sal/osl

2017-07-07 Thread Chris Sherlock
 sal/osl/unx/file_misc.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit b7bee6c10fc46754ea784c301efc2a5488c31b14
Author: Chris Sherlock 
Date:   Wed Jul 5 12:11:35 2017 +1000

osl: osl_closeDirectory cleanup

When I was reading this code, it wasn't entirely clear to me without
looking at the typedef of oslDirectory whether I was dealing with a
variable or a pointer, so I have changed this to pDirectory. I also
made a small tweak to the whitespace to help readability.

I also changed from explicit comparison to nullptr to the more
conventional style.

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

diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 816a4f729405..5ff4d62bb4d2 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -224,33 +224,33 @@ oslFileError SAL_CALL osl_openDirectory(rtl_uString* 
ustrDirectoryURL, oslDirect
 return oslTranslateFileError(OSL_FET_ERROR, errno);
 }
 
-oslFileError SAL_CALL osl_closeDirectory( oslDirectory Directory )
+oslFileError SAL_CALL osl_closeDirectory(oslDirectory pDirectory)
 {
-oslDirectoryImpl* pDirImpl = static_cast(Directory);
+oslDirectoryImpl* pDirImpl = static_cast(pDirectory);
 oslFileError err = osl_File_E_None;
 
-OSL_ASSERT( Directory );
+OSL_ASSERT(pDirectory);
 
-if( pDirImpl == nullptr )
+if (!pDirImpl)
 return osl_File_E_INVAL;
 
 #ifdef ANDROID
-if( pDirImpl->eKind == oslDirectoryImpl::KIND_ASSETS )
+if (pDirImpl->eKind == oslDirectoryImpl::KIND_ASSETS)
 {
-if (lo_apk_closedir( pDirImpl->pApkDirStruct ))
+if (lo_apk_closedir(pDirImpl->pApkDirStruct))
 err = osl_File_E_IO;
 }
 else
 #endif
 {
-if( closedir( pDirImpl->pDirStruct ) )
+if (closedir( pDirImpl->pDirStruct))
 err = oslTranslateFileError(OSL_FET_ERROR, errno);
 }
 
 /* cleanup members */
-rtl_uString_release( pDirImpl->ustrPath );
+rtl_uString_release(pDirImpl->ustrPath);
 
-rtl_freeMemory( pDirImpl );
+rtl_freeMemory(pDirImpl);
 
 return err;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Changes to 'refs/tags/2.1.2-7'

2017-07-07 Thread Andras Timar
Tag '2.1.2-7' created by Andras Timar  at 
2017-07-07 18:05 +

2.1.2-7

Changes since 2.1.2-5:
---
 0 files changed
---
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd' - debian/changelog loolwsd.spec.in

2017-07-07 Thread Andras Timar
 debian/changelog |6 ++
 loolwsd.spec.in  |2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit cc8fc1a28bd2d19e72754720327ffa443e2daa40
Author: Andras Timar 
Date:   Fri Jul 7 20:04:22 2017 +0200

Bump version for packages 2.1.2-7

Change-Id: I967889afbc6156a81e299ddf4ce59d9c092b8037

diff --git a/debian/changelog b/debian/changelog
index 68cbf3e8..2c513e41 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+loolwsd (2.1.2-7) unstable; urgency=medium
+
+  * see the git log: http://col.la/cool21
+
+ -- Andras Timar   Thu, 07 Jul 2017 20:00:00 +0200
+
 loolwsd (2.1.2-6) unstable; urgency=medium
 
   * see the git log: http://col.la/cool21
diff --git a/loolwsd.spec.in b/loolwsd.spec.in
index d1c62520..0ae476c2 100644
--- a/loolwsd.spec.in
+++ b/loolwsd.spec.in
@@ -12,7 +12,7 @@ Name:   loolwsd%{name_suffix}
 Name:   loolwsd
 %endif
 Version:@PACKAGE_VERSION@
-Release:6%{?dist}
+Release:7%{?dist}
 Vendor: Collabora
 Summary:LibreOffice On-Line WebSocket Daemon
 License:MPL
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Mohammed Abdul Azeem
 package/source/zipapi/XBufferedThreadedStream.cxx |4 ++--
 package/source/zipapi/XBufferedThreadedStream.hxx |2 +-
 package/source/zipapi/XUnbufferedStream.cxx   |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit a62507eb405961c27ebf79d6b9bdd7a106d06123
Author: Mohammed Abdul Azeem 
Date:   Fri Jul 7 00:01:03 2017 +0530

tdf#108821 - fix for overflow of variables on opening huge files

This should fix the issue, as well as restrict available
to return only non-negative values.

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

diff --git a/package/source/zipapi/XBufferedThreadedStream.cxx 
b/package/source/zipapi/XBufferedThreadedStream.cxx
index 87b7349cccba..c7fd3dbacd36 100644
--- a/package/source/zipapi/XBufferedThreadedStream.cxx
+++ b/package/source/zipapi/XBufferedThreadedStream.cxx
@@ -145,7 +145,7 @@ sal_Int32 SAL_CALL XBufferedThreadedStream::readBytes( 
Sequence< sal_Int8 >& rDa
 if( !hasBytes() )
 return 0;
 
-const sal_Int32 nAvailableSize = std::min( nBytesToRead, 
remainingSize() );
+const sal_Int32 nAvailableSize = static_cast< sal_Int32 > ( std::min< 
sal_Int64 >( nBytesToRead, remainingSize() ) );
 rData.realloc( nAvailableSize );
 sal_Int32 i = 0, nPendingBytes = nAvailableSize;
 
@@ -188,7 +188,7 @@ sal_Int32 SAL_CALL XBufferedThreadedStream::available()
 if( !hasBytes() )
 return 0;
 
-return remainingSize();
+return static_cast< sal_Int32 > ( std::min< sal_Int64 >( SAL_MAX_INT32, 
remainingSize() ) );
 }
 
 void SAL_CALL XBufferedThreadedStream::closeInput()
diff --git a/package/source/zipapi/XBufferedThreadedStream.hxx 
b/package/source/zipapi/XBufferedThreadedStream.hxx
index 9ba908e01f5e..c28bb049de16 100644
--- a/package/source/zipapi/XBufferedThreadedStream.hxx
+++ b/package/source/zipapi/XBufferedThreadedStream.hxx
@@ -44,7 +44,7 @@ private:
 static const size_t nBufferSize = 32 * 1024;
 
 const Buffer& getNextBlock();
-size_t remainingSize() const { return mnStreamSize - mnPos; }
+sal_Int64 remainingSize() const { return mnStreamSize - mnPos; }
 bool hasBytes() const { return mnPos < mnStreamSize; }
 
 bool canProduce() const
diff --git a/package/source/zipapi/XUnbufferedStream.cxx 
b/package/source/zipapi/XUnbufferedStream.cxx
index e82e720795d3..d1f65b29b7aa 100644
--- a/package/source/zipapi/XUnbufferedStream.cxx
+++ b/package/source/zipapi/XUnbufferedStream.cxx
@@ -310,7 +310,7 @@ void SAL_CALL XUnbufferedStream::skipBytes( sal_Int32 
nBytesToSkip )
 sal_Int32 SAL_CALL XUnbufferedStream::available(  )
 {
 //available size must include the prepended header in case of wrapped raw 
stream
-return static_cast < sal_Int32 > ( mnZipSize + mnHeaderToRead - 
mnMyCurrent );
+return static_cast< sal_Int32 > ( std::min< sal_Int64 >( SAL_MAX_INT32, 
(mnZipSize + mnHeaderToRead - mnMyCurrent) ) );
 }
 
 void SAL_CALL XUnbufferedStream::closeInput(  )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Tamás Zolnai
 cui/source/tabpages/numpages.cxx  |1 +
 include/editeng/numitem.hxx   |5 -
 sd/qa/unit/data/odp/tdf108925.odp |binary
 sd/qa/unit/import-tests.cxx   |   19 +++
 4 files changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 11652be4071ef6d1d89b2c397aa1a32476e03bf6
Author: Tamás Zolnai 
Date:   Fri Jul 7 16:22:47 2017 +0200

tdf#108925: Too small bullet size confuses the user

Add a constraint for bullet relative size to avoid too small
bullets which are hardly recognizable. Use the same 25% lower
limit what MSO uses.

Change-Id: Id956ecf3ec831c569188b944be58da03bf30a55e
Reviewed-on: https://gerrit.libreoffice.org/39696
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index f8c3f4de8738..0ce6790501ee 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1112,6 +1112,7 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(vcl::Window* 
pParent,
 
 get(m_pBulRelSizeFT, "relsizeft");
 get(m_pBulRelSizeMF, "relsize");
+m_pBulRelSizeMF->SetMin(SVX_NUM_REL_SIZE_MIN);
 
 get(m_pAllLevelFT, "sublevelsft");
 get(m_pAllLevelNF, "sublevels");
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 16d418de7f7b..1e72154b43b2 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class SvxBrushItem;
 namespace vcl { class Font; }
@@ -48,6 +49,8 @@ namespace com{namespace sun{ namespace star{
 
 #define SVX_NO_NUM  200 // Marker for no numbering
 #define SVX_NO_NUMLEVEL 0x20
+#define SVX_NUM_REL_SIZE_MIN25 // Lower limit for numbering relative size
+
 
 #define LINK_TOKEN  0x80 //indicate linked bitmaps - for use in dialog only
 class EDITENG_DLLPUBLIC SvxNumberType
@@ -168,7 +171,7 @@ public:
 const vcl::Font* GetBulletFont() const {return pBulletFont;}
 voidSetBulletChar(sal_Unicode cSet){cBullet = cSet;}
 sal_Unicode GetBulletChar()const {return cBullet;}
-voidSetBulletRelSize(sal_uInt16 nSet) {nBulletRelSize = nSet;}
+voidSetBulletRelSize(sal_uInt16 nSet) {nBulletRelSize = 
std::max(nSet,sal_uInt16(SVX_NUM_REL_SIZE_MIN));}
 sal_uInt16  GetBulletRelSize() const { return nBulletRelSize;}
 voidSetBulletColor(Color nSet){nBulletColor = nSet;}
 const Color&GetBulletColor()const {return nBulletColor;}
diff --git a/sd/qa/unit/data/odp/tdf108925.odp 
b/sd/qa/unit/data/odp/tdf108925.odp
new file mode 100755
index ..5b6dfc4ca4a2
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf108925.odp differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 62f2b98f2d88..a4d8253399a6 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -160,6 +160,7 @@ public:
 void testTdf105150PPT();
 void testTdf100926();
 void testTdf89064();
+void testTdf108925();
 
 bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, 
std::vector& rExpected);
 void testPatternImport();
@@ -228,6 +229,7 @@ public:
 CPPUNIT_TEST(testTdf100926);
 CPPUNIT_TEST(testPatternImport);
 CPPUNIT_TEST(testTdf89064);
+CPPUNIT_TEST(testTdf108925);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2187,6 +2189,23 @@ void SdImportTest::testTdf89064()
 xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf108925()
+{
+// Test document contains bulleting with too small bullet size (1%) which 
breaks the lower constraint
+// So it should be converted to the lowest allowed value (25%).
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf108925.odp"), ODP);
+const SdrPage *pPage = GetPage(1, xDocShRef);
+SdrTextObj *pTxtObj = dynamic_cast(pPage->GetObj(0));
+CPPUNIT_ASSERT_MESSAGE("No text object", pTxtObj != nullptr);
+const EditTextObject& aEdit = 
pTxtObj->GetOutlinerParaObject()->GetTextObject();
+
+const SvxNumBulletItem *pNumFmt = dynamic_cast(aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET));
+CPPUNIT_ASSERT(pNumFmt);
+
CPPUNIT_ASSERT_EQUAL(pNumFmt->GetNumRule()->GetLevel(0).GetBulletRelSize(), 
sal_uInt16(25));
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd' - common/Util.cpp common/Util.hpp loleaflet/src loolwsd.xml.in wsd/Admin.cpp wsd/Admin.hpp wsd/AdminModel.cpp wsd/AdminM

2017-07-07 Thread Pranav Kant
 common/Util.cpp  |   21 
 common/Util.hpp  |3 ++
 loleaflet/src/core/Socket.js |4 +--
 loolwsd.xml.in   |1 
 wsd/Admin.cpp|   44 +++
 wsd/Admin.hpp|8 ++-
 wsd/AdminModel.cpp   |   19 ++
 wsd/AdminModel.hpp   |   21 
 wsd/DocumentBroker.cpp   |   12 +--
 wsd/DocumentBroker.hpp   |4 +++
 wsd/LOOLWSD.cpp  |   14 +
 wsd/LOOLWSD.hpp  |4 +++
 12 files changed, 146 insertions(+), 9 deletions(-)

New commits:
commit 99c65d66434e6c623b0a2d7e5fdc5b46a45ade19
Author: Pranav Kant 
Date:   Fri Jul 7 17:12:19 2017 +0530

Introduce memproportion of memory to use before shutting down processes.

Start killing documents when memory usage goes above threshold.

Also make it possible to close documents from admin instance.
In DocumentBroker::closeDocument, just set the _stop flag and wake
up the polling thread which will terminate the children, instead of
manually terminating the children.

Change-Id: Ie70e05b3fb6ea816a87b6dcfaed92cdddb94aa90
(cherry picked from commit fde57adbbf9ab2fba80c6b8e0d877c797b55bea5)

diff --git a/common/Util.cpp b/common/Util.cpp
index b3bcb354..bd7209f9 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -171,6 +171,27 @@ namespace Util
 return nullptr;
 }
 
+size_t getTotalSystemMemory()
+{
+size_t totalMemKb = 0;
+FILE* file = fopen("/proc/meminfo", "r");
+if (file != nullptr)
+{
+char line[4096] = { 0 };
+while (fgets(line, sizeof(line), file))
+{
+const char* value;
+if ((value = startsWith(line, "MemTotal:")))
+{
+totalMemKb = atoi(value);
+break;
+}
+}
+}
+
+return totalMemKb;
+}
+
 std::pair getPssAndDirtyFromSMaps(FILE* file)
 {
 size_t numPSSKb = 0;
diff --git a/common/Util.hpp b/common/Util.hpp
index 93f25cf0..5480d790 100644
--- a/common/Util.hpp
+++ b/common/Util.hpp
@@ -95,6 +95,9 @@ namespace Util
 #endif
 }
 
+/// Returns the total physical memory (in kB) available in the system
+size_t getTotalSystemMemory();
+
 /// Returns the process PSS in KB (works only when we have perms for 
/proc/pid/smaps).
 size_t getMemoryUsagePSS(const Poco::Process::PID pid);
 
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index e137acca..9843d6e7 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -231,7 +231,7 @@ L.Socket = L.Class.extend({
if (textMsg === 'ownertermination') {
msg = _('Session terminated by document owner');
}
-   else if (textMsg === 'idle') {
+   else if (textMsg === 'idle' || textMsg === 'oom') {
msg = _('Session was terminated due to idleness 
- please click to reload');
this._map._documentIdle = true;
}
@@ -301,7 +301,7 @@ L.Socket = L.Class.extend({
});
options.$vex.append(options.$vexContent);
 
-   if (textMsg === 'idle') {
+   if (textMsg === 'idle' || textMsg === 'oom') {
var map = this._map;
options.$vex.bind('click.vex', function(e) {
console.debug('idleness: reactivating');
diff --git a/loolwsd.xml.in b/loolwsd.xml.in
index eed51283..6f8d6d35 100644
--- a/loolwsd.xml.in
+++ b/loolwsd.xml.in
@@ -11,6 +11,7 @@
 
 
 
+
 1
 
 4
diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index 5153586d..3cffc82b 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -291,6 +291,9 @@ Admin::Admin() :
 {
 LOG_INF("Admin ctor.");
 
+_totalSysMem = Util::getTotalSystemMemory();
+LOG_TRC("Total system memory : " << _totalSysMem);
+
 const auto totalMem = getTotalMemoryUsage();
 LOG_TRC("Total memory used: " << totalMem);
 _model.addMemStats(totalMem);
@@ -336,6 +339,9 @@ void Admin::pollingThread()
 
 lastMem = now;
 memWait += _memStatsTaskIntervalMs;
+
+// If our total memory consumption is above limit, cleanup
+triggerMemoryCleanup(totalMem);
 }
 
 // Handle websockets & other work.
@@ -422,6 +428,44 @@ void Admin::updateMemoryDirty(const std::string& docKey, 
int dirty)
  { _model.updateMemoryDirty(docKey, dirty); });
 }
 
+
+void Admin::triggerMemoryCleanup(size_t totalMem)
+{
+LOG_TRC("Total memory we are consuming (in kB): " << totalMem);
+// Trigger mem 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd' - wsd/DocumentBroker.cpp

2017-07-07 Thread Pranav Kant
 wsd/DocumentBroker.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit be3c1d2c8d31d427cb5cc9cff41189733cf1a7ef
Author: Pranav Kant 
Date:   Wed Jun 21 16:52:03 2017 +0530

Remove redundant function call

This is called later after the while loop. Breaking out of while loop
should be enough.

Change-Id: I04979d3af1f475c05b5a43d7afe47770ff69ee25
Reviewed-on: https://gerrit.libreoffice.org/39086
Reviewed-by: pranavk 
Tested-by: pranavk 
(cherry picked from commit 6c6ddbe4253152517312a32cc8cb7fdb22633f37)
Reviewed-on: https://gerrit.libreoffice.org/39702
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 7d482965..a993e3d9 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -242,7 +242,7 @@ void DocumentBroker::pollThread()
 if (ShutdownRequestFlag)
 {
 closeReason = "recycling";
-shutdownClients(closeReason);
+_stop = true;
 }
 else if (AutoSaveEnabled && !_stop &&
  std::chrono::duration_cast(now - 
last30SecCheckTime).count() >= 30)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd' - wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp

2017-07-07 Thread Pranav Kant
 wsd/DocumentBroker.cpp |   19 ++-
 wsd/DocumentBroker.hpp |2 +-
 2 files changed, 7 insertions(+), 14 deletions(-)

New commits:
commit 5d057de0dd7a4d1e5d5cf5fe995f021110691aca
Author: Pranav Kant 
Date:   Wed Jun 21 15:37:38 2017 +0530

Bin unused parameter, rude

Change-Id: I39f55f55f8a0c5432350625d9720ea2367955a8c
Reviewed-on: https://gerrit.libreoffice.org/39085
Reviewed-by: pranavk 
Tested-by: pranavk 
(cherry picked from commit c21de445247813c27f66c62a9bf6af03a11386ec)
Reviewed-on: https://gerrit.libreoffice.org/39703
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index bd506fc2..7d482965 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -283,7 +283,7 @@ void DocumentBroker::pollThread()
 }
 
 // Terminate properly while we can.
-terminateChild(closeReason, false);
+terminateChild(closeReason);
 
 // Stop to mark it done and cleanup.
 _poll->stop();
@@ -1369,17 +1369,14 @@ void DocumentBroker::childSocketTerminated()
 shutdownClients("terminated");
 }
 
-void DocumentBroker::terminateChild(const std::string& closeReason, const bool 
rude)
+void DocumentBroker::terminateChild(const std::string& closeReason)
 {
 assertCorrectThread();
 
 LOG_INF("Terminating doc [" << _docKey << "].");
 
 // Close all running sessions
-if (!rude)
-{
-shutdownClients(closeReason);
-}
+shutdownClients(closeReason);
 
 if (_childProcess)
 {
@@ -1387,12 +1384,8 @@ void DocumentBroker::terminateChild(const std::string& 
closeReason, const bool r
 
 // First flag to stop as it might be waiting on our lock
 // to process some incoming message.
-if (!rude)
-{
-_childProcess->stop();
-}
-
-_childProcess->close(rude);
+_childProcess->stop();
+_childProcess->close(false);
 }
 
 _stop = true;
@@ -1403,7 +1396,7 @@ void DocumentBroker::closeDocument(const std::string& 
reason)
 assertCorrectThread();
 
 LOG_DBG("Closing DocumentBroker for docKey [" << _docKey << "] with 
reason: " << reason);
-terminateChild(reason, true);
+terminateChild(reason);
 }
 
 void DocumentBroker::updateLastActivityTime()
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 27d525c0..11354c0f 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -344,7 +344,7 @@ private:
 
 /// This gracefully terminates the connection
 /// with the child and cleans up ChildProcess etc.
-void terminateChild(const std::string& closeReason, const bool rude);
+void terminateChild(const std::string& closeReason);
 
 /// Saves the doc to the storage.
 bool saveToStorageInternal(const std::string& sesionId, bool success, 
const std::string& result = "");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd' - loleaflet/admin.strings.js loleaflet/dist loleaflet/src wsd/Admin.cpp wsd/Admin.hpp wsd/AdminModel.cpp wsd/AdminModel.

2017-07-07 Thread Aditya Dewan
 loleaflet/admin.strings.js |1 +
 loleaflet/dist/admin/admin.html|1 +
 loleaflet/src/admin/AdminSocketOverview.js |   23 +--
 wsd/Admin.cpp  |5 +
 wsd/Admin.hpp  |1 +
 wsd/AdminModel.cpp |   19 +++
 wsd/AdminModel.hpp |6 ++
 wsd/DocumentBroker.cpp |   10 +++---
 wsd/DocumentBroker.hpp |1 -
 9 files changed, 61 insertions(+), 6 deletions(-)

New commits:
commit 32b757989ba64ab8da509c8c37274cfdfa65bc87
Author: Aditya Dewan 
Date:   Fri May 12 19:29:01 2017 +0530

tdf#107752 admin console: indicating whether a document is modified.

Change-Id: I6055a601c1dd3b5e9700ef75d7c07d7e0b13d663
(cherry picked from commit 9db39ce741604b24a43c08d0db6e7e641a42d19d)
Reviewed-on: https://gerrit.libreoffice.org/39701
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/admin.strings.js b/loleaflet/admin.strings.js
index fcfb574a..6a5e2d39 100644
--- a/loleaflet/admin.strings.js
+++ b/loleaflet/admin.strings.js
@@ -17,6 +17,7 @@ l10nstrings.strDocument = _('Document');
 l10nstrings.strNumberOfViews = _('Number of views');
 l10nstrings.strElapsedTime = _('Elapsed time');
 l10nstrings.strIdleTime = _('Idle time');
+l10nstrings.strModified = _('Modified');
 l10nstrings.strKill = _('Kill');
 l10nstrings.strGraphs = _('Graphs');
 l10nstrings.strSave = _('Save');
diff --git a/loleaflet/dist/admin/admin.html b/loleaflet/dist/admin/admin.html
index ac68b753..59e63507 100644
--- a/loleaflet/dist/admin/admin.html
+++ b/loleaflet/dist/admin/admin.html
@@ -89,6 +89,7 @@
  
document.write(l10nstrings.strMemoryConsumed)
  
document.write(l10nstrings.strElapsedTime)
  
document.write(l10nstrings.strIdleTime)
+ 
document.write(l10nstrings.strModified)

  
  
diff --git a/loleaflet/src/admin/AdminSocketOverview.js 
b/loleaflet/src/admin/AdminSocketOverview.js
index 96c29a0b..b1070fcd 100644
--- a/loleaflet/src/admin/AdminSocketOverview.js
+++ b/loleaflet/src/admin/AdminSocketOverview.js
@@ -23,7 +23,7 @@ var AdminSocketOverview = AdminSocketBase.extend({
this.base.call(this);
 
this.socket.send('documents');
-   this.socket.send('subscribe adddoc rmdoc resetidle propchange');
+   this.socket.send('subscribe adddoc rmdoc resetidle propchange 
modifications');
 
this._getBasicStats();
var socketOverview = this;
@@ -101,7 +101,8 @@ var AdminSocketOverview = AdminSocketBase.extend({
sMem = docProps['memory'];
sDocTime = docProps['elapsedTime'];
sDocIdle = docProps['idleTime'];
-   userListJson = docProps['views']
+   modified = docProps['modified'];
+   userListJson = docProps['views'];
 
$doc = $('#doc' + sPid);
$rowContainer = 
$(document.createElement('tr')).attr('id', 'doc' + sPid);
@@ -137,6 +138,11 @@ var AdminSocketOverview = AdminSocketBase.extend({
  
.val(parseInt(sDocIdle))
  
.text(Util.humanizeSecs(sDocIdle));
$rowContainer.append($docIdle);
+
+   $mod = 
$(document.createElement('td')).attr('id', 'mod' + sPid)
+   
  .text(modified);
+   $rowContainer.append($mod);
+
$('#doclist').append($rowContainer);
}
}
@@ -187,6 +193,10 @@ var AdminSocketOverview = AdminSocketBase.extend({
  
.text(Util.humanizeSecs(0));
$rowContainer.append($docIdle);
 
+   $mod = 
$(document.createElement('td')).attr('id', 'mod' + sPid)
+   
  .text('');
+   $rowContainer.append($mod);
+
$('#doclist').append($rowContainer);
 
$a = 
$(document.getElementById('active_docs_count'));
@@ -255,6 +265,15 @@ var AdminSocketOverview = AdminSocketBase.extend({
}
}
}
+   else if (textMsg.startsWith('modifications')) {
+   textMsg = textMsg.substring('modifications'.lengt

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd' - loleaflet/dist loleaflet/src wsd/Admin.cpp wsd/Admin.hpp wsd/AdminModel.cpp wsd/AdminModel.hpp wsd/ClientSession.hpp w

2017-07-07 Thread Aditya Dewan
 loleaflet/dist/admin/bootstrap/dashboard.css |   12 ++
 loleaflet/src/admin/AdminSocketOverview.js   |   53 ++-
 wsd/Admin.cpp|6 +--
 wsd/Admin.hpp|2 -
 wsd/AdminModel.cpp   |   46 +--
 wsd/AdminModel.hpp   |   10 +++--
 wsd/ClientSession.hpp|1 
 wsd/DocumentBroker.cpp   |2 -
 8 files changed, 97 insertions(+), 35 deletions(-)

New commits:
commit df90eecdd194f4d5c59ced4193cfb876025016af
Author: Aditya Dewan 
Date:   Fri Apr 7 19:49:04 2017 +0530

tdf#106449 admin:adding user list for each document

Change-Id: Ia5c382f469a80464d0435e1e2e4de3daaba8a690
Reviewed-on: https://gerrit.libreoffice.org/36275
Reviewed-by: pranavk 
Tested-by: pranavk 
(cherry picked from commit 41ed318de8c1ebb5c2d707b6fb12a9c9b5440407)
Reviewed-on: https://gerrit.libreoffice.org/39700
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/dist/admin/bootstrap/dashboard.css 
b/loleaflet/dist/admin/bootstrap/dashboard.css
index 0535a2fd..60ed98d2 100644
--- a/loleaflet/dist/admin/bootstrap/dashboard.css
+++ b/loleaflet/dist/admin/bootstrap/dashboard.css
@@ -113,3 +113,15 @@ body {
   position: absolute;
   display: none;
 }
+
+.userContainer{
+  display: none;
+  position: absolute;
+  border: 1px solid black;
+  padding: 5px;
+  border-radius: 4px;
+  background-color: #dd;
+}
+tr:hover .userContainer{
+  display: block;
+}
\ No newline at end of file
diff --git a/loleaflet/src/admin/AdminSocketOverview.js 
b/loleaflet/src/admin/AdminSocketOverview.js
index 4f6e0812..96c29a0b 100644
--- a/loleaflet/src/admin/AdminSocketOverview.js
+++ b/loleaflet/src/admin/AdminSocketOverview.js
@@ -89,21 +89,31 @@ var AdminSocketOverview = AdminSocketBase.extend({
var nViews, nTotalViews;
var docProps, sPid, sName, sViews, sMem, sDocTime;
if (textMsg.startsWith('documents')) {
-   var documents = textMsg.substring('documents'.length);
-   documents = documents.trim().split('\n');
-   for (var i = 0; i < documents.length; i++) {
-   docProps = documents[i].trim().split(' ');
-   sPid = docProps[0];
-   sName = decodeURI(docProps[1]);
-   sViews = docProps[2];
-   sMem = docProps[3];
-   sDocTime = docProps[4];
-   sDocIdle = docProps[5];
+   jsonStart = textMsg.indexOf('{');
+   jsonMsg = JSON.parse(textMsg.substr(jsonStart).trim());
+   docList = jsonMsg['documents'];
+   for (var i = 0; i < docList.length; i++) {
+
+   docProps = docList[i];
+   sPid = docProps['pid'];
+   sName = decodeURI(docProps['fileName']);
+   sViews = docProps['activeViews'];
+   sMem = docProps['memory'];
+   sDocTime = docProps['elapsedTime'];
+   sDocIdle = docProps['idleTime'];
+   userListJson = docProps['views']
 
$doc = $('#doc' + sPid);
$rowContainer = 
$(document.createElement('tr')).attr('id', 'doc' + sPid);
-
$pid = 
$(document.createElement('td')).text(sPid);
+   $userContainer = 
$(document.createElement('div')).attr('id', 'ucontainer' + sPid)
+   
  .addClass('userContainer');
+   for (var j = 0; j < userListJson.length; j++) {
+   $user = 
$(document.createElement('div')).text(userListJson[j]['userName'])
+   
.attr('id', 'user' + userListJson[j]['sessionid']);
+   $userContainer.append($user);
+   }
+   $pid.append($userContainer);
$rowContainer.append($pid);
 
$name = 
$(document.createElement('td')).text(sName);
@@ -142,14 +152,18 @@ var AdminSocketOverview = AdminSocketBase.extend({
docProps = textMsg.trim().split(' ');
sPid = docProps[0];
sName = decodeURI(docProps[1]);
-   // docProps[2] == sessionid
-   sMem = docProps[3];
+   session

[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/source

2017-07-07 Thread Xisco Fauli
 sw/source/core/text/frmform.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit f44f65019a60b5bd70b08eb11db8d1baf4f6e229
Author: Xisco Fauli 
Date:   Mon Jun 12 18:05:27 2017 +0200

tdf#104640, tdf#108469: Insert image where the cursor is

Partially revert 72a4987434368bfb0b15f5ebb70a52
Besides, add bDelta to the condition so the statement is false
if the image is resized

Change-Id: Ib07d328e040c38c63a30f6230ed9f6b605d76d9f
Reviewed-on: https://gerrit.libreoffice.org/38705
Tested-by: Jenkins 
Reviewed-by: Xisco Faulí 
(cherry picked from commit 3919d87210ea12ed3166c649ac52730026db01a4)
Reviewed-on: https://gerrit.libreoffice.org/38772
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 5d25abac0b13..ee0469a929ce 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1085,7 +1085,13 @@ void SwTextFrame::FormatAdjust( SwTextFormatter &rLine,
 
 const SwTwips nDocPrtTop = Frame().Top() + Prt().Top();
 const SwTwips nOldHeight = Prt().SSize().Height();
-const SwTwips nChg = rLine.CalcBottomLine() - nDocPrtTop - nOldHeight;
+SwTwips nChg = rLine.CalcBottomLine() - nDocPrtTop - nOldHeight;
+
+//#i84870# - no shrink of text frame, if it only contains one as-character 
anchored object.
+if ( nChg < 0 && !bDelta && bOnlyContainsAsCharAnchoredObj )
+{
+nChg = 0;
+}
 
 // Vertical Formatting:
 // The (rotated) repaint rectangle's x coordinate referes to the frame.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Varun Dhall
 xmloff/source/text/XMLTextListBlockContext.cxx |6 +++---
 xmloff/source/text/txtlists.cxx|2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7878bcf5547ae4d111aa8e835529e501c4e23838
Author: Varun Dhall 
Date:   Fri Jul 7 20:16:06 2017 +0530

xmloff: Updated XMLTextListBlockContext to insert elements before NumRules

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

diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx 
b/xmloff/source/text/XMLTextListBlockContext.cxx
index 0552d0197611..190840a3b7e9 100644
--- a/xmloff/source/text/XMLTextListBlockContext.cxx
+++ b/xmloff/source/text/XMLTextListBlockContext.cxx
@@ -125,6 +125,9 @@ XMLTextListBlockContext::XMLTextListBlockContext(
 }
 }
 
+// Remember this list block.
+mrTxtImport.GetTextListHelper().PushListContext( this );
+
 mxNumRules = XMLTextListsHelper::MakeNumRule(GetImport(), mxNumRules,
 sParentListStyleName, msListStyleName,
 mnLevel, &mbRestartNumbering, &mbSetDefaults );
@@ -224,9 +227,6 @@ XMLTextListBlockContext::XMLTextListBlockContext(
 sListStyleDefaultListId );
 }
 }
-
-// Remember this list block.
-mrTxtImport.GetTextListHelper().PushListContext( this );
 }
 
 XMLTextListBlockContext::~XMLTextListBlockContext()
diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx
index 420563cf6b7b..f26df8acd606 100644
--- a/xmloff/source/text/txtlists.cxx
+++ b/xmloff/source/text/txtlists.cxx
@@ -451,7 +451,7 @@ XMLTextListsHelper::MakeNumRule(
 
 xNumRules =
 SvxXMLListStyleContext::CreateNumRule( i_rImport.GetModel() );
-assert(xNumRules.is());
+SAL_INFO_IF(xNumRules.is(), "xmloff.core", "cannot create numrules");
 if ( !xNumRules.is() )
 return xNumRules;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: common/Util.cpp common/Util.hpp loleaflet/src loolwsd.xml.in wsd/Admin.cpp wsd/Admin.hpp wsd/AdminModel.cpp wsd/AdminModel.hpp wsd/DocumentBroker.cpp wsd/DocumentBrok

2017-07-07 Thread Pranav Kant
 common/Util.cpp  |   21 +
 common/Util.hpp  |3 +++
 loleaflet/src/core/Socket.js |4 ++--
 loolwsd.xml.in   |1 +
 wsd/Admin.cpp|   43 +++
 wsd/Admin.hpp|5 +
 wsd/AdminModel.cpp   |   19 +++
 wsd/AdminModel.hpp   |   21 +
 wsd/DocumentBroker.cpp   |   12 ++--
 wsd/DocumentBroker.hpp   |4 
 wsd/LOOLWSD.cpp  |   14 ++
 wsd/LOOLWSD.hpp  |4 
 12 files changed, 143 insertions(+), 8 deletions(-)

New commits:
commit fde57adbbf9ab2fba80c6b8e0d877c797b55bea5
Author: Pranav Kant 
Date:   Fri Jul 7 17:12:19 2017 +0530

Introduce hard mode when we are OOM

Start killing documents when memory usage goes above threshold.

Also make it possible to close documents from admin instance.
In DocumentBroker::closeDocument, just set the _stop flag and wake
up the polling thread which will terminate the children, instead of
manually terminating the children.

Change-Id: Ie70e05b3fb6ea816a87b6dcfaed92cdddb94aa90

diff --git a/common/Util.cpp b/common/Util.cpp
index a61fe6d0..a3e5e798 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -171,6 +171,27 @@ namespace Util
 return nullptr;
 }
 
+size_t getTotalSystemMemory()
+{
+size_t totalMemKb = 0;
+FILE* file = fopen("/proc/meminfo", "r");
+if (file != nullptr)
+{
+char line[4096] = { 0 };
+while (fgets(line, sizeof(line), file))
+{
+const char* value;
+if ((value = startsWith(line, "MemTotal:")))
+{
+totalMemKb = atoi(value);
+break;
+}
+}
+}
+
+return totalMemKb;
+}
+
 std::pair getPssAndDirtyFromSMaps(FILE* file)
 {
 size_t numPSSKb = 0;
diff --git a/common/Util.hpp b/common/Util.hpp
index 4f9906e9..e97d1808 100644
--- a/common/Util.hpp
+++ b/common/Util.hpp
@@ -95,6 +95,9 @@ namespace Util
 #endif
 }
 
+/// Returns the total physical memory (in kB) available in the system
+size_t getTotalSystemMemory();
+
 /// Returns the process PSS in KB (works only when we have perms for 
/proc/pid/smaps).
 size_t getMemoryUsagePSS(const Poco::Process::PID pid);
 
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 235a5948..0e23d797 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -243,7 +243,7 @@ L.Socket = L.Class.extend({
if (textMsg === 'ownertermination') {
msg = _('Session terminated by document owner');
}
-   else if (textMsg === 'idle') {
+   else if (textMsg === 'idle' || textMsg === 'oom') {
msg = _('Session was terminated due to idleness 
- please click to reload');
this._map._documentIdle = true;
}
@@ -334,7 +334,7 @@ L.Socket = L.Class.extend({
});
options.$vex.append(options.$vexContent);
 
-   if (textMsg === 'idle') {
+   if (textMsg === 'idle' || textMsg === 'oom') {
var map = this._map;
options.$vex.bind('click.vex', function(e) {
console.debug('idleness: reactivating');
diff --git a/loolwsd.xml.in b/loolwsd.xml.in
index 8ec29c82..a8b67737 100644
--- a/loolwsd.xml.in
+++ b/loolwsd.xml.in
@@ -11,6 +11,7 @@
 
 
 
+
 1
 
 4
diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index 04a20ad5..b1de0ba6 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -333,6 +333,9 @@ Admin::Admin() :
 {
 LOG_INF("Admin ctor.");
 
+_totalSysMem = Util::getTotalSystemMemory();
+LOG_TRC("Total system memory : " << _totalSysMem);
+
 const auto totalMem = getTotalMemoryUsage();
 LOG_TRC("Total memory used: " << totalMem);
 _model.addMemStats(totalMem);
@@ -384,6 +387,9 @@ void Admin::pollingThread()
 
 lastMem = now;
 memWait += _memStatsTaskIntervalMs;
+
+// If our total memory consumption is above limit, cleanup
+triggerMemoryCleanup(totalMem);
 }
 
 int netWait = _networkStatsIntervalMs -
@@ -526,6 +532,43 @@ void Admin::notifyForkit()
 IoUtil::writeToPipe(_forKitWritePipe, oss.str());
 }
 
+void Admin::triggerMemoryCleanup(size_t totalMem)
+{
+LOG_TRC("Total memory we are consuming (in kB): " << totalMem);
+// Trigger mem cleanup when we are consuming too much memory (as 
configured by sysadmin)
+const auto memLimit = LOOLWSD::getConfigValue("memproportion", 
static_

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

2017-07-07 Thread Miklos Vajna
 sot/source/sdstor/storage.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7d876e48cb0292d94e193ea7da2538e018f0e07c
Author: Miklos Vajna 
Date:   Fri Jul 7 17:23:00 2017 +0200

sot: fix loplugin:unnecessaryparen warning

Change-Id: Ia022f6cb1e9c91c9aa49025e54699a5c7718fc75

diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index df3caff95a85..13e6c7d08ab4 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -291,7 +291,7 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, 
StreamMode nMode )
 if( !m_aName.isEmpty() )
 {
 // named storage
-if( ( ( nMode & ERASEMASK ) == ERASEMASK ) )
+if( ( nMode & ERASEMASK ) == ERASEMASK )
 ::utl::UCBContentHelper::Kill( m_aName );
 
 INetURLObject aObj( m_aName );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Miklos Vajna
 sw/qa/extras/uiwriter/data/rhbz739252-3.odt |binary
 sw/qa/extras/uiwriter/uiwriter.cxx  |   13 +
 sw/source/core/layout/sectfrm.cxx   |5 +++--
 3 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 652556ec3e9218655a67b4c4de4e26fbe81855de
Author: Miklos Vajna 
Date:   Fri Jul 7 14:04:28 2017 +0200

rhbz#739252 sw: fix crash on split tables inside nested sections

Commit b5e0a143308e976b4165ff6181f4dccc3db0bd31 (tdf#108524 sw: attempt
to split section frames inside table cells, take two, 2017-07-03)
checked for tables in SwFrame::GetNextSctLeaf() when it considered
looking up the next "follow" cell frame.

But this is too general, in practice it is only necessary to look for
follow cell frames in case the frame in question is in a table, but not
in a table-in-section. This at the same time avoids a crash with tables
inside nested sections, as it happens in the bugdoc.

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

diff --git a/sw/qa/extras/uiwriter/data/rhbz739252-3.odt 
b/sw/qa/extras/uiwriter/data/rhbz739252-3.odt
new file mode 100644
index ..e457c035b662
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/rhbz739252-3.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index b85a7e58e5b4..453c62dece55 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -256,6 +256,7 @@ public:
 void testTdf107976();
 void testTdf108524();
 void testTableInSection();
+void testTableInNestedSection();
 void testLinesInSectionInTable();
 
 CPPUNIT_TEST_SUITE(SwUiWriterTest);
@@ -400,6 +401,7 @@ public:
 CPPUNIT_TEST(testTdf107976);
 CPPUNIT_TEST(testTdf108524);
 CPPUNIT_TEST(testTableInSection);
+CPPUNIT_TEST(testTableInNestedSection);
 CPPUNIT_TEST(testLinesInSectionInTable);
 CPPUNIT_TEST_SUITE_END();
 
@@ -4993,6 +4995,17 @@ void SwUiWriterTest::testTableInSection()
 assertXPath(pXmlDoc, "/root/page[2]/body/section/tab/row/cell", 2);
 }
 
+void SwUiWriterTest::testTableInNestedSection()
+{
+// The document has a nested section, containing a table that spans over 2 
pages.
+// This crashed the layout.
+createDoc("rhbz739252-3.odt");
+xmlDocPtr pXmlDoc = parseLayoutDump();
+// Make sure the table is inside a section and spans over 2 pages.
+assertXPath(pXmlDoc, "//page[1]//section/tab", 1);
+assertXPath(pXmlDoc, "//page[2]//section/tab", 1);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index 7288251dfd12..08e3934ddf6f 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1515,9 +1515,10 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType 
eMakePage )
 SwLayoutFrame *pLayLeaf;
 
 SwLayoutFrame* pCellLeaf = nullptr;
-if (IsInTab())
+if (IsInTab() && !IsInTableInSection(this))
 {
-// We are in a table, see if there is a follow cell frame created 
already.
+// We are in a table (which is itself not in a section), see if there
+// is a follow cell frame created already.
 pCellLeaf = GetNextCellLeaf();
 if (!pCellLeaf)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - vcl/README vcl/source

2017-07-07 Thread Michael Stahl
 vcl/README|4 
 vcl/source/gdi/pdfwriter_impl.cxx |  171 --
 2 files changed, 77 insertions(+), 98 deletions(-)

New commits:
commit 02b61a54674ce112bd9a0fdf064b830e0c35cc4e
Author: Michael Stahl 
Date:   Mon Jun 26 14:21:24 2017 +0200

vcl: adapt README to VCL_DEBUG_DISABLE_PDFCOMPRESSION changes

No longer need to compile with dbglevel=3 since
4dfa3161896a0e045da3b5cf656ebd8f40044a46

Change-Id: I2dbc7ccd07abd191701c93534241ffd4dfef9df1

diff --git a/vcl/README b/vcl/README
index 2bf842087541..b122e8218410 100644
--- a/vcl/README
+++ b/vcl/README
@@ -189,13 +189,11 @@ On-screen display differs in step 1 and 2:
 
 === Debugging PDF export ===
 
-Debugging the PDF export becomes much easier in higher debug-levels, where
+Debugging the PDF export becomes much easier when
 compression is disabled (so the PDF file is directly readable) and
 the MARK function puts comments into the PDF file about which method
 generated the following PDF content.
 
-touch vcl/source/gdi/pdfwriter* && make vcl dbglevel=3
-
 The compression can be disabled even using a env. var:
 
 export VCL_DEBUG_DISABLE_PDFCOMPRESSION=1
commit 3310b7cd84d493979d0a793fdb5219d5b1ac11ca
Author: Michael Stahl 
Date:   Fri Jul 7 16:26:00 2017 +0200

vcl: clean up all #if OSL_DEBUG_LEVEL checks in pdfwriter_impl.cxx

Half of these were around SAL_INFO which does its own checking of
OSL_DEBUG_LEVEL anyway, and the other half can check at runtime
the g_bDebugDisableCompression variable like PDFWriterImpl::MARK()
already does since commit 49968942a62f6feb6db4dcf385ddee925a57b497.

Change-Id: Ic688eb643bde9253375e14e2e2233ece8dc7c18b

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 0126752d2c67..dd4baa368ac7 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1145,12 +1145,10 @@ PDFWriterImpl::PDFPage::~PDFPage()
 
 void PDFWriterImpl::PDFPage::beginStream()
 {
-#if OSL_DEBUG_LEVEL > 1
+if (g_bDebugDisableCompression)
 {
-OStringBuffer aLine( "PDFWriterImpl::PDFPage::beginStream, +" );
- m_pWriter->emitComment( aLine.getStr() );
+m_pWriter->emitComment("PDFWriterImpl::PDFPage::beginStream, +");
 }
-#endif
 m_aStreamObjects.push_back(m_pWriter->createObject());
 if( ! m_pWriter->updateObject( m_aStreamObjects.back() ) )
 return;
@@ -2409,10 +2407,8 @@ const sal_Char* PDFWriterImpl::getAttributeTag( 
PDFWriter::StructAttribute eAttr
 std::map< PDFWriter::StructAttribute, const char* >::const_iterator it =
 aAttributeStrings.find( eAttr );
 
-#if OSL_DEBUG_LEVEL > 1
 if( it == aAttributeStrings.end() )
 SAL_INFO("vcl.pdfwriter", "invalid PDFWriter::StructAttribute " << 
eAttr);
-#endif
 
 return it != aAttributeStrings.end() ? it->second : "";
 }
@@ -2454,10 +2450,8 @@ const sal_Char* PDFWriterImpl::getAttributeValueTag( 
PDFWriter::StructAttributeV
 std::map< PDFWriter::StructAttributeValue, const char* >::const_iterator 
it =
 aValueStrings.find( eVal );
 
-#if OSL_DEBUG_LEVEL > 1
 if( it == aValueStrings.end() )
 SAL_INFO("vcl.pdfwriter", "invalid PDFWriter::StructAttributeValue " 
<< eVal);
-#endif
 
 return it != aValueStrings.end() ? it->second : "";
 }
@@ -2531,15 +2525,14 @@ OString PDFWriterImpl::emitStructureAttributes( 
PDFStructureElement& i_rEle )
 else
 {
 OSL_FAIL( "unresolved link id for Link structure" );
-#if OSL_DEBUG_LEVEL > 1
 SAL_INFO("vcl.pdfwriter", "unresolved link id " << nLink << " 
for Link structure");
+if (g_bDebugDisableCompression)
 {
 OStringBuffer aLine( "unresolved link id " );
 aLine.append( nLink );
 aLine.append( " for Link structure" );
 emitComment( aLine.getStr() );
 }
-#endif
 }
 }
 else
@@ -2638,18 +2631,14 @@ sal_Int32 PDFWriterImpl::emitStructure( 
PDFStructureElement& rEle )
 else
 {
 OSL_FAIL( "PDFWriterImpl::emitStructure: invalid child 
structure element" );
-#if OSL_DEBUG_LEVEL > 1
 SAL_INFO("vcl.pdfwriter", "PDFWriterImpl::emitStructure: 
invalid child structure element with id " << *it);
-#endif
 }
 }
 }
 else
 {
 OSL_FAIL( "PDFWriterImpl::emitStructure: invalid child structure 
id" );
-#if OSL_DEBUG_LEVEL > 1
 SAL_INFO("vcl.pdfwriter", "PDFWriterImpl::emitStructure: invalid 
child structure id " << *it);
-#endif
 }
 }
 
@@ -2808,9 +2797,10 @@ bool PDFWriterImpl::emitTilings()
 
 aTilingObj.setLength( 0 );
 
-#if OSL_DEBUG_LEVEL > 1
-emitComment( "PDFWriterImpl::emitTilings" );
-#endif
+if (g_bDeb

[Libreoffice-commits] core.git: vcl/headless

2017-07-07 Thread Caolán McNamara
 vcl/headless/svpgdi.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bea1dc5f8d17c1011cdfab1ff540f3e4b3a4d1bb
Author: Caolán McNamara 
Date:   Fri Jul 7 13:59:27 2017 +0100

Resolves: rhbz#1467512 mask not created as 1 bit depth

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

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 033389e53aeb..c694fc0c7161 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1110,7 +1110,7 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
 SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long 
nHeight )
 {
 SvpSalBitmap* pBitmap = new SvpSalBitmap();
-pBitmap->Create(Size(nWidth, nHeight), 32, BitmapPalette());
+pBitmap->Create(Size(nWidth, nHeight), GetBitCount(), BitmapPalette());
 
 cairo_surface_t* target = 
SvpSalGraphics::createCairoSurface(pBitmap->GetBuffer());
 cairo_t* cr = cairo_create(target);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cd-5.3' - distro-configs/CPLinux-MPL.conf

2017-07-07 Thread Andras Timar
 distro-configs/CPLinux-MPL.conf |   52 
 1 file changed, 52 insertions(+)

New commits:
commit 8d0f02fd81f5327a1648d1a0a2c7d192f21d44ae
Author: Andras Timar 
Date:   Fri Jul 7 16:15:58 2017 +0200

CPLinux-MPL.conf

Change-Id: I35c364f207d0e3d8b2d029ec0456b2abc45841a1

diff --git a/distro-configs/CPLinux-MPL.conf b/distro-configs/CPLinux-MPL.conf
new file mode 100644
index ..89ff35f5e690
--- /dev/null
+++ b/distro-configs/CPLinux-MPL.conf
@@ -0,0 +1,52 @@
+--enable-mpl-subset
+--with-vendor=Collabora
+--with-branding=icon-themes/galaxy/brand_cp
+--with-theme=tango
+--without-help
+--with-system-dicts
+--with-myspell-dicts
+--with-system-zlib
+--with-system-poppler
+--without-system-openssl
+--without-system-libpng
+--without-system-libxml
+--without-system-jpeg
+--without-system-jars
+--without-system-postgresql
+--without-junit
+--without-helppack-integration
+--with-linker-hash-style=both
+--with-fonts
+--enable-noto-font
+--with-external-thes-dir=/usr/share/mythes
+--with-external-hyph-dir=/usr/share/hyphen
+--with-external-dict-dir=/usr/share/hunspell
+--enable-dbus
+--enable-extension-integration
+--disable-odk
+--disable-kde4
+--disable-gtk3
+--enable-gstreamer-0-10
+--disable-gstreamer-1-0
+--enable-evolution2
+--enable-gio
+--disable-scripting-beanshell
+--disable-scripting-javascript
+--disable-ext-wiki-publisher
+--disable-report-builder
+--disable-ext-nlpsolver
+--disable-ext-numbertext
+--disable-ext-ct2n
+--enable-epm
+--enable-python=internal
+--disable-online-update
+--disable-dconf
+--enable-mergelibs
+--with-package-format=deb
+--enable-release-build
+--without-java
+--with-lang=en-US
+--with-webdav=serf
+--disable-postgresql-sdbc
+--disable-lotuswordpro
+--disable-lpsolve
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'distro/collabora/cd-5.3'

2017-07-07 Thread Tamás Zolnai
New branch 'distro/collabora/cd-5.3' available with the following commits:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Changes to 'distro/collabora/collabora-online-cd'

2017-07-07 Thread Andras Timar
New branch 'distro/collabora/collabora-online-cd' available with the following 
commits:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Michael Stahl
 sw/source/core/crsr/annotationmark.cxx |   37 +++--
 sw/source/core/doc/docbm.cxx   |   12 ++
 sw/source/core/txtnode/atrfld.cxx  |   12 +-
 sw/source/core/unocore/unoportenum.cxx |   15 +
 sw/source/filter/basflt/fltshell.cxx   |   27 +++-
 5 files changed, 50 insertions(+), 53 deletions(-)

New commits:
commit 31c54fa7bb03768b425ae019096e0a0e26e9c736
Author: Michael Stahl 
Date:   Fri Jul 7 13:26:50 2017 +0200

sw: convert SwTextAnnotationField OSL_ENSUREs to assert() and simplify

Change-Id: Ica69cd4527f36edd7480d897a28ff814ecbe97a9

diff --git a/sw/source/core/crsr/annotationmark.cxx 
b/sw/source/core/crsr/annotationmark.cxx
index bca5e903c72a..a73c1715bb36 100644
--- a/sw/source/core/crsr/annotationmark.cxx
+++ b/sw/source/core/crsr/annotationmark.cxx
@@ -52,26 +52,19 @@ namespace sw { namespace mark
 void AnnotationMark::InitDoc(SwDoc* const io_pDoc)
 {
 SwTextNode *pTextNode = GetMarkEnd().nNode.GetNode().GetTextNode();
-
-SwTextField* pTextField = pTextNode ?
-pTextNode->GetFieldTextAttrAt(
-GetMarkEnd().nContent.GetIndex()-1, true ) : nullptr;
-OSL_ENSURE( pTextField != nullptr, " - 
missing text attribute for annotation field!" );
-if ( pTextField != nullptr )
+assert(pTextNode);
+SwTextField *const pTextField = pTextNode->GetFieldTextAttrAt(
+GetMarkEnd().nContent.GetIndex()-1, true);
+assert(pTextField != nullptr);
+const SwPostItField* pPostItField = dynamic_cast< const SwPostItField* 
>(pTextField->GetFormatField().GetField());
+assert(pPostItField != nullptr);
+// use the annotation mark's name as the annotation name, if
+// - the annotation field has an empty annotation name or
+// - the annotation mark's name differs (on mark creation a name clash 
had been detected)
+if ( pPostItField->GetName().isEmpty()
+|| pPostItField->GetName() != GetName() )
 {
-const SwPostItField* pPostItField = dynamic_cast< const 
SwPostItField* >(pTextField->GetFormatField().GetField());
-OSL_ENSURE( pPostItField != nullptr, 
" - annotation field missing!" );
-if ( pPostItField != nullptr )
-{
-// use the annotation mark's name as the annotation name, if
-// - the annotation field has an empty annotation name or
-// - the annotation mark's name differs (on mark creation a 
name clash had been detected)
-if ( pPostItField->GetName().isEmpty()
-|| pPostItField->GetName() != GetName() )
-{
-const_cast(pPostItField)->SetName( 
GetName() );
-}
-}
+const_cast(pPostItField)->SetName( GetName() );
 }
 
 if (io_pDoc->GetIDocumentUndoRedo().DoesUndo())
@@ -84,11 +77,7 @@ namespace sw { namespace mark
 const SwFormatField* AnnotationMark::GetAnnotationFormatField() const
 {
 SwDoc* pDoc = GetMarkPos().GetDoc();
-if ( pDoc == nullptr )
-{
-OSL_ENSURE( false, " - 
missing document at annotation mark" );
-return nullptr;
-}
+assert(pDoc != nullptr);
 
 SwFormatField* pAnnotationFormatField = nullptr;
 
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 7ea1692dd559..68030bbb2955 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -918,15 +918,9 @@ namespace sw { namespace mark
 case IDocumentMarkAccess::MarkType::ANNOTATIONMARK:
 {
 IDocumentMarkAccess::iterator_t ppAnnotationMark = 
lcl_FindMark(m_vAnnotationMarks, *ppMark);
-if ( ppAnnotationMark != m_vAnnotationMarks.end() )
-{
-m_vAnnotationMarks.erase(ppAnnotationMark);
-}
-else
-{
-assert(false &&
-" - Annotation Mark 
not found in Annotation Mark container.");
-}
+assert(ppAnnotationMark != m_vAnnotationMarks.end() &&
+" - Annotation Mark not 
found in Annotation Mark container.");
+m_vAnnotationMarks.erase(ppAnnotationMark);
 }
 break;
 
diff --git a/sw/source/core/txtnode/atrfld.cxx 
b/sw/source/core/txtnode/atrfld.cxx
index de3817eeece9..4beca6d098c6 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -618,18 +618,10 @@ SwTextAnnotationField::~SwTextAnnotationField()
 ::sw::mark::IMark* SwTextAnnotationField::GetAnnotationMark() const
 {
 const SwPostItField* pPostItField = dynamic_cast(GetFormatField().GetField());
-OSL_ENSURE( pPostItField != nullptr, 
" - field missi

[Libreoffice-commits] core.git: solenv/gdb

2017-07-07 Thread Noel Grandin
 solenv/gdb/libreoffice/sw.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit be2481d193d6f7a2593cf5ce767894cac8e41435
Author: Noel Grandin 
Date:   Fri Jul 7 15:39:31 2017 +0200

re-add some gdb BigPtrArray pretty printing

After commit c6902761d797253cda8b3f71f102c66108585e24
"Revert "use std::vector in BigPtrArray""

 noelgrandin: you reverted both gdb changes but only one sw
change?
 mst_, I thought your gdb change only appliled to the
std::vector?
 noelgrandin: there was another std::something or other change
there, one was mvInfo and the other mvData
 mst_, sigh, will fix that

Change-Id: I3059d29b1a559eb3077f5d713be011e15e887ee0

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index cfb3cec3eeb7..6c0165e3fc6b 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -246,7 +246,7 @@ class BigPtrArrayPrinter(object):
 raise StopIteration()
 
 name = str(self.pos)
-node = self.block['pData'][self.pos - self.block['nStart']]
+node = self.block['mvData']['_M_elems'][self.pos - 
self.block['nStart']]
 value =  self._node_value(node)
 if self.pos == self.block['nEnd']:
 self._next_block()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/qa

2017-07-07 Thread Noel Grandin
 sw/qa/extras/ooxmlexport/ooxmlw14export.cxx |  514 ++--
 1 file changed, 257 insertions(+), 257 deletions(-)

New commits:
commit 2894840c8c18ecce609b686d34e378d84a92
Author: Noel Grandin 
Date:   Fri Jul 7 15:35:31 2017 +0200

simplify ooxmlw14export code

no need to do c_str() everywhere, when we can just work with OString's

Change-Id: I4c9e80200c7c4d36abc541ab47b3f3cf1b42e2fb

diff --git a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
index 20e082cc54bf..6b255bfd7fe0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
@@ -306,113 +306,113 @@ DECLARE_OOXMLEXPORT_TEST(Test_TextEffects_Groupshapes, 
"TextEffects_Groupshapes.
 if (!pXmlDoc)
 return;
 
-std::string sPathToWGP = 
"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp";
+OString sPathToWGP = 
"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp";
 
-assertXPath(pXmlDoc, (sPathToWGP + "/wps:wsp").c_str(), 2);
+assertXPath(pXmlDoc, sPathToWGP + "/wps:wsp", 2);
 
-std::string sPathToShapeRunProperties = sPathToWGP + 
"/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr";
+OString sPathToShapeRunProperties = sPathToWGP + 
"/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr";
 
 // Glow
-std::string sPathGlow = sPathToShapeRunProperties + "/w14:glow";
-assertXPath(pXmlDoc, (sPathGlow).c_str(), 1);
-assertXPath(pXmlDoc, (sPathGlow).c_str(), "rad", "127000");
-assertXPath(pXmlDoc, (sPathGlow+"/w14:srgbClr").c_str(), "val", "00B050");
-assertXPath(pXmlDoc, (sPathGlow+"/w14:srgbClr/w14:alpha").c_str(), "val", 
"6");
+OString sPathGlow = sPathToShapeRunProperties + "/w14:glow";
+assertXPath(pXmlDoc, sPathGlow, 1);
+assertXPath(pXmlDoc, sPathGlow, "rad", "127000");
+assertXPath(pXmlDoc, sPathGlow+"/w14:srgbClr", "val", "00B050");
+assertXPath(pXmlDoc, sPathGlow+"/w14:srgbClr/w14:alpha", "val", "6");
 
 // Shadow
-std::string sPathShadow = sPathToShapeRunProperties + "/w14:shadow";
-assertXPath(pXmlDoc, (sPathShadow).c_str(), 1);
-assertXPath(pXmlDoc, (sPathShadow).c_str(), "blurRad", "127000");
-assertXPath(pXmlDoc, (sPathShadow).c_str(), "dist", "787400");
-assertXPath(pXmlDoc, (sPathShadow).c_str(), "dir", "1272");
-assertXPath(pXmlDoc, (sPathShadow).c_str(), "sx", "7");
-assertXPath(pXmlDoc, (sPathShadow).c_str(), "sy", "7");
-assertXPath(pXmlDoc, (sPathShadow).c_str(), "kx", "0");
-assertXPath(pXmlDoc, (sPathShadow).c_str(), "ky", "0");
-assertXPath(pXmlDoc, (sPathShadow).c_str(), "algn", "l");
-assertXPath(pXmlDoc, (sPathShadow+"/w14:srgbClr").c_str(), "val", 
"92D050");
-assertXPath(pXmlDoc, (sPathShadow+"/w14:srgbClr/w14:alpha").c_str(), 
"val", "4");
+OString sPathShadow = sPathToShapeRunProperties + "/w14:shadow";
+assertXPath(pXmlDoc, sPathShadow, 1);
+assertXPath(pXmlDoc, sPathShadow, "blurRad", "127000");
+assertXPath(pXmlDoc, sPathShadow, "dist", "787400");
+assertXPath(pXmlDoc, sPathShadow, "dir", "1272");
+assertXPath(pXmlDoc, sPathShadow, "sx", "7");
+assertXPath(pXmlDoc, sPathShadow, "sy", "7");
+assertXPath(pXmlDoc, sPathShadow, "kx", "0");
+assertXPath(pXmlDoc, sPathShadow, "ky", "0");
+assertXPath(pXmlDoc, sPathShadow, "algn", "l");
+assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr", "val", "92D050");
+assertXPath(pXmlDoc, sPathShadow+"/w14:srgbClr/w14:alpha", "val", "4");
 
 // Reflection
-std::string sPathReflection = sPathToShapeRunProperties + 
"/w14:reflection";
-assertXPath(pXmlDoc, (sPathReflection).c_str(), 1);
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "blurRad", "139700");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "stA", "47000");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "stPos", "0");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "endA", "0");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "endPos", "85000");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "dist", "63500");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "dir", "540");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "fadeDir", "540");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "sx", "10");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "sy", "-10");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "kx", "0");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "ky", "0");
-assertXPath(pXmlDoc, (sPathReflection).c_str(), "algn", "bl");
+OString sPathReflection = sPathToShapeRunProperties + "/w14:reflection";
+assertXPath(pXmlDoc, sPathReflection, 1);
+assertXPath(pXmlDoc, sPathReflection, "blurRad", "139700");
+assertXPath(pXmlDoc, sPathReflection, "stA

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

2017-07-07 Thread Noel Grandin
 solenv/gdb/libreoffice/sw.py |6 +-
 sw/inc/bparr.hxx |7 +-
 sw/source/core/bastyp/bparr.cxx  |  113 ---
 sw/source/core/docnode/nodes.cxx |2 
 4 files changed, 80 insertions(+), 48 deletions(-)

New commits:
commit c6902761d797253cda8b3f71f102c66108585e24
Author: Noel Grandin 
Date:   Fri Jul 7 10:53:38 2017 +0200

Revert "use std::vector in BigPtrArray"

which is causing crashes in the crashtesting in
ooo119635-3.docx and ooo119568-2.docx

It is definitely some kind of use-after-free error, but the
compress and delete logic for BigPtrArray is too hairy for me
to debug right now.

This reverts commit 1eee0abd459a508a6dcf9e71cbf2c1be3725faa7.

Also revert commit 4f743419a04375160437a910254c45dea396f70d
"gdb pretty-printers: fix BigPtrArrayPrinter after recent std::isation"

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

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 031963f5c789..cfb3cec3eeb7 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -194,10 +194,10 @@ class BigPtrArrayPrinter(object):
 class _iterator(six.Iterator):
 
 def __init__(self, array):
-self.blocks = array['m_vpInf']['_M_impl']['_M_start']
+self.blocks = array['m_ppInf']
 self.count = array['m_nSize']
 self.pos = 0
-self.block_count = array['m_vpInf']['_M_impl']['_M_finish'] - 
array['m_vpInf']['_M_impl']['_M_start']
+self.block_count = array['m_nBlock']
 self.block_pos = 0
 self.block = None
 self.indent = ""
@@ -246,7 +246,7 @@ class BigPtrArrayPrinter(object):
 raise StopIteration()
 
 name = str(self.pos)
-node = self.block['mvData']['_M_elems'][self.pos - 
self.block['nStart']]
+node = self.block['pData'][self.pos - self.block['nStart']]
 value =  self._node_value(node)
 if self.pos == self.block['nEnd']:
 self._next_block()
diff --git a/sw/inc/bparr.hxx b/sw/inc/bparr.hxx
index 04b77eb16dee..962736c49ce3 100644
--- a/sw/inc/bparr.hxx
+++ b/sw/inc/bparr.hxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 
 struct BlockInfo;
 class BigPtrArray;
@@ -64,14 +63,16 @@ struct BlockInfo final
 class SW_DLLPUBLIC BigPtrArray
 {
 protected:
-std::vector
-m_vpInf;  ///< block info
+BlockInfo** m_ppInf;  ///< block info
 sal_uLong   m_nSize;  ///< number of elements
+sal_uInt16  m_nMaxBlock;  ///< current max. number of blocks
+sal_uInt16  m_nBlock; ///< number of blocks
 mutable
 sal_uInt16  m_nCur;   ///< last used block
 
 sal_uInt16  Index2Block( sal_uLong ) const; ///< block search
 BlockInfo*  InsBlock( sal_uInt16 ); ///< insert block
+voidBlockDel( sal_uInt16 ); ///< some blocks were deleted
 voidUpdIndex( sal_uInt16 ); ///< recalculate indices
 
 // fill all blocks
diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx
index 8d7124a470ac..446d22ef154c 100644
--- a/sw/source/core/bastyp/bparr.cxx
+++ b/sw/source/core/bastyp/bparr.cxx
@@ -21,7 +21,6 @@
 
 #include 
 #include 
-#include 
 
 /** Resize block management by this constant.
 As a result there are approx. 20 * MAXENTRY == 2 entries available */
@@ -48,21 +47,23 @@ void CheckIdx( BlockInfo** ppInf, sal_uInt16 nBlock, 
sal_uLong nSize, sal_uInt16
 
 BigPtrArray::BigPtrArray()
 {
-m_nCur = 0;
+m_nBlock = m_nCur = 0;
 m_nSize = 0;
-m_vpInf.reserve( nBlockGrowSize );
+m_nMaxBlock = nBlockGrowSize;
+m_ppInf = new BlockInfo* [ m_nMaxBlock ];
 }
 
 BigPtrArray::~BigPtrArray()
 {
-if( m_vpInf.size() )
+if( m_nBlock )
 {
-BlockInfo** pp = m_vpInf.data();
-for( sal_uInt16 n = 0; n < sal_uInt16(m_vpInf.size()); ++n, ++pp )
+BlockInfo** pp = m_ppInf;
+for( sal_uInt16 n = 0; n < m_nBlock; ++n, ++pp )
 {
 delete *pp;
 }
 }
+delete[] m_ppInf;
 }
 
 // Also moving is done simply here. Optimization is useless because of the
@@ -72,7 +73,7 @@ void BigPtrArray::Move( sal_uLong from, sal_uLong to )
 if (from != to)
 {
 sal_uInt16 cur = Index2Block( from );
-BlockInfo* p = m_vpInf[ cur ];
+BlockInfo* p = m_ppInf[ cur ];
 BigPtrEntry* pElem = p->mvData[ from - p->nStart ];
 Insert( pElem, to ); // insert first, then delete!
 Remove( ( to < from ) ? ( from + 1 ) : from );
@@ -83,7 +84,7 @@ BigPtrEntry* BigPtrArray::operator[]( sal_uLong idx ) const
 {
 assert(idx < m_nSize); // operator[]: Inde

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

2017-07-07 Thread Caolán McNamara
 include/oox/export/utils.hxx |   21 +++
 oox/source/export/chartexport.cxx|   12 +++---
 oox/source/export/drawingml.cxx  |4 +-
 sc/source/filter/excel/excrecds.cxx  |   49 +--
 sc/source/filter/excel/xecontent.cxx |9 ++--
 sc/source/filter/excel/xedbdata.cxx  |6 +--
 sc/source/filter/excel/xeescher.cxx  |   10 ++---
 sc/source/filter/excel/xeextlst.cxx  |9 ++--
 sc/source/filter/excel/xename.cxx|7 ++-
 sc/source/filter/excel/xepage.cxx|9 ++--
 sc/source/filter/excel/xepivotxml.cxx|   42 +++
 sc/source/filter/excel/xerecord.cxx  |3 +
 sc/source/filter/excel/xestream.cxx  |   22 ++--
 sc/source/filter/excel/xestyle.cxx   |   33 +-
 sc/source/filter/excel/xetable.cxx   |   21 ++-
 sc/source/filter/excel/xeview.cxx|   21 ++-
 sc/source/filter/inc/xestream.hxx|   11 --
 sc/source/filter/xcl97/XclExpChangeTrack.cxx |   11 +++---
 sc/source/filter/xcl97/xcl97rec.cxx  |4 +-
 19 files changed, 155 insertions(+), 149 deletions(-)

New commits:
commit 23978f85533e66b18ee2e9b72ad2fc71a93958a3
Author: Caolán McNamara 
Date:   Fri Jul 7 12:06:32 2017 +0100

merge BS and ToPsz10, etc

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

diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx
index 05ee6a750281..d94d6c4228ae 100644
--- a/include/oox/export/utils.hxx
+++ b/include/oox/export/utils.hxx
@@ -29,7 +29,26 @@ inline OString I64S_(sal_Int64 x) { return 
OString::number(x); }
 #define I32S(x) I32S_(x).getStr()
 #define I64S(x) I64S_(x).getStr()
 #define IS(x) OString::number( x ).getStr()
-inline const char* BS(bool x) { return x ? "1" : "0"; }
+
+/**
+ * @return const char* literal "true" for true value, or literal "false"
+ * for false value.
+ */
+static inline const char* ToPsz(bool b)
+{
+return b ? "true" : "false";
+}
+
+/**
+ * @return literal "1" for true value, or literal "0" for false value.
+ */
+static inline const char* ToPsz10(bool b)
+{
+// xlsx seems to use "1" or "0" for boolean values.  I wonder it ever uses
+// the "true" "false" variant.
+return b ? "1" : "0";
+}
+
 #define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
 
 static inline sal_Int64 PPTtoEMU( sal_Int32 nPPT )
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index b1ac3f1b5415..5f488e0b4b75 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -888,7 +888,7 @@ void ChartExport::exportChart( const Reference< 
css::chart::XChartDocument >& xC
 bool bIncludeHiddenCells = false;
 aPlotVisOnly >>= bIncludeHiddenCells;
 pFS->singleElement( FSNS( XML_c, XML_plotVisOnly ),
-XML_val, BS(!bIncludeHiddenCells),
+XML_val, ToPsz10(!bIncludeHiddenCells),
 FSEND );
 
 exportMissingValueTreatment(Reference(mxDiagram, 
uno::UNO_QUERY));
@@ -3030,11 +3030,11 @@ void writeLabelProperties(
 }
 }
 
-pFS->singleElement(FSNS(XML_c, XML_showLegendKey), XML_val, 
BS(aLabel.ShowLegendSymbol), FSEND);
-pFS->singleElement(FSNS(XML_c, XML_showVal), XML_val, 
BS(aLabel.ShowNumber), FSEND);
-pFS->singleElement(FSNS(XML_c, XML_showCatName), XML_val, 
BS(aLabel.ShowCategoryName), FSEND);
-pFS->singleElement(FSNS(XML_c, XML_showSerName), XML_val, BS(false), 
FSEND);
-pFS->singleElement(FSNS(XML_c, XML_showPercent), XML_val, 
BS(aLabel.ShowNumberInPercent), FSEND);
+pFS->singleElement(FSNS(XML_c, XML_showLegendKey), XML_val, 
ToPsz10(aLabel.ShowLegendSymbol), FSEND);
+pFS->singleElement(FSNS(XML_c, XML_showVal), XML_val, 
ToPsz10(aLabel.ShowNumber), FSEND);
+pFS->singleElement(FSNS(XML_c, XML_showCatName), XML_val, 
ToPsz10(aLabel.ShowCategoryName), FSEND);
+pFS->singleElement(FSNS(XML_c, XML_showSerName), XML_val, ToPsz10(false), 
FSEND);
+pFS->singleElement(FSNS(XML_c, XML_showPercent), XML_val, 
ToPsz10(aLabel.ShowNumberInPercent), FSEND);
 }
 
 }
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index e3615e6bb5de..ddb91babb7c5 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2006,7 +2006,7 @@ void DrawingML::WriteParagraphProperties( const 
Reference< XTextContent >& rPara
XML_marL, nParaLeftMargin > 0 ? I32S( 
oox::drawingml::convertHmmToEmu( nParaLeftMargin ) ) : nullptr,
XML_indent, nParaFirstLineIndent ? I32S( 
oox::drawingml::convertHmmToEmu( nParaFirstLineIndent ) ) : nullptr,
XML_algn, GetAlignment( nAlignment ),
-   

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

2017-07-07 Thread Caolán McNamara
 svx/source/accessibility/svxpixelctlaccessiblecontext.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 66ebc285320b8dfb064ed6a06a13e5c78158b950
Author: Caolán McNamara 
Date:   Fri Jul 7 12:22:32 2017 +0100

a11y: assert on switching hatch/bitmap area radio button tab things

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

diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx 
b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
index d27f18abe8b1..c2a048a82853 100644
--- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
@@ -355,7 +355,7 @@ void SAL_CALL 
SvxPixelCtlAccessible::addAccessibleEventListener( const uno::Refe
 {
 ::osl::MutexGuard   aGuard( m_aMutex );
 if (!mnClientId)
-mnClientId = 
comphelper::AccessibleEventNotifier::registerClient( );
+mnClientId = comphelper::AccessibleEventNotifier::registerClient( 
);
 comphelper::AccessibleEventNotifier::addEventListener( mnClientId, 
xListener );
 }
 }
@@ -365,7 +365,8 @@ void SAL_CALL 
SvxPixelCtlAccessible::removeAccessibleEventListener( const uno::R
 if (xListener.is())
 {
 ::osl::MutexGuard   aGuard( m_aMutex );
-
+if (!mnClientId)
+return;
 sal_Int32 nListenerCount = 
comphelper::AccessibleEventNotifier::removeEventListener( mnClientId, xListener 
);
 if ( !nListenerCount )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Changes to 'refs/tags/libreoffice-5.4.0.2'

2017-07-07 Thread Andras Timar
Tag 'libreoffice-5.4.0.2' created by Andras Timar  
at 2017-07-07 11:22 +

libreoffice-5.4.0.2

Changes since libreoffice-5.4.0.1-1:
---
 0 files changed
---
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Michael Stahl
 sw/inc/txtfld.hxx |3 ++-
 sw/source/core/crsr/crstrvl.cxx   |   14 --
 sw/source/core/txtnode/atrfld.cxx |   23 ---
 sw/source/core/txtnode/ndtxt.cxx  |2 +-
 sw/source/core/txtnode/thints.cxx |   25 +
 5 files changed, 24 insertions(+), 43 deletions(-)

New commits:
commit 0a710a098e65a5e83c1ea47d5bdc1b56ef48f314
Author: Michael Stahl 
Date:   Thu Jul 6 23:21:51 2017 +0200

sw: convert SwTextInputField OSL_ENSUREs to assert() and simplify

Change-Id: I86df59e4b77d2ddc479144f32342113a6e29a725

diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index e389b4725ad8..edd23e06c736 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -24,6 +24,7 @@
 #include 
 
 #include 
+#include 
 
 class SwPaM;
 class SwTextNode;
@@ -52,7 +53,7 @@ public:
 }
 SwTextNode& GetTextNode() const
 {
-OSL_ENSURE( m_pTextNode, "SwTextField:: where is my TextNode?" );
+assert(m_pTextNode);
 return *m_pTextNode;
 }
 void ChgTextNode( SwTextNode* pNew )
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index d96f2729dd14..7df6263076c2 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -892,22 +892,16 @@ bool SwCursorShell::DocPtInsideInputField( const Point& 
rDocPt ) const
 sal_Int32 SwCursorShell::StartOfInputFieldAtPos( const SwPosition& rPos )
 {
 const SwTextInputField* pTextInputField = dynamic_cast(GetTextFieldAtPos( &rPos, true ));
-if ( pTextInputField == nullptr )
-{
-OSL_ENSURE( false, " - no 
Input Field at given position" );
-return 0;
-}
+assert(pTextInputField != nullptr
+&& " - no Input Field at 
given position");
 return pTextInputField->GetStart();
 }
 
 sal_Int32 SwCursorShell::EndOfInputFieldAtPos( const SwPosition& rPos )
 {
 const SwTextInputField* pTextInputField = dynamic_cast(GetTextFieldAtPos( &rPos, true ));
-if ( pTextInputField == nullptr )
-{
-OSL_ENSURE( false, " - no Input 
Field at given position" );
-return 0;
-}
+assert(pTextInputField != nullptr
+&& " - no Input Field at given 
position");
 return *(pTextInputField->End());
 }
 
diff --git a/sw/source/core/txtnode/atrfld.cxx 
b/sw/source/core/txtnode/atrfld.cxx
index 136955fdcad5..de3817eeece9 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -568,7 +568,7 @@ void SwTextInputField::UpdateFieldContent()
 if ( IsFieldInDoc()
  && GetStart() != (*End()) )
 {
-OSL_ENSURE( (*End()) - GetStart() >= 2,
+assert( (*End()) - GetStart() >= 2 &&
 " - Are 
CH_TXT_ATR_INPUTFIELDSTART and/or CH_TXT_ATR_INPUTFIELDEND missing?" );
 // skip CH_TXT_ATR_INPUTFIELDSTART character
 const sal_Int32 nIdx = GetStart() + 1;
@@ -577,26 +577,19 @@ void SwTextInputField::UpdateFieldContent()
 const OUString aNewFieldContent = GetTextNode().GetExpandText( nIdx, 
nLen );
 
 const SwInputField* pInputField = dynamic_cast(GetFormatField().GetField());
-OSL_ENSURE( pInputField != nullptr,
-" - Missing  
instance!" );
-if ( pInputField != nullptr )
-{
-const_cast(pInputField)->applyFieldContent( 
aNewFieldContent );
-// trigger update of fields for scenarios in which the Input 
Field's content is part of e.g. a table formula
-
GetTextNode().GetDoc()->getIDocumentFieldsAccess().GetUpdateFields().SetFieldsDirty(true);
-}
+assert(pInputField != nullptr);
+const_cast(pInputField)->applyFieldContent( 
aNewFieldContent );
+// trigger update of fields for scenarios in which the Input Field's 
content is part of e.g. a table formula
+
GetTextNode().GetDoc()->getIDocumentFieldsAccess().GetUpdateFields().SetFieldsDirty(true);
 }
 }
 
 void SwTextInputField::UpdateTextNodeContent( const OUString& rNewContent )
 {
-if ( !IsFieldInDoc() )
-{
-OSL_ENSURE( false, " - 
misusage as Input Field is not in document content." );
-return;
-}
+assert(IsFieldInDoc() &&
+" - misusage as Input 
Field is not in document content.");
 
-OSL_ENSURE( (*End()) - GetStart() >= 2,
+assert( (*End()) - GetStart() >= 2 &&
 " - Are 
CH_TXT_ATR_INPUTFIELDSTART and/or CH_TXT_ATR_INPUTFIELDEND missing?" );
 // skip CH_TXT_ATR_INPUTFIELDSTART character
 const sal_Int32 nIdx = GetStart() + 1;
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 7cb4099f1b53..ce5c84fddf61 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1818,7 +1818,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
 // Input Fields are only copied, if completely covered by copied text
 if ( nWhich == RES_TXTATR_INPUTFIELD )
 {
-OSL_ENSURE( pEndIdx !

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - svx/source

2017-07-07 Thread Tamás Zolnai
 svx/source/svdraw/svdedxv.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 664c910653239a4d28036b79a8e396bebed1727b
Author: Tamás Zolnai 
Date:   Sat Jul 1 14:48:22 2017 +0200

tdf#107505: Impress - crash with two people co-editing one slide

In tiledrendering mode cursor inside shapes are not handled very well now.
Different LO instances manipulates the same cursor instead of having
one separate cursor for all instances (as in case of simple text editing
in Writer).

Crashes caused by that one cursor is owned (created and destroyed) by one
LO instance but used by an other instance in the meantime. We can avoid
this by not making this cursor available to the other instances. Cursor is
hidden anyway so don't need to have it set to the corresponding Window.

Change-Id: Id78f79e73eda88f3c2c6aa7f534c32f3f8aba174
Reviewed-on: https://gerrit.libreoffice.org/39432
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 258df6f41d89a606a980942df6337d446634c0a6)
Reviewed-on: https://gerrit.libreoffice.org/39436
Tested-by: Tamás Zolnai 

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index b9ac36ccac22..4159b61fe656 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -913,6 +913,7 @@ bool SdrObjEditView::SdrBeginTextEdit(
 {
 OutlinerView* pOutlView = 
ImpMakeOutlinerView(static_cast(&rOutDev), !bEmpty, nullptr);
 pOutlView->HideCursor();
+
static_cast(&rOutDev)->SetCursor(nullptr);
 pTextEditOutliner->InsertView(pOutlView);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/borderline' - drawinglayer/source svx/source

2017-07-07 Thread Armin Le Grand
 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx |2 
 svx/source/dialog/framelinkarray.cxx  |   78 +++---
 2 files changed, 67 insertions(+), 13 deletions(-)

New commits:
commit 048c2a5842e6eccb5c6422e120140cd3ac4a3e16
Author: Armin Le Grand 
Date:   Fri Jul 7 13:32:45 2017 +0200

borderline: correct line dash visualization

When a dashed line is used, a factor of 10.0 was applied in the
original coded, added that. Also the orientation of vertical
borders was inverted since it was simpler to exchange Start/End,
but this also mirrors the line dash visualisation, corrected that

Change-Id: I77418cc6c84ebb0632f8c3448976e82ce612d6b6

diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx 
b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
index 2bb7eb869289..f9a3ce78f468 100644
--- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
@@ -62,7 +62,7 @@ namespace drawinglayer
 aPolygon.append(rEnd);
 
 const attribute::LineAttribute aLineAttribute(rColor, fWidth);
-static double fPatScFact(1.0); // 10.0 multiply, see old code
+static double fPatScFact(10.0); // 10.0 multiply, see old code
 const std::vector aDashing(svtools::GetLineDashing(aStyle, 
fPatternScale * fPatScFact));
 
 if (aDashing.empty())
diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index 1b3406eafcdf..24f432e3b97d 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -1005,9 +1005,20 @@ void Array::DrawRange( 
drawinglayer::processor2d::BaseProcessor2D& rProcessor,
 drawinglayer::primitive2d::Primitive2DContainer 
aSequence(1);
 aSequence.append(
 CreateBorderPrimitives(
-aStartPos, aEndPos, *pStart,
-aStartLFromTR, *pStartLFromT, *pStartLFromL, 
*pStartLFromB, aStartLFromBR,
-aEndRFromTL, *pEndRFromT, *pEndRFromR, 
*pEndRFromB, aEndRFromBL, pForceColor));
+aStartPos,
+aEndPos,
+*pStart,
+aStartLFromTR,
+*pStartLFromT,
+*pStartLFromL,
+*pStartLFromB,
+aStartLFromBR,
+aEndRFromTL,
+*pEndRFromT,
+*pEndRFromR,
+*pEndRFromB,
+aEndRFromBL,
+pForceColor));
 rProcessor.process(aSequence);
 }
 
@@ -1036,9 +1047,20 @@ void Array::DrawRange( 
drawinglayer::processor2d::BaseProcessor2D& rProcessor,
 drawinglayer::primitive2d::Primitive2DContainer aSequence(1);
 aSequence.append(
 CreateBorderPrimitives(
-aStartPos, aEndPos, *pStart,
-aStartLFromTR, *pStartLFromT, *pStartLFromL, 
*pStartLFromB, aStartLFromBR,
-aEndRFromTL, *pEndRFromT, *pEndRFromR, *pEndRFromB, 
aEndRFromBL, pForceColor));
+aStartPos,
+aEndPos,
+*pStart,
+aStartLFromTR,
+*pStartLFromT,
+*pStartLFromL,
+*pStartLFromB,
+aStartLFromBR,
+aEndRFromTL,
+*pEndRFromT,
+*pEndRFromR,
+*pEndRFromB,
+aEndRFromBL,
+pForceColor));
 rProcessor.process(aSequence);
 }
 }
@@ -1095,9 +1117,28 @@ void Array::DrawRange( 
drawinglayer::processor2d::BaseProcessor2D& rProcessor,
 drawinglayer::primitive2d::Primitive2DContainer 
aSequence(1);
 aSequence.append(
 CreateBorderPrimitives(
-aEndPos, aStartPos, *pStart,
-aEndBFromTL, *pEndBFromL, *pEndBFromB, 
*pEndBFromR, aEndBFromTR,
-aStartTFromBL, *pStartTFromL, *pStartTFromT, 
*pStartTFromR, aStartTFromBR, pForceColor));
+// This replaces DrawVerFrameBorder which went 
from top to bottom. To be able to use
+// the same method as for horizontal 
(CreateBorderPrimitives), the given borders
+// have to be rearranged. Best is to look at the 
explanations of parameters in
+// framelink.hxx and the former calls to 
DrawVerFrameBorder and it's parameters.
+// In principle, the order of the five TFrom and 
B

[Libreoffice-commits] online.git: Branch 'libreoffice-5-4' - configure.ac

2017-07-07 Thread Andras Timar
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fa90d95251a311f799e1d143abae22b1eeb6d87d
Author: Andras Timar 
Date:   Fri Jul 7 13:22:28 2017 +0200

Bump version to 5.4.0.2

Change-Id: I83be77f64f92371d0353129f86153350ac0506db

diff --git a/configure.ac b/configure.ac
index b3f72066..51fd6c64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
 
 AC_PREREQ([2.69])
 
-AC_INIT([libreoffice-online], [5.4.0.1], [libreoffice@lists.freedesktop.org])
+AC_INIT([libreoffice-online], [5.4.0.2], [libreoffice@lists.freedesktop.org])
 LT_INIT([shared, disable-static, dlopen])
 
 AM_INIT_AUTOMAKE([1.11 silent-rules subdir-objects tar-pax -Wno-portability])
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'libreoffice-5-4' - loleaflet/po

2017-07-07 Thread Andras Timar
 loleaflet/po/help-ab.po|4 
 loleaflet/po/help-af.po|4 
 loleaflet/po/help-am.po|8 
 loleaflet/po/help-an.po|4 
 loleaflet/po/help-ar.po|4 
 loleaflet/po/help-as.po|4 
 loleaflet/po/help-ast.po   |4 
 loleaflet/po/help-az.po|4 
 loleaflet/po/help-be.po|4 
 loleaflet/po/help-bg.po|4 
 loleaflet/po/help-bn.po|4 
 loleaflet/po/help-bn_IN.po |4 
 loleaflet/po/help-bo.po|4 
 loleaflet/po/help-br.po|4 
 loleaflet/po/help-brx.po   |4 
 loleaflet/po/help-bs.po|4 
 loleaflet/po/help-ca.po|4 
 loleaflet/po/help-cs.po|4 
 loleaflet/po/help-cy.po|4 
 loleaflet/po/help-da.po|4 
 loleaflet/po/help-de.po|   10 
 loleaflet/po/help-dgo.po   |4 
 loleaflet/po/help-dsb.po   |4 
 loleaflet/po/help-dz.po|4 
 loleaflet/po/help-el.po|4 
 loleaflet/po/help-en_GB.po |4 
 loleaflet/po/help-en_ZA.po |4 
 loleaflet/po/help-eo.po|4 
 loleaflet/po/help-es.po|4 
 loleaflet/po/help-et.po|4 
 loleaflet/po/help-eu.po|4 
 loleaflet/po/help-fa.po|4 
 loleaflet/po/help-fi.po|4 
 loleaflet/po/help-fr.po|4 
 loleaflet/po/help-ga.po|4 
 loleaflet/po/help-gd.po|4 
 loleaflet/po/help-gl.po|4 
 loleaflet/po/help-gu.po|4 
 loleaflet/po/help-gug.po   |4 
 loleaflet/po/help-he.po|4 
 loleaflet/po/help-hi.po|4 
 loleaflet/po/help-hr.po|4 
 loleaflet/po/help-hsb.po   |4 
 loleaflet/po/help-hu.po|4 
 loleaflet/po/help-id.po|4 
 loleaflet/po/help-is.po|4 
 loleaflet/po/help-it.po|4 
 loleaflet/po/help-ja.po|4 
 loleaflet/po/help-jv.po|4 
 loleaflet/po/help-ka.po|4 
 loleaflet/po/help-kk.po|8 
 loleaflet/po/help-kl.po|4 
 loleaflet/po/help-km.po|4 
 loleaflet/po/help-kn.po|4 
 loleaflet/po/help-ko.po|4 
 loleaflet/po/help-kok.po   |4 
 loleaflet/po/help-ks.po|4 
 loleaflet/po/help-ky.po|4 
 loleaflet/po/help-lb.po|4 
 loleaflet/po/help-lo.po|4 
 loleaflet/po/help-lt.po|4 
 loleaflet/po/help-lv.po|4 
 loleaflet/po/help-mai.po   |4 
 loleaflet/po/help-mk.po|4 
 loleaflet/po/help-ml.po|4 
 loleaflet/po/help-mn.po|4 
 loleaflet/po/help-mni.po   |4 
 loleaflet/po/help-mr.po|4 
 loleaflet/po/help-my.po|4 
 loleaflet/po/help-nb.po|4 
 loleaflet/po/help-ne.po|4 
 loleaflet/po/help-nl.po|4 
 loleaflet/po/help-nn.po|4 
 loleaflet/po/help-nr.po|4 
 loleaflet/po/help-nso.po   |4 
 loleaflet/po/help-oc.po|4 
 loleaflet/po/help-om.po|4 
 loleaflet/po/help-or.po|4 
 loleaflet/po/help-pa_IN.po |4 
 loleaflet/po/help-pl.po|4 
 loleaflet/po/help-pt.po|4 
 loleaflet/po/help-pt_BR.po |4 
 loleaflet/po/help-ro.po|4 
 loleaflet/po/help-ru.po|4 
 loleaflet/po/help-rw.po|4 
 loleaflet/po/help-sa_IN.po |4 
 loleaflet/po/help-sah.po   |4 
 loleaflet/po/help-sat.po   |4 
 loleaflet/po/help-sd.po|4 
 loleaflet/po/help-si.po|4 
 loleaflet/po/help-sid.po   |4 
 loleaflet/po/help-sk.po|4 
 loleaflet/po/help-sq.po|4 
 loleaflet/po/help-ss.po|4 
 loleaflet/po/help-st.po|4 
 loleaflet/po/help-sv.po|4 
 loleaflet/po/help-sw_TZ.po |4 
 loleaflet/po/help-ta.po|4 
 loleaflet/po/help-te.po|4 
 loleaflet/po/help-tg.po|4 
 loleaflet/po/help-th.po|4 
 loleaflet/po/help-ti.po|4 
 loleaflet/po/help-tn.po|4 
 loleaflet/po/help-tr.po|4 
 loleaflet/po/help-ts.po|4 
 loleaflet/po/help-tt.po|4 
 loleaflet/po/help-ug.po|4 
 loleaflet/po/help-uk.po|4 
 loleaflet/po/help-ur.po|4 
 loleaflet/po/help-uz.po|4 
 loleaflet/po/help-ve.po|4 
 loleaflet/po/help-vi.po|4 
 loleaflet/po/help-xh.po|4 
 loleaflet/po/help-zh_CN.po |4 
 loleaflet/po/help-zh_TW.po |4 
 loleaflet/po/help-zu.po|4 
 loleaflet/po/ui-ab.po  |   89 
 loleaflet/po/ui-af.po  |   89 
 loleaflet/po/ui-am.po  |  831 -
 loleaflet/po/ui-an.po  |   89 
 loleaflet/po/ui-ar.po  |   89 
 loleaflet/po/ui-as.po  |   89 
 loleaflet/po/ui-ast.po |   89 
 loleaflet/po/ui-az.po  |   89 
 loleaflet/po/ui-be.po  |   89 
 loleaflet/po/ui-bg.po  |6 
 loleaflet/po/ui-bn.po  |   89 
 loleaflet/po/ui-bn_IN.po   |   89 
 loleaflet/po/ui-bo.po  |   89 
 loleaflet/po/ui-br.po  |   89 
 loleaflet/po/ui-brx.po |   89 
 loleaflet/po/ui-bs.po  |   89 
 loleaflet/po/ui-ca.po  |  111 +-
 loleaflet/po/ui-cs.po  |   93 -
 loleaflet/po/ui-cy.po  |6 
 loleaflet/po/ui-da.po 

[Libreoffice-commits] core.git: setup_native/scripts

2017-07-07 Thread Troy
 setup_native/scripts/source/getuid.c |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit c113d386888152632ae26fae9f59faf4f1d2f2dc
Author: Troy 
Date:   Tue Jun 13 16:40:47 2017 +1000

Add setgid call stub for Linux

Required by dpkg --build on Debian squeeze.

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

diff --git a/setup_native/scripts/source/getuid.c 
b/setup_native/scripts/source/getuid.c
index 8d0d9ebc1627..3f86817051de 100644
--- a/setup_native/scripts/source/getuid.c
+++ b/setup_native/scripts/source/getuid.c
@@ -24,6 +24,8 @@
 #include 
 #include 
 
+#define UNUSED(x) (void)(x)
+
 #ifdef _cplusplus
 extern "C" {
 #endif
@@ -112,6 +114,7 @@ int fstatat64(int fildes, const char *path, struct stat64  
*buf, int flag)
 
 uid_t getuid  (void) {return 0;}
 uid_t geteuid (void) {return 0;}
+int setgid  (gid_t p) { UNUSED(p); return 0; }
 
 /* This is to fool tar */
 #ifdef X86_64
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sw/qa writerfilter/source

2017-07-07 Thread Mike Kaganski
 sw/qa/extras/ooxmlimport/data/xml_space.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   10 
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |   37 +-
 writerfilter/source/ooxml/OOXMLFastContextHandler.hxx |8 +++
 4 files changed, 53 insertions(+), 2 deletions(-)

New commits:
commit 6a3960044c609b682170f7a34612761e62746c98
Author: Mike Kaganski 
Date:   Fri Jul 7 11:33:34 2017 +0300

tdf#108995: take xml:space attribute into account

See paragraph 2.10 of XML 1.0 specification and 17.3.3.31 of ECMA-376-1:2016

Change-Id: I7f19d3b9cf2ccce88a5fa03022beeb99facc04fe
Reviewed-on: https://gerrit.libreoffice.org/39682
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 
(cherry picked from commit 7c1a51516aaf2767e43b393259a1ad21570df5fb)
Reviewed-on: https://gerrit.libreoffice.org/39688
Tested-by: Mike Kaganski 

diff --git a/sw/qa/extras/ooxmlimport/data/xml_space.docx 
b/sw/qa/extras/ooxmlimport/data/xml_space.docx
new file mode 100644
index ..305c135fdd75
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/xml_space.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 767f908ab6fb..a46a09d32bf3 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1466,6 +1466,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf108714, "tdf108714.docx")
 CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, breakType);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf108995, "xml_space.docx")
+{
+CPPUNIT_ASSERT_EQUAL(1, getParagraphs());
+// We need to take xml:space attribute into account
+uno::Reference< text::XTextRange > paragraph = getParagraph(1);
+CPPUNIT_ASSERT_EQUAL(OUString("\tA\t\tline  with\txml:space=\"preserve\" 
\n"
+  "A  line  without xml:space"),
+ paragraph->getString());
+}
+
 // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in 
ooxmlEXPORT
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx 
b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 84d2a65ad6e0..bb59ed9bebdc 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -627,6 +627,12 @@ void OOXMLFastContextHandler::text(const OUString & sText)
 // tdf#108806: CRLFs in XML were converted to \n before this point.
 // These must be converted to spaces before further processing.
 OUString sNormalizedText = sText.replaceAll("\n", " ");
+// tdf#108995: by default, leading and trailing white space is ignored;
+// tabs are converted to spaces
+if (!IsPreserveSpace())
+{
+sNormalizedText = sNormalizedText.trim().replaceAll("\t", " ");
+}
 mpStream->utext(reinterpret_cast < const sal_uInt8 * >
 (sNormalizedText.getStr()),
 sNormalizedText.getLength());
@@ -889,6 +895,15 @@ void OOXMLFastContextHandler::sendPropertiesToParent()
 }
 }
 
+bool OOXMLFastContextHandler::IsPreserveSpace() const
+{
+// xml:space attribute applies to all elements within the content of the 
element where it is specified,
+// unless overridden with another instance of the xml:space attribute
+if (mpParent)
+return mpParent->IsPreserveSpace();
+return false; // default value
+}
+
 /*
   class OOXMLFastContextHandlerStream
  */
@@ -896,7 +911,9 @@ void OOXMLFastContextHandler::sendPropertiesToParent()
 OOXMLFastContextHandlerStream::OOXMLFastContextHandlerStream
 (OOXMLFastContextHandler * pContext)
 : OOXMLFastContextHandler(pContext),
-  mpPropertySetAttrs(new OOXMLPropertySet)
+  mpPropertySetAttrs(new OOXMLPropertySet),
+  mbPreserveSpace(false),
+  mbPreserveSpaceSet(false)
 {
 }
 
@@ -907,7 +924,14 @@ 
OOXMLFastContextHandlerStream::~OOXMLFastContextHandlerStream()
 void OOXMLFastContextHandlerStream::newProperty(Id nId,
 const OOXMLValue::Pointer_t& 
pVal)
 {
-if (nId != 0x0)
+if (nId == NS_ooxml::LN_CT_Text_space)
+{
+// Set  value early, to allow
+// child contexts use it when dealing with strings
+mbPreserveSpace = pVal->getString() == "preserve";
+mbPreserveSpaceSet = true;
+}
+else if (nId != 0x0)
 {
 OOXMLProperty::Pointer_t pProperty(new OOXMLProperty(nId, pVal, 
OOXMLProperty::ATTRIBUTE));
 
@@ -938,6 +962,15 @@ void OOXMLFastContextHandlerStream::handleHyperlink()
 getPropertySetAttrs()->resolve(aHyperlinkHandler);
 }
 
+bool OOXMLFastContextHandlerStream::IsPreserveSpace() const
+{
+// xml:space attribute applies to all elements within the content of the 
element where it is specified,
+// unless overridden with another instance of the xml:space attribute
+

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

2017-07-07 Thread Mike Kaganski
 sw/qa/extras/ooxmlimport/data/xml_space.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   10 
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |   37 +-
 writerfilter/source/ooxml/OOXMLFastContextHandler.hxx |8 +++
 4 files changed, 53 insertions(+), 2 deletions(-)

New commits:
commit 7c1a51516aaf2767e43b393259a1ad21570df5fb
Author: Mike Kaganski 
Date:   Fri Jul 7 11:33:34 2017 +0300

tdf#108995: take xml:space attribute into account

See paragraph 2.10 of XML 1.0 specification and 17.3.3.31 of ECMA-376-1:2016

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

diff --git a/sw/qa/extras/ooxmlimport/data/xml_space.docx 
b/sw/qa/extras/ooxmlimport/data/xml_space.docx
new file mode 100644
index ..305c135fdd75
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/xml_space.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 2513ca8097e7..817c065f4e95 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1372,6 +1372,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf108714, "tdf108714.docx")
 CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, breakType);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf108995, "xml_space.docx")
+{
+CPPUNIT_ASSERT_EQUAL(1, getParagraphs());
+// We need to take xml:space attribute into account
+uno::Reference< text::XTextRange > paragraph = getParagraph(1);
+CPPUNIT_ASSERT_EQUAL(OUString("\tA\t\tline  with\txml:space=\"preserve\" 
\n"
+  "A  line  without xml:space"),
+ paragraph->getString());
+}
+
 // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in 
ooxmlEXPORT
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx 
b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 6ec8820f5293..acb40f85e7d8 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -601,6 +601,12 @@ void OOXMLFastContextHandler::text(const OUString & sText)
 // tdf#108806: CRLFs in XML were converted to \n before this point.
 // These must be converted to spaces before further processing.
 OUString sNormalizedText = sText.replaceAll("\n", " ");
+// tdf#108995: by default, leading and trailing white space is ignored;
+// tabs are converted to spaces
+if (!IsPreserveSpace())
+{
+sNormalizedText = sNormalizedText.trim().replaceAll("\t", " ");
+}
 mpStream->utext(reinterpret_cast < const sal_uInt8 * >
 (sNormalizedText.getStr()),
 sNormalizedText.getLength());
@@ -863,6 +869,15 @@ void OOXMLFastContextHandler::sendPropertiesToParent()
 }
 }
 
+bool OOXMLFastContextHandler::IsPreserveSpace() const
+{
+// xml:space attribute applies to all elements within the content of the 
element where it is specified,
+// unless overridden with another instance of the xml:space attribute
+if (mpParent)
+return mpParent->IsPreserveSpace();
+return false; // default value
+}
+
 /*
   class OOXMLFastContextHandlerStream
  */
@@ -870,7 +885,9 @@ void OOXMLFastContextHandler::sendPropertiesToParent()
 OOXMLFastContextHandlerStream::OOXMLFastContextHandlerStream
 (OOXMLFastContextHandler * pContext)
 : OOXMLFastContextHandler(pContext),
-  mpPropertySetAttrs(new OOXMLPropertySet)
+  mpPropertySetAttrs(new OOXMLPropertySet),
+  mbPreserveSpace(false),
+  mbPreserveSpaceSet(false)
 {
 }
 
@@ -881,7 +898,14 @@ 
OOXMLFastContextHandlerStream::~OOXMLFastContextHandlerStream()
 void OOXMLFastContextHandlerStream::newProperty(Id nId,
 const OOXMLValue::Pointer_t& 
pVal)
 {
-if (nId != 0x0)
+if (nId == NS_ooxml::LN_CT_Text_space)
+{
+// Set  value early, to allow
+// child contexts use it when dealing with strings
+mbPreserveSpace = pVal->getString() == "preserve";
+mbPreserveSpaceSet = true;
+}
+else if (nId != 0x0)
 {
 OOXMLProperty::Pointer_t pProperty(new OOXMLProperty(nId, pVal, 
OOXMLProperty::ATTRIBUTE));
 
@@ -913,6 +937,15 @@ void OOXMLFastContextHandlerStream::handleHyperlink()
 aHyperlinkHandler.writetext();
 }
 
+bool OOXMLFastContextHandlerStream::IsPreserveSpace() const
+{
+// xml:space attribute applies to all elements within the content of the 
element where it is specified,
+// unless overridden with another instance of the xml:space attribute
+if (mbPreserveSpaceSet)
+return mbPreserveSpace;
+return OOXMLFastContextHandler::IsPreserveSpace();
+}
+
 /*
   class OOXMLFastContextHandlerProperties
  */
diff --

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

2017-07-07 Thread Marco A . G . Pinto
 extras/source/autocorr/lang/pt/DocumentList.xml |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit 350fb0249af7c29c98c3e15415a151bda8fae7ee
Author: Marco A.G.Pinto 
Date:   Wed Jul 5 13:01:28 2017 +0200

[pt_PT] autocorrect - added 22 words

Change-Id: I05e1e3b87478767a233caf38640b5e85f0fe751f
Reviewed-on: https://gerrit.libreoffice.org/39583
Tested-by: Jenkins 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/extras/source/autocorr/lang/pt/DocumentList.xml 
b/extras/source/autocorr/lang/pt/DocumentList.xml
index 31724be362f8..40b0a6477c98 100644
--- a/extras/source/autocorr/lang/pt/DocumentList.xml
+++ b/extras/source/autocorr/lang/pt/DocumentList.xml
@@ -1134,6 +1134,8 @@
 
 
 
+
+
 
 
 
@@ -1160,7 +1162,12 @@
 
 
 
+
+
 
+
+
+
 
 
 
@@ -1194,6 +1201,8 @@
 
 
 
+
+
 
 
 
@@ -1547,6 +1556,7 @@
 
 
 
+
 
 
 
@@ -1555,6 +1565,7 @@
 
 
 
+
 
 
 
@@ -1734,6 +1745,7 @@
 
 
 
+
 
 
 
@@ -1797,9 +1809,14 @@
 
 
 
+
+
+
 
 
 
+
+
 
 
 
@@ -1827,6 +1844,8 @@
 
 
 
+
+
 
 
 
@@ -2181,6 +2200,9 @@
   
   
   
+  
+  
+  
   
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Takeshi Abe
 basic/source/classes/eventatt.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit d64b83b2b05ca8f003707ffdfc1a04fd0f1acc50
Author: Takeshi Abe 
Date:   Fri Jul 7 17:51:52 2017 +0900

basic: Put local stuff into unnamed namespace

Change-Id: Ic8515d04980ee627f964821547fb25d52240e933
Reviewed-on: https://gerrit.libreoffice.org/39681
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/basic/source/classes/eventatt.cxx 
b/basic/source/classes/eventatt.cxx
index bd81d108cfb6..7dc252a9d58b 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -62,6 +62,7 @@ using namespace ::com::sun::star::awt;
 using namespace ::com::sun::star::io;
 using namespace ::cppu;
 
+namespace {
 
 void SFURL_firing_impl( const ScriptEvent& aScriptEvent, Any* pRet, const 
Reference< frame::XModel >& xModel )
 {
@@ -401,6 +402,8 @@ css::uno::Reference< css::container::XNameContainer > 
implFindDialogLibForDialog
 return aDlgLib;
 }
 
+}
+
 void RTL_Impl_CreateUnoDialog( SbxArray& rPar )
 {
 Reference< XComponentContext > xContext( 
comphelper::getProcessComponentContext() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Dennis Francis
 include/o3tl/sorted_vector.hxx   |1 +
 toolkit/source/controls/geometrycontrolmodel.cxx |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 99cd7dc54ff8b2c6ea895e2808d9e0eeb7fb707c
Author: Dennis Francis 
Date:   Fri Jul 7 13:32:49 2017 +0530

fix compile error due to missing include

Change-Id: I087c47084347c28f1af7881129de1a7b01960715
Reviewed-on: https://gerrit.libreoffice.org/39678
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/include/o3tl/sorted_vector.hxx b/include/o3tl/sorted_vector.hxx
index c50e19912ea1..7a9ca4568032 100644
--- a/include/o3tl/sorted_vector.hxx
+++ b/include/o3tl/sorted_vector.hxx
@@ -12,6 +12,7 @@
 
 #include 
 #include 
+#include 
 
 namespace o3tl
 {
diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx 
b/toolkit/source/controls/geometrycontrolmodel.cxx
index 3328a822ea35..5e3f3767cc48 100644
--- a/toolkit/source/controls/geometrycontrolmodel.cxx
+++ b/toolkit/source/controls/geometrycontrolmodel.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 #define GCM_PROPERTY_ID_POS_X   1
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/oox

2017-07-07 Thread Caolán McNamara
 include/oox/export/utils.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dde903aeb0e495c04b23e2169b3e733549f438af
Author: Caolán McNamara 
Date:   Fri Jul 7 09:23:16 2017 +0100

turn BS macro into an inline

maybe this will clear coverity#1413007 Out-of-bounds access

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

diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx
index a66941f9dc07..05ee6a750281 100644
--- a/include/oox/export/utils.hxx
+++ b/include/oox/export/utils.hxx
@@ -29,7 +29,7 @@ inline OString I64S_(sal_Int64 x) { return 
OString::number(x); }
 #define I32S(x) I32S_(x).getStr()
 #define I64S(x) I64S_(x).getStr()
 #define IS(x) OString::number( x ).getStr()
-#define BS(x) (x ? "1":"0")
+inline const char* BS(bool x) { return x ? "1" : "0"; }
 #define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
 
 static inline sal_Int64 PPTtoEMU( sal_Int32 nPPT )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Justin Luth
 sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docx |binary
 sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx   |   10 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx   |2 +-
 4 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit a75477101510e7a8e60db03edbf2d253f504d70d
Author: Justin Luth 
Date:   Thu Jul 6 09:46:06 2017 -0400

tdf#77219 writerfilter: allow shapes to be in front of text

In LO4.3, commit 2496eaa5c4535b88b44e4ac034aae6af0c08de0e
forced every shape to be "in background". That is not correct.
Word appears to use negative z-indexes to indicate behind-text
zordering and positive numbers for in-front placement.

Change-Id: I4083ae67ef76152e1c0a894d810950d249ac13b4
Reviewed-on: https://gerrit.libreoffice.org/39670
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docx 
b/sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docx
new file mode 100644
index ..bcfdcf377491
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docx differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docx 
b/sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docx
new file mode 100644
index ..7de2b4c39021
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index c4c4f035a784..0957e02eb313 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -631,6 +631,16 @@ DECLARE_OOXMLEXPORT_TEST(test77219, "test77219.docx")
 assertXPath(pXmlDoc, 
"/w:document[1]/w:body[1]/w:p[6]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]",
 "behindDoc", "1");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf77219_backgroundShape, 
"tdf77219_backgroundShape.docx")
+{
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", false, 
bool(getProperty(getShape(1), "Opaque")));
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf77219_foregroundShape, 
"tdf77219_foregroundShape.docx")
+{
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", true, 
bool(getProperty(getShape(1), "Opaque")));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx")
 {
 // Document contains a flowChartMultidocument preset shape, our date for 
that shape wasn't correct.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 8b8a78995b8a..bc15fc347fcf 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2081,7 +2081,7 @@ void DomainMapper_Impl::PushShapeContext( const 
uno::Reference< drawing::XShape
 aGrabBag[i].Value >>= zOrder;
 xShapePropertySet->setPropertyValue( "ZOrder", 
uno::makeAny(pZOrderHelper->findZOrder(zOrder)));
 pZOrderHelper->addItem(xShapePropertySet, zOrder);
-xShapePropertySet->setPropertyValue(getPropertyName( 
PROP_OPAQUE ), uno::makeAny( false ) );
+xShapePropertySet->setPropertyValue(getPropertyName( 
PROP_OPAQUE ), uno::makeAny( zOrder >= 0 ) );
 checkZOrderStatus = true;
 }
 else if ( aGrabBag[i].Name == "TxbxHasLink" )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: codemaker/source compilerplugins/clang connectivity/source cppu/source cui/source dbaccess/source editeng/source embeddedobj/source filter/source hwpfilter/source io/so

2017-07-07 Thread Noel Grandin
 codemaker/source/cppumaker/cppuoptions.cxx |2 -
 codemaker/source/javamaker/javaoptions.cxx |2 -
 compilerplugins/clang/test/unnecessaryparen.cxx|2 +
 compilerplugins/clang/unnecessaryparen.cxx |   31 -
 connectivity/source/drivers/mork/MResultSet.cxx|2 -
 cppu/source/typelib/typelib.cxx|4 +-
 cui/source/options/cfgchart.cxx|2 -
 dbaccess/source/ui/querydesign/JoinTableView.cxx   |2 -
 editeng/source/editeng/impedit4.cxx|2 -
 embeddedobj/source/general/dummyobject.cxx |2 -
 embeddedobj/source/msole/olepersist.cxx|2 -
 filter/source/graphicfilter/etiff/etiff.cxx|2 -
 filter/source/xsltdialog/typedetectionimport.cxx   |2 -
 filter/source/xsltdialog/xmlfilterjar.cxx  |2 -
 hwpfilter/source/hcode.cxx |4 +-
 io/source/stm/odata.cxx|2 -
 lotuswordpro/source/filter/lwpdrawobj.cxx  |4 +-
 package/source/xstor/xstorage.cxx  |2 -
 rsc/source/parser/rsckey.cxx   |3 --
 rsc/source/res/rscclass.cxx|4 +-
 rsc/source/res/rscconst.cxx|2 -
 sal/osl/unx/socket.cxx |2 -
 sal/rtl/locale.cxx |2 -
 sc/source/core/tool/compiler.cxx   |8 ++---
 sc/source/core/tool/interpr2.cxx   |2 -
 sc/source/core/tool/token.cxx  |4 +-
 sc/source/ui/Accessibility/AccessibleDocument.cxx  |2 -
 sc/source/ui/vba/vbarange.cxx  |2 -
 sc/source/ui/view/tabcont.cxx  |4 +-
 sd/source/core/CustomAnimationEffect.cxx   |6 ++--
 sd/source/core/EffectMigration.cxx |4 +-
 sd/source/filter/eppt/epptso.cxx   |   20 ++---
 sd/source/filter/html/htmlex.cxx   |   19 +++-
 sd/source/ui/animations/CustomAnimationDialog.cxx  |2 -
 sd/source/ui/animations/CustomAnimationPane.cxx|2 -
 sd/source/ui/annotations/annotationmanager.cxx |2 -
 sd/source/ui/unoidl/unoobj.cxx |2 -
 slideshow/source/engine/slide/userpaintoverlay.cxx |4 +-
 starmath/source/dialog.cxx |2 -
 svl/source/numbers/zforfind.cxx|6 ++--
 svx/source/gallery2/galbrws2.cxx   |2 -
 svx/source/svdraw/svdtrans.cxx |2 -
 svx/source/table/svdotable.cxx |2 -
 sw/source/core/doc/DocumentStylePoolManager.cxx|2 -
 sw/source/filter/ww8/rtfattributeoutput.cxx|2 -
 sw/source/filter/ww8/ww8par6.cxx   |6 ++--
 sw/source/ui/table/tabledlg.cxx|4 +-
 sw/source/uibase/shells/grfsh.cxx  |2 -
 sw/source/uibase/shells/tabsh.cxx  |5 ++-
 sw/source/uibase/uiview/viewtab.cxx|4 +-
 ucb/source/core/ucbstore.cxx   |2 -
 ucb/source/ucp/webdav-neon/ContentProperties.cxx   |4 +-
 vcl/source/bitmap/BitmapProcessor.cxx  |6 ++--
 vcl/source/filter/wmf/wmfwr.cxx|2 -
 vcl/source/gdi/print2.cxx  |6 ++--
 vcl/unx/generic/gdi/salgdi.cxx |4 +-
 vcl/unx/generic/print/genpspgraphics.cxx   |2 -
 xmloff/source/draw/sdxmlexp.cxx|4 +-
 xmloff/source/style/impastpl.cxx   |4 +-
 59 files changed, 138 insertions(+), 102 deletions(-)

New commits:
commit 868d8c8f0fdf376b0a3eb545ee841c9c12ffee3b
Author: Noel Grandin 
Date:   Fri Jul 7 08:42:54 2017 +0200

loplugin:unnecessaryparen handle parens inside call expr

stick to single-arg function calls, sometimes parens in multi-arg calls
might be there for clarity

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

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index 2a15f3497283..ea15907cc1e5 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -43,7 +43,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 
 OString name(av[0]);
 sal_Int32 index = name.lastIndexOf(SEPARATOR);
-m_program = name.copy((index > 0 ? index+1 : 0));
+m_program = name.copy(index > 0 ? index+1 : 0);
 
 if (ac < 2)
 {
diff --git a/codemaker/source/javamaker/javaoptions.cxx 
b/codemaker/source/javamaker/javaoptions.cxx
index cffc74451ac7..a09107a99b53 100644
--- a/codemaker/source/javamaker/javaoptions.cxx
+++ b/codemaker/source/javamaker/javaoptions.

[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( &aEditSource, 
&aSvxXMLTextImportComponentPropertySet, 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] libvisio.git: src/lib

2017-07-07 Thread David Tardon
 src/lib/VSDContentCollector.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4c9f3fd5cf1de3e4c6c0d28b848b0d496cc24f0a
Author: David Tardon 
Date:   Fri Jul 7 10:26:30 2017 +0200

ofz#2477 avoid divide by zero

Change-Id: I952670a60a0a8133509178449ac89dfad2091213

diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp
index 08e88e1..bc7fa42 100644
--- a/src/lib/VSDContentCollector.cpp
+++ b/src/lib/VSDContentCollector.cpp
@@ -1978,7 +1978,7 @@ void 
libvisio::VSDContentCollector::_generateBezierSegmentsFromNURBS(unsigned de
   while (b < m)
   {
 i = b;
-while (b < m && knotVector[b+1] == knotVector[b])
+while (b < m && VSD_APPROX_EQUAL(knotVector[b+1], knotVector[i]))
   b++;
 unsigned mult = b - i + 1;
 if (mult > degree) // it doesn't make sense to have knot multiplicity 
greater than the curve degree
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Caolán McNamara
 sw/source/filter/ww8/ww8graf.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e37539b3f0066abe29b737d4194ee766d5b09028
Author: Caolán McNamara 
Date:   Fri Jul 7 09:11:21 2017 +0100

coverity#1414682 unnecessary dynamic_cast

Change-Id: I7a1a7b5601f474fda84eef53009f4d45ae35b158

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 38070fe68586..9565b70465ab 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1210,7 +1210,7 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD* pHd, 
SfxAllItemSet &rSet)
 aP1.X() += (sal_Int16)SVBT16ToShort( pHd->dxa );
 aP1.Y() += (sal_Int16)SVBT16ToShort( pHd->dya );
 
-SdrObject* pObj = new SdrRectObj( OBJ_TEXT, tools::Rectangle( aP0, aP1 ) );
+SdrRectObj* pObj = new SdrRectObj( OBJ_TEXT, tools::Rectangle( aP0, aP1 ) 
);
 pObj->SetModel( m_pDrawModel );
 pObj->NbcSetSnapRect(tools::Rectangle(aP0, aP1));
 Size aSize( (sal_Int16)SVBT16ToShort( pHd->dxa ) ,
@@ -1218,7 +1218,7 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD* pHd, 
SfxAllItemSet &rSet)
 
 long nStartCpFly,nEndCpFly;
 bool bContainsGraphics;
-InsertTxbxText(dynamic_cast(pObj), &aSize, 0, 0, 0, nullptr, 
false,
+InsertTxbxText(pObj, &aSize, 0, 0, 0, nullptr, false,
 bDummy,nullptr,&nStartCpFly,&nEndCpFly,&bContainsGraphics);
 
 SetStdAttr( rSet, aTextB.aLnt, aTextB.aShd );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


New Defects reported by Coverity Scan for LibreOffice

2017-07-07 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found 
with Coverity Scan.

1 new defect(s) introduced to LibreOffice found with Coverity Scan.
9 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent 
build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)


** CID 1414682:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/filter/ww8/ww8graf.cxx: 1221 in 
SwWW8ImplReader::ReadTextBox(WW8_DPHEAD *, SfxAllItemSet &)()



*** CID 1414682:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/filter/ww8/ww8graf.cxx: 1221 in 
SwWW8ImplReader::ReadTextBox(WW8_DPHEAD *, SfxAllItemSet &)()
1215 pObj->NbcSetSnapRect(tools::Rectangle(aP0, aP1));
1216 Size aSize( (sal_Int16)SVBT16ToShort( pHd->dxa ) ,
1217 (sal_Int16)SVBT16ToShort( pHd->dya ) );
1218 
1219 long nStartCpFly,nEndCpFly;
1220 bool bContainsGraphics;
>>> CID 1414682:  Null pointer dereferences  (FORWARD_NULL)
>>> Dynamic cast to pointer "dynamic_cast (pObj)" can return 
>>> "NULL".
1221 InsertTxbxText(dynamic_cast(pObj), &aSize, 0, 0, 0, 
nullptr, false,
1222 bDummy,nullptr,&nStartCpFly,&nEndCpFly,&bContainsGraphics);
1223 
1224 SetStdAttr( rSet, aTextB.aLnt, aTextB.aShd );
1225 SetFill( rSet, aTextB.aFill );
1226 



To view the defects in Coverity Scan visit, 
https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZBnDJeNb0HijxaS4JNJPxk3kpyAm2AYqo71yXmnOxB72ibeUH-2F-2F1Lhi9AZq3dRu-2F4-3D_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyqlsX0Godtc0fyDvRbzdAhDsODb1a0r27CnPrXc6n98zTcVHev3JGSspgDhsrJKbciU2Q-2Bk2bJLK7JhAyisZzect50R8mf1ACZm-2FAb9t-2BY5NRmnU9zue-2BDGxO8OgDyOJ7JRy73V4ejaaLCFbRckkAKdta6CokVs8WQiQG-2BTcmBbA-3D

To manage Coverity Scan email notifications for 
"libreoffice@lists.freedesktop.org", click 
https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4k1FZJSDV-2FTHi5VQof9xGafB4oBwGYxuHHknceo2QLpCrZ44Ciy7AqBR2QyX6OCB5N5X-2B1MAElavPQhH6nLwozJzqOkt2k8uOkYf2ZoppNa9QVe0T3fEZVQ7Kky1tOkLz_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyqlsX0Godtc0fyDvRbzdAhIOcc3cd7nSKt2SGSS-2FsUF1J0YCBA-2F6FEafJfrgD6z8-2FPbRK-2BIXoDL-2Fzxzn0pPidVORwa-2BmWn0kpTR2N4JMm1jiBDvXYk4taKm8QT8El27FVzeILA-2FsQaUFA02BTeiDtiiEueafkRry5c4-2Fv3WWwn7Y-3D

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: offapi/com

2017-07-07 Thread Miklos Vajna
 offapi/com/sun/star/graphic/GraphicDescriptor.idl |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 0ed17ba0555c4c3cb5b4125a9756dc438000d2c0
Author: Miklos Vajna 
Date:   Thu Jul 6 21:38:45 2017 +0200

offapi: document used mime type for svg and pdf images in GraphicDescriptor

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

diff --git a/offapi/com/sun/star/graphic/GraphicDescriptor.idl 
b/offapi/com/sun/star/graphic/GraphicDescriptor.idl
index 248e95f72467..d08869f9d408 100644
--- a/offapi/com/sun/star/graphic/GraphicDescriptor.idl
+++ b/offapi/com/sun/star/graphic/GraphicDescriptor.idl
@@ -79,6 +79,8 @@ published service GraphicDescriptor
 image/x-wmf
 image/x-sgv
 image/x-emf
+image/svg+xml
+application/pdf
 image/x-vclgraphic
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/findunusedcode Makefile.in unusedcode.easy unusedcode.exclude unusedcode.README

2017-07-07 Thread Caolán McNamara
 Makefile.in|5 --
 bin/findunusedcode |   99 -
 unusedcode.README  |   39 
 unusedcode.easy|   76 
 unusedcode.exclude |   42 --
 5 files changed, 1 insertion(+), 260 deletions(-)

New commits:
commit f58bca9d8ca01db299f1f62da61f2c8118c8f822
Author: Caolán McNamara 
Date:   Thu Jul 6 17:13:05 2017 +0100

drop findunusedcode

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

diff --git a/Makefile.in b/Makefile.in
index 5bbbe1682e14..e1c4c857e911 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -9,7 +9,7 @@
 
 gb_Top_MODULE_CHECK_TARGETS := slowcheck unitcheck subsequentcheck perfcheck 
uicheck screenshot
 
-.PHONY : all check-if-root bootstrap gbuild build build-non-l10n-only 
build-l10n-only check clean clean-build clean-host test-install distclean 
distro-pack-install distro-pack-install-strip docs download etags fetch 
findunusedcode get-submodules id install install-strip tags debugrun help 
showmodules translations packageinfo internal.clean 
$(gb_Top_MODULE_CHECK_TARGETS)
+.PHONY : all check-if-root bootstrap gbuild build build-non-l10n-only 
build-l10n-only check clean clean-build clean-host test-install distclean 
distro-pack-install distro-pack-install-strip docs download etags fetch 
get-submodules id install install-strip tags debugrun help showmodules 
translations packageinfo internal.clean $(gb_Top_MODULE_CHECK_TARGETS)
 
 MAKECMDGOALS?=all
 build_goal:=$(if $(filter build check,$(MAKECMDGOALS)),all)\
@@ -395,9 +395,6 @@ etags:
 docs:
@$(SRCDIR)/solenv/bin/mkdocs.sh $(SRCDIR)/docs 
$(SRCDIR)/solenv/inc/doxygen.cfg
 
-findunusedcode:
-   @$(SRCDIR)/bin/findunusedcode $(SRCDIR) $(MAKE)
-
 findunusedheaders:
$(SRCDIR)/bin/find-unusedheaders.py
 
diff --git a/bin/findunusedcode b/bin/findunusedcode
deleted file mode 100755
index 526b2f706859..
--- a/bin/findunusedcode
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/bash
-set -e
-SRCDIR=$1
-GNUMAKE=$2
-
-cd ${SRCDIR}
-which callcatcher > /dev/null 2>&1 || \
-   (echo "callcatcher not installed" && false)
-
-mkdir -p ${SRCDIR}/callcatcher
-cd ${SRCDIR}/callcatcher
-
-echo "--without-doxygen
---enable-verbose
---enable-gio
---enable-packagekit
---enable-extension-integration
---enable-evolution2
---enable-online-update
---enable-dbgutil
---enable-werror
---enable-gtk3
---enable-kde4
---enable-dbus
---enable-gstreamer-1-0
---disable-gstreamer-0-10" \
-  > autogen.input
-
-export CC="callcatcher ${CC:-gcc}"
-export CXX="callcatcher ${CXX:-g++}"
-export AR="callarchive ${AR:-ar}"
-
-/bin/env -i CC="$CC" CXX="$CXX" AR="$AR" /bin/bash -l ../autogen.sh
-
-export dbglevel=2
-
-make clean && make check
-
-callanalyse \
-  instdir/program/* \
-  instdir/sdk/bin/* \
-  workdir/LinkTarget/*/* workdir/LinkTarget/*/*/* \
-  workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit.so* \
-  > unusedcode.all
-
-grep ::.*\( unusedcode.all \
- | grep -v ^Atom \
- | grep -v ^atom:: \
- | grep -v ^boost:: \
- | grep -v ^CIcc \
- | grep -v ^CLuceneError:: \
- | grep -v ^cppu:: \
- | grep -v ^CppUnit:: \
- | grep -v ^Dde \
- | grep -v ^graphite2:: \
- | grep -v ^jvmaccess:: \
- | grep -v ^Json:: \
- | grep -v ^libcdr:: \
- | grep -v ^libcmis:: \
- | grep -v ^libgltf:: \
- | grep -v ^libmspub:: \
- | grep -v ^libvisio:: \
- | grep -v ^libwpg:: \
- | grep -v ^libwps_tools_win:: \
- | grep -v ^lucene:: \
- | grep -v ^Matrix3d:: \
- | grep -v ^RelatedMultipart:: \
- | grep -v ^salhelper:: \
- | grep -v ^VSDInternalStream:: \
- | grep -v ^WP1 \
- | grep -v ^WP3 \
- | grep -v ^WP42 \
- | grep -v ^WP6 \
- | grep -v ^WPG \
- | grep -v ^WPS \
- | grep -v WPX \
- | grep -v ^WSObject \
- | grep -v ^OAuth2Handler \
- | grep -v ^COLLADABU:: \
- | grep -v ^COLLADAFW:: \
- | grep -v ^COLLADASaxFWL14:: \
- | grep -v ^COLLADASaxFWL15:: \
- | grep -v ^COLLADASaxFWL:: \
- | grep -v ^o3dgc:: \
- | grep -v ^MathML:: \
- | grep -v ^GeneratedSaxParser:: \
- | grep -v ^GLTF:: \
- | grep -v ^OneDrive \
- | grep -v ^SharePoint \
- | grep -v ^VersioningService:: \
-  

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

2017-07-07 Thread Caolán McNamara
 sc/source/filter/excel/xepivotxml.cxx |   28 +---
 1 file changed, 13 insertions(+), 15 deletions(-)

New commits:
commit bc29aa9f4ceaa6060c7290607c65cf0cb6276ea8
Author: Caolán McNamara 
Date:   Thu Jul 6 21:38:40 2017 +0100

coverity#1413006 Mixing enum types

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

diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index a8ce9f886588..2cd292d9ec6a 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -79,34 +79,32 @@ const char* toOOXMLAxisType( 
sheet::DataPilotFieldOrientation eOrient )
 return "";
 }
 
-const char* toOOXMLSubtotalType( sheet::GeneralFunction eFunc )
+const char* toOOXMLSubtotalType(ScGeneralFunction eFunc)
 {
 switch (eFunc)
 {
-case sheet::GeneralFunction_SUM:
+case ScGeneralFunction::SUM:
 return "sum";
-case sheet::GeneralFunction_COUNT:
+case ScGeneralFunction::COUNT:
 return "count";
-case sheet::GeneralFunction_AVERAGE:
+case ScGeneralFunction::AVERAGE:
 return "average";
-case sheet::GeneralFunction_MAX:
+case ScGeneralFunction::MAX:
 return "max";
-case sheet::GeneralFunction_MIN:
+case ScGeneralFunction::MIN:
 return "min";
-case sheet::GeneralFunction_PRODUCT:
+case ScGeneralFunction::PRODUCT:
 return "product";
-case sheet::GeneralFunction_COUNTNUMS:
+case ScGeneralFunction::COUNTNUMS:
 return "countNums";
-case sheet::GeneralFunction_STDEV:
+case ScGeneralFunction::STDEV:
 return "stdDev";
-case sheet::GeneralFunction_STDEVP:
+case ScGeneralFunction::STDEVP:
 return "stdDevp";
-case sheet::GeneralFunction_VAR:
+case ScGeneralFunction::VAR:
 return "var";
-case sheet::GeneralFunction_VARP:
+case ScGeneralFunction::VARP:
 return "varp";
-case sheet::GeneralFunction_NONE:
-case sheet::GeneralFunction_AUTO:
 default:
 ;
 }
@@ -800,7 +798,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
 
 rStrm.WriteAttributes(XML_fld, OString::number(nDimIdx).getStr(), 
FSEND);
 
-sheet::GeneralFunction eFunc = 
static_cast(rDim.GetFunction());
+ScGeneralFunction eFunc = rDim.GetFunction();
 const char* pSubtotal = toOOXMLSubtotalType(eFunc);
 if (pSubtotal)
 rStrm.WriteAttributes(XML_subtotal, pSubtotal, FSEND);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-07 Thread Caolán McNamara
 vcl/source/outdev/text.cxx |   14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 8d80832a91520ae43f420f244bba278ead7689bc
Author: Caolán McNamara 
Date:   Thu Jul 6 21:43:44 2017 +0100

xContext only needed for bHyphenate case

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

diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 7d4a729f3bd6..ba9208d5ba1c 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -472,19 +472,17 @@ long OutputDevice::ImplGetTextLines( 
ImplMultiTextLineInfo& rLineInfo,
 rLineInfo.Clear();
 if ( !rStr.isEmpty() && (nWidth > 0) )
 {
-css::uno::Reference < css::i18n::XBreakIterator > xBI;
-// get service provider
-css::uno::Reference< css::uno::XComponentContext > xContext( 
comphelper::getProcessComponentContext() );
-
-bool bHyphenate = (nStyle & DrawTextFlags::WordBreakHyphenation)
-== DrawTextFlags::WordBreakHyphenation;
+const bool bHyphenate = (nStyle & DrawTextFlags::WordBreakHyphenation) 
== DrawTextFlags::WordBreakHyphenation;
 css::uno::Reference< css::linguistic2::XHyphenator > xHyph;
-if ( bHyphenate )
+if (bHyphenate)
 {
-css::uno::Reference< css::linguistic2::XLinguServiceManager2> 
xLinguMgr = css::linguistic2::LinguServiceManager::create(xContext);
+// get service provider
+css::uno::Reference 
xContext(comphelper::getProcessComponentContext());
+css::uno::Reference 
xLinguMgr = css::linguistic2::LinguServiceManager::create(xContext);
 xHyph = xLinguMgr->getHyphenator();
 }
 
+css::uno::Reference xBI;
 sal_Int32 nPos = 0;
 sal_Int32 nLen = rStr.getLength();
 while ( nPos < nLen )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits