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

2023-10-24 Thread sahil (via logerrit)
 lotuswordpro/source/filter/bencont.cxx   |2 +-
 lotuswordpro/source/filter/bento.hxx |2 +-
 lotuswordpro/source/filter/lwpfilter.cxx |2 +-
 lotuswordpro/source/filter/lwpgrfobj.cxx |6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e2c9b9056182dfb1fc1145ab627bc5db4e73d62b
Author: sahil 
AuthorDate: Thu Sep 14 01:02:48 2023 +0530
Commit: Hossein 
CommitDate: Tue Oct 24 09:41:12 2023 +0200

changed sal_uInt8 to BenError (enum)

Change-Id: Ia7cb2f879b7be833d1a5ccf845a8dc8bfb94befd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156900
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/lotuswordpro/source/filter/bencont.cxx 
b/lotuswordpro/source/filter/bencont.cxx
index 3677c7809a7a..29153ee0a828 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -71,7 +71,7 @@ const char gsBenMagicBytes[] = BEN_MAGIC_BYTES;
 *   @param  pointer to pointer of Bento Container object
 *   @return error code
 */
-sal_uInt8 BenOpenContainer(LwpSvStream * pStream, 
std::unique_ptr* ppContainer)
+BenError BenOpenContainer(LwpSvStream * pStream, 
std::unique_ptr* ppContainer)
 {
 *ppContainer = nullptr;
 
diff --git a/lotuswordpro/source/filter/bento.hxx 
b/lotuswordpro/source/filter/bento.hxx
index acf7a6e21a38..86d79b40c0b0 100644
--- a/lotuswordpro/source/filter/bento.hxx
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -135,7 +135,7 @@ typedef sal_uInt32 BenContainerPos;
 typedef sal_uInt32 BenObjectID;
 typedef sal_uInt32 BenGeneration;
 
-sal_uInt8 BenOpenContainer(LwpSvStream * pStream, 
std::unique_ptr* ppContainer);
+BenError BenOpenContainer(LwpSvStream * pStream, 
std::unique_ptr* ppContainer);
 
 class CBenIDListElmt : public CUtListElmt
 {
diff --git a/lotuswordpro/source/filter/lwpfilter.cxx 
b/lotuswordpro/source/filter/lwpfilter.cxx
index 5a8d4169a199..9a8f8ef4d026 100644
--- a/lotuswordpro/source/filter/lwpfilter.cxx
+++ b/lotuswordpro/source/filter/lwpfilter.cxx
@@ -96,7 +96,7 @@ static bool Decompress(SvStream* pCompressed, SvStream*& 
pOutDecompressed)
 LwpSvStream aLwpStream(pCompressed);
 std::unique_ptr pBentoContainer;
 {
-sal_uInt8 ulRet = BenOpenContainer(, );
+BenError ulRet = BenOpenContainer(, );
 if (ulRet != BenErr_OK)
 return false;
 }
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx 
b/lotuswordpro/source/filter/lwpgrfobj.cxx
index f17ea8e98f93..202e662ae02f 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -286,7 +286,7 @@ void LwpGraphicObject::CreateDrawObjects()
 LwpSvStream* pStream = m_pStrm->GetCompressedStream() ?  
m_pStrm->GetCompressedStream(): m_pStrm;
 
 std::unique_ptr pBentoContainer;
-sal_uInt8 ulRet = OpenStormBento::BenOpenContainer(pStream, 
);
+OpenStormBento::BenError ulRet = OpenStormBento::BenOpenContainer(pStream, 
);
 if (ulRet != OpenStormBento::BenErr_OK)
 return;
 
@@ -333,7 +333,7 @@ std::vector LwpGraphicObject::GetRawGrafData()
 
 std::unique_ptr pBentoContainer;
 {
-sal_uInt8 ulRet = OpenStormBento::BenOpenContainer(pStream, 
);
+OpenStormBento::BenError ulRet = 
OpenStormBento::BenOpenContainer(pStream, );
 if (ulRet != OpenStormBento::BenErr_OK)
 return aGrafData;
 }
@@ -359,7 +359,7 @@ sal_uInt32 
LwpGraphicObject::GetGrafData(std::unique_ptr& pGrafData
 LwpSvStream* pStream = m_pStrm->GetCompressedStream() ?  
m_pStrm->GetCompressedStream(): m_pStrm;
 
 std::unique_ptr pBentoContainer;
-sal_uInt8 ulRet = OpenStormBento::BenOpenContainer(pStream, 
);
+OpenStormBento::BenError ulRet = OpenStormBento::BenOpenContainer(pStream, 
);
 if (ulRet != OpenStormBento::BenErr_OK)
 return 0;
 


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

2023-09-11 Thread sahil (via logerrit)
 lotuswordpro/source/filter/bencont.cxx   |4 ++--
 lotuswordpro/source/filter/bento.hxx |   12 ++--
 lotuswordpro/source/filter/lwpfilter.cxx |4 ++--
 lotuswordpro/source/filter/lwpgrfobj.cxx |6 +++---
 lotuswordpro/source/filter/tocread.cxx   |4 ++--
 5 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit f5bcc34580d02f92af01963155f2d54776a5249b
Author: sahil 
AuthorDate: Mon Aug 21 00:21:32 2023 +0530
Commit: Hossein 
CommitDate: Tue Sep 12 02:36:35 2023 +0200

tdf#114441 - Convert sal_uLong to better integer types

Change-Id: Idc6de0c0275ce9913e248548466b77aaef180d7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155873
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/lotuswordpro/source/filter/bencont.cxx 
b/lotuswordpro/source/filter/bencont.cxx
index 60e644ce212d..3677c7809a7a 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -71,7 +71,7 @@ const char gsBenMagicBytes[] = BEN_MAGIC_BYTES;
 *   @param  pointer to pointer of Bento Container object
 *   @return error code
 */
-sal_uLong BenOpenContainer(LwpSvStream * pStream, 
std::unique_ptr* ppContainer)
+sal_uInt8 BenOpenContainer(LwpSvStream * pStream, 
std::unique_ptr* ppContainer)
 {
 *ppContainer = nullptr;
 
@@ -318,7 +318,7 @@ std::vector 
LtcBenContainer::GetGraphicData(const char *pObjectName)
 return aData;
 }
 
-sal_uLong LtcBenContainer::remainingSize() const
+sal_uInt64 LtcBenContainer::remainingSize() const
 {
 return m_ulLength - cpStream->Tell();
 }
diff --git a/lotuswordpro/source/filter/bento.hxx 
b/lotuswordpro/source/filter/bento.hxx
index d2c1cb90d703..acf7a6e21a38 100644
--- a/lotuswordpro/source/filter/bento.hxx
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -135,7 +135,7 @@ typedef sal_uInt32 BenContainerPos;
 typedef sal_uInt32 BenObjectID;
 typedef sal_uInt32 BenGeneration;
 
-sal_uLong BenOpenContainer(LwpSvStream * pStream, 
std::unique_ptr* ppContainer);
+sal_uInt8 BenOpenContainer(LwpSvStream * pStream, 
std::unique_ptr* ppContainer);
 
 class CBenIDListElmt : public CUtListElmt
 {
@@ -175,7 +175,7 @@ public:
 public: // Overridden methods
 
 /* added by  */
-sal_uLong GetSize() const { return m_ulValueLength; };
+sal_uInt64 GetSize() const { return m_ulValueLength; };
 protected: // Overridden methods
 
 virtual std::size_t GetData(void* pData, std::size_t nSize) override;
@@ -188,7 +188,7 @@ private: // Data
 CBenValue * cpValue;
 size_t cCurrentPosition;
 
-sal_uLong m_ulValueLength;  // Added by , sum of length of all 
sub-valuesegments
+sal_uInt64 m_ulValueLength;  // Added by , sum of length of all 
sub-valuesegments
 };
 
 class LtcBenContainer
@@ -207,7 +207,7 @@ public: // Internal methods
 explicit LtcBenContainer(LwpSvStream * pStream);
 ~LtcBenContainer();
 
-sal_uLong remainingSize() const;
+sal_uInt64 remainingSize() const;
 void Read(void * pBuffer, size_t MaxSize,
   size_t* pAmtRead);
 BenError ReadKnownSize(void * pBuffer, size_t Amt);
@@ -222,12 +222,12 @@ public: // Internal methods
 LtcUtBenValueStream * FindValueStreamWithPropertyName(const char * 
sPropertyName);
 std::vector GetGraphicData(const char *pObjectName);
 
-sal_uLong GetSize() const { return m_ulLength; }
+sal_uInt64 GetSize() const { return m_ulLength; }
 private: // Data
 CUtOwningList cObjects;
 CUtList cNamedObjects;
 LwpSvStream * cpStream;
-sal_uLong m_ulLength;   // Added for TOCRead.cpp
+sal_uInt64 m_ulLength;   // Added for TOCRead.cpp
 BenObjectID cNextAvailObjectID; // for new object
 };
 
diff --git a/lotuswordpro/source/filter/lwpfilter.cxx 
b/lotuswordpro/source/filter/lwpfilter.cxx
index e8ba358ae8c7..5a8d4169a199 100644
--- a/lotuswordpro/source/filter/lwpfilter.cxx
+++ b/lotuswordpro/source/filter/lwpfilter.cxx
@@ -96,7 +96,7 @@ static bool Decompress(SvStream* pCompressed, SvStream*& 
pOutDecompressed)
 LwpSvStream aLwpStream(pCompressed);
 std::unique_ptr pBentoContainer;
 {
-sal_uLong ulRet = BenOpenContainer(, );
+sal_uInt8 ulRet = BenOpenContainer(, );
 if (ulRet != BenErr_OK)
 return false;
 }
@@ -112,7 +112,7 @@ static bool Decompress(SvStream* pCompressed, SvStream*& 
pOutDecompressed)
 if (0 != decompress.explode())
 return false;
 
-sal_uInt32 nPos = aWordProData->GetSize();
+sal_uInt64 nPos = aWordProData->GetSize();
 nPos += 0x10;
 
 pCompressed->Seek(nPos);
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx 
b/lotuswordpro/source/filter/lwpgrfobj.cxx
index 3c8f3d03a381..f17ea8e98f93 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -286,7 +286,7 @@ void LwpGraphicObject::CreateDrawObjects()
 LwpSvStream* pStream = m_pStrm->GetCompressedStream() ?  
m_pStrm->GetCompressedStream(): m_pStrm;
 
 std::unique_ptr 

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

2023-05-02 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwprowlayout.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 81e8cc7aa3d97ecc42f2592a2f6075f7f1ba74ff
Author: Caolán McNamara 
AuthorDate: Tue May 2 09:04:59 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 2 12:54:04 2023 +0200

ofz#58529 Null-dereference READ

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

diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx 
b/lotuswordpro/source/filter/lwprowlayout.cxx
index b5583d19e6d4..d63a06fe9e38 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -192,6 +192,8 @@ void LwpRowLayout::ConvertRow(rtl::Reference const 
& pXFTable,sal_uInt8
 if (!pTableLayout)
 throw std::runtime_error("missing TableLayout");
 LwpTable* pTable = pTableLayout->GetTable();
+if (!pTable)
+throw std::runtime_error("missing Table");
 
 //calculate the connected cell position
 sal_Int32 nMarkConnCell = FindMarkConnCell(nStartCol,nEndCol);


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

2023-01-12 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpbackgroundstuff.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 13cd316bc733fbe37db105dc705b9d172aec8809
Author: Caolán McNamara 
AuthorDate: Thu Jan 12 14:50:41 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 12 20:03:30 2023 +

ofz#55034 Stack-buffer-overflow in vcl::bitmap::CreateFromData

since:

commit 21734247d58a6e915b058d8fa55ece949d049613
Date:   Tue Jan 10 12:56:58 2023 +0200

drop internal support for 1-bit images

the input data is still 1 bit here, even if the output will be 8 bit

Change-Id: Ib7eb301b2e62ebc61ee61ebb99e6de92c1f4931b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145410
Reviewed-by: Noel Grandin 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx 
b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
index 2c2fcf109504..dc3f9194e094 100644
--- a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
+++ b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
@@ -114,7 +114,7 @@ std::unique_ptr 
LwpBackgroundStuff::GetFillPattern()
 GetPattern(m_nID, aPttnArray);
 
 // create bitmap object from the pattern array
-BitmapEx aBmp = vcl::bitmap::CreateFromData(aPttnArray, 8, 8, 1, 
/*nBitsPerPixel*/ 8);
+BitmapEx aBmp = vcl::bitmap::CreateFromData(aPttnArray, 8, 8, 1, 
/*nBitsPerPixel*/ 1);
 
 // create XOBitmap object from bitmap object
 XOBitmap aXOBitmap(aBmp);


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

2022-11-05 Thread Stephan Bergmann (via logerrit)
 lotuswordpro/source/filter/bencont.cxx |   13 +
 lotuswordpro/source/filter/lwpgrfobj.cxx   |   12 ++--
 lotuswordpro/source/filter/xfilter/xfcolor.cxx |4 ++--
 3 files changed, 13 insertions(+), 16 deletions(-)

New commits:
commit 34cecc1f9c5dd41473a84be051d56b37118698aa
Author: Stephan Bergmann 
AuthorDate: Sat Nov 5 16:00:48 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 6 01:14:44 2022 +0100

-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): lotuswordpro

Change-Id: I6b9707c1f416eb1ab890ff0d783151066cf695d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142329
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/lotuswordpro/source/filter/bencont.cxx 
b/lotuswordpro/source/filter/bencont.cxx
index b5648a64b3ec..60e644ce212d 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -55,9 +55,9 @@
  /
 #include "first.hxx"
 #include "tocread.hxx"
-#include 
 #include 
 #include 
+#include 
 
 namespace OpenStormBento
 {
@@ -277,16 +277,13 @@ std::vector 
LtcBenContainer::GetGraphicData(const char *pObjectName)
 return aData;
 }
 // construct the string of property name
-char sSName[64]="";
-char sDName[64]="";
-
-sprintf(sSName, "%s-S", pObjectName);
-sprintf(sDName, "%s-D", pObjectName);
+OString sSName=OString::Concat(pObjectName) + "-S";
+OString sDName=OString::Concat(pObjectName) + "-D";
 
 /* traverse the found properties and construct the stream vectors */
 // get S's stream and merge them together
-std::unique_ptr xS(FindValueStreamWithPropertyName(sSName));
-std::unique_ptr xD(FindValueStreamWithPropertyName(sDName));
+std::unique_ptr 
xS(FindValueStreamWithPropertyName(sSName.getStr()));
+std::unique_ptr 
xD(FindValueStreamWithPropertyName(sDName.getStr()));
 
 sal_uInt64 nDLen = 0;
 if (xD)
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx 
b/lotuswordpro/source/filter/lwpgrfobj.cxx
index 76c8aa76c52a..3c8f3d03a381 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -58,9 +58,8 @@
  * @file
  *  For LWP filter architecture prototype
 */
-#include 
-
 #include 
+#include 
 
 #include 
 #include "lwpgrfobj.hxx"
@@ -69,6 +68,8 @@
 
 #include 
 #include 
+#include 
+#include 
 #include "lwpframelayout.hxx"
 
 #include 
@@ -314,7 +315,7 @@ void LwpGraphicObject::GetBentoNamebyID(LwpObjectID const & 
rMyID, std::string&
 sal_uInt32 nLow = rMyID.GetLow();
 char pTempStr[32];
 rName = std::string("Gr");
-sprintf(pTempStr, "%X,%" SAL_PRIXUINT32, nHigh, nLow);
+o3tl::sprintf(pTempStr, "%X,%" SAL_PRIXUINT32, nHigh, nLow);
 rName.append(pTempStr);
 }
 
@@ -369,11 +370,10 @@ sal_uInt32 
LwpGraphicObject::GetGrafData(std::unique_ptr& pGrafData
 std::string aGrfObjName;
 GetBentoNamebyID(rMyID,  aGrfObjName);
 
-char sDName[64]="";
-sprintf(sDName, "%s-D", aGrfObjName.c_str());
+OString sDName=OString::Concat(std::string_view(aGrfObjName)) + "-D";
 
 // get bento stream by the name
-pGrafStream = pBentoContainer->FindValueStreamWithPropertyName(sDName);
+pGrafStream = 
pBentoContainer->FindValueStreamWithPropertyName(sDName.getStr());
 
 std::unique_ptr 
pMemGrafStream(static_cast(pGrafStream));
 
diff --git a/lotuswordpro/source/filter/xfilter/xfcolor.cxx 
b/lotuswordpro/source/filter/xfilter/xfcolor.cxx
index c30e35341f3e..7b5fd8655361 100644
--- a/lotuswordpro/source/filter/xfilter/xfcolor.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfcolor.cxx
@@ -57,13 +57,13 @@
  * @file
  * Color object to serial to xml filter.
  /
-#include 
+#include 
 #include 
 
 OUString XFColor::ToString() const
 {
 charbuf[8] = {};
-sprintf(buf,"#%2x%2x%2x",m_nRed, m_nGreen, m_nBlue);
+o3tl::sprintf(buf,"#%2x%2x%2x",m_nRed, m_nGreen, m_nBlue);
 for( int i=1; i<7;i++ )
 {
 if( buf[i] == ' ' )


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

2022-09-09 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwptablelayout.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 3642db420a66133ebe4aabb346ce0adca17e26e6
Author: Caolán McNamara 
AuthorDate: Fri Sep 9 11:28:44 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Sep 9 13:40:46 2022 +0200

ofz#51149 avoid Timeout

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

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx 
b/lotuswordpro/source/filter/lwptablelayout.cxx
index 7624664964d7..c2760c6c6c4c 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -81,6 +81,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -801,7 +802,14 @@ void LwpTableLayout::ParseTable()
 sal_uInt16 nEndHeadRow;
 pTableHeading->GetStartEndRow(nStartHeadRow,nEndHeadRow);
 if (nStartHeadRow == 0)
+{
+if (utl::ConfigManager::IsFuzzing() && nEndHeadRow - nStartHeadRow 
> 128)
+{
+SAL_WARN("lwp", "truncating HeadingRow for fuzzing 
performance");
+nEndHeadRow = nStartHeadRow + 128;
+}
 nContentRow = 
ConvertHeadingRow(m_pXFTable,nStartHeadRow,nEndHeadRow+1);
+}
 }
 
 ConvertTable(m_pXFTable, nContentRow, nRow, 0, nCol);


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

2022-09-09 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwptablelayout.cxx |   15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 7a7cd044887ce6801791e1cf7eb18ac1a0e68e07
Author: Caolán McNamara 
AuthorDate: Fri Sep 9 11:22:10 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Sep 9 13:40:23 2022 +0200

rearrange to have a single ConvertTable call

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

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx 
b/lotuswordpro/source/filter/lwptablelayout.cxx
index c3d027e91008..7624664964d7 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -790,6 +790,8 @@ void LwpTableLayout::ParseTable()
 sal_uInt16 nRow = m_nRows;
 sal_uInt8 nCol = static_cast(m_nCols);
 
+sal_uInt16 nContentRow = 0;
+
 //process header rows
 LwpTableHeadingLayout* pTableHeading;
 pTableHeading = pSuper->GetTableHeadingLayout();
@@ -798,16 +800,11 @@ void LwpTableLayout::ParseTable()
 sal_uInt16 nStartHeadRow;
 sal_uInt16 nEndHeadRow;
 pTableHeading->GetStartEndRow(nStartHeadRow,nEndHeadRow);
-if (nStartHeadRow != 0)
-ConvertTable(m_pXFTable,0,nRow,0,nCol);
-else
-{
-sal_uInt16 nContentRow = 
ConvertHeadingRow(m_pXFTable,nStartHeadRow,nEndHeadRow+1);
-ConvertTable(m_pXFTable,nContentRow,nRow,0,nCol);
-}
+if (nStartHeadRow == 0)
+nContentRow = 
ConvertHeadingRow(m_pXFTable,nStartHeadRow,nEndHeadRow+1);
 }
-else
-ConvertTable(m_pXFTable,0,nRow,0,nCol);
+
+ConvertTable(m_pXFTable, nContentRow, nRow, 0, nCol);
 }
 
 /**


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

2022-08-30 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpfribframe.cxx |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit b715118b8ea3374fc6895c7e5792b71410ad155c
Author: Caolán McNamara 
AuthorDate: Tue Aug 30 08:58:26 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 30 12:20:55 2022 +0200

ofz#50756 Direct-leak

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

diff --git a/lotuswordpro/source/filter/lwpfribframe.cxx 
b/lotuswordpro/source/filter/lwpfribframe.cxx
index ad494d429883..9bdc1237c4c1 100644
--- a/lotuswordpro/source/filter/lwpfribframe.cxx
+++ b/lotuswordpro/source/filter/lwpfribframe.cxx
@@ -170,9 +170,9 @@ void LwpFribFrame::XFConvert(XFContentContainer* pCont)
 sChangeID = pChangeMgr->GetChangeID(this);
 if (!sChangeID.isEmpty())
 {
-XFChangeStart* pChangeStart = new XFChangeStart;
-pChangeStart->SetChangeID(sChangeID);
-pXFContentContainer->Add(pChangeStart);
+rtl::Reference xChangeStart(new XFChangeStart);
+xChangeStart->SetChangeID(sChangeID);
+pXFContentContainer->Add(xChangeStart.get());
 }
 }
 
@@ -182,18 +182,18 @@ void LwpFribFrame::XFConvert(XFContentContainer* pCont)
 {
 if (!sChangeID.isEmpty())
 {
-XFChangeEnd* pChangeEnd = new XFChangeEnd;
-pChangeEnd->SetChangeID(sChangeID);
-pXFContentContainer->Add(pChangeEnd);
+rtl::Reference xChangeEnd(new XFChangeEnd);
+xChangeEnd->SetChangeID(sChangeID);
+pXFContentContainer->Add(xChangeEnd.get());
 }
 }
 
 if (LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE == nType && HasNextFrib())
 {
-XFParagraph* pXFPara = new XFParagraph();
-pXFPara->SetStyleName(m_StyleName);
-m_pPara->AddXFContent(pXFPara);
-m_pPara->GetFribs().SetXFPara(pXFPara);
+rtl::Reference xXFPara(new XFParagraph);
+xXFPara->SetStyleName(m_StyleName);
+m_pPara->AddXFContent(xXFPara.get());
+m_pPara->GetFribs().SetXFPara(xXFPara.get());
 }
 }
 


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

2022-03-23 Thread VaibhavMalik4187 (via logerrit)
 lotuswordpro/source/filter/lwpsdwrect.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d0055ac076c61d24c505c2ffa4f99e36c97b1266
Author: VaibhavMalik4187 
AuthorDate: Sat Mar 19 16:32:13 2022 +0530
Commit: Hossein 
CommitDate: Wed Mar 23 20:52:13 2022 +0100

tdf#147906 Use std::hypot for Pythagorean addition

Change-Id: I7813b9929771858d33e951e50e6de7893fe19085
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131684
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/lotuswordpro/source/filter/lwpsdwrect.cxx 
b/lotuswordpro/source/filter/lwpsdwrect.cxx
index 3ec27ccfbc42..3bc2704ac76f 100644
--- a/lotuswordpro/source/filter/lwpsdwrect.cxx
+++ b/lotuswordpro/source/filter/lwpsdwrect.cxx
@@ -170,7 +170,7 @@ double SdwRectangle::GetRotationAngle() const
 
 double SdwRectangle::CalcDistBetween2Points(tools::Long nX1, tools::Long nY1, 
tools::Long nX2, tools::Long nY2)
 {
-return sqrt(static_cast((nX1-nX2)*(nX1-nX2) + 
(nY1-nY2)*(nY1-nY2)));
+return std::hypot(nX1 - nX2, nY1 - nY2);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-03-13 Thread Andrea Gelmini (via logerrit)
 lotuswordpro/source/filter/lwpgrfobj.cxx |2 +-
 lotuswordpro/source/filter/lwpgrfobj.hxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 15cf536adce74c6ca3fb401e0e232aacadd87f8f
Author: Andrea Gelmini 
AuthorDate: Sun Mar 13 12:26:02 2022 +0100
Commit: Julien Nabet 
CommitDate: Sun Mar 13 19:15:47 2022 +0100

Fix typo in code

Change-Id: Id38f846aaf451d94e975e049f6494a6261eb4ae3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131494
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx 
b/lotuswordpro/source/filter/lwpgrfobj.cxx
index 986cdff85195..76c8aa76c52a 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -126,7 +126,7 @@ void LwpGraphicObject::Read()
 {
 m_aIPData.nBrightness = aServerContext[14];
 m_aIPData.nContrast = aServerContext[19];
-m_aIPData.nEdgeEnchancement = aServerContext[24];
+m_aIPData.nEdgeEnhancement = aServerContext[24];
 m_aIPData.nSmoothing = aServerContext[29];
 m_aIPData.bInvertImage = (aServerContext[34] == 0x01);
 m_aIPData.bAutoContrast = (aServerContext[44] == 0x00);
diff --git a/lotuswordpro/source/filter/lwpgrfobj.hxx 
b/lotuswordpro/source/filter/lwpgrfobj.hxx
index 406f5883d6bb..5c05bf218059 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.hxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.hxx
@@ -70,7 +70,7 @@ struct ImageProcessingData
 {
 sal_uInt8 nBrightness;
 sal_uInt8 nContrast;
-sal_uInt8 nEdgeEnchancement;
+sal_uInt8 nEdgeEnhancement;
 sal_uInt8 nSmoothing;
 bool bAutoContrast;
 bool bInvertImage;
@@ -78,7 +78,7 @@ struct ImageProcessingData
 ImageProcessingData()
   : nBrightness(50),
 nContrast(50),
-nEdgeEnchancement(0),
+nEdgeEnhancement(0),
 nSmoothing(0),
 bAutoContrast(false),
 bInvertImage(false)


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

2022-03-13 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 71fc9f50ac69da474c1767cef9abaf7edf529675
Author: Caolán McNamara 
AuthorDate: Sun Mar 13 10:48:47 2022 +
Commit: Caolán McNamara 
CommitDate: Sun Mar 13 12:58:31 2022 +0100

ofz#45524 string is presumed to be at least length 1

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 130e729f6fc6..5b704c1d5065 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1244,7 +1244,11 @@ void LwpDrawTextArt::Read()
 - 
(m_aTextArtRec.aPath[1].n*3 + 1)*4;
 
 
-if (!m_pStream->good() || m_aTextArtRec.nTextLen > 
m_pStream->remainingSize())
+if (!m_pStream->good())
+throw BadRead();
+if (m_aTextArtRec.nTextLen > m_pStream->remainingSize())
+throw BadRead();
+if (m_aTextArtRec.nTextLen < 1)
 throw BadRead();
 
 m_aTextArtRec.pTextString = new sal_uInt8 [m_aTextArtRec.nTextLen];


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

2022-02-01 Thread Andrea Gelmini (via logerrit)
 lotuswordpro/source/filter/lwptools.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 74bcd46bbf4cb88112b054e5b192a995f3ef354a
Author: Andrea Gelmini 
AuthorDate: Tue Feb 1 16:16:52 2022 +0100
Commit: Julien Nabet 
CommitDate: Wed Feb 2 08:57:44 2022 +0100

Fix typo

Change-Id: Ice5721d480567be4f8a4a79da6e01a6a389bf4bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129318
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/lotuswordpro/source/filter/lwptools.cxx 
b/lotuswordpro/source/filter/lwptools.cxx
index 674be2b89cd8..8a171fda7755 100644
--- a/lotuswordpro/source/filter/lwptools.cxx
+++ b/lotuswordpro/source/filter/lwptools.cxx
@@ -264,8 +264,8 @@ std::unique_ptr 
LwpTools::GetSystemDateStyle(bool bLongFormat)
 return nullptr;
 // 3 parse pattern string,per icu date/time format syntax, there are 20 
letters reserved
 // as pattern letter,each represent an element in date/time and its repeat 
numbers represent
-// different format: for example: M produces '1',MM produces '01', MMM 
produces 'Jan',  produces 'Januaray'
-// letter other than these letters is regard as text in the format, for 
example ','in 'Jan,2005'
+// different format: for example: M produces '1', MM produces '01', MMM 
produces 'Jan',  produces 'January'
+// letter other than these letters is regard as text in the format, for 
example ',' in 'Jan,2005'
 // we parse pattern string letter by letter and get the time format.
 UChar cSymbol;
 UChar cTmp;


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

2022-02-01 Thread zhutyra (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |   65 ++
 1 file changed, 15 insertions(+), 50 deletions(-)

New commits:
commit 5e8ceac64b66d1298037b939350d3adb86b37752
Author: zhutyra 
AuthorDate: Tue Feb 1 14:07:26 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 1 20:37:47 2022 +0100

ensure bounds checking

LIBREOFFICE-SBQ5TJRS

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 7e1322a8f67f..130e729f6fc6 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1363,21 +1363,20 @@ void LwpDrawBitmap::Read()
 m_pStream->ReadUInt16( m_aBmpRec.nTranslation );
 m_pStream->ReadUInt16( m_aBmpRec.nRotation );
 
+// 20 == length of draw-specific fields.
 if (m_aObjHeader.nRecLen < 20)
 throw BadRead();
 
-// 20 == length of draw-specific fields.
-// 14 == length of bmp file header.
-m_aBmpRec.nFileSize = m_aObjHeader.nRecLen - 20 + 14;
+sal_uInt64 nBmpPos = m_pStream->Tell();
+sal_uInt64 nBmpLen =
+std::min(m_aObjHeader.nRecLen - 20, 
m_pStream->remainingSize());
 
 BmpInfoHeader2 aInfoHeader2;
 m_pStream->ReadUInt32( aInfoHeader2.nHeaderLen );
 
-if (!m_pStream->good())
+if (!m_pStream->good() || nBmpLen < aInfoHeader2.nHeaderLen)
 throw BadRead();
 
-m_pImageData.reset( new sal_uInt8 [m_aBmpRec.nFileSize] );
-
 sal_uInt32 N;
 sal_uInt32 rgbTableSize;
 
@@ -1405,7 +1404,7 @@ void LwpDrawBitmap::Read()
 rgbTableSize = 3 * (1 << N);
 }
 }
-else
+else if (aInfoHeader2.nHeaderLen >= sizeof(BmpInfoHeader2))
 {
 m_pStream->ReadUInt32( aInfoHeader2.nWidth );
 m_pStream->ReadUInt32( aInfoHeader2.nHeight );
@@ -1424,9 +1423,15 @@ void LwpDrawBitmap::Read()
 {
 rgbTableSize = 4 * (1 << N);
 }
-
+}
+else
+{
+throw BadRead();
 }
 
+m_aBmpRec.nFileSize = static_cast(nBmpLen + 14);
+m_pImageData.reset( new sal_uInt8 [m_aBmpRec.nFileSize] );
+
 sal_uInt32 nOffBits = 14 + aInfoHeader2.nHeaderLen + rgbTableSize;
 m_pImageData[0] = 'B';
 m_pImageData[1] = 'M';
@@ -1443,50 +1448,10 @@ void LwpDrawBitmap::Read()
 m_pImageData[12] = static_cast(nOffBits >> 16);
 m_pImageData[13] = static_cast(nOffBits >> 24);
 
-sal_uInt32 nDIBRemaining;
 sal_uInt8* pPicData = m_pImageData.get();
-if (aInfoHeader2.nHeaderLen== sizeof(BmpInfoHeader))
-{
-m_pImageData[14] = static_cast(aInfoHeader2.nHeaderLen);
-m_pImageData[15] = static_cast(aInfoHeader2.nHeaderLen >> 
8);
-m_pImageData[16] = static_cast(aInfoHeader2.nHeaderLen >> 
16);
-m_pImageData[17] = static_cast(aInfoHeader2.nHeaderLen >> 
24);
-m_pImageData[18] = static_cast(aInfoHeader2.nWidth);
-m_pImageData[19] = static_cast(aInfoHeader2.nWidth >> 8);
-m_pImageData[20] = static_cast(aInfoHeader2.nHeight);
-m_pImageData[21] = static_cast(aInfoHeader2.nHeight >> 8);
-m_pImageData[22] = static_cast(aInfoHeader2.nPlanes);
-m_pImageData[23] = static_cast(aInfoHeader2.nPlanes >> 8);
-m_pImageData[24] = static_cast(aInfoHeader2.nBitCount);
-m_pImageData[25] = static_cast(aInfoHeader2.nBitCount >> 8);
-
-nDIBRemaining = m_aBmpRec.nFileSize - 26;
-pPicData += 26*sizeof(sal_uInt8);
-}
-else
-{
-m_pImageData[14] = static_cast(aInfoHeader2.nHeaderLen);
-m_pImageData[15] = static_cast(aInfoHeader2.nHeaderLen >> 
8);
-m_pImageData[16] = static_cast(aInfoHeader2.nHeaderLen >> 
16);
-m_pImageData[17] = static_cast(aInfoHeader2.nHeaderLen >> 
24);
-m_pImageData[18] = static_cast(aInfoHeader2.nWidth);
-m_pImageData[19] = static_cast(aInfoHeader2.nWidth >> 8);
-m_pImageData[20] = static_cast(aInfoHeader2.nWidth >> 16);
-m_pImageData[21] = static_cast(aInfoHeader2.nWidth >> 24);
-m_pImageData[22] = static_cast(aInfoHeader2.nHeight);
-m_pImageData[23] = static_cast(aInfoHeader2.nHeight >> 8);
-m_pImageData[24] = static_cast(aInfoHeader2.nHeight >> 16);
-m_pImageData[25] = static_cast(aInfoHeader2.nHeight >> 24);
-m_pImageData[26] = static_cast(aInfoHeader2.nPlanes);
-m_pImageData[27] = static_cast(aInfoHeader2.nPlanes >> 8);
-m_pImageData[28] = static_cast(aInfoHeader2.nBitCount);
-m_pImageData[29] = static_cast(aInfoHeader2.nBitCount >> 8);
-
-nDIBRemaining = m_aBmpRec.nFileSize - 30;
-pPicData += 30*sizeof(sal_uInt8);
-}
 
-if (nDIBRemaining != m_pStream->ReadBytes(pPicData, nDIBRemaining))
+m_pStream->Seek(nBmpPos);
+if (nBmpLen != m_pStream->ReadBytes(pPicData 

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

2022-02-01 Thread zhutyra (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit dfcf8a75a975b09d3a39e4c753a717dc67036a3c
Author: zhutyra 
AuthorDate: Tue Feb 1 13:54:55 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 1 20:37:30 2022 +0100

read of width/height uses wrong record size

this initially went wrong at:

commit b4fb7a437bb0ce987702b12008737756623618ac
Date:   Mon May 23 21:38:40 2011 +0100

fix up some more endian

LIBREOFFICE-SBQ5TJRS

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index ad14a778d2cb..7e1322a8f67f 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1383,8 +1383,12 @@ void LwpDrawBitmap::Read()
 
 if (aInfoHeader2.nHeaderLen == sizeof(BmpInfoHeader))
 {
-m_pStream->ReadUInt32( aInfoHeader2.nWidth );
-m_pStream->ReadUInt32( aInfoHeader2.nHeight );
+sal_uInt16 nTmp;
+
+m_pStream->ReadUInt16( nTmp );
+aInfoHeader2.nWidth = nTmp;
+m_pStream->ReadUInt16( nTmp );
+aInfoHeader2.nHeight = nTmp;
 m_pStream->ReadUInt16( aInfoHeader2.nPlanes );
 m_pStream->ReadUInt16( aInfoHeader2.nBitCount );
 


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

2022-01-28 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e863b90a0e5fc90c3b824e4b0012f9389b87a3ac
Author: Caolán McNamara 
AuthorDate: Thu Jan 27 20:38:33 2022 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 28 09:52:08 2022 +0100

ofz: Undefined-Shift

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 1ad3a5329002..ad14a778d2cb 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1392,7 +1392,7 @@ void LwpDrawBitmap::Read()
 throw BadRead();
 
 N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
-if (N == 24)
+if (N >= 16)
 {
 rgbTableSize = 0;
 }
@@ -1412,7 +1412,7 @@ void LwpDrawBitmap::Read()
 throw BadRead();
 
 N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
-if (N == 24)
+if (N >= 16)
 {
 rgbTableSize = 0;
 }


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

2022-01-26 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 92f84e7864c0c6729c2d87a03c1176ce565c8b99
Author: Caolán McNamara 
AuthorDate: Wed Jan 26 11:57:13 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 26 14:49:11 2022 +0100

ofz#44080 throw exception on a negative length

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index a46d44d1e51f..2dc4d5cdee9c 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1094,6 +1094,9 @@ rtl::Reference 
LwpDrawTextBox::CreateDrawObj(const OUString& rStyleName
 aEncoding = LwpCharSetMgr::GetTextCharEncoding();
 }
 
+if (TextLength < 2)
+throw BadRead();
+
 XFParagraph* pXFPara = new XFParagraph();
 pXFPara->Add(OUString(reinterpret_cast(m_aTextRec.pTextString), 
(TextLength-2), aEncoding));
 pXFPara->SetStyleName(rStyleName);
@@ -1107,13 +1110,6 @@ rtl::Reference 
LwpDrawTextBox::CreateDrawObj(const OUString& rStyleName
 OUString sName = 
pXFStyleManager->AddStyle(std::move(pBoxStyle)).m_pStyle->GetStyleName();
 xTextBox->SetStyleName(sName);
 
-//todo: add the interface for rotating textbox
-//  if (m_aTextRec.nTextRotation)
-//  {
-//  double fAngle = double(3600-m_aTextRec.nTextRotation)/10;
-//  xTextBox->SetRotate(fAngle);
-//  }
-
 return xTextBox;
 }
 


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

2022-01-22 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwptablelayout.cxx |   25 ++---
 1 file changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 8f81535faf6a5d80d5e4d522768c7537e0ca5d21
Author: Caolán McNamara 
AuthorDate: Sat Jan 22 12:49:03 2022 +
Commit: Caolán McNamara 
CommitDate: Sat Jan 22 15:22:53 2022 +0100

ofz#43949 Timeout

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

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx 
b/lotuswordpro/source/filter/lwptablelayout.cxx
index 70a387781394..c3d027e91008 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -111,22 +111,24 @@ LwpTableLayout* LwpSuperTableLayout::GetTableLayout()
 {
 LwpObjectID *pID = ();
 
-while(pID && !pID->IsNull())
+o3tl::sorted_vector aSeen;
+while (pID && !pID->IsNull())
 {
+bool bAlreadySeen = !aSeen.insert(pID).second;
+if (bAlreadySeen)
+throw std::runtime_error("loop in conversion");
+
 LwpLayout* pLayout = dynamic_cast(pID->obj().get());
 if (!pLayout)
-{
 break;
-}
 if (pLayout->GetLayoutType() == LWP_TABLE_LAYOUT)
-{
 return dynamic_cast(pLayout);
-}
 pID = >GetPrevious();
 }
 
 return nullptr;
 }
+
 /**
  * @short   Get effective heading table layout, the one just before table 
layout is the only one which is effective
  * @return LwpTableHeadingLayout* - pointer to table heading layout
@@ -135,23 +137,24 @@ LwpTableHeadingLayout* 
LwpSuperTableLayout::GetTableHeadingLayout()
 {
 LwpObjectID *pID = ();
 
-while(pID && !pID->IsNull())
+o3tl::sorted_vector aSeen;
+while (pID && !pID->IsNull())
 {
+bool bAlreadySeen = !aSeen.insert(pID).second;
+if (bAlreadySeen)
+throw std::runtime_error("loop in conversion");
+
 LwpLayout * pLayout = dynamic_cast(pID->obj().get());
 if (!pLayout)
-{
 break;
-}
-
 if (pLayout->GetLayoutType() == LWP_TABLE_HEADING_LAYOUT)
-{
 return dynamic_cast(pLayout);
-}
 pID = >GetPrevious();
 }
 
 return nullptr;
 }
+
 /**
  * @short   Register super table layout style
  */


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

2022-01-20 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx |8 
 lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx |2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 1284937bf2bd112197a99e844a5a1a961e2cf4fc
Author: Caolán McNamara 
AuthorDate: Thu Jan 20 09:23:01 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 20 11:59:39 2022 +0100

ofz#43689 Direct-Leak

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

diff --git a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx 
b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
index 47362c809892..916531a8d624 100644
--- a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
+++ b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
@@ -234,7 +234,7 @@ void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector< 
rtl::Reference LwpSdwGroupLoaderV0102::CreateDrawGroupObject()
 {
 //flag
 unsigned char BinSignature[2];
@@ -263,7 +263,7 @@ XFDrawGroup* LwpSdwGroupLoaderV0102::CreateDrawGroupObject()
 // fileSize
 m_pStream->SeekRel(2);
 
-XFDrawGroup* pXFDrawGroup = new XFDrawGroup();
+rtl::Reference xXFDrawGroup(new XFDrawGroup());
 
 if (nRecCount > m_pStream->remainingSize())
 {
@@ -284,12 +284,12 @@ XFDrawGroup* 
LwpSdwGroupLoaderV0102::CreateDrawGroupObject()
 }
 else
 {
-pXFDrawGroup->Add(xXFDrawObj.get());
+xXFDrawGroup->Add(xXFDrawObj.get());
 }
 }
 }
 
-return pXFDrawGroup;
+return xXFDrawGroup;
 }
 
 /**
diff --git a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx 
b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx
index b0e5b21072bb..d9d63e8424b3 100644
--- a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx
+++ b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx
@@ -83,7 +83,7 @@ public:
 
 public:
 void BeginDrawObjects(std::vector>* 
pDrawObjVector);
-XFDrawGroup* CreateDrawGroupObject();
+rtl::Reference CreateDrawGroupObject();
 rtl::Reference CreateDrawObject();
 };
 


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

2022-01-20 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 7b37a1a5144a3a4c8b0803b7e2da81e9e108bf66
Author: Caolán McNamara 
AuthorDate: Thu Jan 20 09:17:03 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 20 11:08:45 2022 +0100

ofz: Use-of-uninitialized-value

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index f7bd4f511283..a46d44d1e51f 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1372,11 +1372,15 @@ void LwpDrawBitmap::Read()
 // 20 == length of draw-specific fields.
 // 14 == length of bmp file header.
 m_aBmpRec.nFileSize = m_aObjHeader.nRecLen - 20 + 14;
-m_pImageData.reset( new sal_uInt8 [m_aBmpRec.nFileSize] );
 
 BmpInfoHeader2 aInfoHeader2;
 m_pStream->ReadUInt32( aInfoHeader2.nHeaderLen );
 
+if (!m_pStream->good())
+throw BadRead();
+
+m_pImageData.reset( new sal_uInt8 [m_aBmpRec.nFileSize] );
+
 sal_uInt32 N;
 sal_uInt32 rgbTableSize;
 


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

2022-01-20 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx |   11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

New commits:
commit e9443070888628f7643741c1abcaaef28de6a53f
Author: Caolán McNamara 
AuthorDate: Wed Jan 19 20:43:58 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 20 09:44:16 2022 +0100

ofz: Use-of-uninitialized-value

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

diff --git a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx 
b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
index 35920fb2e7ec..47362c809892 100644
--- a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
+++ b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
@@ -238,20 +238,15 @@ XFDrawGroup* 
LwpSdwGroupLoaderV0102::CreateDrawGroupObject()
 {
 //flag
 unsigned char BinSignature[2];
-m_pStream->ReadBytes(BinSignature, 2);
+if (m_pStream->ReadBytes(BinSignature, 2) != 2)
+return nullptr;
 if (BinSignature[0] != 'S' || BinSignature[1] != 'M')
-{
-assert(false);
 return nullptr;
-}
 //version
-unsigned short nVersion;
+unsigned short nVersion(0);
 m_pStream->ReadUInt16(nVersion);
 if (nVersion<0x0102)
-{
-assert(false);
 return nullptr;
-}
 // topObj, botObj
 m_pStream->SeekRel(4);
 //record count


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

2022-01-17 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 84dc0f3dc044ab13e3d8638433d2b5533fc55aa0
Author: Caolán McNamara 
AuthorDate: Mon Jan 17 10:48:12 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Jan 17 13:09:56 2022 +0100

ofz: Use-of-uninitialized-value

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 808edae43e68..f7bd4f511283 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1481,7 +1481,8 @@ void LwpDrawBitmap::Read()
 pPicData += 30*sizeof(sal_uInt8);
 }
 
-m_pStream->ReadBytes(pPicData, nDIBRemaining);
+if (nDIBRemaining != m_pStream->ReadBytes(pPicData, nDIBRemaining))
+throw BadRead();
 }
 
 OUString LwpDrawBitmap::RegisterStyle()


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

2022-01-17 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpsdwfileloader.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit a6b1f367419e2b3645f37b572736f3d504520c16
Author: Caolán McNamara 
AuthorDate: Mon Jan 17 10:40:20 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Jan 17 13:09:40 2022 +0100

ofz: Use-of-uninitialized-value

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

diff --git a/lotuswordpro/source/filter/lwpsdwfileloader.cxx 
b/lotuswordpro/source/filter/lwpsdwfileloader.cxx
index 3a7f05bb477a..bcdb7bb018af 100644
--- a/lotuswordpro/source/filter/lwpsdwfileloader.cxx
+++ b/lotuswordpro/source/filter/lwpsdwfileloader.cxx
@@ -77,12 +77,13 @@ LwpSdwFileLoader::~LwpSdwFileLoader() {}
 void LwpSdwFileLoader::CreateDrawObjects(std::vector>* 
pDrawObjVector)
 {
 unsigned char BinSignature[2];
-m_pStream->ReadBytes(BinSignature, 2);
+if (m_pStream->ReadBytes(BinSignature, 2) != 2)
+return;
 
 if (BinSignature[0] != 'S' || BinSignature[1] != 'M')
 return;
 
-unsigned short nVersion;
+unsigned short nVersion(0);
 m_pStream->ReadUInt16(nVersion);
 
 m_pStream->Seek(0);


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

2022-01-16 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |   20 
 1 file changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 3fcfa152c5a12f549aed9d6c8261017f2ad75df3
Author: Caolán McNamara 
AuthorDate: Sun Jan 16 14:30:15 2022 +
Commit: Caolán McNamara 
CommitDate: Sun Jan 16 20:23:08 2022 +0100

ofz: Use-of-uninitialized-value

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 0e78359fa0c6..808edae43e68 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -498,7 +498,7 @@ void LwpDrawPolyLine::Read()
 m_pStream->ReadUChar( m_aPolyLineRec.aPenColor.unused );
 m_pStream->ReadUInt16( m_aPolyLineRec.nNumPoints );
 
-if (m_aPolyLineRec.nNumPoints > m_pStream->remainingSize() / 4)
+if (!m_pStream->good() || m_aPolyLineRec.nNumPoints > 
m_pStream->remainingSize() / 4)
 throw BadRead();
 
 m_pVector.reset( new SdwPoint[m_aPolyLineRec.nNumPoints] );
@@ -578,7 +578,7 @@ void LwpDrawPolygon::Read()
 ReadClosedObjStyle();
 m_pStream->ReadUInt16( m_nNumPoints );
 
-if (m_nNumPoints > m_pStream->remainingSize() / 4)
+if (!m_pStream->good() || m_nNumPoints > m_pStream->remainingSize() / 4)
 throw BadRead();
 
 m_pVector.reset( new SdwPoint[m_nNumPoints] );
@@ -1043,6 +1043,9 @@ void LwpDrawTextBox::Read()
 m_pStream->ReadInt16( m_aTextRec.nTextRotation );
 m_pStream->ReadInt16( m_aTextRec.nTextExtraSpacing );
 
+if (!m_pStream->good())
+throw BadRead();
+
 // some draw files in version 1.2 have an extra byte following '\0'.
 // can't rely on that, so read in the whole string into memory.
 
@@ -1188,17 +1191,17 @@ void LwpDrawTextArt::Read()
 m_pStream->ReadInt16( m_aTextArtRec.nRotation );
 
 sal_uInt16 nPointNumber;
-sal_Int16 nX, nY;
 m_pStream->ReadUInt16( nPointNumber );
 
 size_t nPoints = nPointNumber*3+1;
-if (nPoints > m_pStream->remainingSize() / 4)
+if (!m_pStream->good() || nPoints > m_pStream->remainingSize() / 4)
 throw BadRead();
 
 m_aTextArtRec.aPath[0].n = nPointNumber;
 m_aTextArtRec.aPath[0].aPts.resize(nPoints);
 for (size_t nPt = 0; nPt < nPoints; ++nPt)
 {
+sal_Int16 nX, nY;
 m_pStream->ReadInt16( nX );
 m_pStream->ReadInt16( nY );
 m_aTextArtRec.aPath[0].aPts[nPt].x = nX;
@@ -1208,13 +1211,14 @@ void LwpDrawTextArt::Read()
 m_pStream->ReadUInt16( nPointNumber );
 
 nPoints = nPointNumber*3+1;
-if (nPoints > m_pStream->remainingSize() / 4)
+if (!m_pStream->good() || nPoints > m_pStream->remainingSize() / 4)
 throw BadRead();
 
 m_aTextArtRec.aPath[1].n = nPointNumber;
 m_aTextArtRec.aPath[1].aPts.resize(nPoints);
 for (size_t nPt = 0; nPt < nPoints; ++nPt)
 {
+sal_Int16 nX, nY;
 m_pStream->ReadInt16( nX );
 m_pStream->ReadInt16( nY );
 m_aTextArtRec.aPath[1].aPts[nPt].x = nX;
@@ -1243,7 +1247,7 @@ void LwpDrawTextArt::Read()
 - 
(m_aTextArtRec.aPath[1].n*3 + 1)*4;
 
 
-if (m_aTextArtRec.nTextLen > m_pStream->remainingSize())
+if (!m_pStream->good() || m_aTextArtRec.nTextLen > 
m_pStream->remainingSize())
 throw BadRead();
 
 m_aTextArtRec.pTextString = new sal_uInt8 [m_aTextArtRec.nTextLen];
@@ -1383,7 +1387,7 @@ void LwpDrawBitmap::Read()
 m_pStream->ReadUInt16( aInfoHeader2.nPlanes );
 m_pStream->ReadUInt16( aInfoHeader2.nBitCount );
 
-if (!IsValid(aInfoHeader2))
+if (!m_pStream->good() || !IsValid(aInfoHeader2))
 throw BadRead();
 
 N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
@@ -1403,7 +1407,7 @@ void LwpDrawBitmap::Read()
 m_pStream->ReadUInt16( aInfoHeader2.nPlanes );
 m_pStream->ReadUInt16( aInfoHeader2.nBitCount );
 
-if (!IsValid(aInfoHeader2))
+if (!m_pStream->good() || !IsValid(aInfoHeader2))
 throw BadRead();
 
 N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;


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

2022-01-13 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 77a07bcaf59181dbbc719b913566091deadc
Author: Caolán McNamara 
AuthorDate: Thu Jan 13 16:57:48 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 13 20:25:11 2022 +0100

ofz#43577 valid reclen must be >= 20

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 55d23be1ef7b..0e78359fa0c6 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1362,6 +1362,9 @@ void LwpDrawBitmap::Read()
 m_pStream->ReadUInt16( m_aBmpRec.nTranslation );
 m_pStream->ReadUInt16( m_aBmpRec.nRotation );
 
+if (m_aObjHeader.nRecLen < 20)
+throw BadRead();
+
 // 20 == length of draw-specific fields.
 // 14 == length of bmp file header.
 m_aBmpRec.nFileSize = m_aObjHeader.nRecLen - 20 + 14;


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

2022-01-12 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |  203 --
 lotuswordpro/source/filter/lwpdrawobj.hxx |   54 ++--
 lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx |   31 +-
 lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx |2 
 4 files changed, 143 insertions(+), 147 deletions(-)

New commits:
commit 00391f14ab72f31ebc35078b34fbf3628b5cc7a1
Author: Caolán McNamara 
AuthorDate: Wed Jan 12 10:24:38 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 12 20:45:12 2022 +0100

ofz: Direct-leak

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 9c721e74756a..55d23be1ef7b 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -374,7 +374,7 @@ OUString LwpDrawObj::GetArrowName(sal_uInt8 nArrowStyle)
  * @descr   template method of creating drawing object from Lwp-Model to 
XF-Model
  * @return   pointer of the drawing object of XF-Model.
  */
-XFFrame* LwpDrawObj::CreateXFDrawObject()
+rtl::Reference LwpDrawObj::CreateXFDrawObject()
 {
 // read records
 Read();
@@ -383,27 +383,27 @@ XFFrame* LwpDrawObj::CreateXFDrawObject()
 OUString aStyleName = RegisterStyle();
 
 // create XF-Objects
-XFFrame* pXFObj = nullptr;
+rtl::Reference xXFObj;
 if (m_pTransData
 && FABS(m_pTransData->fOffsetX - m_pTransData->fLeftMargin) < THRESHOLD
 && FABS(m_pTransData->fOffsetY - m_pTransData->fTopMargin) < THRESHOLD
 && FABS(m_pTransData->fScaleX - 1.0) < THRESHOLD
 && FABS(m_pTransData->fScaleY - 1.0) < THRESHOLD)
 {
-pXFObj = CreateStandardDrawObj(aStyleName);
+xXFObj = CreateStandardDrawObj(aStyleName);
 }
 else
 {
-pXFObj = CreateDrawObj(aStyleName);
+xXFObj = CreateDrawObj(aStyleName);
 }
 
 // set anchor type
-if (pXFObj)
+if (xXFObj)
 {
-pXFObj->SetAnchorType(enumXFAnchorFrame);
+xXFObj->SetAnchorType(enumXFAnchorFrame);
 }
 
-return pXFObj;
+return xXFObj;
 }
 
 /**
@@ -448,28 +448,28 @@ OUString LwpDrawLine::RegisterStyle()
 return 
pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName();
 }
 
-XFFrame* LwpDrawLine::CreateDrawObj(const OUString& rStyleName )
+rtl::Reference LwpDrawLine::CreateDrawObj(const OUString& rStyleName )
 {
-XFDrawPath* pLine = new XFDrawPath();
-pLine->MoveTo(XFPoint(static_cast(m_aLineRec.nStartX)/TWIPS_PER_CM 
* m_pTransData->fScaleX,
+rtl::Reference xLine(new XFDrawPath());
+xLine->MoveTo(XFPoint(static_cast(m_aLineRec.nStartX)/TWIPS_PER_CM 
* m_pTransData->fScaleX,
 static_cast(m_aLineRec.nStartY)/TWIPS_PER_CM * 
m_pTransData->fScaleY));
-pLine->LineTo(XFPoint(static_cast(m_aLineRec.nEndX)/TWIPS_PER_CM * 
m_pTransData->fScaleX,
+xLine->LineTo(XFPoint(static_cast(m_aLineRec.nEndX)/TWIPS_PER_CM * 
m_pTransData->fScaleX,
 static_cast(m_aLineRec.nEndY)/TWIPS_PER_CM * 
m_pTransData->fScaleY));
-SetPosition(pLine);
+SetPosition(xLine.get());
 
-pLine->SetStyleName(rStyleName);
+xLine->SetStyleName(rStyleName);
 
-return pLine;
+return xLine;
 }
 
-XFFrame* LwpDrawLine::CreateStandardDrawObj(const  OUString& rStyleName)
+rtl::Reference LwpDrawLine::CreateStandardDrawObj(const  OUString& 
rStyleName)
 {
-XFDrawLine* pLine = new XFDrawLine();
-
pLine->SetStartPoint(static_cast(m_aLineRec.nStartX)/TWIPS_PER_CM,static_cast(m_aLineRec.nStartY)/TWIPS_PER_CM);
-
pLine->SetEndPoint(static_cast(m_aLineRec.nEndX)/TWIPS_PER_CM,static_cast(m_aLineRec.nEndY)/TWIPS_PER_CM);
+rtl::Reference xLine(new XFDrawLine());
+
xLine->SetStartPoint(static_cast(m_aLineRec.nStartX)/TWIPS_PER_CM,static_cast(m_aLineRec.nStartY)/TWIPS_PER_CM);
+
xLine->SetEndPoint(static_cast(m_aLineRec.nEndX)/TWIPS_PER_CM,static_cast(m_aLineRec.nEndY)/TWIPS_PER_CM);
 
-pLine->SetStyleName(rStyleName);
-return pLine;
+xLine->SetStyleName(rStyleName);
+return xLine;
 }
 
 /**
@@ -525,35 +525,35 @@ OUString LwpDrawPolyLine::RegisterStyle()
 return 
pXFStyleManager->AddStyle(std::move(pStyle)).m_pStyle->GetStyleName();
 }
 
-XFFrame* LwpDrawPolyLine::CreateDrawObj(const OUString& rStyleName )
+rtl::Reference LwpDrawPolyLine::CreateDrawObj(const OUString& 
rStyleName )
 {
-XFDrawPath* pPolyline = new XFDrawPath();
-pPolyline->MoveTo(XFPoint(static_cast(m_pVector[0].x)/TWIPS_PER_CM 
* m_pTransData->fScaleX,
+rtl::Reference xPolyline(new XFDrawPath());
+xPolyline->MoveTo(XFPoint(static_cast(m_pVector[0].x)/TWIPS_PER_CM 
* m_pTransData->fScaleX,
 static_cast(m_pVector[0].y)/TWIPS_PER_CM * 
m_pTransData->fScaleY));
 for (sal_uInt16 nC = 1; nC < m_aPolyLineRec.nNumPoints; nC++)
 {
-

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

2022-01-12 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 6c9e722fa989ce9530569be2342c67ffd141c466
Author: Caolán McNamara 
AuthorDate: Wed Jan 12 09:51:30 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 12 18:40:17 2022 +0100

ofz#43551 Use-of-uninitialized-value

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index dfaa84b02217..9c721e74756a 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1024,6 +1024,7 @@ void LwpDrawTextBox::Read()
 
 m_pStream->ReadInt16( m_aTextRec.nTextHeight );
 m_pStream->ReadBytes(m_aTextRec.tmpTextFaceName, DRAW_FACESIZE);
+m_aTextRec.tmpTextFaceName[DRAW_FACESIZE - 1] = 0;
 m_pStream->SeekRel(1);// PitchAndFamily
 
 m_pStream->ReadInt16( m_aTextRec.nTextSize );
@@ -1223,6 +1224,7 @@ void LwpDrawTextArt::Read()
 m_pStream->SeekRel(1);
 
 m_pStream->ReadBytes(m_aTextArtRec.tmpTextFaceName, DRAW_FACESIZE);
+m_aTextArtRec.tmpTextFaceName[DRAW_FACESIZE - 1] = 0;
 m_pStream->SeekRel(1);// PitchAndFamily
 
 m_pStream->ReadInt16( m_aTextArtRec.nTextSize );


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

2022-01-11 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx   |   40 +---
 lotuswordpro/source/filter/lwpsdwdrawheader.hxx |4 +-
 2 files changed, 18 insertions(+), 26 deletions(-)

New commits:
commit 11eecc7dadbee933a1f1e77adb1e4724015d2310
Author: Caolán McNamara 
AuthorDate: Mon Jan 10 19:58:20 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 11 11:59:59 2022 +0100

ofz#43509 use std::vector and at()

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 877cf4623872..dfaa84b02217 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1129,16 +1129,8 @@ LwpDrawTextArt::LwpDrawTextArt(SvStream* pStream, 
DrawingOffsetAndScale* pTransD
 
 LwpDrawTextArt::~LwpDrawTextArt()
 {
-if (m_aTextArtRec.aPath[0].pPts)
-{
-delete [] m_aTextArtRec.aPath[0].pPts;
-m_aTextArtRec.aPath[0].pPts = nullptr;
-}
-if (m_aTextArtRec.aPath[1].pPts)
-{
-delete [] m_aTextArtRec.aPath[1].pPts;
-m_aTextArtRec.aPath[1].pPts = nullptr;
-}
+m_aTextArtRec.aPath[0].aPts.clear();
+m_aTextArtRec.aPath[1].aPts.clear();
 if (m_aTextArtRec.pTextString)
 {
 delete [] m_aTextArtRec.pTextString;
@@ -1150,8 +1142,8 @@ LwpDrawTextArt::~LwpDrawTextArt()
 void LwpDrawTextArt::CreateFWPath(XFDrawPath* pPath)
 {
 sal_Int16 nX, nY;
-nX = (m_aTextArtRec.aPath[0].pPts[0].x + m_aTextArtRec.aPath[1].pPts[0].x) 
/ 2;
-nY = (m_aTextArtRec.aPath[0].pPts[0].y + m_aTextArtRec.aPath[1].pPts[0].y) 
/ 2;
+nX = (m_aTextArtRec.aPath[0].aPts[0].x + m_aTextArtRec.aPath[1].aPts[0].x) 
/ 2;
+nY = (m_aTextArtRec.aPath[0].aPts[0].y + m_aTextArtRec.aPath[1].aPts[0].y) 
/ 2;
 XFPoint aStart(static_cast(nX)/TWIPS_PER_CM * 
m_pTransData->fScaleX,
 static_cast(nY)/TWIPS_PER_CM * m_pTransData->fScaleY);
 pPath->MoveTo(aStart);
@@ -1159,20 +1151,20 @@ void LwpDrawTextArt::CreateFWPath(XFDrawPath* pPath)
 sal_uInt8 nPtIndex = 1;
 for (sal_uInt16 nC = 1; nC <= m_aTextArtRec.aPath[0].n; nC++)
 {
-nX = (m_aTextArtRec.aPath[0].pPts[nPtIndex].x + 
m_aTextArtRec.aPath[1].pPts[nPtIndex].x) / 2;
-nY = (m_aTextArtRec.aPath[0].pPts[nPtIndex].y + 
m_aTextArtRec.aPath[1].pPts[nPtIndex].y) / 2;
+nX = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).x + 
m_aTextArtRec.aPath[1].aPts.at(nPtIndex).x) / 2;
+nY = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).y + 
m_aTextArtRec.aPath[1].aPts.at(nPtIndex).y) / 2;
 XFPoint aCtrl1(static_cast(nX)/TWIPS_PER_CM * 
m_pTransData->fScaleX,
 static_cast(nY)/TWIPS_PER_CM * m_pTransData->fScaleY);
 
 nPtIndex++;
-nX = (m_aTextArtRec.aPath[0].pPts[nPtIndex].x + 
m_aTextArtRec.aPath[1].pPts[nPtIndex].x) / 2;
-nY = (m_aTextArtRec.aPath[0].pPts[nPtIndex].y + 
m_aTextArtRec.aPath[1].pPts[nPtIndex].y) / 2;
+nX = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).x + 
m_aTextArtRec.aPath[1].aPts.at(nPtIndex).x) / 2;
+nY = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).y + 
m_aTextArtRec.aPath[1].aPts.at(nPtIndex).y) / 2;
 XFPoint aCtrl2(static_cast(nX)/TWIPS_PER_CM * 
m_pTransData->fScaleX,
 static_cast(nY)/TWIPS_PER_CM * m_pTransData->fScaleY);
 
 nPtIndex++;
-nX = (m_aTextArtRec.aPath[0].pPts[nPtIndex].x + 
m_aTextArtRec.aPath[1].pPts[nPtIndex].x) / 2;
-nY = (m_aTextArtRec.aPath[0].pPts[nPtIndex].y + 
m_aTextArtRec.aPath[1].pPts[nPtIndex].y) / 2;
+nX = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).x + 
m_aTextArtRec.aPath[1].aPts.at(nPtIndex).x) / 2;
+nY = (m_aTextArtRec.aPath[0].aPts.at(nPtIndex).y + 
m_aTextArtRec.aPath[1].aPts.at(nPtIndex).y) / 2;
 XFPoint aDest(static_cast(nX)/TWIPS_PER_CM * 
m_pTransData->fScaleX,
 static_cast(nY)/TWIPS_PER_CM * m_pTransData->fScaleY);
 
@@ -1203,13 +1195,13 @@ void LwpDrawTextArt::Read()
 throw BadRead();
 
 m_aTextArtRec.aPath[0].n = nPointNumber;
-m_aTextArtRec.aPath[0].pPts = new SdwPoint[nPoints];
+m_aTextArtRec.aPath[0].aPts.resize(nPoints);
 for (size_t nPt = 0; nPt < nPoints; ++nPt)
 {
 m_pStream->ReadInt16( nX );
 m_pStream->ReadInt16( nY );
-m_aTextArtRec.aPath[0].pPts[nPt].x = nX;
-m_aTextArtRec.aPath[0].pPts[nPt].y = nY;
+m_aTextArtRec.aPath[0].aPts[nPt].x = nX;
+m_aTextArtRec.aPath[0].aPts[nPt].y = nY;
 }
 
 m_pStream->ReadUInt16( nPointNumber );
@@ -1219,13 +1211,13 @@ void LwpDrawTextArt::Read()
 throw BadRead();
 
 m_aTextArtRec.aPath[1].n = nPointNumber;
-m_aTextArtRec.aPath[1].pPts = new SdwPoint[nPoints];
+m_aTextArtRec.aPath[1].aPts.resize(nPoints);
 for (size_t nPt = 0; nPt < nPoints; ++nPt)
 {
 

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

2022-01-10 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit b4c56c0fd917623bbc0982eb53276e6ca64e7f42
Author: Caolán McNamara 
AuthorDate: Mon Jan 10 09:49:50 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Jan 10 11:56:04 2022 +0100

ofz: Use-of-unintialized-value

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 4811c8b8d9cc..877cf4623872 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1049,9 +1049,9 @@ void LwpDrawTextBox::Read()
 sal_Int16 TextLength = m_aObjHeader.nRecLen - 71;
 if (TextLength < 0)
 throw BadRead();
-m_aTextRec.pTextString = new sal_uInt8 [TextLength];
-
-m_pStream->ReadBytes(m_aTextRec.pTextString, TextLength);
+m_aTextRec.pTextString = new sal_uInt8[TextLength];
+if (m_pStream->ReadBytes(m_aTextRec.pTextString, TextLength) != 
o3tl::make_unsigned(TextLength))
+throw BadRead();
 }
 
 OUString LwpDrawTextBox::RegisterStyle()


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

2022-01-09 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpsdwdrawheader.hxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit b4a281af53efa0c36ee1770e6cf4d800be77a6d2
Author: Caolán McNamara 
AuthorDate: Sat Jan 8 14:44:11 2022 +
Commit: Caolán McNamara 
CommitDate: Sun Jan 9 22:26:56 2022 +0100

ofz#43818 delete of uninitialized pointer

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

diff --git a/lotuswordpro/source/filter/lwpsdwdrawheader.hxx 
b/lotuswordpro/source/filter/lwpsdwdrawheader.hxx
index 3153b837aaba..13696f453a74 100644
--- a/lotuswordpro/source/filter/lwpsdwdrawheader.hxx
+++ b/lotuswordpro/source/filter/lwpsdwdrawheader.hxx
@@ -271,6 +271,18 @@ struct SdwTextBoxRecord
 sal_Int16 nTextRotation;
 sal_Int16 nTextExtraSpacing;
 sal_uInt8* pTextString;
+SdwTextBoxRecord()
+: nTextWidth(0)
+, nTextHeight(0)
+, nTextSize(0)
+, tmpTextFaceName{}
+, nTextAttrs(0)
+, nTextCharacterSet(0)
+, nTextRotation(0)
+, nTextExtraSpacing(0)
+, pTextString(nullptr)
+{
+}
 };
 
 struct SdwFMPATH


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

2022-01-09 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit e28f4b6bccafb2b9f3c44dfabf36d1b822d85f84
Author: Caolán McNamara 
AuthorDate: Sun Jan 9 16:16:39 2022 +
Commit: Caolán McNamara 
CommitDate: Sun Jan 9 22:26:38 2022 +0100

ofz#43458 avoid OOM

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 2ea201082cce..4811c8b8d9cc 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1047,6 +1047,8 @@ void LwpDrawTextBox::Read()
 
 // the 71 is the fixed length before text content in textbox record
 sal_Int16 TextLength = m_aObjHeader.nRecLen - 71;
+if (TextLength < 0)
+throw BadRead();
 m_aTextRec.pTextString = new sal_uInt8 [TextLength];
 
 m_pStream->ReadBytes(m_aTextRec.pTextString, TextLength);


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

2022-01-09 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit 27e9de358b4afc6a89b09c173316cee0abfb471d
Author: Caolán McNamara 
AuthorDate: Sun Jan 9 16:07:32 2022 +
Commit: Caolán McNamara 
CommitDate: Sun Jan 9 20:04:08 2022 +0100

ofz#43446 Undefined-shift

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 4adb32b7fdd3..2ea201082cce 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1343,6 +1343,22 @@ LwpDrawBitmap::~LwpDrawBitmap()
 {
 }
 
+static bool IsValid(const BmpInfoHeader2& rHeader)
+{
+if (rHeader.nPlanes != 1)
+return false;
+
+if (rHeader.nBitCount != 0 && rHeader.nBitCount != 1 &&
+rHeader.nBitCount != 4 && rHeader.nBitCount != 8 &&
+rHeader.nBitCount != 16 && rHeader.nBitCount != 24 &&
+rHeader.nBitCount != 32)
+{
+return false;
+}
+
+return true;
+}
+
 /**
  * @descr   reading function of class LwpDrawBitmap
  */
@@ -1369,6 +1385,9 @@ void LwpDrawBitmap::Read()
 m_pStream->ReadUInt16( aInfoHeader2.nPlanes );
 m_pStream->ReadUInt16( aInfoHeader2.nBitCount );
 
+if (!IsValid(aInfoHeader2))
+throw BadRead();
+
 N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
 if (N == 24)
 {
@@ -1385,6 +1404,10 @@ void LwpDrawBitmap::Read()
 m_pStream->ReadUInt32( aInfoHeader2.nHeight );
 m_pStream->ReadUInt16( aInfoHeader2.nPlanes );
 m_pStream->ReadUInt16( aInfoHeader2.nBitCount );
+
+if (!IsValid(aInfoHeader2))
+throw BadRead();
+
 N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
 if (N == 24)
 {


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

2022-01-07 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.cxx |2 +-
 lotuswordpro/source/filter/lwpdrawobj.hxx |2 +-
 lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx |   12 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 77611e43241dfe3b6224d792156c8457a0fd93d8
Author: Caolán McNamara 
AuthorDate: Fri Jan 7 09:27:26 2022 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 7 12:52:39 2022 +0100

Objct->Object

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

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 5245bfd93ddc..4adb32b7fdd3 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -55,7 +55,7 @@
  /
 /**
  * @file
- * Implementation file of LwpDrawObjcts and associated class like 
LwpDrawGroup, LwpDrawRectangle
+ * Implementation file of LwpDrawObjects and associated class like 
LwpDrawGroup, LwpDrawRectangle
  *  and so on.
  */
 #include 
diff --git a/lotuswordpro/source/filter/lwpdrawobj.hxx 
b/lotuswordpro/source/filter/lwpdrawobj.hxx
index e4a8f0efa92d..ab5bba1d7775 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.hxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.hxx
@@ -55,7 +55,7 @@
  /
 /**
  * @file
-  * The file declares the LwpDrawObjcts and associated class like 
LwpDrawGroup, LwpDrawRectangle
+  * The file declares the LwpDrawObjects and associated class like 
LwpDrawGroup, LwpDrawRectangle
  *  and so on.
  */
 
diff --git a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx 
b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
index 1b73b97a1f4f..1780bf432db4 100644
--- a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
+++ b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
@@ -309,7 +309,7 @@ XFFrame* LwpSdwGroupLoaderV0102::CreateDrawObject()
 m_pStream->ReadUChar(recType);
 
 std::unique_ptr pDrawObj;
-XFFrame* pRetObjct = nullptr;
+XFFrame* pRetObject = nullptr;
 
 switch(recType)
 {
@@ -371,12 +371,12 @@ XFFrame* LwpSdwGroupLoaderV0102::CreateDrawObject()
 // read out the object header
 pDrawObj.reset(new LwpDrawGroup(m_pStream));
 
-pRetObjct = CreateDrawGroupObject();
+pRetObject = CreateDrawGroupObject();
 
-if (pRetObjct)
+if (pRetObject)
 {
 // set anchor type
-pRetObjct->SetAnchorType(enumXFAnchorFrame);
+pRetObject->SetAnchorType(enumXFAnchorFrame);
 }
 break;
 }
@@ -396,10 +396,10 @@ XFFrame* LwpSdwGroupLoaderV0102::CreateDrawObject()
 // we don't need create the corresponding XF-object of a group object.
 if (pDrawObj && recType != OT_GROUP)
 {
-pRetObjct = pDrawObj->CreateXFDrawObject();
+pRetObject = pDrawObj->CreateXFDrawObject();
 }
 
-return pRetObjct;
+return pRetObject;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-01-07 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 71be70b16b37fb3c1b6331ab3581300556ecc7aa
Author: Caolán McNamara 
AuthorDate: Fri Jan 7 09:24:27 2022 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 7 12:33:12 2022 +0100

ofz#43376 Null-dereference

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

diff --git a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx 
b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
index 3b8e8accad33..1b73b97a1f4f 100644
--- a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
+++ b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
@@ -373,8 +373,11 @@ XFFrame* LwpSdwGroupLoaderV0102::CreateDrawObject()
 
 pRetObjct = CreateDrawGroupObject();
 
-// set anchor type
-pRetObjct->SetAnchorType(enumXFAnchorFrame);
+if (pRetObjct)
+{
+// set anchor type
+pRetObjct->SetAnchorType(enumXFAnchorFrame);
+}
 break;
 }
 case OT_CHART://fall-through


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

2022-01-05 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpfnlayout.cxx |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 1cb5b519a06709e22b99bec75d7bf95020442205
Author: Caolán McNamara 
AuthorDate: Tue Jan 4 21:04:40 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 5 11:18:55 2022 +0100

ofz#42829 Timeout

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

diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx 
b/lotuswordpro/source/filter/lwpfnlayout.cxx
index febf995acffc..b91b86a3dab1 100644
--- a/lotuswordpro/source/filter/lwpfnlayout.cxx
+++ b/lotuswordpro/source/filter/lwpfnlayout.cxx
@@ -244,20 +244,18 @@ LwpVirtualLayout* 
LwpEnSuperTableLayout::GetMainTableLayout()
 {
 LwpObjectID* pID = ();
 
-LwpVirtualLayout* pPrevLayout = nullptr;
+o3tl::sorted_vector aSeen;
 while (!pID->IsNull())
 {
 LwpVirtualLayout* pLayout = 
dynamic_cast(pID->obj().get());
-if (!pLayout || pLayout == pPrevLayout)
-{
+if (!pLayout)
 break;
-}
+bool bAlreadySeen = !aSeen.insert(pLayout).second;
+if (bAlreadySeen)
+throw std::runtime_error("loop in conversion");
 if (pLayout->GetLayoutType() == LWP_ENDNOTE_LAYOUT)
-{
 return pLayout;
-}
 pID = >GetPrevious();
-pPrevLayout = pLayout;
 }
 
 return nullptr;


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

2021-11-23 Thread Hossein (via logerrit)
 lotuswordpro/source/filter/lwpresource.hxx |   66 -
 1 file changed, 66 deletions(-)

New commits:
commit 90ce07f5afcf52fc1ad7a9e636c8409af2d05913
Author: Hossein 
AuthorDate: Tue Nov 23 15:11:19 2021 +0100
Commit: Hossein 
CommitDate: Tue Nov 23 16:34:48 2021 +0100

Remove unused header file lwpresource.hxx

* Removed unused header file lwpresource.hxx which contained
  symbolic constants of type 'const char[]' that were no longer in use
  - STR_WORDPRO
  - STR_IMPLEMENTATION_NAME
  - STR_SERVICE_NAME
  - STR_WRITER_IMPORTER_NAME

Change-Id: I4f1293a83c4058d7d01a98454a673ac88bd35b9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125701
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/lotuswordpro/source/filter/lwpresource.hxx 
b/lotuswordpro/source/filter/lwpresource.hxx
deleted file mode 100644
index e381edc41ae7..
--- a/lotuswordpro/source/filter/lwpresource.hxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- * - GNU Lesser General Public License Version 2.1
- * - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
- *
- *
- *  Sun Industry Standards Source License Version 1.1
- *  =
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
- *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
- *
- *  The Initial Developer of the Original Code is: IBM Corporation
- *
- *  Copyright: 2008 by IBM Corporation
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): ___
- *
- *
- /
-#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPRESOURCE_HXX
-#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPRESOURCE_HXX
-
-const char STR_WORDPRO[] = "Wordpro";
-const char STR_IMPLEMENTATION_NAME[] = "com.ibm.ILWPImportFilter";
-const char STR_SERVICE_NAME[] = "com.sun.star.document.ImportFilter";
-const char STR_WRITER_IMPORTER_NAME[] = "com.sun.star.comp.Writer.XMLImporter";
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-10-17 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpdoc.cxx |   36 
 lotuswordpro/source/filter/lwpfnlayout.cxx|6 ++--
 lotuswordpro/source/filter/lwplayout.cxx  |   18 ++--
 lotuswordpro/source/filter/lwppagelayout.cxx  |   14 -
 lotuswordpro/source/filter/lwppara.cxx|6 ++--
 lotuswordpro/source/filter/lwppara1.cxx   |6 ++--
 lotuswordpro/source/filter/lwprowlayout.cxx   |   14 -
 lotuswordpro/source/filter/lwpstory.cxx   |   27 +-
 lotuswordpro/source/filter/lwptablelayout.cxx |   38 +-
 9 files changed, 82 insertions(+), 83 deletions(-)

New commits:
commit 3059d56c9d91b7450e2229b2baee0ddc2cf8fa0d
Author: Caolán McNamara 
AuthorDate: Sat Oct 16 20:25:44 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Oct 17 22:02:47 2021 +0200

just do one lookup for loop detection

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

diff --git a/lotuswordpro/source/filter/lwpdoc.cxx 
b/lotuswordpro/source/filter/lwpdoc.cxx
index bb9c8810e899..d83b37500d9a 100644
--- a/lotuswordpro/source/filter/lwpdoc.cxx
+++ b/lotuswordpro/source/filter/lwpdoc.cxx
@@ -298,13 +298,13 @@ void LwpDocument::RegisterStylesInPara()
 o3tl::sorted_vector aSeen;
 while (xStory.is())
 {
-aSeen.insert(xStory.get());
+bool bAlreadySeen = !aSeen.insert(xStory.get()).second;
+if (bAlreadySeen)
+throw std::runtime_error("loop in conversion");
 //Register the child para
 xStory->SetFoundry(m_xOwnedFoundry.get());
 xStory->DoRegisterStyle();
 
xStory.set(dynamic_cast(xStory->GetNext().obj(VO_STORY).get()));
-if (aSeen.find(xStory.get()) != aSeen.end())
-throw std::runtime_error("loop in conversion");
 }
 }
 /**
@@ -323,12 +323,12 @@ void LwpDocument::RegisterBulletStyles()
 o3tl::sorted_vector aSeen;
 while (pBullet)
 {
-aSeen.insert(pBullet);
+bool bAlreadySeen = !aSeen.insert(pBullet).second;
+if (bAlreadySeen)
+throw std::runtime_error("loop in conversion");
 pBullet->SetFoundry(m_xOwnedFoundry.get());
 pBullet->RegisterStyle();
 pBullet = 
dynamic_cast(pBullet->GetNext().obj().get());
-if (aSeen.find(pBullet) != aSeen.end())
-throw std::runtime_error("loop in conversion");
 }
 }
 /**
@@ -574,7 +574,9 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents()
 o3tl::sorted_vector aSeen;
 while (pDivision && pDivision != this)
 {
-aSeen.insert(pDivision);
+bool bAlreadySeen = !aSeen.insert(pDivision).second;
+if (bAlreadySeen)
+throw std::runtime_error("loop in conversion");
 LwpDocument* pContentDivision = 
pDivision->GetLastDivisionWithContents();
 if (pContentDivision)
 {
@@ -582,8 +584,6 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents()
 break;
 }
 pDivision = pDivision->GetPreviousDivision();
-if (aSeen.find(pDivision) != aSeen.end())
-throw std::runtime_error("loop in conversion");
 }
 }
 
@@ -640,12 +640,12 @@ LwpDocument* LwpDocument::GetRootDocument()
 o3tl::sorted_vector aSeen;
 while (pRoot)
 {
-aSeen.insert(pRoot);
+bool bAlreadySeen = !aSeen.insert(pRoot).second;
+if (bAlreadySeen)
+throw std::runtime_error("loop in conversion");
 if (!pRoot->IsChildDoc())
 return pRoot;
 pRoot = pRoot->GetParentDivision();
-if (aSeen.find(pRoot) != aSeen.end())
-throw std::runtime_error("loop in conversion");
 }
 return nullptr;
 }
@@ -662,13 +662,13 @@ LwpDocument* 
LwpDocument::ImplGetFirstDivisionWithContentsThatIsNotOLE()
 o3tl::sorted_vector aSeen;
 while (pDivision)
 {
-aSeen.insert(pDivision);
+bool bAlreadySeen = !aSeen.insert(pDivision).second;
+if (bAlreadySeen)
+throw std::runtime_error("loop in conversion");
 LwpDocument* pContentDivision = 
pDivision->GetFirstDivisionWithContentsThatIsNotOLE();
 if (pContentDivision)
 return pContentDivision;
 pDivision = pDivision->GetNextDivision();
-if (aSeen.find(pDivision) != aSeen.end())
-throw std::runtime_error("loop in conversion");
 }
 return nullptr;
 }
@@ -682,12 +682,12 @@ LwpDocument* LwpDocument::GetLastDivisionThatHasEndnote()
 o3tl::sorted_vector aSeen;
 while (pLastDoc)
 {
-aSeen.insert(pLastDoc);
+bool bAlreadySeen = !aSeen.insert(pLastDoc).second;
+if (bAlreadySeen)
+throw std::runtime_error("loop in conversion");
 if (pLastDoc->GetEnSuperTableLayout().is())
 

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

2021-10-16 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwppagelayout.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 7422ef83a1304d34cd303a7160efd4e76cc44a49
Author: Caolán McNamara 
AuthorDate: Sat Oct 16 14:04:35 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sat Oct 16 20:36:40 2021 +0200

ofz#40004 Timeout

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

diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx 
b/lotuswordpro/source/filter/lwppagelayout.cxx
index 0a72db8f7d30..735a0791c2e2 100644
--- a/lotuswordpro/source/filter/lwppagelayout.cxx
+++ b/lotuswordpro/source/filter/lwppagelayout.cxx
@@ -607,8 +607,11 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 
nLayoutNumber)
 
 //get first pagehint
 LwpPageHint* pPageHint = 
dynamic_cast(pHeadTail->GetHead().obj().get());
+o3tl::sorted_vector aSeen;
 while (pPageHint)
 {
+aSeen.insert(pPageHint);
+
 if (GetObjectID() == pPageHint->GetPageLayoutID())
 {
 sal_uInt16 nNumber = pPageHint->GetPageNumber();
@@ -635,7 +638,11 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 
nLayoutNumber)
 break;
 }
 }
+
 pPageHint = 
dynamic_cast(pPageHint->GetNext().obj().get());
+
+if (aSeen.find(pPageHint) != aSeen.end())
+throw std::runtime_error("loop in conversion");
 }
 if (nPageNumber >= 0)
 {


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

2021-10-05 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpfnlayout.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit afb022f0a399799be43a3fd3a1380b6b26350ed4
Author: Caolán McNamara 
AuthorDate: Mon Oct 4 20:08:44 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Oct 5 11:13:37 2021 +0200

ofz: detect infinite loop

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

diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx 
b/lotuswordpro/source/filter/lwpfnlayout.cxx
index fbbdcb6b4873..0cdede0560d4 100644
--- a/lotuswordpro/source/filter/lwpfnlayout.cxx
+++ b/lotuswordpro/source/filter/lwpfnlayout.cxx
@@ -59,6 +59,7 @@
  */
 
 #include "lwpfnlayout.hxx"
+#include 
 
 LwpFootnoteLayout::LwpFootnoteLayout(LwpObjectHeader const& objHdr, 
LwpSvStream* pStrm)
 : LwpTableLayout(objHdr, pStrm)
@@ -111,12 +112,16 @@ void LwpFnRowLayout::RegisterStyle()
 LwpObjectID* pCellID = ();
 LwpCellLayout* pCellLayout = 
dynamic_cast(pCellID->obj().get());
 
+o3tl::sorted_vector aSeen;
 while (pCellLayout)
 {
+aSeen.insert(pCellLayout);
 pCellLayout->SetFoundry(m_pFoundry);
 pCellLayout->RegisterStyle();
 pCellID = >GetNext();
 pCellLayout = dynamic_cast(pCellID->obj().get());
+if (aSeen.find(pCellLayout) != aSeen.end())
+throw std::runtime_error("loop in conversion");
 }
 }
 


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

2021-09-25 Thread Andrea Gelmini (via logerrit)
 lotuswordpro/source/filter/lwptools.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 384d4301797fcdb9eb9c4f378d27c21f0d759969
Author: Andrea Gelmini 
AuthorDate: Fri Sep 24 16:37:29 2021 +0200
Commit: Julien Nabet 
CommitDate: Sat Sep 25 11:54:31 2021 +0200

Fix typos

Change-Id: I40b4efb228176891678b8560a7ee4e37e77495e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122596
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/lotuswordpro/source/filter/lwptools.cxx 
b/lotuswordpro/source/filter/lwptools.cxx
index 9af6d1b4ffb3..674be2b89cd8 100644
--- a/lotuswordpro/source/filter/lwptools.cxx
+++ b/lotuswordpro/source/filter/lwptools.cxx
@@ -263,7 +263,7 @@ std::unique_ptr 
LwpTools::GetSystemDateStyle(bool bLongFormat)
 if (pattern == nullptr)
 return nullptr;
 // 3 parse pattern string,per icu date/time format syntax, there are 20 
letters reserved
-// as patter letter,each represent an element in date/time and its repeat 
numbers represent
+// as pattern letter,each represent an element in date/time and its repeat 
numbers represent
 // different format: for example: M produces '1',MM produces '01', MMM 
produces 'Jan',  produces 'Januaray'
 // letter other than these letters is regard as text in the format, for 
example ','in 'Jan,2005'
 // we parse pattern string letter by letter and get the time format.
@@ -651,7 +651,7 @@ std::unique_ptr LwpTools::GetSystemTimeStyle()
 if (pattern == nullptr)
 return nullptr;
 // 3 parse pattern string,per icu date/time format syntax, there are 20 
letters reserved
-// as patter letter,each represent an element in date/time and its repeat 
numbers represent
+// as pattern letter,each represent an element in date/time and its repeat 
numbers represent
 // different format: for example: M produces '1',MM produces '01', MMM 
produces 'Jan',  produces 'Januaray'
 // letter other than these letters is regard as text in the format, for 
example ','in 'Jan,2005'
 // we parse pattern string letter by letter and get the time format.


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

2021-09-19 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwprowlayout.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 770dcb1f717d576facf31efed14bee403e1a7155
Author: Caolán McNamara 
AuthorDate: Sun Sep 19 19:24:58 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Sep 19 21:45:32 2021 +0200

ofz: avoid Timeout

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

diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx 
b/lotuswordpro/source/filter/lwprowlayout.cxx
index e37086960e2c..3b06b64efb67 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -463,10 +463,14 @@ void LwpRowLayout::SetCellSplit(sal_uInt16 nEffectRows)
 {
 for (LwpConnectedCellLayout* pConnCell : m_ConnCellList)
 {
-sal_uInt16 nRowSpan = pConnCell->GetRowID()+pConnCell->GetNumrows();
-if ( nRowSpan > nEffectRows )
+sal_uInt16 nRowSpan;
+if (o3tl::checked_add(pConnCell->GetRowID(), pConnCell->GetNumrows(), 
nRowSpan))
+throw std::range_error("bad span");
+if (nRowSpan > nEffectRows)
 {
-pConnCell->SetNumrows(nEffectRows - pConnCell->GetRowID());
+if (o3tl::checked_sub(nEffectRows, pConnCell->GetRowID(), 
nRowSpan))
+throw std::range_error("bad span");
+pConnCell->SetNumrows(nRowSpan);
 }
 }
 }


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

2021-09-18 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpcelllayout.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0685678da0994103b14b9417c52310bd40e21102
Author: Caolán McNamara 
AuthorDate: Sat Sep 18 14:52:51 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sat Sep 18 17:28:11 2021 +0200

ofz#37911 Avoid timeout when fuzzing

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

diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx 
b/lotuswordpro/source/filter/lwpcelllayout.cxx
index ef39c4ae1009..cd5478e3f5cd 100644
--- a/lotuswordpro/source/filter/lwpcelllayout.cxx
+++ b/lotuswordpro/source/filter/lwpcelllayout.cxx
@@ -821,7 +821,7 @@ void LwpConnectedCellLayout::Read()
 
 m_nRealrowspan = cnumrows;
 if (utl::ConfigManager::IsFuzzing())
-m_nRealrowspan = std::min(m_nRealrowspan, SAL_MAX_INT16);
+m_nRealrowspan = std::min(m_nRealrowspan, 128);
 m_nRealcolspan = cnumcols;
 
 m_pObjStrm->SkipExtra();


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

2021-09-05 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpsilverbullet.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f37ef60c19d1608f0b597d37d025e401d6c99171
Author: Caolán McNamara 
AuthorDate: Sun Sep 5 15:15:42 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Sep 5 18:25:30 2021 +0200

cid#1490901 silence Out-of-bounds read

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

diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx 
b/lotuswordpro/source/filter/lwpsilverbullet.cxx
index e2fa4112d243..629b5affcfb5 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.cxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx
@@ -98,7 +98,8 @@ void LwpSilverBullet::Read()
 for (sal_uInt16 nC = 0; nC < nNumPos; nC++)
 m_pResetPositionFlags[nC] = m_pObjStrm->QuickReaduInt8();
 
-std::fill(m_pResetPositionFlags + nNumPos, m_pResetPositionFlags + 
SAL_N_ELEMENTS(m_pResetPositionFlags), 0);
+if (nNumPos < SAL_N_ELEMENTS(m_pResetPositionFlags))
+std::fill(m_pResetPositionFlags + nNumPos, m_pResetPositionFlags + 
SAL_N_ELEMENTS(m_pResetPositionFlags), 0);
 
 m_nUseCount = m_pObjStrm->QuickReaduInt32();
 


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

2021-09-04 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpsilverbullet.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit aa07e8267d28b5d57df655f373d2bb585672bf3a
Author: Caolán McNamara 
AuthorDate: Sat Sep 4 12:34:03 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sat Sep 4 21:40:35 2021 +0200

cid#1490901 silence Out-of-bounds read

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

diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx 
b/lotuswordpro/source/filter/lwpsilverbullet.cxx
index 07232d36d9bb..e2fa4112d243 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.cxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx
@@ -98,7 +98,7 @@ void LwpSilverBullet::Read()
 for (sal_uInt16 nC = 0; nC < nNumPos; nC++)
 m_pResetPositionFlags[nC] = m_pObjStrm->QuickReaduInt8();
 
-memset(m_pResetPositionFlags + nNumPos, 0, 
SAL_N_ELEMENTS(m_pResetPositionFlags) - nNumPos);
+std::fill(m_pResetPositionFlags + nNumPos, m_pResetPositionFlags + 
SAL_N_ELEMENTS(m_pResetPositionFlags), 0);
 
 m_nUseCount = m_pObjStrm->QuickReaduInt32();
 


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

2021-09-03 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpsilverbullet.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ba346227f1c4f896b717676a7eae22fea222f3e4
Author: Caolán McNamara 
AuthorDate: Thu Sep 2 10:15:10 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Sep 3 12:49:43 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx 
b/lotuswordpro/source/filter/lwpsilverbullet.cxx
index 338e71e5290a..07232d36d9bb 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.cxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx
@@ -98,6 +98,8 @@ void LwpSilverBullet::Read()
 for (sal_uInt16 nC = 0; nC < nNumPos; nC++)
 m_pResetPositionFlags[nC] = m_pObjStrm->QuickReaduInt8();
 
+memset(m_pResetPositionFlags + nNumPos, 0, 
SAL_N_ELEMENTS(m_pResetPositionFlags) - nNumPos);
+
 m_nUseCount = m_pObjStrm->QuickReaduInt32();
 
 m_pAtomHolder->Read(m_pObjStrm.get());


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

2021-09-02 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwp9reader.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 0e05ce8b9377b90cda47a76a7d0cbd1d5c65c521
Author: Caolán McNamara 
AuthorDate: Thu Sep 2 11:12:27 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 2 21:05:46 2021 +0200

cid#1490900 Unchecked return value

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

diff --git a/lotuswordpro/source/filter/lwp9reader.cxx 
b/lotuswordpro/source/filter/lwp9reader.cxx
index 39c753f5ecd2..7340adb042b2 100644
--- a/lotuswordpro/source/filter/lwp9reader.cxx
+++ b/lotuswordpro/source/filter/lwp9reader.cxx
@@ -111,7 +111,9 @@ bool Lwp9Reader::ReadFileHeader()
 LwpFileHeader::m_nFileRevision = 0;
 
 LwpObjectHeader objHdr;
-objHdr.Read(*m_pDocStream);
+if (!objHdr.Read(*m_pDocStream))
+return false;
+
 sal_Int64 pos = m_pDocStream->Tell();
 m_LwpFileHdr.Read(m_pDocStream);
 return m_pDocStream->CheckSeek(pos + objHdr.GetSize());


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

2021-08-30 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpidxmgr.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit a10d8bb18e81414bf49e7ea7a04c172e4b30b9ea
Author: Caolán McNamara 
AuthorDate: Mon Aug 30 09:59:06 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 30 13:12:45 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/lotuswordpro/source/filter/lwpidxmgr.cxx 
b/lotuswordpro/source/filter/lwpidxmgr.cxx
index f999ec79a23b..504533fb27cc 100644
--- a/lotuswordpro/source/filter/lwpidxmgr.cxx
+++ b/lotuswordpro/source/filter/lwpidxmgr.cxx
@@ -107,9 +107,7 @@ void LwpIndexManager::Read(LwpSvStream* pStrm)
 {
 //Read leaf
 sal_Int64 nPos = m_ChildIndex[k]+LwpSvStream::LWP_STREAM_BASE;
-sal_Int64 nActualPos = pStrm->Seek(nPos);
-
-if (nPos != nActualPos)
+if (!pStrm->CheckSeek(nPos))
 throw BadSeek();
 
 //Old Code


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpsilverbullet.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d3581066fb0db1b9088a766d9577040ccda10021
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 11:15:07 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 16:18:28 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx 
b/lotuswordpro/source/filter/lwpsilverbullet.cxx
index 105bdf169115..338e71e5290a 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.cxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx
@@ -76,6 +76,7 @@ LwpSilverBullet::LwpSilverBullet(LwpObjectHeader const & 
objHdr, LwpSvStream* pS
 , m_nUseCount(0)
 , m_pAtomHolder(new LwpAtomHolder)
 {
+memset(m_pHideLevels, 0, sizeof(m_pHideLevels));
 }
 
 LwpSilverBullet::~LwpSilverBullet()


[Libreoffice-commits] core.git: lotuswordpro/source tsan-suppress.txt wizards/source

2021-08-03 Thread Andrea Gelmini (via logerrit)
 lotuswordpro/source/filter/lwpdrawobj.hxx |2 +-
 tsan-suppress.txt |2 +-
 wizards/source/sfdocuments/SF_Calc.xba|4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 3e21ee215d0cda14725133e7c33b974b2290f2d3
Author: Andrea Gelmini 
AuthorDate: Tue Aug 3 12:57:22 2021 +0200
Commit: Julien Nabet 
CommitDate: Tue Aug 3 14:17:59 2021 +0200

Fix typos

Change-Id: Ie4809d5367d15dc155033db034d86aaa75cb5abe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119932
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/lotuswordpro/source/filter/lwpdrawobj.hxx 
b/lotuswordpro/source/filter/lwpdrawobj.hxx
index 0ccf8c8f3388..e4a8f0efa92d 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.hxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.hxx
@@ -133,7 +133,7 @@ protected:
 public:
 /**
  * @descr   create a completed XF-draw object(read data, register styles 
and create XF-draw object)
- * @return  pointer of the created competed XF-draw object.
+ * @return  pointer of the created completed XF-draw object.
  */
 XFFrame* CreateXFDrawObject();
 
diff --git a/tsan-suppress.txt b/tsan-suppress.txt
index 9d6c73c557ae..82252cdf212f 100644
--- a/tsan-suppress.txt
+++ b/tsan-suppress.txt
@@ -42,7 +42,7 @@ race:libjvm.so
 # so there is no failure mode
 race:ireallocSequence
 
-# TODO There appears to be a race here, initialisng the
+# TODO There appears to be a race here, initialising the
 #   ::com::sun::star::uno::Sequence< T >::s_pType
 # field. But no idea at all how to fix it.
 race:cppu::getTypeFavourUnsigned
diff --git a/wizards/source/sfdocuments/SF_Calc.xba 
b/wizards/source/sfdocuments/SF_Calc.xba
index c7b1e0fd5081..89afc16fc6ea 100644
--- a/wizards/source/sfdocuments/SF_Calc.xba
+++ b/wizards/source/sfdocuments/SF_Calc.xba
@@ -928,7 +928,7 @@ Try:
  Initialize sheet and range
Set oSheet = _Component.getSheets.getByName(SheetName)
Set oRange = _ParseAddress(Range)
- Create the chart and get ihe corresponding chart instance
+ Create the chart and get the corresponding chart instance
oSheet.getCharts.addNewByName(ChartName, oRectangle, 
Array(oRange.XCellRange.RangeAddress), ColumnHeader, RowHeader)
Set oChart = Charts(SheetName, ChartName)
oChart._Shape.Name = ChartNameBoth used-defined and 
internal names match ChartName
@@ -3218,4 +3218,4 @@ CatchDuplicate:
 End Function SFDocuments.SF_Calc._ValidateSheet
 
 REM  END OF SFDOCUMENTS.SF_CALC
-
\ No newline at end of file
+


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

2021-03-26 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpobjstrm.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4c9e40653c0defd8b2b3223b32a3662bcd998837
Author: Caolán McNamara 
AuthorDate: Fri Mar 26 15:41:59 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Mar 26 20:39:57 2021 +0100

cid#1474321 make it a little more clear that the size *is* checked

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

diff --git a/lotuswordpro/source/filter/lwpobjstrm.cxx 
b/lotuswordpro/source/filter/lwpobjstrm.cxx
index 11cbce4e8c41..728e3a71f8f3 100644
--- a/lotuswordpro/source/filter/lwpobjstrm.cxx
+++ b/lotuswordpro/source/filter/lwpobjstrm.cxx
@@ -71,7 +71,7 @@ LwpObjectStream::LwpObjectStream(LwpSvStream* pStrm, bool 
isCompressed, sal_uInt
 , m_pStrm(pStrm)
 , m_bCompressed(isCompressed)
 {
-if (size >= IO_BUFFERSIZE)
+if (m_nBufSize >= IO_BUFFERSIZE)
 throw std::range_error("bad Object size");
 // read object data from stream
 if (m_nBufSize > 0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-24 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/tocread.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit ba5d6da97c8c7ed59592d47ab5cd495c79ef262d
Author: Caolán McNamara 
AuthorDate: Wed Mar 24 08:54:17 2021 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 24 16:20:15 2021 +0100

cid#140 silence bogus Untrusted divisor

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

diff --git a/lotuswordpro/source/filter/tocread.cxx 
b/lotuswordpro/source/filter/tocread.cxx
index 53f7e2b929f8..2942005df391 100644
--- a/lotuswordpro/source/filter/tocread.cxx
+++ b/lotuswordpro/source/filter/tocread.cxx
@@ -494,9 +494,12 @@ CBenTOCReader::GetCode()
 return BEN_READ_PAST_END_OF_TOC;
 
 if (Code == BEN_END_OF_BUFFER)
+{
+assert(cBlockSize && "cBlockSize of 0 should have already caused 
BenErr_UnknownBentoFormatVersion in CBenTOCReader::ReadLabel");
 // Advance to next block
 cCurr = cBlockSize * ((cCurr + (cBlockSize - 1)) /
   cBlockSize);
+}
 }
 while (Code == BEN_NOOP || Code == BEN_END_OF_BUFFER);
 return Code;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-21 Thread David Tardon (via logerrit)
 lotuswordpro/source/filter/LotusWordProImportFilter.cxx |  131 
 1 file changed, 131 insertions(+)

New commits:
commit 301b09f0c4fef6fca52fa0b28827a6576b39
Author: David Tardon 
AuthorDate: Sat Feb 13 15:51:20 2021 +0100
Commit: David Tardon 
CommitDate: Sun Feb 21 16:23:39 2021 +0100

lotuswordpro: allow to dump intermediate XML into file

If env. variable DBG_LWPIMPORT_DIR= is set to an existing directory, a
formatted representation of the intermediate XML format is dumped into a
file named lwpimport.xml in that directory. This makes debugging of
Lotus Word Pro import a lot easier.

Change-Id: I872c388c2b378d55f476973890a073ec932e1b4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111283
Tested-by: Jenkins
Reviewed-by: David Tardon 

diff --git a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx 
b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
index 73335e0bab88..296561bcc375 100644
--- a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
+++ b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
@@ -30,6 +30,19 @@
 #include "LotusWordProImportFilter.hxx"
 #include "lwpfilter.hxx"
 
+#if OSL_DEBUG_LEVEL > 0
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include 
+#endif
+
 using namespace com::sun::star;
 using com::sun::star::uno::Sequence;
 using com::sun::star::uno::Any;
@@ -41,6 +54,100 @@ using com::sun::star::ucb::XCommandEnvironment;
 using com::sun::star::document::XImporter;
 using com::sun::star::xml::sax::XDocumentHandler;
 
+#if OSL_DEBUG_LEVEL > 0
+namespace
+{
+
+class DebugDocumentHandler final : public cppu::WeakImplHelper< 
XDocumentHandler >
+{
+public:
+DebugDocumentHandler(const uno::Reference< XDocumentHandler >& handler, 
const uno::Reference< XDocumentHandler >& debug)
+: m_handler(handler)
+, m_debug(debug)
+{
+}
+
+// XDocumentHandler
+
+virtual void SAL_CALL
+startDocument() override
+{
+m_handler->startDocument();
+m_debug->startDocument();
+}
+
+virtual void SAL_CALL
+endDocument() override
+{
+m_handler->endDocument();
+m_debug->endDocument();
+}
+
+virtual void SAL_CALL
+startElement(
+const OUString& aName,
+const uno::Reference< xml::sax::XAttributeList > & xAttribs) 
override
+{
+m_handler->startElement(aName, xAttribs);
+m_debug->ignorableWhitespace(" "); // NOTE: needed for pretty-printing
+m_debug->startElement(aName, xAttribs);
+}
+
+virtual void SAL_CALL
+endElement(const OUString& aName) override
+{
+m_handler->endElement(aName);
+m_debug->ignorableWhitespace(" "); // NOTE: needed for pretty-printing
+m_debug->endElement(aName);
+}
+
+virtual void SAL_CALL
+characters(const OUString& aChars) override
+{
+m_handler->characters(aChars);
+m_debug->characters(aChars);
+}
+
+virtual void SAL_CALL
+ignorableWhitespace(const OUString& aWhitespaces) override
+{
+m_handler->ignorableWhitespace(aWhitespaces);
+m_debug->ignorableWhitespace(aWhitespaces);
+}
+
+virtual void SAL_CALL
+processingInstruction(const OUString& aTarget, const OUString& aData) 
override
+{
+m_handler->processingInstruction(aTarget, aData);
+m_debug->processingInstruction(aTarget, aData);
+}
+
+virtual void SAL_CALL
+setDocumentLocator(const uno::Reference< xml::sax::XLocator >& xLocator) 
override
+{
+m_handler->setDocumentLocator(xLocator);
+m_debug->setDocumentLocator(xLocator);
+}
+
+// XInterface
+
+virtual uno::Any SAL_CALL queryInterface(const uno::Type & rType) override
+{
+uno::Any aIface = cppu::WeakImplHelper< XDocumentHandler 
>::queryInterface(rType);
+// delegate all queries we cannot satisfy ourselves to the real handler
+if (!aIface.has< uno::Reference< uno::XInterface > >())
+aIface = m_handler->queryInterface(rType);
+return aIface;
+}
+
+private:
+uno::Reference< XDocumentHandler > m_handler;
+uno::Reference< XDocumentHandler > m_debug;
+};
+
+}
+#endif
+
 // W o r d P r o
 const sal_Int8 header[] = { 0x57, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f };
 
@@ -61,6 +168,30 @@ bool LotusWordProImportFilter::importImpl( const Sequence< 
css::beans::PropertyV
 // An XML import service: what we push sax messages to...
 uno::Reference< XDocumentHandler > xInternalHandler(
 mxContext->getServiceManager()->createInstanceWithContext( 
"com.sun.star.comp.Writer.XMLImporter", mxContext ), UNO_QUERY );
+
+#if OSL_DEBUG_LEVEL > 0
+std::unique_ptr pDebugFile;
+const char* pDir = getenv("DBG_LWPIMPORT_DIR");
+if (pDir)
+{
+OUString aStr(OStringToOUString(pDir, RTL_TEXTENCODING_UTF8));
+OUString 

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

2021-02-01 Thread Dr. David Alan Gilbert (via logerrit)
 lotuswordpro/source/filter/explode.cxx |2 +-
 sc/source/core/tool/appoptio.cxx   |2 +-
 sc/source/ui/view/tabvwsha.cxx |2 +-
 vcl/source/fontsubset/sft.cxx  |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit c3a8fe7b40465134e500d5698b1455d2181aed4f
Author: Dr. David Alan Gilbert 
AuthorDate: Sat Jan 30 17:30:39 2021 +
Commit: Michael Stahl 
CommitDate: Mon Feb 1 12:25:35 2021 +0100

cppcheck: Clean up signed 32 bit shift by 31

cppcheck moans about 1

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

2021-01-28 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpfribptr.cxx |   35 +++---
 lotuswordpro/source/filter/lwpfribptr.hxx |4 +--
 2 files changed, 20 insertions(+), 19 deletions(-)

New commits:
commit 4e84a42add9c8ac27feb5e49a96e00ffcc8f0bc8
Author: Caolán McNamara 
AuthorDate: Thu Jan 28 14:54:13 2021 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 28 18:14:54 2021 +0100

ofz#30005 crash in LwpFribPtr::XFConvert

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

diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx 
b/lotuswordpro/source/filter/lwpfribptr.cxx
index dc00504a9be6..01089461d576 100644
--- a/lotuswordpro/source/filter/lwpfribptr.cxx
+++ b/lotuswordpro/source/filter/lwpfribptr.cxx
@@ -84,7 +84,8 @@
 #include 
 
 LwpFribPtr::LwpFribPtr()
-: m_pFribs(nullptr),m_pXFPara(nullptr),m_pPara(nullptr)
+: m_pFribs(nullptr)
+, m_pPara(nullptr)
 {
 }
 
@@ -173,7 +174,7 @@ void LwpFribPtr::XFConvert()
 case FRIB_TAG_TEXT:
 {
 LwpFribText* textFrib= static_cast(pFrib);
-textFrib->XFConvert(m_pXFPara,m_pPara->GetStory());
+textFrib->XFConvert(m_pXFPara.get(),m_pPara->GetStory());
 }
 break;
 case FRIB_TAG_TAB:
@@ -245,7 +246,7 @@ void LwpFribPtr::XFConvert()
 case FRIB_TAG_UNICODE3: //fall through
 {
 LwpFribUnicode* unicodeFrib= static_cast(pFrib);
-unicodeFrib->XFConvert(m_pXFPara,m_pPara->GetStory());
+unicodeFrib->XFConvert(m_pXFPara.get(), m_pPara->GetStory());
 }
 break;
 case FRIB_TAG_HARDSPACE:
@@ -254,13 +255,13 @@ void LwpFribPtr::XFConvert()
 LwpStory *pStory = m_pPara->GetStory();
 LwpHyperlinkMgr* pHyperlink = pStory ? pStory->GetHyperlinkMgr() : 
nullptr;
 if (pHyperlink && pHyperlink->GetHyperlinkFlag())
-pFrib->ConvertHyperLink(m_pXFPara,pHyperlink,sHardSpace);
+pFrib->ConvertHyperLink(m_pXFPara.get(), 
pHyperlink,sHardSpace);
 else
-pFrib->ConvertChars(m_pXFPara,sHardSpace);
+pFrib->ConvertChars(m_pXFPara.get(), sHardSpace);
 }
 break;
 case FRIB_TAG_SOFTHYPHEN:
-pFrib->ConvertChars(m_pXFPara,u"\x00ad");
+pFrib->ConvertChars(m_pXFPara.get(), u"\x00ad");
 break;
 case FRIB_TAG_FRAME:
 {
@@ -271,64 +272,64 @@ void LwpFribPtr::XFConvert()
 LwpFoundry* pFoundry = m_pPara->GetFoundry();
 LwpDropcapMgr* pMgr = pFoundry ? pFoundry->GetDropcapMgr() : 
nullptr;
 if (pMgr)
-pMgr->SetXFPara(m_pXFPara);
+pMgr->SetXFPara(m_pXFPara.get());
 }
-frameFrib->XFConvert(m_pXFPara);
+frameFrib->XFConvert(m_pXFPara.get());
 break;
 }
 case FRIB_TAG_CHBLOCK:
 {
 LwpFribCHBlock* chbFrib = static_cast(pFrib);
-chbFrib->XFConvert(m_pXFPara,m_pPara->GetStory());
+chbFrib->XFConvert(m_pXFPara.get(),m_pPara->GetStory());
 }
 break;
 case FRIB_TAG_TABLE:
 {
 LwpFribTable* tableFrib = static_cast(pFrib);
 //tableFrib->XFConvert(m_pPara->GetXFContainer());
-tableFrib->XFConvert(m_pXFPara);
+tableFrib->XFConvert(m_pXFPara.get());
 }
 break;
 case FRIB_TAG_BOOKMARK:
 {
 LwpFribBookMark* bookmarkFrib = 
static_cast(pFrib);
-bookmarkFrib->XFConvert(m_pXFPara);
+bookmarkFrib->XFConvert(m_pXFPara.get());
 }
 break;
 case FRIB_TAG_FOOTNOTE:
 {
 LwpFribFootnote* pFootnoteFrib = 
static_cast(pFrib);
-pFootnoteFrib->XFConvert(m_pXFPara);
+pFootnoteFrib->XFConvert(m_pXFPara.get());
 break;
 }
 case FRIB_TAG_FIELD:
 {
 LwpFribField* fieldFrib = static_cast(pFrib);
-fieldFrib->XFConvert(m_pXFPara);
+fieldFrib->XFConvert(m_pXFPara.get());
 break;
 }
 case FRIB_TAG_NOTE:
 {
 LwpFribNote* pNoteFrib = static_cast(pFrib);
-pNoteFrib->XFConvert(m_pXFPara);
+pNoteFrib->XFConvert(m_pXFPara.get());
 break;
 }
 case FRIB_TAG_PAGENUMBER:
 {
 LwpFribPageNumber* pagenumFrib = 
static_cast(pFrib);
-pagenumFrib->XFConvert(m_pXFPara);
+pagenumFrib->XFConvert(m_pXFPara.get());
 break;
 }
 case FRIB_TAG_DOCVAR:
 {
 LwpFribDocVar* docFrib = static_cast(pFrib);
-docFrib->XFConvert(m_pXFPara);
+docFrib->XFConvert(m_pXFPara.get());
 break;
 

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

2020-11-23 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpcelllayout.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 59d985bbcdf760a368f1dd2edb0926a60e99db12
Author: Caolán McNamara 
AuthorDate: Sun Nov 22 20:13:13 2020 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 23 09:51:28 2020 +0100

ofz#27756 null deref

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

diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx 
b/lotuswordpro/source/filter/lwpcelllayout.cxx
index cd8d49d7519b..71d0bce8a943 100644
--- a/lotuswordpro/source/filter/lwpcelllayout.cxx
+++ b/lotuswordpro/source/filter/lwpcelllayout.cxx
@@ -66,6 +66,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -345,7 +347,11 @@ LwpPara* LwpCellLayout::GetLastParaOfPreviousStory()
 if (pPreStoryID && !(pPreStoryID->IsNull()))
 {
 LwpStory* pPreStory = 
dynamic_cast(pPreStoryID->obj(VO_STORY).get());
-assert(pPreStory);
+if (!pPreStory)
+{
+SAL_WARN("lwp", "unexpected null VO_STORY");
+return nullptr;
+}
 return 
dynamic_cast(pPreStory->GetLastPara().obj(VO_PARA).get());
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-19 Thread Stephan Bergmann (via logerrit)
 lotuswordpro/source/filter/utlist.hxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 26a0e88bcd3b443ca4b827d91b85f67e490ade1c
Author: Stephan Bergmann 
AuthorDate: Thu Nov 19 09:05:00 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Nov 19 12:09:03 2020 +0100

Improve comment layout

...after 69b12a6eb3616d15035310eeb0c3dbc7aefcb5c1 "tdf#123936 Formatting 
files
in module lotuswordpro with clang-format"

Change-Id: I95ce76de02068f1f5480fb32f61d5770e302be84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106120
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/lotuswordpro/source/filter/utlist.hxx 
b/lotuswordpro/source/filter/utlist.hxx
index 5820ba1074b6..c4eee183af66 100644
--- a/lotuswordpro/source/filter/utlist.hxx
+++ b/lotuswordpro/source/filter/utlist.hxx
@@ -71,8 +71,7 @@ public: // Methods
 explicit CUtListElmt(CUtListElmt* pPrev) { InsertAfter(pPrev); }
 explicit CUtListElmt(CUtList* pList);
 virtual ~CUtListElmt();
-void MakeNotOnList() { cpNext = nullptr; } // Same as Remove but doesn't
-// patch up list
+void MakeNotOnList() { cpNext = nullptr; } // Same as Remove but doesn't 
patch up list
 CUtListElmt* GetNext() const { return cpNext; }
 void SetNext(CUtListElmt* pNext) { cpNext = pNext; }
 CUtListElmt* GetPrev() const { return cpPrev; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-02 Thread Noel (via logerrit)
 lotuswordpro/source/filter/lwpbulletstylemgr.cxx   |3 +--
 lotuswordpro/source/filter/lwpcontent.cxx  |2 +-
 lotuswordpro/source/filter/lwpgrfobj.cxx   |2 +-
 lotuswordpro/source/filter/lwpoleobject.cxx|2 +-
 lotuswordpro/source/filter/lwptablelayout.cxx  |7 +++
 lotuswordpro/source/filter/xfilter/xfstylecont.cxx |2 +-
 6 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 8c7946db697103b56d34ed159d80555f751e55c5
Author: Noel 
AuthorDate: Mon Nov 2 10:00:41 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon Nov 2 10:37:48 2020 +0100

loplugin:reducevarscope in lotuswordpro

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

diff --git a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx 
b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
index d22a234ece60..6f5c9711d5b4 100644
--- a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
+++ b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
@@ -114,11 +114,10 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* 
pPara, const LwpBulletO
 }
 
 LwpParaProperty* pProp = pPara->GetProperty(PP_LOCAL_INDENT);
-LwpParaIndentProperty* pIndentProp = nullptr;
 LwpObjectID aIndentID;
 if (pProp)
 {
-pIndentProp = static_cast(pProp);
+LwpParaIndentProperty* pIndentProp = 
static_cast(pProp);
 aIndentID = pIndentProp->GetIndentID();
 }
 
diff --git a/lotuswordpro/source/filter/lwpcontent.cxx 
b/lotuswordpro/source/filter/lwpcontent.cxx
index f4f16484303b..0df9f9cb7497 100644
--- a/lotuswordpro/source/filter/lwpcontent.cxx
+++ b/lotuswordpro/source/filter/lwpcontent.cxx
@@ -90,7 +90,6 @@ void LwpContent::Read()
 //ClassName.Read(pStrm);
 m_ClassName.Read(pStrm);
 
-LwpObjectID SkipID;
 if(LwpFileHeader::m_nFileRevision >= 0x0006)
 {
 //SkipID.ReadIndexed(pStrm);
@@ -101,6 +100,7 @@ void LwpContent::Read()
 
 if (LwpFileHeader::m_nFileRevision >= 0x0007)
 {
+LwpObjectID SkipID;
 if(LwpFileHeader::m_nFileRevision < 0x000B)
 {
 SkipID.ReadIndexed(pStrm);
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx 
b/lotuswordpro/source/filter/lwpgrfobj.cxx
index 8d32472ac0c7..986cdff85195 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -571,7 +571,6 @@ void LwpGraphicObject::CreateGrafObject()
 };
 LwpRect aFrameRect(-fOffsetX, (fDisFrameWidth-fOffsetX), 
(-fOffsetY), (fDisFrameHeight-fOffsetY));
 LwpRect aImageRect(0, fSclGrafWidth, 0, fSclGrafHeight);
-LwpRect aCropRect;
 
 if (aFrameRect.fRight <= aImageRect.fLeft || aFrameRect.fLeft 
>= aImageRect.fRight
 ||aFrameRect.fBottom <= aImageRect.fTop|| aFrameRect.fTop 
>= aImageRect.fBottom)
@@ -581,6 +580,7 @@ void LwpGraphicObject::CreateGrafObject()
 else// need cropped
 {
 // horizontal crop
+LwpRect aCropRect;
 if (aFrameRect.fLeft > aImageRect.fLeft)
 {
 aCropRect.fLeft = (aFrameRect.fLeft - 
aImageRect.fLeft) / fXRatio;
diff --git a/lotuswordpro/source/filter/lwpoleobject.cxx 
b/lotuswordpro/source/filter/lwpoleobject.cxx
index 92e3154f0632..6da021f210d6 100644
--- a/lotuswordpro/source/filter/lwpoleobject.cxx
+++ b/lotuswordpro/source/filter/lwpoleobject.cxx
@@ -198,10 +198,10 @@ void LwpOleObject::Read()
 cPersistentFlags = m_pObjStrm->QuickReaduInt16();
 
 // qCMarker read
-LwpObjectID ID;
 
 if (LwpFileHeader::m_nFileRevision >= 0x0004)
 {
+LwpObjectID ID;
 m_pObjStrm->QuickReaduInt16();
 
 m_pObjStrm->QuickReadStringPtr();
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx 
b/lotuswordpro/source/filter/lwptablelayout.cxx
index ffbd05208d9b..b6a61d9198ce 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -791,17 +791,16 @@ void LwpTableLayout::ParseTable()
 //process header rows
 LwpTableHeadingLayout* pTableHeading;
 pTableHeading = pSuper->GetTableHeadingLayout();
-sal_uInt16 nStartHeadRow;
-sal_uInt16 nEndHeadRow;
-sal_uInt16 nContentRow;
 if (pTableHeading)
 {
+sal_uInt16 nStartHeadRow;
+sal_uInt16 nEndHeadRow;
 pTableHeading->GetStartEndRow(nStartHeadRow,nEndHeadRow);
 if (nStartHeadRow != 0)
 ConvertTable(m_pXFTable,0,nRow,0,nCol);
 else
 {
-nContentRow = 
ConvertHeadingRow(m_pXFTable,nStartHeadRow,nEndHeadRow+1);
+sal_uInt16 nContentRow = 
ConvertHeadingRow(m_pXFTable,nStartHeadRow,nEndHeadRow+1);
 ConvertTable(m_pXFTable,nContentRow,nRow,0,nCol);
 }
 

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

2020-10-10 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwptablelayout.cxx |   17 +
 lotuswordpro/source/filter/lwptablelayout.hxx |4 +++-
 2 files changed, 8 insertions(+), 13 deletions(-)

New commits:
commit 7ca1632a402bea7568d8441524d3f6092695f3c5
Author: Caolán McNamara 
AuthorDate: Fri Oct 9 20:51:17 2020 +0100
Commit: Caolán McNamara 
CommitDate: Sat Oct 10 20:01:38 2020 +0200

ofz#23505 31 seconds -> 12 seconds

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

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx 
b/lotuswordpro/source/filter/lwptablelayout.cxx
index 846e757ad3e3..5ea2d42db9a4 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -1408,15 +1408,10 @@ void 
LwpTableLayout::ConvertDefaultRow(rtl::Reference const & pXFTable,
  * @param   nRow - row id
  * @param   nCol - column id
  */
-void LwpTableLayout::SetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol,XFCell* 
pXFCell)
+void LwpTableLayout::SetCellsMap(sal_uInt16 nRow, sal_uInt8 nCol, XFCell* 
pXFCell)
 {
-std::pair,XFCell*> cell;
-std::pair pos;
-pos.first = nRow;
-pos.second = nCol;
-cell.first = pos;
-cell.second = pXFCell;
-m_CellsMap.insert(cell);
+// combine the 16bit nRow and 8bit nCol into a single 32bit number
+m_CellsMap.insert(std::make_pair((nRow << 8) | nCol, pXFCell));
 }
 
 /**
@@ -1425,11 +1420,9 @@ void LwpTableLayout::SetCellsMap(sal_uInt16 
nRow,sal_uInt8 nCol,XFCell* pXFCell)
  * @param   nCol  - column id
  * @return  pXFCell
  */
-XFCell* LwpTableLayout::GetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol)
+XFCell* LwpTableLayout::GetCellsMap(sal_uInt16 nRow, sal_uInt8 nCol)
 {
-std::pair pos;
-pos.first = nRow;
-pos.second = nCol;
+RowCol pos = (nRow << 8) | nCol;
 auto iter =  m_CellsMap.find(pos);
 if (iter == m_CellsMap.end())
 return nullptr;
diff --git a/lotuswordpro/source/filter/lwptablelayout.hxx 
b/lotuswordpro/source/filter/lwptablelayout.hxx
index 9eebb2b391c1..21ab84ec1c67 100644
--- a/lotuswordpro/source/filter/lwptablelayout.hxx
+++ b/lotuswordpro/source/filter/lwptablelayout.hxx
@@ -67,6 +67,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class XFTableStyle;
 class XFTable;
@@ -164,7 +165,8 @@ private:
 void SplitConflictCells();
 rtl::Reference m_pXFTable;
 bool m_bConverted;
-std::map,XFCell*> m_CellsMap;
+typedef sal_Int32 RowCol;
+std::unordered_map m_CellsMap;
 
 void PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID);
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-09 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpparaborderoverride.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1064ff57880dc6d35deb4ddc9aa83d2a5273aa4a
Author: Caolán McNamara 
AuthorDate: Fri Oct 9 09:45:45 2020 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 9 14:06:22 2020 +0200

ofz: Invalid-enum-value

extend

commit 9d1c8e66f7020fa0150b23bd450e514f848bd20b
Date:   Tue Apr 5 12:35:54 2016 +0200

UBSan: Restrict BorderWidthType values to valid range on input

to the other assignment to m_eRightType

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

diff --git a/lotuswordpro/source/filter/lwpparaborderoverride.cxx 
b/lotuswordpro/source/filter/lwpparaborderoverride.cxx
index 4d372ae5b763..c0919cd7a265 100644
--- a/lotuswordpro/source/filter/lwpparaborderoverride.cxx
+++ b/lotuswordpro/source/filter/lwpparaborderoverride.cxx
@@ -152,7 +152,7 @@ void LwpParaBorderOverride::Read(LwpObjectStream *pStrm)
 
 if( pStrm->CheckExtra() )
 {
-m_eRightType = 
static_cast(pStrm->QuickReaduInt16());
+m_eRightType = readBorderWidthType(pStrm);
 m_nRightWidth = pStrm->QuickReaduInt32();
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-23 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwptablelayout.cxx |   14 +++---
 lotuswordpro/source/filter/lwptablelayout.hxx |2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 20a900e5e98e9a1fb704349d4272d63bca4b801b
Author: Caolán McNamara 
AuthorDate: Wed Sep 23 12:44:14 2020 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 23 15:16:28 2020 +0200

ofz#25881 use std::vector with bounds checking accessor

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

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx 
b/lotuswordpro/source/filter/lwptablelayout.cxx
index 95aaf13715fc..846e757ad3e3 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -860,7 +860,7 @@ sal_uInt16 LwpTableLayout::ConvertHeadingRow(
 ConvertTable(pTmpTable.get(),nStartHeadRow,nEndHeadRow,0,nCol);
 
 sal_uInt16 nRowNum = pTmpTable->GetRowCount();
-std::unique_ptr CellMark( new sal_uInt8[nRowNum] );
+std::vector CellMark(nRowNum);
 
 if (nRowNum == 1)
 {
@@ -872,11 +872,11 @@ sal_uInt16 LwpTableLayout::ConvertHeadingRow(
 else
 {
 sal_uInt8 nFirstColSpann = 1;
-const bool bFindFlag = 
FindSplitColMark(pTmpTable.get(),CellMark.get(),nFirstColSpann);
+const bool bFindFlag = FindSplitColMark(pTmpTable.get(), CellMark, 
nFirstColSpann);
 
 if (bFindFlag)//split to 2 cells
 {
-
SplitRowToCells(pTmpTable.get(),pXFTable,nFirstColSpann,CellMark.get());
+SplitRowToCells(pTmpTable.get(), pXFTable, nFirstColSpann, 
CellMark.data());
 nContentRow = nEndHeadRow;
 }
 else//can not split,the first row will be the heading row,the rest 
will be content row
@@ -992,7 +992,7 @@ void LwpTableLayout::SplitRowToCells(XFTable* pTmpTable, 
rtl::Reference
  * @param  pXFTable - pointer of tmp XFtable
  * @param  CellMark - pointer of cell mark array
  */
-bool  LwpTableLayout::FindSplitColMark(XFTable* pXFTable, sal_uInt8* pCellMark,
+bool  LwpTableLayout::FindSplitColMark(XFTable* pXFTable, 
std::vector& rCellMark,
 sal_uInt8& nMaxColSpan)
 {
 sal_uInt16 nRowNum = pXFTable->GetRowCount();
@@ -1022,7 +1022,7 @@ bool  LwpTableLayout::FindSplitColMark(XFTable* pXFTable, 
sal_uInt8* pCellMark,
 }
 if (nColSpan > nMaxColSpan)
 nMaxColSpan = nColSpan;
-pCellMark[nRowLoop] = 0;//reset all cell mark to zero
+rCellMark.at(nRowLoop) = 0;//reset all cell mark to zero
 }
 
 //find if other row has the same column
@@ -1045,11 +1045,11 @@ bool  LwpTableLayout::FindSplitColMark(XFTable* 
pXFTable, sal_uInt8* pCellMark,
 if (nCellMark == 0)
 break;
 else
-pCellMark[nRowLoop] = nCellMark;
+rCellMark.at(nRowLoop) = nCellMark;
 }
 for(nRowLoop=1;nRowLoop<=nRowNum;nRowLoop++)//check if all ==0,break
 {
-if (pCellMark[nRowLoop] == 0)
+if (rCellMark.at(nRowLoop) == 0)
 break;
 }
 if (nRowLoop == nRowNum+1)
diff --git a/lotuswordpro/source/filter/lwptablelayout.hxx 
b/lotuswordpro/source/filter/lwptablelayout.hxx
index 7852ab9c0b0b..9eebb2b391c1 100644
--- a/lotuswordpro/source/filter/lwptablelayout.hxx
+++ b/lotuswordpro/source/filter/lwptablelayout.hxx
@@ -156,7 +156,7 @@ private:
 sal_uInt8 nEndCol, sal_uInt16 nRowID);
 void ConvertColumn(rtl::Reference const & pXFTable, sal_uInt8 
nStartCol, sal_uInt8 nEndCol);
 sal_uInt16 ConvertHeadingRow(rtl::Reference const & 
pXFTable,sal_uInt16 nStartHeadRow,sal_uInt16 nEndHeadRow);
-static bool FindSplitColMark(XFTable* pXFTable,sal_uInt8* 
pCellMark,sal_uInt8& nMaxColSpan);
+static bool FindSplitColMark(XFTable* pXFTable, std::vector& 
rCellMark, sal_uInt8& nMaxColSpan);
 void SplitRowToCells(XFTable* pTmpTable, rtl::Reference const & 
pXFTable,
 sal_uInt8 nFirstColSpann, const sal_uInt8* pCellMark);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-01 Thread Andrea Gelmini (via logerrit)
 lotuswordpro/source/filter/lwpfrib.cxx |2 +-
 slideshow/source/engine/box2dtools.cxx |4 ++--
 slideshow/source/inc/box2dtools.hxx|8 
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx |2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 09619872fe0c0d677006bcf4e9a8febe2978d242
Author: Andrea Gelmini 
AuthorDate: Mon Aug 31 19:37:07 2020 +0200
Commit: Andrea Gelmini 
CommitDate: Tue Sep 1 08:17:08 2020 +0200

Fix typos

Change-Id: Ieff77be89ee8505b8241234f6dbb7507256dbc4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101757
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/lotuswordpro/source/filter/lwpfrib.cxx 
b/lotuswordpro/source/filter/lwpfrib.cxx
index b8d42a680153..bc9450fd17bc 100644
--- a/lotuswordpro/source/filter/lwpfrib.cxx
+++ b/lotuswordpro/source/filter/lwpfrib.cxx
@@ -195,7 +195,7 @@ LwpFrib* LwpFrib::CreateFrib(LwpPara* pPara, 
LwpObjectStream* pObjStrm, sal_uInt
 break;
 }
 
-//Do not know why the fribTag judgement is necessary, to be checked with
+//Do not know why the fribTag judgment is necessary, to be checked with
 if (fribtag & FRIB_TAG_MODIFIER)
 {
 newFrib->SetModifiers(xModInfo.release());
diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index 1cc69b53632a..e863616b2187 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -408,7 +408,7 @@ void box2DWorld::initateAllShapesAsStaticBodies(
 SdrObject* pTemp = 
SdrObject::getSdrObjectFromXShape(pShape->getXShape());
 if (pTemp && pTemp->IsGroupObject())
 {
-// if it is a group object iterate over it's childs and flag 
them
+// if it is a group object iterate over its children and flag 
them
 SdrObjList* aObjList = pTemp->GetSubList();
 const size_t nObjCount(aObjList->GetObjCount());
 
@@ -614,7 +614,7 @@ double box2DWorld::stepAmount(const double fPassedTime, 
const float fTimeStep,
 // that the updates can be processed using that value
 double fTimeSteppedThrough = fTimeStep * nStepAmount;
 
-// do the updates required to simulate other animaton effects going in 
parallel
+// do the updates required to simulate other animation effects going in 
parallel
 processUpdateQueue(fTimeSteppedThrough);
 
 if (!mbAlreadyStepped)
diff --git a/slideshow/source/inc/box2dtools.hxx 
b/slideshow/source/inc/box2dtools.hxx
index 0f6707fbd7c6..c17fb1648a51 100644
--- a/slideshow/source/inc/box2dtools.hxx
+++ b/slideshow/source/inc/box2dtools.hxx
@@ -299,7 +299,7 @@ public:
  */
 Box2DBodySharedPtr makeShapeStatic(const 
slideshow::internal::ShapeSharedPtr& pShape);
 
-/** Create a static body that represeted by the shape's geometry
+/** Create a static body that is represented by the shape's geometry
 
 @return pointer to the box2d body
  */
@@ -325,20 +325,20 @@ public:
const ::basegfx::B2DVector& rVelocity,
const int nDelayForSteps = 0);
 
-/// Queue an appropraite update for the animation effect that is in 
parallel with a physics animation
+/// Queue an appropriate update for the animation effect that is in 
parallel with a physics animation
 void
 queueShapeAnimationUpdate(const css::uno::Reference& 
xShape,
   const 
slideshow::internal::ShapeAttributeLayerSharedPtr& pAttrLayer,
   const slideshow::internal::AttributeType 
eAttrType,
   const bool bIsFirstUpdate);
 
-/// Queue an appropraite update for a path animation that is in parallel 
with a physics animation
+/// Queue an appropriate update for a path animation that is in parallel 
with a physics animation
 void queueShapePathAnimationUpdate(
 const css::uno::Reference& xShape,
 const slideshow::internal::ShapeAttributeLayerSharedPtr& pAttrLayer,
 const bool bIsFirstUpdate);
 
-/// Queue an appropraite update for the animation effect that just ended
+/// Queue an appropriate update for the animation effect that just ended
 void queueShapeAnimationEndUpdate(const 
css::uno::Reference& xShape,
   const slideshow::internal::AttributeType 
eAttrType);
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 30a27a22e1ce..88f86f57da67 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -1266,7 +1266,7 @@ 
DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromTopMarginNoHeader,
 
 DECLARE_OOXMLEXPORT_TEST(testVmlShapeTextWordWrap, 
"tdf97618_testVmlShapeTextWordWrap.docx")
 {
-// tdf#97618 The text wraping of a shape was not handled in a canvas.
+   

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

2020-08-29 Thread Stephan Bergmann (via logerrit)
 lotuswordpro/source/filter/xfilter/xftabstyle.hxx |   12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 098bcc6131900eaeb51402fba06f4141bfbc5532
Author: Stephan Bergmann 
AuthorDate: Fri Aug 28 12:45:20 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Sat Aug 29 09:10:20 2020 +0200

Directly use OUString(sal_Unicode) ctor

Change-Id: I60869118cf163afb2af3790a4a394fd03adcd868
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101576
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/lotuswordpro/source/filter/xfilter/xftabstyle.hxx 
b/lotuswordpro/source/filter/xfilter/xftabstyle.hxx
index 4b455268e083..6a25ddd3a73d 100644
--- a/lotuswordpro/source/filter/xfilter/xftabstyle.hxx
+++ b/lotuswordpro/source/filter/xfilter/xftabstyle.hxx
@@ -97,20 +97,12 @@ inline void XFTabStyle::SetLength(double len)
 
 inline void XFTabStyle::SetDelimiter(sal_Unicode delimiter)
 {
-sal_Unicode chs[2];
-chs[0] = delimiter;
-chs[1] = 0;
-
-m_strDelimiter = OUString(chs);
+m_strDelimiter = OUString(delimiter);
 }
 
 inline void XFTabStyle::SetLeaderChar(sal_Unicode leader)
 {
-sal_Unicode chs[2];
-chs[0] = leader;
-chs[1] = 0;
-
-m_strLeader = OUString(chs);
+m_strLeader = OUString(leader);
 }
 
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-23 Thread Andrea Gelmini (via logerrit)
 lotuswordpro/source/filter/lwpnumericfmt.cxx |6 +++---
 lotuswordpro/source/filter/lwpnumericfmt.hxx |2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 57520e35bb250eff60bd8e3dcdd3d7ef1129e1b5
Author: Andrea Gelmini 
AuthorDate: Sat Aug 22 18:41:25 2020 +0200
Commit: Julien Nabet 
CommitDate: Sun Aug 23 23:43:15 2020 +0200

Fix typo in code

Change-Id: Ie0f3d8b01e0370f0a2e95d46b61be56943d3bd78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101198
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/lotuswordpro/source/filter/lwpnumericfmt.cxx 
b/lotuswordpro/source/filter/lwpnumericfmt.cxx
index 3edf96eeb8dc..c2dc4d4e76a6 100644
--- a/lotuswordpro/source/filter/lwpnumericfmt.cxx
+++ b/lotuswordpro/source/filter/lwpnumericfmt.cxx
@@ -209,7 +209,7 @@ LwpNumericFormat::GetDecimalPlaces()
 return cDecimalPlaces;
 return GetDefaultDecimalPlaces(cFormat);
 }
-void LwpNumericFormat::GetCurrencyStr(LwpNumericFormatSubset aNumber, 
OUString& aPrefix, OUString& aSuffix, bool bNegtive)
+void LwpNumericFormat::GetCurrencyStr(LwpNumericFormatSubset aNumber, 
OUString& aPrefix, OUString& aSuffix, bool bNegative)
 {
 aPrefix = aNumber.GetPrefix();
 aSuffix = aNumber.GetSuffix();
@@ -220,7 +220,7 @@ void 
LwpNumericFormat::GetCurrencyStr(LwpNumericFormatSubset aNumber, OUString&
 bool bShowSpace = m_aCurrencyInfo.IsShowSpace(cFormat);
 if ( aNumber.IsDefaultPrefix())
 {
-if (bNegtive)
+if (bNegative)
 {
 aPrefix = "(";
 }
@@ -246,7 +246,7 @@ void 
LwpNumericFormat::GetCurrencyStr(LwpNumericFormatSubset aNumber, OUString&
 
 }
 
-if (bNegtive)
+if (bNegative)
 {
 aSuffix += ")";
 }
diff --git a/lotuswordpro/source/filter/lwpnumericfmt.hxx 
b/lotuswordpro/source/filter/lwpnumericfmt.hxx
index 225f373c4f6f..ef1af1da01ec 100644
--- a/lotuswordpro/source/filter/lwpnumericfmt.hxx
+++ b/lotuswordpro/source/filter/lwpnumericfmt.hxx
@@ -269,7 +269,7 @@ private:
 static sal_uInt16 GetDefaultDecimalPlaces(sal_uInt16 Format);
 static LwpCurrencyPool m_aCurrencyInfo;
 
-void GetCurrencyStr(LwpNumericFormatSubset aNumber, OUString& aPrefix, 
OUString& aSuffix, bool bNegtive=false);
+void GetCurrencyStr(LwpNumericFormatSubset aNumber, OUString& aPrefix, 
OUString& aSuffix, bool bNegative=false);
 void SetNumberType(XFNumberStyle* pStyle);
 static OUString reencode(const OUString& sCode);
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-23 Thread Andrea Gelmini (via logerrit)
 lotuswordpro/source/filter/lwpdocdata.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0d35413b97d609c1a14a1adfe6fa2a7cbdb5ade4
Author: Andrea Gelmini 
AuthorDate: Sat Aug 22 18:40:55 2020 +0200
Commit: Julien Nabet 
CommitDate: Sun Aug 23 12:34:45 2020 +0200

Fix typo

Change-Id: I17407c534f95f20bb16b2d5545b92ae293e761ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101218
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/lotuswordpro/source/filter/lwpdocdata.cxx 
b/lotuswordpro/source/filter/lwpdocdata.cxx
index 833a17db46d1..55eecfcbb006 100644
--- a/lotuswordpro/source/filter/lwpdocdata.cxx
+++ b/lotuswordpro/source/filter/lwpdocdata.cxx
@@ -79,7 +79,7 @@ void LwpDocData::Read()
 m_DocOptions.encrypt1password.Read(m_pObjStrm.get());
 //cEncrypt2Password
 m_DocOptions.encrypt2password.Read(m_pObjStrm.get());
-//cCharecterSet
+//cCharacterSet
 m_DocOptions.characterSet.Read(m_pObjStrm.get());
 //cGrammerSet
 m_DocOptions.grammerSet.Read(m_pObjStrm.get());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-01 Thread Stephan Bergmann (via logerrit)
 lotuswordpro/source/filter/LotusWordProImportFilter.cxx |2 +-
 lotuswordpro/source/filter/explode.cxx  |4 ++--
 lotuswordpro/source/filter/lwppttntbl.hxx   |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b551604a81d6cd5ab9b85d56c57a97f4abc457fd
Author: Stephan Bergmann 
AuthorDate: Wed Jul 1 13:23:11 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 1 16:17:39 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: lotuswordpro

Change-Id: I5b68c490b534da933de4f26e01328dfb2976dafc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97616
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx 
b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
index 9d65394bae8c..73335e0bab88 100644
--- a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
+++ b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
@@ -42,7 +42,7 @@ using com::sun::star::document::XImporter;
 using com::sun::star::xml::sax::XDocumentHandler;
 
 // W o r d P r o
-static const sal_Int8 header[] = { 0x57, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f };
+const sal_Int8 header[] = { 0x57, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f };
 
 bool LotusWordProImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >& aDescriptor )
 {
diff --git a/lotuswordpro/source/filter/explode.cxx 
b/lotuswordpro/source/filter/explode.cxx
index 017bd476139b..ab82f3380b23 100644
--- a/lotuswordpro/source/filter/explode.cxx
+++ b/lotuswordpro/source/filter/explode.cxx
@@ -61,7 +61,7 @@
 #include 
 #include 
 
-const static char Tree1String[][32] = {
+const char Tree1String[][32] = {
 "101",
 "11",
"100",
@@ -80,7 +80,7 @@
 "000",
 };
 
-const static char Tree2String[][32] = {
+const char Tree2String[][32] = {
 "11",
 "1011"  ,
"1010"  ,
diff --git a/lotuswordpro/source/filter/lwppttntbl.hxx 
b/lotuswordpro/source/filter/lwppttntbl.hxx
index a0774fbbb8bf..f74c8f6eda9d 100644
--- a/lotuswordpro/source/filter/lwppttntbl.hxx
+++ b/lotuswordpro/source/filter/lwppttntbl.hxx
@@ -64,7 +64,7 @@
 
 #include 
 
-static const sal_uInt8 s_pLwpPatternTab[][8] = {//Id  Name
+const sal_uInt8 s_pLwpPatternTab[][8] = {//Id  Name
 { 0xDF, 0xAF, 0x77, 0x77, 0x77, 0x77, 0xFA, 0xFD },//0  Transparent
 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },//1  SolidForeground
 { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//2  SolidBackground
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-26 Thread Stephan Bergmann (via logerrit)
 lotuswordpro/source/filter/lwpfribptr.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit c3243dfbe0c11f57825c0aa7cf1c760f6b98d141
Author: Stephan Bergmann 
AuthorDate: Fri Jun 26 11:23:19 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 26 12:49:37 2020 +0200

Upcoming improved loplugin:elidestringvar: lotuswordpro

Change-Id: If39fbdf78bcac3394927c6a973cd5da36c1b35d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97200
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx 
b/lotuswordpro/source/filter/lwpfribptr.cxx
index 3b2f82395786..dc00504a9be6 100644
--- a/lotuswordpro/source/filter/lwpfribptr.cxx
+++ b/lotuswordpro/source/filter/lwpfribptr.cxx
@@ -260,10 +260,7 @@ void LwpFribPtr::XFConvert()
 }
 break;
 case FRIB_TAG_SOFTHYPHEN:
-{
-OUString sSoftHyphen(u'\x00ad');
-pFrib->ConvertChars(m_pXFPara,sSoftHyphen);
-}
+pFrib->ConvertChars(m_pXFPara,u"\x00ad");
 break;
 case FRIB_TAG_FRAME:
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-11 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwprowlayout.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 6e77dcd9d2605e55b57d0a379d87cdd2c48b62f4
Author: Caolán McNamara 
AuthorDate: Thu Jun 11 09:31:44 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jun 11 12:13:12 2020 +0200

ofz#23300 infinite loop

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

diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx 
b/lotuswordpro/source/filter/lwprowlayout.cxx
index e21505d06420..3321f294469e 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -404,7 +404,10 @@ void 
LwpRowLayout::ConvertCommonRow(rtl::Reference const & pXFTable, sa
 auto nNumCols = pConnCell->GetNumcols();
 if (!nNumCols)
 throw std::runtime_error("loop in conversion");
-nCellEndCol = i + nNumCols - 1;
+auto nNewEndCol = i + nNumCols - 1;
+if (nNewEndCol > std::numeric_limits::max())
+throw std::range_error("column index too large");
+nCellEndCol = nNewEndCol;
 i = nCellEndCol;
 }
 xCell = 
pCellLayout->DoConvertCell(pTable->GetObjectID(),crowid,i);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-06 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpoverride.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 635b1c1b64e2d022f2a41d5bd93b4f7b8b278bbb
Author: Caolán McNamara 
AuthorDate: Fri Jun 5 21:03:28 2020 +0100
Commit: Caolán McNamara 
CommitDate: Sat Jun 6 16:22:25 2020 +0200

ofz#23103 Invalid-enum-value

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

diff --git a/lotuswordpro/source/filter/lwpoverride.cxx 
b/lotuswordpro/source/filter/lwpoverride.cxx
index 677b3638f9f0..5201a2dc7be8 100644
--- a/lotuswordpro/source/filter/lwpoverride.cxx
+++ b/lotuswordpro/source/filter/lwpoverride.cxx
@@ -58,6 +58,7 @@
  *  For LWP filter architecture prototype
  /
 
+#include 
 #include 
 
 #include "clone.hxx"
@@ -311,7 +312,11 @@ void LwpAlignmentOverride::Read(LwpObjectStream * pStrm)
 if (pStrm->QuickReadBool())
 {
 ReadCommon(pStrm);
-m_nAlignType = static_cast(pStrm->QuickReaduInt8());
+sal_uInt8 nAlignType = pStrm->QuickReaduInt8();
+if (nAlignType <= ALIGN_SQUEEZE)
+m_nAlignType = static_cast(nAlignType);
+else
+SAL_WARN("lwp", "unknown align type:" << nAlignType);
 m_nPosition = pStrm->QuickReaduInt32();
 m_nAlignChar = pStrm->QuickReaduInt16();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-04 Thread Stephan Bergmann (via logerrit)
 lotuswordpro/source/filter/lwpfribtext.cxx |   85 +
 1 file changed, 17 insertions(+), 68 deletions(-)

New commits:
commit 21e930b292b8dcfacb3a5f4dd09c69d858654b6e
Author: Stephan Bergmann 
AuthorDate: Thu Jun 4 13:57:14 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jun 4 21:17:12 2020 +0200

Upcoming loplugin:elidestringvar: lotuswordpro

Change-Id: Ica7a05d890d2cd51ed7251e18dd630d1006ba6d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95506
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/lotuswordpro/source/filter/lwpfribtext.cxx 
b/lotuswordpro/source/filter/lwpfribtext.cxx
index 0ba910ab7da3..51a941c47f5a 100644
--- a/lotuswordpro/source/filter/lwpfribtext.cxx
+++ b/lotuswordpro/source/filter/lwpfribtext.cxx
@@ -261,7 +261,6 @@ void LwpFribDocVar::XFConvert(XFContentContainer* pXFPara)
 pContent = new XFInitialCreator;
 break;
 case DOCSIZE:
-{
 /*  pContent = new XFAnnotation;
 XFTextContent* pSpan = new XFTextContent();
 pSpan->SetText("Document Size is Here");
@@ -270,106 +269,56 @@ void LwpFribDocVar::XFConvert(XFContentContainer* 
pXFPara)
 static_cast(pContent)->Add(pPara);
 break;
 */
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case SMARTMASTER:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case DIVISIONNAME:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case SECTIONNAME:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case VERSIONCREATEBY:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case VERSIONCREATEDATE:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case VERSIONOTHEREDITORS:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case VERSIONNAME:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case VERSIONNUMBER:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case ALLVERSIONNAME:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case VERSIONREMARK:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case DOCUMENTCATEGORY:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case VERSIONLASTDATE:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case VERSIONLASTEDITOR:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case LASTEDIT:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case OTHEREDITORS:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 case NUMOFREVISION:
-{
-OUString text = "";
-LwpFrib::ConvertChars(pXFPara,text);
+LwpFrib::ConvertChars(pXFPara,"");
 return;
-}
 default:
 return;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-03 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpparastyle.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 2bccbd2ba6c90d5e02285629c2b079c35260c08b
Author: Caolán McNamara 
AuthorDate: Wed Jun 3 11:59:05 2020 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jun 3 17:37:41 2020 +0200

ofz#23016 Invalid-enum-value

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

diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx 
b/lotuswordpro/source/filter/lwpparastyle.cxx
index 33b6cc37c77b..4e9871363914 100644
--- a/lotuswordpro/source/filter/lwpparastyle.cxx
+++ b/lotuswordpro/source/filter/lwpparastyle.cxx
@@ -385,9 +385,8 @@ void LwpParaStyle::ApplyBreaks(XFParaStyle* pParaStyle, 
const LwpBreaksOverride*
 void LwpParaStyle::ApplyAlignment(XFParaStyle* pParaStyle, const 
LwpAlignmentOverride* pAlign)
 {
 enumXFAlignType alignType = enumXFAlignStart;
-LwpAlignmentOverride::AlignType type;
+auto type = pAlign->GetAlignType();
 
-type = pAlign->GetAlignType();
 pParaStyle->SetNumberRight(false);//to identify its align attribute
 switch(type)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-04-22 Thread Mike Kaganski (via logerrit)
 lotuswordpro/source/filter/bencont.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c763ff8c7fb47432a4942eb5b9c010d2a1117e5f
Author: Mike Kaganski 
AuthorDate: Tue Apr 21 21:58:13 2020 +0300
Commit: Mike Kaganski 
CommitDate: Wed Apr 22 08:46:31 2020 +0200

Add include needed for std::min

Change-Id: Ia7bb9a99c029d9ad47371b5ae999fd9808c4cbac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92537
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/lotuswordpro/source/filter/bencont.cxx 
b/lotuswordpro/source/filter/bencont.cxx
index 3f85996722ee..ca63a961e197 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -57,6 +57,7 @@
 #include "tocread.hxx"
 #include 
 #include 
+#include 
 #include 
 #include 
 namespace OpenStormBento
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-04-07 Thread Noel Grandin (via logerrit)
 lotuswordpro/source/filter/lwpborderstuff.cxx   |   34 ++--
 lotuswordpro/source/filter/lwpdoc.cxx   |   95 ++--
 lotuswordpro/source/filter/lwpfootnote.cxx  |   48 +++---
 lotuswordpro/source/filter/lwpframelayout.cxx   |  184 +++-
 lotuswordpro/source/filter/lwpfrib.cxx  |   40 ++---
 lotuswordpro/source/filter/lwpfribmark.cxx  |   44 ++---
 lotuswordpro/source/filter/lwpfribsection.cxx   |   36 ++--
 lotuswordpro/source/filter/lwpfribtext.cxx  |   28 +--
 lotuswordpro/source/filter/lwpgrfobj.cxx|   76 -
 lotuswordpro/source/filter/lwplaypiece.cxx  |   28 +--
 lotuswordpro/source/filter/lwpnotes.cxx |   42 ++---
 lotuswordpro/source/filter/lwpnumericfmt.cxx|   24 +--
 lotuswordpro/source/filter/lwppagelayout.cxx|  110 +++---
 lotuswordpro/source/filter/lwppara.cxx  |   34 ++--
 lotuswordpro/source/filter/lwpparastyle.cxx |   43 ++---
 lotuswordpro/source/filter/lwpsdwfileloader.cxx |   28 +--
 lotuswordpro/source/filter/lwptablelayout.cxx   |  147 +--
 lotuswordpro/source/filter/lwptoc.cxx   |   96 ++--
 18 files changed, 566 insertions(+), 571 deletions(-)

New commits:
commit 9f424bf2d71abcb7d30f2a4539169c4c10ffeb8c
Author: Noel Grandin 
AuthorDate: Tue Apr 7 10:06:09 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Apr 7 11:19:13 2020 +0200

loplugin:flatten in lotuswordpro

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

diff --git a/lotuswordpro/source/filter/lwpborderstuff.cxx 
b/lotuswordpro/source/filter/lwpborderstuff.cxx
index 89cc11ac8f82..d3aebcdabdb7 100644
--- a/lotuswordpro/source/filter/lwpborderstuff.cxx
+++ b/lotuswordpro/source/filter/lwpborderstuff.cxx
@@ -131,24 +131,24 @@ voidLwpBorderStuff::Read(LwpObjectStream *pStrm)
 m_nValid = pStrm->QuickReaduInt16();
 pStrm->SkipExtra();
 
-if( LwpFileHeader::m_nFileRevision < 0x0010 )
+if( LwpFileHeader::m_nFileRevision >= 0x0010 )
+return;
+
+if( m_nBorderGroupIDLeft_ID )
 {
-if( m_nBorderGroupIDLeft_ID )
-{
-m_nBorderGroupIDLeft = BGRP_SOLID;
-}
-if( m_nBorderGroupIDRight_ID )
-{
-m_nBorderGroupIDRight = BGRP_SOLID;
-}
-if( m_nBorderGroupIDTop_ID )
-{
-m_nBorderGroupIDTop = BGRP_SOLID;
-}
-if( m_nBorderGroupIDBottom_ID )
-{
-m_nBorderGroupIDBottom = BGRP_SOLID;
-}
+m_nBorderGroupIDLeft = BGRP_SOLID;
+}
+if( m_nBorderGroupIDRight_ID )
+{
+m_nBorderGroupIDRight = BGRP_SOLID;
+}
+if( m_nBorderGroupIDTop_ID )
+{
+m_nBorderGroupIDTop = BGRP_SOLID;
+}
+if( m_nBorderGroupIDBottom_ID )
+{
+m_nBorderGroupIDBottom = BGRP_SOLID;
 }
 }
 
diff --git a/lotuswordpro/source/filter/lwpdoc.cxx 
b/lotuswordpro/source/filter/lwpdoc.cxx
index fd6e567ee030..f42a510fef5e 100644
--- a/lotuswordpro/source/filter/lwpdoc.cxx
+++ b/lotuswordpro/source/filter/lwpdoc.cxx
@@ -260,19 +260,19 @@ void LwpDocument::RegisterLayoutStyles()
 
 //set initial pagelayout in story for parsing pagelayout
 LwpDivInfo* pDivInfo = dynamic_cast (m_DivInfo.obj( 
VO_DIVISIONINFO).get());
-if (pDivInfo)
+if (!pDivInfo)
+return;
+
+LwpPageLayout* pPageLayout = 
dynamic_cast(pDivInfo->GetInitialLayoutID().obj(VO_PAGELAYOUT).get());
+if(pPageLayout)
 {
-LwpPageLayout* pPageLayout = 
dynamic_cast(pDivInfo->GetInitialLayoutID().obj(VO_PAGELAYOUT).get());
-if(pPageLayout)
+//In Ole division, the content of pagelayout is VO_OLEOBJECT
+LwpStory* pStory = 
dynamic_cast(pPageLayout->GetContent().obj(VO_STORY).get());
+if(pStory)
 {
-//In Ole division, the content of pagelayout is VO_OLEOBJECT
-LwpStory* pStory = 
dynamic_cast(pPageLayout->GetContent().obj(VO_STORY).get());
-if(pStory)
-{
-//add all the pagelayout in order into the pagelayout list;
-pStory->SortPageLayout();
-pStory->SetCurrentLayout(pPageLayout);
-}
+//add all the pagelayout in order into the pagelayout list;
+pStory->SortPageLayout();
+pStory->SetCurrentLayout(pPageLayout);
 }
 }
 }
@@ -285,20 +285,20 @@ void LwpDocument::RegisterStylesInPara()
 rtl::Reference xContent(m_xOwnedFoundry
 ? dynamic_cast 
(m_xOwnedFoundry->GetContentManager().GetContentList().obj().get())
 : nullptr);
-if (xContent.is())
+if (!xContent.is())
+return;
+
+rtl::Reference 
xStory(dynamic_cast(xContent->GetChildHead().obj(VO_STORY).get()));
+o3tl::sorted_vector aSeen;
+while (xStory.is())
 {
-rtl::Reference 

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

2020-04-06 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwprowlayout.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fec598900ffe7ee7c55313ef0e258fb43fb36ef7
Author: Caolán McNamara 
AuthorDate: Mon Apr 6 15:21:12 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 6 17:21:43 2020 +0200

ofz#21164 infinite loop

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

diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx 
b/lotuswordpro/source/filter/lwprowlayout.cxx
index 2cc3bd59bbf9..56ea0c98ce33 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -240,8 +240,8 @@ void LwpRowLayout::ConvertRow(rtl::Reference const 
& pXFTable,sal_uInt8
 m_ConnCellList[nMarkConnCell]->GetColID());
 
 //set all cell in this merge cell to cellsmap
-for (sal_uInt16 nRowLoop = crowid;nRowLoopSetCellsMap(nRowLoop,nColLoop, 
xXFCell.get());
 
 i += m_ConnCellList[nMarkConnCell]->GetNumcols();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-25 Thread Noel Grandin (via logerrit)
 lotuswordpro/source/filter/lwpcelllayout.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 39fa33d01032ad3f5cdc164aee654022d30775b5
Author: Noel Grandin 
AuthorDate: Fri Mar 13 16:44:24 2020 +0200
Commit: Caolán McNamara 
CommitDate: Wed Mar 25 14:36:42 2020 +0100

fix assert when loading id:59,sig:11,src:08,op:havoc,rep:2.lwp

one of caolans test files, which appears to have a row layout which
references a non-existent parent.

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

diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx 
b/lotuswordpro/source/filter/lwpcelllayout.cxx
index 17f516a7897a..13b6461feeb5 100644
--- a/lotuswordpro/source/filter/lwpcelllayout.cxx
+++ b/lotuswordpro/source/filter/lwpcelllayout.cxx
@@ -713,10 +713,7 @@ void LwpConnectedCellLayout::SetCellMap()
 LwpCellBorderType LwpConnectedCellLayout::GetCellBorderType(sal_uInt16 nRow, 
sal_uInt16 nCol, LwpTableLayout * pTableLayout)
 {
 if (!pTableLayout)
-{
-assert(false);
-return enumWholeBorder;
-}
+throw std::runtime_error("missing table layout");
 
 sal_uInt16 nRowSpan = m_nRealrowspan;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-08 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwprowlayout.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 17cf56c127351ff61aeb75e84dfa884492f5252d
Author: Caolán McNamara 
AuthorDate: Sat Mar 7 19:11:06 2020 +
Commit: Caolán McNamara 
CommitDate: Sun Mar 8 15:08:26 2020 +0100

ofz#20635 infinite loop

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

diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx 
b/lotuswordpro/source/filter/lwprowlayout.cxx
index 811b7abb762e..2cc3bd59bbf9 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -403,7 +403,10 @@ void 
LwpRowLayout::ConvertCommonRow(rtl::Reference const & pXFTable, sa
 if (pCellLayout->GetLayoutType() == LWP_CONNECTED_CELL_LAYOUT)
 {
 LwpConnectedCellLayout* pConnCell = 
static_cast(pCellLayout);
-nCellEndCol = i+pConnCell->GetNumcols()-1;
+auto nNumCols = pConnCell->GetNumcols();
+if (!nNumCols)
+throw std::runtime_error("loop in conversion");
+nCellEndCol = i + nNumCols - 1;
 i = nCellEndCol;
 }
 xCell = 
pCellLayout->DoConvertCell(pTable->GetObjectID(),crowid,i);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-04 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwprowlayout.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 852f469ba97caf01641b654f2e37dd9a290a6bce
Author: Caolán McNamara 
AuthorDate: Mon Feb 3 21:14:18 2020 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 4 09:48:31 2020 +0100

ofz#20507 hold by reference

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

diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx 
b/lotuswordpro/source/filter/lwprowlayout.cxx
index 9760dd7a5e24..7a564bdd5849 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -225,9 +225,9 @@ void LwpRowLayout::ConvertRow(rtl::Reference const 
& pXFTable,sal_uInt8
 {
 xXFCell.set(new XFCell);
 xXFCell->SetColumnSpaned(nColMark-i);
-XFTable* pSubTable = new XFTable;
-pTableLayout->ConvertTable(pSubTable,crowid,nRowMark,i,nColMark);
-xXFCell->Add(pSubTable);
+rtl::Reference xSubTable(new XFTable);
+pTableLayout->ConvertTable(xSubTable,crowid,nRowMark,i,nColMark);
+xXFCell->Add(xSubTable.get());
 i = nColMark;
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-01 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwprowlayout.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 0754e581b0d8569dd08cf26f88678754f249face
Author: Caolán McNamara 
AuthorDate: Sat Feb 1 12:04:26 2020 +
Commit: Caolán McNamara 
CommitDate: Sat Feb 1 18:04:35 2020 +0100

ofz#20456 Null-dereference READ

this is the first honggfuzz (honggfuzz_asan_libreoffice) report I've seen 
to date

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

diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx 
b/lotuswordpro/source/filter/lwprowlayout.cxx
index de4e0b12789e..9760dd7a5e24 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -283,14 +283,15 @@ void LwpRowLayout::RegisterCurRowStyle(XFRow* 
pXFRow,sal_uInt16 nRowMark)
 {
 pRowStyle = static_cast(
 
pXFStyleManager->FindStyle(pTableLayout->GetDefaultRowStyleName()));
-fHeight += pRowStyle->GetRowHeight();
 }
 else
 {
 pRowStyle = static_cast(
 pXFStyleManager->FindStyle(iter->second->GetStyleName()));
-fHeight+=pRowStyle->GetRowHeight();
 }
+if (!pRowStyle)
+throw std::runtime_error("missing RowStyle");
+fHeight += pRowStyle->GetRowHeight();
 }
 
 if (m_nDirection & 0x0030)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-01 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwprowlayout.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit fec7e3422f4d1c5b9382518a11d0bb99b12e41c9
Author: Caolán McNamara 
AuthorDate: Sat Feb 1 11:21:10 2020 +
Commit: Caolán McNamara 
CommitDate: Sat Feb 1 16:26:52 2020 +0100

ofz#20447 Null-dereference READ

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

diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx 
b/lotuswordpro/source/filter/lwprowlayout.cxx
index 38dc355afd1a..de4e0b12789e 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -191,7 +191,8 @@ void LwpRowLayout::Read()
 void LwpRowLayout::ConvertRow(rtl::Reference const & 
pXFTable,sal_uInt8 nStartCol,sal_uInt8 nEndCol)
 {
 LwpTableLayout* pTableLayout = GetParentTableLayout();
-assert(pTableLayout);
+if (!pTableLayout)
+throw std::runtime_error("missing TableLayout");
 LwpTable* pTable = pTableLayout->GetTable();
 
 //calculate the connected cell position
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-31 Thread Noel Grandin (via logerrit)
 lotuswordpro/source/filter/lwpdoc.cxx |   14 +++---
 lotuswordpro/source/filter/lwplayout.cxx  |7 ---
 lotuswordpro/source/filter/lwppara.cxx|4 ++--
 lotuswordpro/source/filter/lwppara1.cxx   |4 ++--
 lotuswordpro/source/filter/lwprowlayout.cxx   |6 +++---
 lotuswordpro/source/filter/lwpstory.cxx   |   10 +-
 lotuswordpro/source/filter/lwptablelayout.cxx |   14 +++---
 7 files changed, 30 insertions(+), 29 deletions(-)

New commits:
commit 3bcef77383d07d86a13bc097894b3044cae4f57f
Author: Noel Grandin 
AuthorDate: Fri Jan 31 20:49:52 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 1 07:07:48 2020 +0100

std:set->o3tl::sorted_vector

which is always a better choice when dealing with pointers, for
2 reasons: way more cache dense, and we very often iterate pointers
roughly in-order, which means very little sorting needs to be done

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

diff --git a/lotuswordpro/source/filter/lwpdoc.cxx 
b/lotuswordpro/source/filter/lwpdoc.cxx
index a5ef2a7f4203..96f4c2f1bbfd 100644
--- a/lotuswordpro/source/filter/lwpdoc.cxx
+++ b/lotuswordpro/source/filter/lwpdoc.cxx
@@ -68,7 +68,7 @@
 #include "lwpverdocument.hxx"
 #include 
 #include 
-#include 
+#include 
 
 LwpDocument::LwpDocument(LwpObjectHeader const & objHdr, LwpSvStream* pStrm)
 : LwpDLNFPVList(objHdr, pStrm)
@@ -287,7 +287,7 @@ void LwpDocument::RegisterStylesInPara()
 if (xContent.is())
 {
 rtl::Reference 
xStory(dynamic_cast(xContent->GetChildHead().obj(VO_STORY).get()));
-std::set aSeen;
+o3tl::sorted_vector aSeen;
 while (xStory.is())
 {
 aSeen.insert(xStory.get());
@@ -314,7 +314,7 @@ void LwpDocument::RegisterBulletStyles()
 return;
 LwpSilverBullet* pBullet = dynamic_cast
 (pBulletHead->GetHeadID().obj().get());
-std::set aSeen;
+o3tl::sorted_vector aSeen;
 while (pBullet)
 {
 aSeen.insert(pBullet);
@@ -562,7 +562,7 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents()
 {
 LwpDocument* pDivision = GetLastDivision();
 
-std::set aSeen;
+o3tl::sorted_vector aSeen;
 while (pDivision && pDivision != this)
 {
 aSeen.insert(pDivision);
@@ -628,7 +628,7 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents()
  LwpDocument* LwpDocument::GetRootDocument()
 {
 LwpDocument* pRoot = this;
-std::set aSeen;
+o3tl::sorted_vector aSeen;
 while (pRoot)
 {
 aSeen.insert(pRoot);
@@ -651,7 +651,7 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents()
 return this;
 
 LwpDocument* pDivision = GetFirstDivision();
-std::set aSeen;
+o3tl::sorted_vector aSeen;
 while (pDivision)
 {
 aSeen.insert(pDivision);
@@ -671,7 +671,7 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents()
 {
 LwpDocument* pRoot = GetRootDocument();
 LwpDocument *pLastDoc = pRoot ? pRoot->GetLastDivisionWithContents() : 
nullptr;
-std::set aSeen;
+o3tl::sorted_vector aSeen;
 while (pLastDoc)
 {
 aSeen.insert(pLastDoc);
diff --git a/lotuswordpro/source/filter/lwplayout.cxx 
b/lotuswordpro/source/filter/lwplayout.cxx
index a393d50b4535..4c41574180a2 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -73,6 +73,7 @@
 #include "lwpgrfobj.hxx"
 #include 
 #include 
+#include 
 
 LwpVirtualLayout::LwpVirtualLayout(LwpObjectHeader const , LwpSvStream* 
pStrm)
 : LwpDLNFPVList(objHdr, pStrm)
@@ -500,7 +501,7 @@ void LwpHeadLayout::RegisterStyle()
 {
 //Register all children styles
 rtl::Reference 
xLayout(dynamic_cast(GetChildHead().obj().get()));
-std::set aSeen;
+o3tl::sorted_vector aSeen;
 while (xLayout.is())
 {
 aSeen.insert(xLayout.get());
@@ -522,7 +523,7 @@ void LwpHeadLayout::RegisterStyle()
 rtl::Reference LwpHeadLayout::FindEnSuperTableLayout()
 {
 rtl::Reference 
xLayout(dynamic_cast(GetChildHead().obj().get()));
-std::set aSeen;
+o3tl::sorted_vector aSeen;
 while (xLayout.get())
 {
 aSeen.insert(xLayout.get());
@@ -1376,7 +1377,7 @@ bool LwpMiddleLayout::IsProtected()
 rtl::Reference LwpMiddleLayout::GetWaterMarkLayout()
 {
 rtl::Reference 
xLay(dynamic_cast(GetChildHead().obj().get()));
-std::set aSeen;
+o3tl::sorted_vector aSeen;
 while (xLay.is())
 {
 aSeen.insert(xLay.get());
diff --git a/lotuswordpro/source/filter/lwppara.cxx 
b/lotuswordpro/source/filter/lwppara.cxx
index 5b92281b0560..b60f34354141 100644
--- a/lotuswordpro/source/filter/lwppara.cxx
+++ b/lotuswordpro/source/filter/lwppara.cxx
@@ -96,7 +96,7 @@
 #include 
 #include "lwptable.hxx"
 #include 
-#include 
+#include 
 
 

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

2020-01-29 Thread Noel Grandin (via logerrit)
 lotuswordpro/source/filter/lwpfnlayout.cxx|   32 ++---
 lotuswordpro/source/filter/lwpfoundry.cxx |8 +--
 lotuswordpro/source/filter/lwplayout.cxx  |8 +--
 lotuswordpro/source/filter/lwprowlayout.cxx   |   32 ++---
 lotuswordpro/source/filter/lwptablelayout.cxx |   64 +-
 lotuswordpro/source/filter/lwptoc.cxx |   16 +++---
 6 files changed, 80 insertions(+), 80 deletions(-)

New commits:
commit 0b113d6ebbaf923e11ba576bed2691bb68e95ae6
Author: Noel Grandin 
AuthorDate: Wed Jan 29 16:04:27 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 29 15:56:13 2020 +0100

tdf#129993 broken tables opening LWP file

regression from
commit e2080e70fe8b085f18e868e46340454720fa94ca
new compilerplugin returnbyref

The parts that fix this specific bug are in lwprowlayout.cxx and
lwprowlayout.cxx, but fix the other parts I messed up but not
understanding the semantics of assigning to reference variables.

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

diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx 
b/lotuswordpro/source/filter/lwpfnlayout.cxx
index 6dc167ff8dda..f95a1eddb622 100644
--- a/lotuswordpro/source/filter/lwpfnlayout.cxx
+++ b/lotuswordpro/source/filter/lwpfnlayout.cxx
@@ -114,15 +114,15 @@ void LwpFnRowLayout::Read()
 void LwpFnRowLayout::RegisterStyle()
 {
 // register cells' style
-LwpObjectID& rCellID = GetChildHead();
-LwpCellLayout * pCellLayout = dynamic_cast(rCellID.obj().get());
+LwpObjectID* pCellID = ();
+LwpCellLayout * pCellLayout = dynamic_cast(pCellID->obj().get());
 
 while(pCellLayout)
 {
 pCellLayout->SetFoundry(m_pFoundry);
 pCellLayout->RegisterStyle();
-rCellID = pCellLayout->GetNext();
-pCellLayout = dynamic_cast(rCellID.obj().get());
+pCellID = >GetNext();
+pCellLayout = dynamic_cast(pCellID->obj().get());
 }
 }
 
@@ -194,15 +194,15 @@ void LwpEndnoteLayout::Read()
 void LwpEndnoteLayout::RegisterStyle()
 {
 // register style of rows
-LwpObjectID& rRowID = GetChildHead();
-LwpRowLayout * pRowLayout = dynamic_cast(rRowID.obj().get());
+LwpObjectID* pRowID = ();
+LwpRowLayout * pRowLayout = dynamic_cast(pRowID->obj().get());
 while (pRowLayout)
 {
 pRowLayout->SetFoundry(m_pFoundry);
 pRowLayout->RegisterStyle();
 
-rRowID = pRowLayout->GetNext();
-pRowLayout = dynamic_cast(rRowID.obj().get());
+pRowID = >GetNext();
+pRowLayout = dynamic_cast(pRowID->obj().get());
 }
 }
 
@@ -254,12 +254,12 @@ void LwpEnSuperTableLayout::XFConvert(XFContentContainer 
* /*pCont*/)
  */
 LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout()
 {
-LwpObjectID& rID = GetChildTail();
+LwpObjectID *pID = ();
 
 LwpVirtualLayout *pPrevLayout = nullptr;
-while(!rID.IsNull())
+while(!pID->IsNull())
 {
-LwpVirtualLayout* pLayout = 
dynamic_cast(rID.obj().get());
+LwpVirtualLayout* pLayout = 
dynamic_cast(pID->obj().get());
 if (!pLayout || pLayout == pPrevLayout)
 {
 break;
@@ -268,7 +268,7 @@ LwpVirtualLayout* 
LwpEnSuperTableLayout::GetMainTableLayout()
 {
 return pLayout;
 }
-rID = pLayout->GetPrevious();
+pID = >GetPrevious();
 pPrevLayout = pLayout;
 }
 
@@ -312,11 +312,11 @@ void LwpFnSuperTableLayout::XFConvert(XFContentContainer 
* /*pCont*/)
  */
 LwpVirtualLayout* LwpFnSuperTableLayout::GetMainTableLayout()
 {
-LwpObjectID& rID = GetChildTail();
+LwpObjectID *pID = ();
 
-while(!rID.IsNull())
+while(pID && !pID->IsNull())
 {
-LwpVirtualLayout * pLayout = dynamic_cast(rID.obj().get());
+LwpVirtualLayout * pLayout = dynamic_cast(pID->obj().get());
 if(!pLayout)
 {
 break;
@@ -325,7 +325,7 @@ LwpVirtualLayout* 
LwpFnSuperTableLayout::GetMainTableLayout()
 {
 return pLayout;
 }
-rID = pLayout->GetPrevious();
+pID = >GetPrevious();
 }
 
 return nullptr;
diff --git a/lotuswordpro/source/filter/lwpfoundry.cxx 
b/lotuswordpro/source/filter/lwpfoundry.cxx
index 40420d92244c..12226c95255c 100644
--- a/lotuswordpro/source/filter/lwpfoundry.cxx
+++ b/lotuswordpro/source/filter/lwpfoundry.cxx
@@ -216,15 +216,15 @@ LwpBookMark* LwpFoundry::GetBookMark(LwpObjectID 
objMarker)
 if (!pHeadHolder)
 return nullptr;
 
-LwpObjectID& rObjID = pHeadHolder->GetHeadID();
-LwpBookMark* pBookMark = dynamic_cast(rObjID.obj().get());
+LwpObjectID* pObjID = >GetHeadID();
+LwpBookMark* pBookMark = dynamic_cast(pObjID->obj().get());
 
 while (pBookMark)
 {
 if (pBookMark->IsRightMarker(objMarker))
 return pBookMark;
-

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

2020-01-28 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwplayout.cxx |   21 +++--
 lotuswordpro/source/filter/lwplayout.hxx |1 +
 2 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit 018bf569904e77e897b9b76f17a9b539cc415dcc
Author: Caolán McNamara 
AuthorDate: Tue Jan 28 10:46:01 2020 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 28 14:54:53 2020 +0100

ofz#20361 infinite recursion

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

diff --git a/lotuswordpro/source/filter/lwplayout.cxx 
b/lotuswordpro/source/filter/lwplayout.cxx
index d9b442268b04..9d8b33fa94b5 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -88,6 +88,7 @@ LwpVirtualLayout::LwpVirtualLayout(LwpObjectHeader const 
, LwpSvStream* p
 , m_bGettingBorderStuff(false)
 , m_bGettingUseWhen(false)
 , m_bGettingStyleLayout(false)
+, m_bGettingAutoGrowUp(false)
 , m_nAttributes(0)
 , m_nAttributes2(0)
 , m_nAttributes3(0)
@@ -1189,19 +1190,27 @@ bool LwpMiddleLayout::IsAutoGrowDown()
 */
 bool LwpMiddleLayout::IsAutoGrowUp()
 {
-if(m_nOverrideFlag & OVER_SIZE)
+if (m_bGettingAutoGrowUp)
+throw std::runtime_error("recursion in layout");
+m_bGettingAutoGrowUp = true;
+
+bool bRet;
+
+if (m_nOverrideFlag & OVER_SIZE)
 {
-return (m_nDirection & (LAY_AUTOGROW << SHIFT_UP)) != 0;
+bRet = (m_nDirection & (LAY_AUTOGROW << SHIFT_UP)) != 0;
 }
 else
 {
 rtl::Reference xBase(GetBasedOnStyle());
 if (LwpMiddleLayout* pLay = 
dynamic_cast(xBase.get()))
-{
-return pLay->IsAutoGrowUp();
-}
+bRet = pLay->IsAutoGrowUp();
+else
+bRet = LwpVirtualLayout::IsAutoGrowUp();
 }
-return LwpVirtualLayout::IsAutoGrowUp();
+
+m_bGettingAutoGrowUp = false;
+return bRet;
 }
 
 /**
diff --git a/lotuswordpro/source/filter/lwplayout.hxx 
b/lotuswordpro/source/filter/lwplayout.hxx
index c68a82d1edd3..c11f830c83a5 100644
--- a/lotuswordpro/source/filter/lwplayout.hxx
+++ b/lotuswordpro/source/filter/lwplayout.hxx
@@ -240,6 +240,7 @@ protected:
 bool m_bGettingBorderStuff;
 bool m_bGettingUseWhen;
 bool m_bGettingStyleLayout;
+bool m_bGettingAutoGrowUp;
 sal_uInt32 m_nAttributes;
 sal_uInt32 m_nAttributes2;
 sal_uInt32 m_nAttributes3;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-09 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpparastyle.cxx |2 +-
 lotuswordpro/source/filter/lwptabrack.hxx   |   21 -
 2 files changed, 9 insertions(+), 14 deletions(-)

New commits:
commit 88b88db488396258c0cfe1614e4b540eeb988ecd
Author: Caolán McNamara 
AuthorDate: Thu Jan 9 09:20:22 2020 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 9 11:10:33 2020 +0100

ofz#19961 Invalid-enum-value

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

diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx 
b/lotuswordpro/source/filter/lwpparastyle.cxx
index e52909e3b361..3ae8b69e578f 100644
--- a/lotuswordpro/source/filter/lwpparastyle.cxx
+++ b/lotuswordpro/source/filter/lwpparastyle.cxx
@@ -621,7 +621,7 @@ void LwpParaStyle::ApplyTab(XFParaStyle *pParaStyle, 
LwpTabOverride *pTabOverRid
 
 //get leader type
 sal_Unicode cLeader = 0x00;
-LwpTab::LeaderType leader= pTab->GetLeaderType();
+auto leader= pTab->GetLeaderType();
 switch(leader)
 {
 case LwpTab::TL_NONE:
diff --git a/lotuswordpro/source/filter/lwptabrack.hxx 
b/lotuswordpro/source/filter/lwptabrack.hxx
index 1f038e61ffd7..7157e08abbd1 100644
--- a/lotuswordpro/source/filter/lwptabrack.hxx
+++ b/lotuswordpro/source/filter/lwptabrack.hxx
@@ -100,9 +100,14 @@ public:
 {
 return m_nType;
 }
-inline LeaderType GetLeaderType() const;
-inline sal_uInt16 GetAlignChar() const;
-
+sal_uInt8 GetLeaderType() const
+{
+return m_nLeader;
+}
+sal_uInt16 GetAlignChar() const
+{
+return m_nAlignChar;
+}
 private:
 sal_uInt32  m_nX;
 sal_uInt8   m_nType;
@@ -116,16 +121,6 @@ inline sal_uInt32 LwpTab::GetPosition() const
 return m_nX;
 }
 
-inline LwpTab::LeaderType LwpTab::GetLeaderType() const
-{
-return static_cast(m_nLeader);
-}
-
-inline sal_uInt16 LwpTab::GetAlignChar() const
-{
-return m_nAlignChar;
-}
-
 class   LwpTabRack : public LwpObject
 {
 public:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-03 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpparastyle.cxx |2 +-
 lotuswordpro/source/filter/lwptabrack.hxx   |   10 --
 2 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 80fd15abe368627c7d5f385e178d94ee67eaafe6
Author: Caolán McNamara 
AuthorDate: Fri Jan 3 17:07:08 2020 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 3 21:59:25 2020 +0100

ofz#19786 Invalid-enum-value

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

diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx 
b/lotuswordpro/source/filter/lwpparastyle.cxx
index f7fc6979746d..e52909e3b361 100644
--- a/lotuswordpro/source/filter/lwpparastyle.cxx
+++ b/lotuswordpro/source/filter/lwpparastyle.cxx
@@ -597,7 +597,7 @@ void LwpParaStyle::ApplyTab(XFParaStyle *pParaStyle, 
LwpTabOverride *pTabOverRid
 return;
 
 enumXFTab eType = enumXFTabNone;
-LwpTab::TabType type = pTab->GetTabType();
+sal_uInt32 type = pTab->GetTabType();
 switch(type)
 {
 case LwpTab::TT_LEFT:
diff --git a/lotuswordpro/source/filter/lwptabrack.hxx 
b/lotuswordpro/source/filter/lwptabrack.hxx
index d29aaada28f9..1f038e61ffd7 100644
--- a/lotuswordpro/source/filter/lwptabrack.hxx
+++ b/lotuswordpro/source/filter/lwptabrack.hxx
@@ -96,7 +96,10 @@ public:
 public:
 voidRead(LwpObjectStream *pStrm);
 inline sal_uInt32 GetPosition() const;
-inline TabType GetTabType() const;
+sal_uInt8 GetTabType() const
+{
+return m_nType;
+}
 inline LeaderType GetLeaderType() const;
 inline sal_uInt16 GetAlignChar() const;
 
@@ -113,11 +116,6 @@ inline sal_uInt32 LwpTab::GetPosition() const
 return m_nX;
 }
 
-inline LwpTab::TabType LwpTab::GetTabType() const
-{
-return static_cast(m_nType);
-}
-
 inline LwpTab::LeaderType LwpTab::GetLeaderType() const
 {
 return static_cast(m_nLeader);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: lotuswordpro/source odk/examples

2019-12-19 Thread Noel Grandin (via logerrit)
 lotuswordpro/source/filter/explode.cxx 
  |   14 -
 lotuswordpro/source/filter/explode.hxx 
  |8 
 lotuswordpro/source/filter/lwptools.cxx
  |4 
 lotuswordpro/source/filter/xfilter/xfbase64.cxx
  |8 
 lotuswordpro/source/filter/xfilter/xftextcontent.cxx   
  |2 
 
odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
|2 
 odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx 
  |2 
 odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx 
  |4 
 odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.cxx   
  |  110 +-
 odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.hxx   
  |4 
 
odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
   |2 
 
odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx
 |2 
 
odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
   |2 
 odk/examples/cpp/complextoolbarcontrols/exports.cxx
  |2 
 odk/examples/cpp/counter/counter.cxx   
  |2 
 odk/examples/cpp/custompanel/ctp_services.cxx  
  |2 
 odk/examples/cpp/remoteclient/remoteclient.cxx 
  |2 
 17 files changed, 86 insertions(+), 86 deletions(-)

New commits:
commit 5b97250bfc158fcd2726a670af710eb6a9235490
Author: Noel Grandin 
AuthorDate: Thu Dec 19 09:50:35 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Dec 19 10:35:21 2019 +0100

sal_Char->char in lotuswordpro..odk

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

diff --git a/lotuswordpro/source/filter/explode.cxx 
b/lotuswordpro/source/filter/explode.cxx
index 1815e406ea93..017bd476139b 100644
--- a/lotuswordpro/source/filter/explode.cxx
+++ b/lotuswordpro/source/filter/explode.cxx
@@ -334,7 +334,7 @@ sal_Int32 Decompression::explode()
  * @descr   bits to string
  * @return
  */
-void Decompression::ToString(sal_uInt32 nBits, sal_Char *pChar, sal_uInt32 
nLen)
+void Decompression::ToString(sal_uInt32 nBits, char *pChar, sal_uInt32 nLen)
 {
 sal_uInt32 nBit;
 for (sal_uInt32 i=nLen; i > 0; i--)
@@ -364,7 +364,7 @@ sal_uInt32 Decompression::Decode(HuffmanTreeNode * pRoot)
 
 nReadAlready  = (nReadAlready << 1) | (nRead & 0x01);
 
-sal_Char sCode[16];
+char sCode[16];
 ToString(nReadAlready, sCode, i);
 nRet = pRoot->QueryValue(sCode);
 if (nRet != 0x)
@@ -456,13 +456,13 @@ HuffmanTreeNode::~HuffmanTreeNode()
 {
 }
 
-HuffmanTreeNode * HuffmanTreeNode::InsertNode(sal_uInt32 nValue, const 
sal_Char * pInCode)
+HuffmanTreeNode * HuffmanTreeNode::InsertNode(sal_uInt32 nValue, const char * 
pInCode)
 {
 HuffmanTreeNode *pNew = new HuffmanTreeNode(nValue);
 std::string aCode(pInCode);
 
 // query its parents
-const sal_Char cLast = aCode.back();
+const char cLast = aCode.back();
 aCode.pop_back();
 HuffmanTreeNode * pParent = QueryNode(aCode.c_str());
 if (!pParent)
@@ -477,14 +477,14 @@ HuffmanTreeNode * HuffmanTreeNode::InsertNode(sal_uInt32 
nValue, const sal_Char
 return pNew;
 }
 
-HuffmanTreeNode * HuffmanTreeNode::QueryNode(const sal_Char * pCode)
+HuffmanTreeNode * HuffmanTreeNode::QueryNode(const char * pCode)
 {
 sal_uInt32 nLen = strlen(pCode);
 
 HuffmanTreeNode * pNode = this; // this is the root
 for(sal_uInt32 i=0; ileft.get();
@@ -497,7 +497,7 @@ HuffmanTreeNode * HuffmanTreeNode::QueryNode(const sal_Char 
* pCode)
 return pNode;
 }
 
-sal_uInt32 HuffmanTreeNode::QueryValue(const sal_Char * pCode)
+sal_uInt32 HuffmanTreeNode::QueryValue(const char * pCode)
 {
 HuffmanTreeNode * pNode =QueryNode(pCode);
 if (pNode)
diff --git a/lotuswordpro/source/filter/explode.hxx 
b/lotuswordpro/source/filter/explode.hxx
index a313c55dd2bd..95f45f2ef821 100644
--- a/lotuswordpro/source/filter/explode.hxx
+++ b/lotuswordpro/source/filter/explode.hxx
@@ -69,9 +69,9 @@ class HuffmanTreeNode
 public:
 explicit HuffmanTreeNode(sal_uInt32 value = 0x) ;
 ~HuffmanTreeNode() ;
-HuffmanTreeNode * InsertNode(sal_uInt32 nValue, const sal_Char * pInCode);
-HuffmanTreeNode * QueryNode(const sal_Char *pCode);
-sal_uInt32 QueryValue(const sal_Char *pCode);
+HuffmanTreeNode * 

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

2019-10-04 Thread Caolán McNamara (via logerrit)
 lotuswordpro/source/filter/lwpstory.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit f6ddb203a74cf3373df15636cf9ac2973abdca66
Author: Caolán McNamara 
AuthorDate: Fri Oct 4 16:39:50 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 4 22:19:50 2019 +0200

ofz#17675 loop in lwp filter

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

diff --git a/lotuswordpro/source/filter/lwpstory.cxx 
b/lotuswordpro/source/filter/lwpstory.cxx
index 32d6342e47dc..2474dc03202a 100644
--- a/lotuswordpro/source/filter/lwpstory.cxx
+++ b/lotuswordpro/source/filter/lwpstory.cxx
@@ -322,8 +322,10 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* 
pCont)
 while (xLayout.is())
 {
 rtl::Reference 
xFrameLayout(dynamic_cast(xLayout->GetChildHead().obj().get()));
+std::set aSeen;
 while (xFrameLayout.is())
 {
+aSeen.insert(xFrameLayout.get());
 if( xFrameLayout->IsAnchorPage()
 && (xFrameLayout->IsFrame()
 || xFrameLayout->IsSuperTable()
@@ -332,6 +334,8 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* 
pCont)
 xFrameLayout->DoXFConvert(pCont);
 }
 
xFrameLayout.set(dynamic_cast(xFrameLayout->GetNext().obj().get()));
+if (aSeen.find(xFrameLayout.get()) != aSeen.end())
+throw std::runtime_error("loop in conversion");
 }
 xLayout = GetLayout(xLayout.get());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-05 Thread Andrea Gelmini (via logerrit)
 lotuswordpro/source/filter/lwptblcell.hxx |2 +-
 offapi/com/sun/star/document/XDocumentRecovery.idl|6 +++---
 offapi/com/sun/star/document/XUndoManager.idl |2 +-
 offapi/com/sun/star/embed/XOptimizedStorage.idl   |2 +-
 offapi/com/sun/star/image/ImageMap.idl|2 +-
 offapi/com/sun/star/image/ImageMapObject.idl  |2 +-
 offapi/com/sun/star/inspection/PropertyControlType.idl|2 +-
 offapi/com/sun/star/inspection/XObjectInspector.idl   |2 +-
 offapi/com/sun/star/linguistic2/XHyphenator.idl   |2 +-
 offapi/com/sun/star/mail/XMailMessage.idl |6 +++---
 offapi/com/sun/star/presentation/EffectPresetClass.idl|2 +-
 offapi/com/sun/star/rendering/XSprite.idl |2 +-
 offapi/com/sun/star/report/XImageControl.idl  |2 +-
 offapi/com/sun/star/script/XLibraryContainer2.idl |2 +-
 offapi/com/sun/star/sdb/QueryDesign.idl   |2 +-
 offapi/com/sun/star/security/XCertificate.idl |2 +-
 offapi/com/sun/star/sheet/AccessiblePageHeaderFooterAreasView.idl |2 +-
 17 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit 06b9ea06ac93dd8dab13145813b4ac6f57ca7c78
Author: Andrea Gelmini 
AuthorDate: Mon Aug 5 10:22:39 2019 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 5 17:15:39 2019 +0200

Fix typos

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

diff --git a/lotuswordpro/source/filter/lwptblcell.hxx 
b/lotuswordpro/source/filter/lwptblcell.hxx
index b8e52ff75d17..567edfc99caf 100644
--- a/lotuswordpro/source/filter/lwptblcell.hxx
+++ b/lotuswordpro/source/filter/lwptblcell.hxx
@@ -67,7 +67,7 @@
 
 #include 
 
-// temporily added for compile
+// temporarily added for compile
 class LwpObject;
 
 class LwpContent;
diff --git a/offapi/com/sun/star/document/XDocumentRecovery.idl 
b/offapi/com/sun/star/document/XDocumentRecovery.idl
index a18e8dde800a..914a091b672b 100644
--- a/offapi/com/sun/star/document/XDocumentRecovery.idl
+++ b/offapi/com/sun/star/document/XDocumentRecovery.idl
@@ -38,7 +38,7 @@ interface XDocumentRecovery
 If storeToRecoveryFile has not been called before, 
this method returns whether the document
 has been modified since it has been loaded respectively created.
 
-When saving a session, either in case of a emergency (when 
OpenOffice.org crashed), or during a
+When saving a session, either in case of an emergency (when 
OpenOffice.org crashed), or during a
 periodic session save as configured by the user, storeToRecoveryFile() 
is called for every
 document where wasModifiedSinceLastSave returns 
`TRUE`.
 
@@ -62,7 +62,7 @@ interface XDocumentRecovery
 specifies the URL of the location to which the document should be 
emergency-saved.
 
 @param MediaDescriptor
-contains additional arguments for the save process, for instance 
an StatusIndicator.
+contains additional arguments for the save process, for instance a 
StatusIndicator.
 
 @see MediaDescriptor
 */
@@ -96,7 +96,7 @@ interface XDocumentRecovery
 then the file should be recovered from its original location.
 
 @param MediaDescriptor
-contains additional arguments for the load process, for instance 
an StatusIndicator.
+contains additional arguments for the load process, for instance a 
StatusIndicator.
 
 @see MediaDescriptor
 */
diff --git a/offapi/com/sun/star/document/XUndoManager.idl 
b/offapi/com/sun/star/document/XUndoManager.idl
index 04f8b7ec80ab..9eb3d1d5cfb7 100644
--- a/offapi/com/sun/star/document/XUndoManager.idl
+++ b/offapi/com/sun/star/document/XUndoManager.idl
@@ -78,7 +78,7 @@ interface XUndoManager
 /** allows accessing the component, usually a document, which the undo 
manager works for.
 
 com::sun::star::container::XChild::setParent() is not supported, 
and will throw
-an com::sun::star::lang::NoSupportException.
+a com::sun::star::lang::NoSupportException.
 */
 interface ::com::sun::star::container::XChild;
 
diff --git a/offapi/com/sun/star/embed/XOptimizedStorage.idl 
b/offapi/com/sun/star/embed/XOptimizedStorage.idl
index cf354ef7db76..65d5de599d12 100644
--- a/offapi/com/sun/star/embed/XOptimizedStorage.idl
+++ b/offapi/com/sun/star/embed/XOptimizedStorage.idl
@@ -71,7 +71,7 @@ published interface XOptimizedStorage
 ::com::sun::star::io::IOException,
 ::com::sun::star::embed::StorageWrappedTargetException );
 
-/** allows to copy storage element directly, not guarantied to work.
+/** 

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

2019-03-05 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/tocread.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit efbd217afc52390138195e06e96ef9c8f10bf37b
Author: Caolán McNamara 
AuthorDate: Tue Mar 5 13:25:16 2019 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 5 22:09:26 2019 +0100

Resolves: tdf#123815 null terminator included in string

regression from...

commit 18d636063fd7be165e7888af49372a6e2b851776
Author: Caolán McNamara 
Date:   Mon Jun 19 09:46:31 2017 +0100

ofz: use OString instead of bare char*

this is no use to the reporter though, as the document format is
10 and 11 is the oldest the filter will open

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

diff --git a/lotuswordpro/source/filter/tocread.cxx 
b/lotuswordpro/source/filter/tocread.cxx
index e2421efb0931..203fe79a466f 100644
--- a/lotuswordpro/source/filter/tocread.cxx
+++ b/lotuswordpro/source/filter/tocread.cxx
@@ -290,7 +290,9 @@ CBenTOCReader::ReadTOC()
 return Err;
 }
 
-OString sName(sBuffer, Length);
+OString sName;
+if (Length)
+sName = OString(sBuffer, Length - 1);
 
 CUtListElmt * pPrevNamedObjectListElmt;
 if (FindNamedObject(>GetNamedObjects(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-01-07 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/bencont.cxx   |7 +++
 lotuswordpro/source/filter/bento.hxx |3 ++-
 lotuswordpro/source/filter/lwpfilter.cxx |4 +---
 lotuswordpro/source/filter/lwpgrfobj.cxx |   13 -
 4 files changed, 10 insertions(+), 17 deletions(-)

New commits:
commit da2d11d2efb1c0baaa80b9d7052f7c8da5b5bf45
Author: Noel Grandin 
AuthorDate: Mon Jan 7 08:35:52 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 7 09:38:40 2019 +0100

use unique_ptr in BenOpenContainer

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

diff --git a/lotuswordpro/source/filter/bencont.cxx 
b/lotuswordpro/source/filter/bencont.cxx
index 06be40c8a614..ceed08c55020 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -70,7 +70,7 @@ const char gsBenMagicBytes[] = BEN_MAGIC_BYTES;
 *   @param  pointer to pointer of Bento Container object
 *   @return error code
 */
-sal_uLong BenOpenContainer(LwpSvStream * pStream, LtcBenContainer ** 
ppContainer)
+sal_uLong BenOpenContainer(LwpSvStream * pStream, 
std::unique_ptr* ppContainer)
 {
 *ppContainer = nullptr;
 
@@ -79,14 +79,13 @@ sal_uLong BenOpenContainer(LwpSvStream * pStream, 
LtcBenContainer ** ppContainer
 return BenErr_ContainerWithNoObjects;
 }
 
-LtcBenContainer * pContainer = new LtcBenContainer(pStream);
+std::unique_ptr pContainer(new LtcBenContainer(pStream));
 if (pContainer->Open() != BenErr_OK) // delete two inputs
 {
-delete pContainer;
 return BenErr_InvalidTOC;
 }
 
-*ppContainer = pContainer;
+*ppContainer = std::move(pContainer);
 return BenErr_OK;
 }
 
diff --git a/lotuswordpro/source/filter/bento.hxx 
b/lotuswordpro/source/filter/bento.hxx
index 4b294183a8eb..f437ce9bdbec 100644
--- a/lotuswordpro/source/filter/bento.hxx
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -59,6 +59,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -136,7 +137,7 @@ typedef sal_uInt32 BenContainerPos;
 typedef sal_uInt32 BenObjectID;
 typedef sal_uInt32 BenGeneration;
 
-sal_uLong BenOpenContainer(LwpSvStream * pStream, LtcBenContainer ** 
ppContainer);
+sal_uLong BenOpenContainer(LwpSvStream * pStream, 
std::unique_ptr* ppContainer);
 
 class CBenIDListElmt : public CUtListElmt
 {
diff --git a/lotuswordpro/source/filter/lwpfilter.cxx 
b/lotuswordpro/source/filter/lwpfilter.cxx
index 5dbaf0f29c03..4e743eb4da0f 100644
--- a/lotuswordpro/source/filter/lwpfilter.cxx
+++ b/lotuswordpro/source/filter/lwpfilter.cxx
@@ -109,9 +109,7 @@ static bool Decompress(SvStream *pCompressed, SvStream * & 
pOutDecompressed)
 std::unique_ptr aLwpStream(new LwpSvStream(pCompressed));
 std::unique_ptr pBentoContainer;
 {
-OpenStormBento::LtcBenContainer* pTmp(nullptr);
-sal_uLong ulRet = BenOpenContainer(aLwpStream.get(), );
-pBentoContainer.reset(pTmp);
+sal_uLong ulRet = BenOpenContainer(aLwpStream.get(), );
 if (ulRet != BenErr_OK)
 return false;
 }
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx 
b/lotuswordpro/source/filter/lwpgrfobj.cxx
index 6e0069bf98a8..1d21c9a3d4c8 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -286,7 +286,7 @@ void LwpGraphicObject::CreateDrawObjects()
 // if small file, use the compressed stream for BENTO
 LwpSvStream* pStream = m_pStrm->GetCompressedStream() ?  
m_pStrm->GetCompressedStream(): m_pStrm;
 
-OpenStormBento::LtcBenContainer* pBentoContainer;
+std::unique_ptr pBentoContainer;
 sal_uLong ulRet = OpenStormBento::BenOpenContainer(pStream, 
);
 if (ulRet != OpenStormBento::BenErr_OK)
 return;
@@ -334,9 +334,7 @@ std::vector LwpGraphicObject::GetRawGrafData()
 
 std::unique_ptr pBentoContainer;
 {
-OpenStormBento::LtcBenContainer* pTmp(nullptr);
-sal_uLong ulRet = OpenStormBento::BenOpenContainer(pStream, );
-pBentoContainer.reset(pTmp);
+sal_uLong ulRet = OpenStormBento::BenOpenContainer(pStream, 
);
 if (ulRet != OpenStormBento::BenErr_OK)
 return aGrafData;
 }
@@ -361,7 +359,7 @@ sal_uInt32 
LwpGraphicObject::GetGrafData(std::unique_ptr& pGrafData
 // if small file, use the compressed stream for BENTO
 LwpSvStream* pStream = m_pStrm->GetCompressedStream() ?  
m_pStrm->GetCompressedStream(): m_pStrm;
 
-OpenStormBento::LtcBenContainer* pBentoContainer;
+std::unique_ptr pBentoContainer;
 sal_uLong ulRet = OpenStormBento::BenOpenContainer(pStream, 
);
 if (ulRet != OpenStormBento::BenErr_OK)
 return 0;
@@ -379,7 +377,7 @@ sal_uInt32 
LwpGraphicObject::GetGrafData(std::unique_ptr& pGrafData
 // get bento stream by the name
 pGrafStream = pBentoContainer->FindValueStreamWithPropertyName(sDName);
 
-

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

2018-10-22 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwptblformula.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7f44b106cf8876fdd56d4afdb656f652bffceaee
Author: Caolán McNamara 
AuthorDate: Mon Oct 22 15:53:11 2018 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 22 21:54:54 2018 +0200

simpler to use a vector

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

diff --git a/lotuswordpro/source/filter/lwptblformula.cxx 
b/lotuswordpro/source/filter/lwptblformula.cxx
index f539d16cf47d..4a1e6ecd8978 100644
--- a/lotuswordpro/source/filter/lwptblformula.cxx
+++ b/lotuswordpro/source/filter/lwptblformula.cxx
@@ -99,12 +99,12 @@ void LwpFormulaInfo::ReadText()
 m_pObjStrm->QuickReadInt16(); //Disk Size
 sal_uInt16 nStrLen = m_pObjStrm->QuickReadInt16();
 
-std::unique_ptr pBuf(new char[nStrLen+1]);
-m_pObjStrm->QuickRead( pBuf.get(), nStrLen );
-*(pBuf.get()+nStrLen)='\0';
+std::vector aBuf(nStrLen + 1);
+m_pObjStrm->QuickRead(aBuf.data(), nStrLen);
+aBuf[nStrLen]= '\0';
 OUString aText;
 aText += "\"";
-aText += OUString(pBuf.get(), nStrLen, osl_getThreadTextEncoding());
+aText += OUString(aBuf.data(), nStrLen, osl_getThreadTextEncoding());
 aText += "\"";
 
 m_aStack.push_back(o3tl::make_unique(aText));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-09-26 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwptblformula.cxx |   42 ++-
 lotuswordpro/source/filter/lwptblformula.hxx |2 -
 2 files changed, 18 insertions(+), 26 deletions(-)

New commits:
commit 1140eccc9f620de227efe381980ea06e0b455aed
Author: Noel Grandin 
AuthorDate: Tue Sep 25 15:25:04 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 26 09:00:21 2018 +0200

loplugin:useuniqueptr in LwpFormulaInfo

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

diff --git a/lotuswordpro/source/filter/lwptblformula.cxx 
b/lotuswordpro/source/filter/lwptblformula.cxx
index 4b8f56de0379..f539d16cf47d 100644
--- a/lotuswordpro/source/filter/lwptblformula.cxx
+++ b/lotuswordpro/source/filter/lwptblformula.cxx
@@ -67,6 +67,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 LwpFormulaArg::~LwpFormulaArg()
@@ -81,19 +82,13 @@ LwpFormulaArg::~LwpFormulaArg()
 
 LwpFormulaInfo::~LwpFormulaInfo()
 {
-while(m_aStack.size()>0)
-{
-LwpFormulaArg* pArg=m_aStack.back();
-m_aStack.pop_back();
-delete pArg; pArg=nullptr;
-}
 }
 
 void LwpFormulaInfo::ReadConst()
 {
 double Constant = m_pObjStrm->QuickReadDouble();
 
-m_aStack.push_back( new LwpFormulaConst(Constant) );
+m_aStack.push_back( o3tl::make_unique(Constant) );
 }
 
 /**
@@ -112,7 +107,7 @@ void LwpFormulaInfo::ReadText()
 aText += OUString(pBuf.get(), nStrLen, osl_getThreadTextEncoding());
 aText += "\"";
 
-m_aStack.push_back(new LwpFormulaText(aText));
+m_aStack.push_back(o3tl::make_unique(aText));
 }
 
 void LwpFormulaInfo::ReadCellID()
@@ -123,26 +118,24 @@ void LwpFormulaInfo::ReadCellID()
 RowSpecifier.QuickRead(m_pObjStrm.get());
 ColumnSpecifier.QuickRead(m_pObjStrm.get());
 
-m_aStack.push_back( new 
LwpFormulaCellAddr(ColumnSpecifier.ColumnID(cColumn),
+m_aStack.push_back( 
o3tl::make_unique(ColumnSpecifier.ColumnID(cColumn),
 
RowSpecifier.RowID(m_nFormulaRow)) );
 }
 
 void LwpFormulaInfo::ReadCellRange()
 {
 ReadCellID( ); // start
-LwpFormulaCellAddr* pStartCellAddr = 
static_cast(m_aStack.back());
+std::unique_ptr pStartCellAddr( 
static_cast(m_aStack.back().release()));
 m_aStack.pop_back();
 
 ReadCellID(); // end
-LwpFormulaCellAddr* pEndCellAddr = 
static_cast(m_aStack.back());
+std::unique_ptr 
pEndCellAddr(static_cast(m_aStack.back().release()));
 m_aStack.pop_back();
 
-m_aStack.push_back( new LwpFormulaCellRangeAddr(pStartCellAddr->GetCol(),
+m_aStack.push_back( 
o3tl::make_unique(pStartCellAddr->GetCol(),
 pStartCellAddr->GetRow(),
 pEndCellAddr->GetCol(),
 pEndCellAddr->GetRow()) );
-delete pStartCellAddr;
-delete pEndCellAddr;
 }
 
 /**
@@ -190,7 +183,7 @@ void LwpFormulaInfo::ReadExpression()
 {
 std::unique_ptr xFunc(new 
LwpFormulaFunc(TokenType));
 ReadArguments(*xFunc);
-m_aStack.push_back(xFunc.release());
+m_aStack.push_back(std::move(xFunc));
 }
 break;
 
@@ -211,18 +204,18 @@ void LwpFormulaInfo::ReadExpression()
 
 if (m_aStack.size() >= 2)
 {//binary operator
-LwpFormulaOp* pOp = new LwpFormulaOp(TokenType);
-
pOp->AddArg(std::unique_ptr(m_aStack.back())); 
m_aStack.pop_back();
-
pOp->AddArg(std::unique_ptr(m_aStack.back())); 
m_aStack.pop_back();
-m_aStack.push_back(pOp);
+std::unique_ptr pOp(new 
LwpFormulaOp(TokenType));
+pOp->AddArg(std::move(m_aStack.back())); 
m_aStack.pop_back();
+pOp->AddArg(std::move(m_aStack.back())); 
m_aStack.pop_back();
+m_aStack.push_back(std::move(pOp));
 }
 break;
 case TK_UNARY_MINUS:
 if (!m_aStack.empty())
 {
-LwpFormulaUnaryOp* pOp = new LwpFormulaUnaryOp(TokenType);
-
pOp->AddArg(std::unique_ptr(m_aStack.back())); 
m_aStack.pop_back();
-m_aStack.push_back(pOp);
+std::unique_ptr pOp(new 
LwpFormulaUnaryOp(TokenType));
+pOp->AddArg(std::move(m_aStack.back())); 
m_aStack.pop_back();
+m_aStack.push_back(std::move(pOp));
 }
 break;
 default:
@@ -293,7 +286,7 @@ void LwpFormulaInfo::ReadArguments(LwpFormulaFunc& aFunc)
 
 if (bArgument && !m_aStack.empty())
 {
-aFunc.AddArg(std::unique_ptr(m_aStack.back()));
+

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

2018-09-12 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwpbackgroundstuff.cxx |9 -
 lotuswordpro/source/filter/lwpdocdata.cxx |8 
 lotuswordpro/source/filter/xfilter/xfbase64.cxx   |   17 -
 3 files changed, 16 insertions(+), 18 deletions(-)

New commits:
commit e75baaa5dfffd96da55b892dd26ffec37ad5080c
Author: Noel Grandin 
AuthorDate: Mon Sep 10 10:27:57 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 12 08:56:42 2018 +0200

loplugin:useuniqueptr in lotuswordpro

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

diff --git a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx 
b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
index 4bce3d669545..b139682f46e9 100644
--- a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
+++ b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
@@ -147,15 +147,14 @@ std::unique_ptr 
LwpBackgroundStuff::GetFillPattern()
 aXOBitmap.Array2Bitmap();
 WriteDIB(aXOBitmap.GetBitmap(), aPicMemStream);
 sal_uInt32 nSize = aPicMemStream.GetEndOfData();
-sal_uInt8* pImageBuff = new sal_uInt8 [nSize];
-memcpy(pImageBuff, aPicMemStream.GetData(), nSize);
+std::unique_ptr pImageBuff(new sal_uInt8 [nSize]);
+memcpy(pImageBuff.get(), aPicMemStream.GetData(), nSize);
 
 // create XFBGImage object.
 std::unique_ptr xXFBGImage(new XFBGImage);
-xXFBGImage->SetImageData(pImageBuff, nSize);
+xXFBGImage->SetImageData(pImageBuff.get(), nSize);
 
-delete [] pImageBuff;
-pImageBuff = nullptr;
+pImageBuff.reset();
 
 xXFBGImage->SetRepeate();
 
diff --git a/lotuswordpro/source/filter/lwpdocdata.cxx 
b/lotuswordpro/source/filter/lwpdocdata.cxx
index 55d43f0e016b..e887515248ad 100644
--- a/lotuswordpro/source/filter/lwpdocdata.cxx
+++ b/lotuswordpro/source/filter/lwpdocdata.cxx
@@ -116,8 +116,8 @@ void LwpDocData::Read()
 
 //EditorList
 m_DocInfo.nNumEditedBy = m_pObjStrm->QuickReaduInt16();
-LwpAtomHolder* pCDLNList = new LwpAtomHolder[m_DocInfo.nNumEditedBy];
-LwpAtomHolder* pEditorList = new LwpAtomHolder[m_DocInfo.nNumEditedBy];
+std::unique_ptr pCDLNList(new 
LwpAtomHolder[m_DocInfo.nNumEditedBy]);
+std::unique_ptr pEditorList(new 
LwpAtomHolder[m_DocInfo.nNumEditedBy]);
 sal_uInt16 i = 0;
 for ( i = 0; i < m_DocInfo.nNumEditedBy; i++)
 {
@@ -131,8 +131,8 @@ void LwpDocData::Read()
 
 m_pObjStrm->SkipExtra();
 
-delete [] pCDLNList;
-delete [] pEditorList;
+pCDLNList.reset();
+pEditorList.reset();
 
 //doc control
 //cGreeting
diff --git a/lotuswordpro/source/filter/xfilter/xfbase64.cxx 
b/lotuswordpro/source/filter/xfilter/xfbase64.cxx
index 9e3787f2bab7..0a388f7b6a47 100644
--- a/lotuswordpro/source/filter/xfilter/xfbase64.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfbase64.cxx
@@ -58,6 +58,7 @@
  * Base64 tool.
  /
 #include 
+#include 
 #include "xfbase64.hxx"
 
 const  sal_Char aBase64EncodeTable[] =
@@ -95,7 +96,7 @@ inline void Encode_(const sal_uInt8 *src, sal_Char* dest)
  */
 OUString XFBase64::Encode(sal_uInt8 const *buf, sal_Int32 len)
 {
-sal_Char*buffer;
+std::unique_ptr buffer;
 sal_Int32   nNeeded;
 sal_Int32   cycles = len/3;
 sal_Int32   remain = len%3;
@@ -104,31 +105,29 @@ OUString XFBase64::Encode(sal_uInt8 const *buf, sal_Int32 
len)
 nNeeded = cycles*4;
 else
 nNeeded = (cycles+1)*4;
-buffer = new sal_Char[nNeeded+1];
+buffer.reset(new sal_Char[nNeeded+1]);
 
-memset(buffer, 0, nNeeded+1);
+memset(buffer.get(), 0, nNeeded+1);
 
 for( sal_Int32 i=0; ihttps://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-17 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwpdoc.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit c05692cbcdcc820bb98b53af6dca09d13c804c00
Author: Caolán McNamara 
AuthorDate: Fri Aug 17 09:15:02 2018 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 17 11:29:24 2018 +0200

ofz: infinite loop

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

diff --git a/lotuswordpro/source/filter/lwpdoc.cxx 
b/lotuswordpro/source/filter/lwpdoc.cxx
index 77dae05e68dc..a5ef2a7f4203 100644
--- a/lotuswordpro/source/filter/lwpdoc.cxx
+++ b/lotuswordpro/source/filter/lwpdoc.cxx
@@ -651,13 +651,16 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents()
 return this;
 
 LwpDocument* pDivision = GetFirstDivision();
-
+std::set aSeen;
 while (pDivision)
 {
+aSeen.insert(pDivision);
 LwpDocument* pContentDivision = 
pDivision->GetFirstDivisionWithContentsThatIsNotOLE();
-if(pContentDivision)
+if (pContentDivision)
 return pContentDivision;
 pDivision = pDivision->GetNextDivision();
+if (aSeen.find(pDivision) != aSeen.end())
+throw std::runtime_error("loop in conversion");
 }
 return nullptr;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-16 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwpgrfobj.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2dc14bee879903bd8824b0ca0ced2d48df7b19f2
Author: Stephan Bergmann 
AuthorDate: Thu Aug 16 10:07:14 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Aug 16 13:37:05 2018 +0200

-Werror,-Wformat (clang-cl)

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

diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx 
b/lotuswordpro/source/filter/lwpgrfobj.cxx
index 26b3b8a52be5..2fc8d2ee3380 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -316,7 +316,7 @@ void LwpGraphicObject::GetBentoNamebyID(LwpObjectID const & 
rMyID, std::string&
 sal_uInt32 nLow = rMyID.GetLow();
 char pTempStr[32];
 rName = std::string("Gr");
-sprintf(pTempStr, "%X,%X", nHigh, nLow);
+sprintf(pTempStr, "%X,%" SAL_PRIXUINT32, nHigh, nLow);
 rName.append(pTempStr);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-15 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwpgrfobj.cxx |   25 ++---
 1 file changed, 10 insertions(+), 15 deletions(-)

New commits:
commit aa7c6cccd896f4ad7357dc819c668983ffc979e6
Author: Caolán McNamara 
AuthorDate: Wed Aug 15 11:44:05 2018 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 15 14:59:50 2018 +0200

ofz#9910 Direct-leak

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

diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx 
b/lotuswordpro/source/filter/lwpgrfobj.cxx
index c732b611a0f1..26b3b8a52be5 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -112,7 +112,6 @@ void LwpGraphicObject::Read()
 m_sDataFormat[strsize] = '\0';
 }
 sal_uInt32 nServerContextSize = m_pObjStrm->QuickReaduInt32();
-unsigned char *pServerContext = nullptr;
 if (nServerContextSize > 0)
 {
 sal_uInt16 nMaxPossibleSize = m_pObjStrm->remainingSize();
@@ -123,16 +122,16 @@ void LwpGraphicObject::Read()
 nServerContextSize = nMaxPossibleSize;
 }
 
-pServerContext = new unsigned char[nServerContextSize];
-m_pObjStrm->QuickRead(pServerContext, 
static_cast(nServerContextSize));
+std::vector aServerContext(nServerContextSize);
+m_pObjStrm->QuickRead(aServerContext.data(), 
static_cast(nServerContextSize));
 if (nServerContextSize > 44)
 {
-m_aIPData.nBrightness = pServerContext[14];
-m_aIPData.nContrast = pServerContext[19];
-m_aIPData.nEdgeEnchancement = pServerContext[24];
-m_aIPData.nSmoothing = pServerContext[29];
-m_aIPData.bInvertImage = (pServerContext[34] == 0x01);
-m_aIPData.bAutoContrast = (pServerContext[44] == 0x00);
+m_aIPData.nBrightness = aServerContext[14];
+m_aIPData.nContrast = aServerContext[19];
+m_aIPData.nEdgeEnchancement = aServerContext[24];
+m_aIPData.nSmoothing = aServerContext[29];
+m_aIPData.bInvertImage = (aServerContext[34] == 0x01);
+m_aIPData.bAutoContrast = (aServerContext[44] == 0x00);
 }
 }
 m_pObjStrm->QuickReaduInt16(); //disksize
@@ -153,7 +152,6 @@ void LwpGraphicObject::Read()
 }
 m_nCachedBaseLine = m_pObjStrm->QuickReadInt32();
 m_bIsLinked = m_pObjStrm->QuickReadInt16();
-unsigned char * pFilterContext = nullptr;
 
 if (m_bIsLinked)
 {
@@ -170,8 +168,8 @@ void LwpGraphicObject::Read()
 nFilterContextSize = nMaxPossibleSize;
 }
 
-pFilterContext = new unsigned char[nFilterContextSize];
-m_pObjStrm->QuickRead(pFilterContext, 
static_cast(nFilterContextSize));
+std::vector aFilterContext(nFilterContextSize);
+m_pObjStrm->QuickRead(aFilterContext.data(), 
static_cast(nFilterContextSize));
 }
 if (LwpFileHeader::m_nFileRevision >= 0x000b)
 {
@@ -200,9 +198,6 @@ void LwpGraphicObject::Read()
 {
 m_WatermarkName = m_pObjStrm->QuickReadStringPtr();
 }
-
-delete[] pServerContext;
-delete[] pFilterContext;
 }
 
 void LwpGraphicObject::XFConvert (XFContentContainer* pCont)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-14 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwpobjstrm.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 87b26787804cf1839d1eefd54854e647f716d934
Author: Caolán McNamara 
AuthorDate: Tue Aug 14 08:40:05 2018 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 14 14:44:55 2018 +0200

abandon import on bad entry

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

diff --git a/lotuswordpro/source/filter/lwpobjstrm.cxx 
b/lotuswordpro/source/filter/lwpobjstrm.cxx
index b1b9744da682..4ac9fd11d6a5 100644
--- a/lotuswordpro/source/filter/lwpobjstrm.cxx
+++ b/lotuswordpro/source/filter/lwpobjstrm.cxx
@@ -57,7 +57,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -372,11 +371,9 @@ OUString LwpObjectStream::QuickReadStringPtr()
 QuickReaduInt16(); //len
 
 OUString str;
-if (diskSize >= sizeof diskSize) {
-LwpTools::QuickReadUnicode(this, str, diskSize-sizeof(diskSize), 
RTL_TEXTENCODING_MS_1252);
-} else {
-SAL_WARN("lwp", "Too small size " << diskSize);
-}
+if (diskSize < sizeof diskSize)
+throw std::range_error("Too small size");
+LwpTools::QuickReadUnicode(this, str, diskSize-sizeof(diskSize), 
RTL_TEXTENCODING_MS_1252);
 return str;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-29 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwpnumericfmt.cxx |2 +-
 sw/source/core/doc/tblcpy.cxx|2 +-
 xmloff/source/text/XMLRedlineExport.cxx  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e9112e17efa0e59078a5f921a22855db317a
Author: Andrea Gelmini 
AuthorDate: Thu Jul 26 16:09:23 2018 +0200
Commit: Julien Nabet 
CommitDate: Sun Jul 29 17:32:09 2018 +0200

Fix typos

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

diff --git a/lotuswordpro/source/filter/lwpnumericfmt.cxx 
b/lotuswordpro/source/filter/lwpnumericfmt.cxx
index 2d41599f798f..313c3c3d275e 100644
--- a/lotuswordpro/source/filter/lwpnumericfmt.cxx
+++ b/lotuswordpro/source/filter/lwpnumericfmt.cxx
@@ -353,7 +353,7 @@ XFStyle* LwpNumericFormat::Convert()
static_cast(aColor.GetGreen()),
static_cast(aColor.GetBlue())) );
 }
-{//Negtive
+{//Negative
 pStyle->SetNegativeStyle( aNegPrefix, aNegSuffix, 
XFColor(static_cast(aNegativeColor.GetRed()),
 
static_cast(aNegativeColor.GetGreen()),
 
static_cast(aNegativeColor.GetBlue())) );
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index fa0b16627fc0..bd63396d6340 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -601,7 +601,7 @@ static void lcl_CpyBox( const SwTable& rCpyTable, const 
SwTableBox* pCpyBox,
 if( bReplaceColl &&
 (( 1 < rDstTable.GetTabLines().size() &&
 pLine == rDstTable.GetTabLines().front() )
-// Is the Table's content sill valid?
+// Is the Table's content still valid?
 ? RES_POOLCOLL_TABLE == nPoolId
 : RES_POOLCOLL_TABLE_HDLN == nPoolId ) )
 {
diff --git a/xmloff/source/text/XMLRedlineExport.cxx 
b/xmloff/source/text/XMLRedlineExport.cxx
index 6e23cd2d4743..fa494e86396a 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -368,7 +368,7 @@ void XMLRedlineExport::ExportChangedRegion(
 //   be exported there
 }
 
-// changed change? Hierarchical changes can onl be two levels
+// changed change? Hierarchical changes can only be two levels
 // deep. Here we check for the second level.
 aAny = rPropSet->getPropertyValue("RedlineSuccessorData");
 Sequence aSuccessorData;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-28 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwpstory.cxx   |7 ---
 lotuswordpro/source/filter/lwptblformula.cxx  |   12 ++--
 lotuswordpro/source/filter/xfilter/xfdrawpath.cxx |   17 ++---
 lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx  |9 +
 lotuswordpro/source/filter/xfilter/xfdrawpolyline.cxx |9 +
 5 files changed, 30 insertions(+), 24 deletions(-)

New commits:
commit 0c64757b574f8dcffe76087db34310786029e625
Author: Noel Grandin 
AuthorDate: Sat Jul 28 11:30:44 2018 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 28 17:23:33 2018 +0200

loplugin:stringloop in lotuswordpro

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

diff --git a/lotuswordpro/source/filter/lwpstory.cxx 
b/lotuswordpro/source/filter/lwpstory.cxx
index 320400ea01e5..b0f9586270e2 100644
--- a/lotuswordpro/source/filter/lwpstory.cxx
+++ b/lotuswordpro/source/filter/lwpstory.cxx
@@ -66,6 +66,7 @@
 #include "lwppara.hxx"
 #include 
 #include "lwppagelayout.hxx"
+#include 
 
 #include 
 
@@ -427,16 +428,16 @@ OUString LwpStory::GetContentText(bool bAllText)
 {
 if (bAllText)//convert all text fribs
 {
-OUString sText("");
+OUStringBuffer sText;
 //process para list
 LwpPara* pPara = dynamic_cast(GetFirstPara().obj().get());
 while (pPara)
 {
 pPara->SetFoundry(m_pFoundry);
-sText += pPara->GetContentText(true);
+sText.append(pPara->GetContentText(true));
 pPara = dynamic_cast(pPara->GetNext().obj().get());
 }
-return sText;
+return sText.makeStringAndClear();
 }
 else //only the first text frib
 {
diff --git a/lotuswordpro/source/filter/lwptblformula.cxx 
b/lotuswordpro/source/filter/lwptblformula.cxx
index c0d00f9a22f1..768e54f14a65 100644
--- a/lotuswordpro/source/filter/lwptblformula.cxx
+++ b/lotuswordpro/source/filter/lwptblformula.cxx
@@ -441,29 +441,29 @@ OUString LwpFormulaFunc::ToArgString(LwpTableLayout* 
pCellsMap)
 */
 OUString LwpFormulaFunc::ToString(LwpTableLayout* pCellsMap)
 {
-OUString aFormula;
+OUStringBuffer aFormula;
 
 OUString aFuncName = LwpFormulaTools::GetName(m_nTokenType);
-aFormula += aFuncName;
-aFormula += " ";//Append a blank space
+aFormula.append(aFuncName);
+aFormula.append(" ");//Append a blank space
 
 //Append args
 for (auto const& elem : m_aArgs)
 {
-aFormula += elem->ToArgString(pCellsMap) + "|"; //separator
+aFormula.append(elem->ToArgString(pCellsMap)).append("|"); //separator
 }
 
 //erase the last "|"
 if (!m_aArgs.empty())
 {
-aFormula = aFormula.replaceAt(aFormula.getLength()-1,1,"");
+aFormula.setLength(aFormula.getLength()-1);
 }
 else
 {
 assert(false);
 }
 
-return aFormula;
+return aFormula.makeStringAndClear();
 }
 
 /**
diff --git a/lotuswordpro/source/filter/xfilter/xfdrawpath.cxx 
b/lotuswordpro/source/filter/xfilter/xfdrawpath.cxx
index f5cd90b1102a..e9ae753773a4 100644
--- a/lotuswordpro/source/filter/xfilter/xfdrawpath.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfdrawpath.cxx
@@ -58,6 +58,7 @@
  * Draw path object.
  /
 #include 
+#include 
 
 XFSvgPathEntry::XFSvgPathEntry()
 {
@@ -66,13 +67,14 @@ XFSvgPathEntry::XFSvgPathEntry()
 OUString XFSvgPathEntry::ToString()
 {
 assert(!m_strCommand.isEmpty());
-OUString str = m_strCommand;
+OUStringBuffer str = m_strCommand;
 
 for (auto const& point : m_aPoints)
 {
-str += OUString::number(point.GetX()*1000) + " " + 
OUString::number(point.GetY()*1000) + " ";
+str.append(OUString::number(point.GetX()*1000)).append(" 
").append(OUString::number(point.GetY()*1000)).append(" ");
 }
-return str.trim();
+str.stripEnd(' ');
+return str.makeStringAndClear();
 }
 
 XFDrawPath::XFDrawPath()
@@ -132,13 +134,14 @@ voidXFDrawPath::ToXml(IXFStream *pStrm)
 pAttrList->AddAttribute( "svg:viewBox", strViewBox);
 
 //points
-OUString   strPath;
+OUStringBuffer strPath;
 for (auto & path : m_aPaths)
 {
-strPath += path.ToString();
+strPath.append(path.ToString());
 }
-strPath = strPath.trim();
-pAttrList->AddAttribute( "svg:d", strPath);
+if (!strPath.isEmpty())
+strPath.setLength(strPath.getLength()-1);
+pAttrList->AddAttribute( "svg:d", strPath.makeStringAndClear());
 
 SetPosition(rect);
 XFDrawObject::ToXml(pStrm);
diff --git a/lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx 
b/lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx
index 6159bff3f80a..6b50db7c56ed 100644
--- a/lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx
@@ 

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

2018-07-27 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwplayout.cxx |   31 ---
 lotuswordpro/source/filter/lwplayout.hxx |   12 ++--
 2 files changed, 26 insertions(+), 17 deletions(-)

New commits:
commit d97dd0d7e9075f5cdb5f3b6a62256d0fdca6d425
Author: Caolán McNamara 
AuthorDate: Fri Jul 27 08:58:56 2018 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 27 17:15:10 2018 +0200

ofz#9603 infinite recursion

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

diff --git a/lotuswordpro/source/filter/lwplayout.cxx 
b/lotuswordpro/source/filter/lwplayout.cxx
index 487058cbb08b..5e548d1a6019 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -588,6 +588,7 @@ void LwpLayoutMisc::Read(LwpObjectStream* pStrm)
 LwpMiddleLayout::LwpMiddleLayout( LwpObjectHeader const , LwpSvStream* 
pStrm )
 : LwpVirtualLayout(objHdr, pStrm)
 , m_bGettingGeometry(false)
+, m_bGettingBackgroundStuff(false)
 {
 }
 
@@ -655,21 +656,28 @@ rtl::Reference 
LwpMiddleLayout::GetBasedOnStyle()
 * @descr:   Get the geometry of current layout
 *
 */
-LwpLayoutGeometry* LwpMiddleLayout::Geometry()
+LwpLayoutGeometry* LwpMiddleLayout::GetGeometry()
 {
+if (m_bGettingGeometry)
+throw std::runtime_error("recursion in layout");
+m_bGettingGeometry = true;
+
+LwpLayoutGeometry* pRet = nullptr;
 if( !m_LayGeometry.IsNull() )
 {
-return dynamic_cast (m_LayGeometry.obj().get());
+pRet = dynamic_cast (m_LayGeometry.obj().get());
 }
 else
 {
 rtl::Reference xBase(GetBasedOnStyle());
 if (LwpMiddleLayout* pLay = 
dynamic_cast(xBase.get()))
 {
-return pLay->GetGeometry();
+pRet = pLay->GetGeometry();
 }
 }
-return nullptr;
+
+m_bGettingGeometry = false;
+return pRet;
 }
 
 /**
@@ -818,21 +826,30 @@ LwpBorderStuff* LwpMiddleLayout::GetBorderStuff()
 */
 LwpBackgroundStuff* LwpMiddleLayout::GetBackgroundStuff()
 {
+if (m_bGettingBackgroundStuff)
+throw std::runtime_error("recursion in layout");
+m_bGettingBackgroundStuff = true;
+
+LwpBackgroundStuff* pRet = nullptr;
+
 if(m_nOverrideFlag & OVER_BACKGROUND)
 {
 LwpLayoutBackground* pLayoutBackground = 
dynamic_cast(m_LayBackgroundStuff.obj().get());
-return pLayoutBackground ? >GetBackgoudStuff() : 
nullptr;
+pRet = pLayoutBackground ? >GetBackgoudStuff() : 
nullptr;
 }
 else
 {
 rtl::Reference xBase(GetBasedOnStyle());
 if (LwpMiddleLayout* pLay = 
dynamic_cast(xBase.get()))
 {
-return pLay->GetBackgroundStuff();
+pRet = pLay->GetBackgroundStuff();
 }
 }
-return nullptr;
+
+m_bGettingBackgroundStuff = false;
+return pRet;
 }
+
 /**
  * @descr:  create xfborder.
 */
diff --git a/lotuswordpro/source/filter/lwplayout.hxx 
b/lotuswordpro/source/filter/lwplayout.hxx
index 2d0694b67864..98d7ca515906 100644
--- a/lotuswordpro/source/filter/lwplayout.hxx
+++ b/lotuswordpro/source/filter/lwplayout.hxx
@@ -347,19 +347,11 @@ class LwpMiddleLayout : public LwpVirtualLayout
 public:
 LwpMiddleLayout( LwpObjectHeader const , LwpSvStream* pStrm );
 virtual ~LwpMiddleLayout() override;
-LwpLayoutGeometry* GetGeometry()
-{
-if (m_bGettingGeometry)
-throw std::runtime_error("recursion in layout");
-m_bGettingGeometry = true;
-auto pRet = Geometry();
-m_bGettingGeometry = false;
-return pRet;
-}
 double GetGeometryHeight();
 double GetGeometryWidth();
 LwpBorderStuff* GetBorderStuff();
 LwpBackgroundStuff* GetBackgroundStuff();
+LwpLayoutGeometry* GetGeometry();
 enumXFTextDir GetTextDirection();
 XFBorders* GetXFBorders();
 LwpColor* GetBackColor();
@@ -402,7 +394,6 @@ protected:
 virtual bool IsAutoGrowDown() override;
 private:
 LwpObjectID m_BasedOnStyle;
-LwpLayoutGeometry* Geometry();
 protected:
 enum
 {
@@ -422,6 +413,7 @@ protected:
 LwpObjectID m_LayBackgroundStuff;
 LwpObjectID m_LayExtBorderStuff;
 boolm_bGettingGeometry;
+boolm_bGettingBackgroundStuff;
 public:
 LwpObjectID& GetContent() { return m_Content; }
 LwpTabOverride* GetTabOverride();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-20 Thread Libreoffice Gerrit user
 lotuswordpro/source/filter/lwplayout.cxx |2 +-
 lotuswordpro/source/filter/lwppagelayout.cxx |4 ++--
 vcl/unx/generic/print/genprnpsp.cxx  |4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f61cff7f039153c1296ea823316fbebee6c895a8
Author: Andrea Gelmini 
AuthorDate: Fri Jul 20 10:23:48 2018 +0200
Commit: Julien Nabet 
CommitDate: Fri Jul 20 12:35:10 2018 +0200

Fix typos

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

diff --git a/lotuswordpro/source/filter/lwplayout.cxx 
b/lotuswordpro/source/filter/lwplayout.cxx
index 4423178aeeeb..487058cbb08b 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -1377,7 +1377,7 @@ rtl::Reference 
LwpMiddleLayout::GetWaterMarkLayout()
 }
 
 /**
-* @descr:   Create and reture xfbgimage object for watermark
+* @descr:   Create and return xfbgimage object for watermark
 *
 */
 std::unique_ptr LwpMiddleLayout::GetXFBGImage()
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx 
b/lotuswordpro/source/filter/lwppagelayout.cxx
index 5a00d5368778..b3d58c692542 100644
--- a/lotuswordpro/source/filter/lwppagelayout.cxx
+++ b/lotuswordpro/source/filter/lwppagelayout.cxx
@@ -578,7 +578,7 @@ double LwpPageLayout::GetMarginWidth()
   =LAST_LAYOUTPAGENO, return the last page number 
that current page layout covers
else, return the specified page number that 
current page layout covers
  * @param:
- * @return:  if reture value >=0, success to find the page number, or fail.
+ * @return:  if return value >=0, success to find the page number, or fail.
 */
 sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber)
 {
@@ -609,7 +609,7 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 
nLayoutNumber)
 nPageNumber = nNumber;
 if(pPageHint->GetNext().IsNull())
 {
-//if is last page number of entire document, reture 
directly
+//if is last page number of entire document, return 
directly
 return nPageNumber + pDoc->GetNumberOfPagesBefore();
 }
 }
diff --git a/vcl/unx/generic/print/genprnpsp.cxx 
b/vcl/unx/generic/print/genprnpsp.cxx
index d30a518457b5..58c70696fab1 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -569,8 +569,8 @@ bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* 
pJobSetup )
 return true;
 }
 
-// This function merges the independ driver data
-// and sets the new independ data in pJobSetup
+// This function merges the independent driver data
+// and sets the new independent data in pJobSetup
 // Only the data must be changed, where the bit
 // in nGetDataFlags is set
 bool PspSalInfoPrinter::SetData(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-24 Thread Andrea Gelmini
 lotuswordpro/source/filter/lwpfoundry.cxx |2 +-
 sw/source/core/unocore/unomap.cxx |2 +-
 sw/source/uibase/utlui/content.cxx|4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit bef51263c2904fbee0d1283f0cbd32d89af1cbe4
Author: Andrea Gelmini 
Date:   Sat Jun 23 14:28:45 2018 +0200

Fix typos

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

diff --git a/lotuswordpro/source/filter/lwpfoundry.cxx 
b/lotuswordpro/source/filter/lwpfoundry.cxx
index 2f56998ee4b7..40420d92244c 100644
--- a/lotuswordpro/source/filter/lwpfoundry.cxx
+++ b/lotuswordpro/source/filter/lwpfoundry.cxx
@@ -442,7 +442,7 @@ LwpOrderedObject* 
LwpOrderedObjectManager::Enumerate(LwpOrderedObject * pLast)
 LwpListList* pList = nullptr;
 if(pLast)
 {
-// We're at the end of Last's list (not Liszt's list).
+// We're at the end of Last's list (not list's list).
 // Start with the next active list
 pList = dynamic_cast(pLast->GetListList().obj().get());
 pList= GetNextActiveListList(pList);
diff --git a/sw/source/core/unocore/unomap.cxx 
b/sw/source/core/unocore/unomap.cxx
index 3dffbe6859fc..1c242d610de7 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -328,7 +328,7 @@ const SfxItemPropertyMapEntry* 
SwUnoPropertyMapProvider::GetPropertyMapEntries(s
 cppu::UnoType::get(),
 PropertyAttribute::READONLY, 0},
 // #i71182#
-// missing map entry for property 
+// missing map entry for property 
 { OUString(UNO_NAME_PAGE_TOGGLE), RES_HORI_ORIENT,  
cppu::UnoType::get(), PROPERTY_NONE ,MID_HORIORIENT_PAGETOGGLE },
 { OUString(UNO_NAME_RELATIVE_HEIGHT), RES_FRM_SIZE, 
cppu::UnoType::get()  , PROPERTY_NONE, 
MID_FRMSIZE_REL_HEIGHT },
 { OUString(UNO_NAME_RELATIVE_HEIGHT_RELATION), 
RES_FRM_SIZE, cppu::UnoType::get(),  PROPERTY_NONE, 
MID_FRMSIZE_REL_HEIGHT_RELATION },
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 5ed2db49a19d..645469eb143f 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -393,7 +393,7 @@ void SwContentType::Init(bool* pbInvalidateWindow)
 if(nullptr != pbInvalidateWindow)
 {
 // need to check visibility (and equal entry number) after
-// creation due to a sorted liszt being used here (before,
+// creation due to a sorted list being used here (before,
 // entries with same index were compared already at 
creation
 // time what worked before a sorted list was used)
 *pbInvalidateWindow = checkVisibilityChanged(
@@ -689,7 +689,7 @@ void SwContentType::FillMemberList(bool* 
pbLevelOrVisibilityChanged)
 if(nullptr != pbLevelOrVisibilityChanged)
 {
 // need to check visibility (and equal entry number) after
-// creation due to a sorted liszt being used here (before,
+// creation due to a sorted list being used here (before,
 // entries with same index were compared already at 
creation
 // time what worked before a sorted list was used)
 *pbLevelOrVisibilityChanged = checkVisibilityChanged(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-08 Thread Caolán McNamara
 lotuswordpro/source/filter/lwplayout.cxx |   15 ---
 lotuswordpro/source/filter/lwplayout.hxx |1 +
 2 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 02c9756f52565e9c13507a9a4d60d33bc18609c4
Author: Caolán McNamara 
Date:   Tue May 8 12:43:47 2018 +0100

ofz#8161 avoid recurse to death

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

diff --git a/lotuswordpro/source/filter/lwplayout.cxx 
b/lotuswordpro/source/filter/lwplayout.cxx
index 166320b0c565..4423178aeeeb 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -84,6 +84,7 @@ LwpVirtualLayout::LwpVirtualLayout(LwpObjectHeader const 
, LwpSvStream* p
 , m_bGettingExtMarginsValue(false)
 , m_bGettingUsePrinterSettings(false)
 , m_bGettingScaleCenter(false)
+, m_bGettingBorderStuff(false)
 , m_bGettingUseWhen(false)
 , m_bGettingStyleLayout(false)
 , m_nAttributes(0)
@@ -788,20 +789,28 @@ double LwpMiddleLayout::ExtMarginsValue(sal_uInt8 
nWhichSide)
 */
 LwpBorderStuff* LwpMiddleLayout::GetBorderStuff()
 {
+if (m_bGettingBorderStuff)
+throw std::runtime_error("recursion in layout");
+m_bGettingBorderStuff = true;
+
+LwpBorderStuff* pRet = nullptr;
+
 if(m_nOverrideFlag & OVER_BORDERS)
 {
 LwpLayoutBorder* pLayoutBorder = 
dynamic_cast(m_LayBorderStuff.obj().get());
-return pLayoutBorder ? >GetBorderStuff() : nullptr;
+pRet = pLayoutBorder ? >GetBorderStuff() : nullptr;
 }
 else
 {
 rtl::Reference xBase(GetBasedOnStyle());
 if (LwpMiddleLayout* pLay = 
dynamic_cast(xBase.get()))
 {
-return pLay->GetBorderStuff();
+pRet = pLay->GetBorderStuff();
 }
 }
-return nullptr;
+
+m_bGettingBorderStuff= false;
+return pRet;
 }
 
 /**
diff --git a/lotuswordpro/source/filter/lwplayout.hxx 
b/lotuswordpro/source/filter/lwplayout.hxx
index b3685f587945..2d0694b67864 100644
--- a/lotuswordpro/source/filter/lwplayout.hxx
+++ b/lotuswordpro/source/filter/lwplayout.hxx
@@ -238,6 +238,7 @@ protected:
 bool m_bGettingExtMarginsValue;
 bool m_bGettingUsePrinterSettings;
 bool m_bGettingScaleCenter;
+bool m_bGettingBorderStuff;
 bool m_bGettingUseWhen;
 bool m_bGettingStyleLayout;
 sal_uInt32 m_nAttributes;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   4   >