[Libreoffice-commits] core.git: forms/source include/svtools include/vcl svtools/source svx/source toolkit/inc toolkit/source vcl/qa vcl/source

2021-08-29 Thread Chris Sherlock (via logerrit)
 forms/source/richtext/richtextcontrol.cxx  |2 
 forms/source/richtext/richtextvclcontrol.cxx   |2 
 forms/source/richtext/richtextvclcontrol.hxx   |2 
 include/svtools/brwbox.hxx |2 
 include/vcl/InterimItemWindow.hxx  |3 -
 include/vcl/headbar.hxx|2 
 include/vcl/outdev.hxx |2 
 include/vcl/print.hxx  |1 
 include/vcl/rendercontext/SystemTextColorFlags.hxx |   37 +++
 include/vcl/scrbar.hxx |4 -
 include/vcl/tabpage.hxx|2 
 include/vcl/toolkit/button.hxx |   18 +++
 include/vcl/toolkit/combobox.hxx   |2 
 include/vcl/toolkit/dialog.hxx |2 
 include/vcl/toolkit/edit.hxx   |2 
 include/vcl/toolkit/fixed.hxx  |   10 ++--
 include/vcl/toolkit/group.hxx  |4 -
 include/vcl/toolkit/imgctrl.hxx|2 
 include/vcl/toolkit/lstbox.hxx |2 
 include/vcl/toolkit/spin.hxx   |2 
 include/vcl/toolkit/spinfld.hxx|2 
 include/vcl/toolkit/vclmedit.hxx   |2 
 include/vcl/window.hxx |   15 --
 svtools/source/brwbox/brwbox2.cxx  |2 
 svtools/source/brwbox/editbrowsebox.cxx|2 
 svx/source/fmcomp/gridcell.cxx |2 
 toolkit/inc/controls/filectrl.hxx  |2 
 toolkit/source/awt/vclxtabpagecontainer.cxx|2 
 toolkit/source/awt/vclxwindow.cxx  |4 -
 toolkit/source/awt/vclxwindows.cxx |8 +--
 toolkit/source/controls/filectrl.cxx   |2 
 vcl/qa/cppunit/outdev.cxx  |   20 
 vcl/source/control/InterimItemWindow.cxx   |5 +-
 vcl/source/control/button.cxx  |   50 ++---
 vcl/source/control/combobox.cxx|4 -
 vcl/source/control/edit.cxx|4 -
 vcl/source/control/fixed.cxx   |   18 +++
 vcl/source/control/imgctrl.cxx |2 
 vcl/source/control/listbox.cxx |4 -
 vcl/source/control/scrbar.cxx  |   20 
 vcl/source/control/spinbtn.cxx |4 -
 vcl/source/control/spinfld.cxx |6 +-
 vcl/source/edit/vclmedit.cxx   |   19 ---
 vcl/source/gdi/print.cxx   |5 ++
 vcl/source/outdev/text.cxx |   16 ++
 vcl/source/toolkit/group.cxx   |   18 +++
 vcl/source/treelist/headbar.cxx|4 -
 vcl/source/window/dialog.cxx   |2 
 vcl/source/window/tabpage.cxx  |2 
 vcl/source/window/window.cxx   |2 
 50 files changed, 203 insertions(+), 148 deletions(-)

New commits:
commit a2c8195f465a2e4346169d2b586c34e8fbed253c
Author: Chris Sherlock 
AuthorDate: Wed May 12 20:01:05 2021 +1000
Commit: Mike Kaganski 
CommitDate: Mon Aug 30 06:09:49 2021 +0200

tdf#74702 vcl: introduce GetSystemTextColor()

Also rename DrawFlags to SystemDrawColorFlags, added a unit test.

Change-Id: I3cb74b278e43561d1055b3b55b9730cdbdea51aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113559
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/forms/source/richtext/richtextcontrol.cxx 
b/forms/source/richtext/richtextcontrol.cxx
index 45e898b8ed13..7aeb8410b568 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -330,7 +330,7 @@ namespace frm
 if ( eTargetUnit != MapUnit::MapPixel )
 aPos = pTargetDevice->PixelToLogic( aPos );
 
-pControl->Draw( pTargetDevice, aPos, DrawFlags::NoControls );
+pControl->Draw( pTargetDevice, aPos, SystemTextColorFlags::NoControls 
);
 }
 
 
diff --git a/forms/source/richtext/richtextvclcontrol.cxx 
b/forms/source/richtext/richtextvclcontrol.cxx
index 0df141693f54..ff570eb74efa 100644
--- a/forms/source/richtext/richtextvclcontrol.cxx
+++ b/forms/source/richtext/richtextvclcontrol.cxx
@@ -288,7 +288,7 @@ namespace frm
 return bDone || Control::EventNotify(_rNEvt);
 }
 
-void RichTextControl::Draw( OutputDevice* _pDev, const Point& _rPos, 
DrawFlags /*_nFlags*/ )
+void RichTextControl::Draw( OutputDevice* _pDev, const Point& _rPos, 
SystemTextColorFlags /*_nFlags*/ )
 {
 m_pImpl->Draw( _pDev, _rPos, _pDev->PixelToLogic(GetSizePixel()) );
 }
diff --git a/forms/source/richtext/richtextvclcontrol.hxx 
b/forms/source/richtext/richtextvclcontrol.hxx
index 58448c34cd11..92d0

[Libreoffice-commits] core.git: desktop/source include/vcl sw/source vcl/inc vcl/Library_vcl.mk vcl/qa vcl/source

2021-08-29 Thread Chris Sherlock (via logerrit)
 desktop/source/lib/init.cxx |2 +-
 include/vcl/outdev.hxx  |   19 +++
 include/vcl/window.hxx  |2 +-
 sw/source/core/inc/drawfont.hxx |   10 ++
 sw/source/core/inc/fntcache.hxx |2 +-
 sw/source/core/text/inftxt.cxx  |6 +++---
 sw/source/core/text/inftxt.hxx  |   14 +++---
 sw/source/core/text/porfld.cxx  |2 +-
 sw/source/core/text/pormulti.cxx|2 +-
 sw/source/core/txtnode/fntcache.cxx |2 +-
 vcl/Library_vcl.mk  |1 +
 vcl/inc/TextLayoutCache.hxx |   18 --
 vcl/inc/sallayout.hxx   |8 
 vcl/qa/cppunit/text.cxx |6 +++---
 vcl/source/gdi/CommonSalLayout.cxx  |   12 ++--
 vcl/source/gdi/sallayout.cxx|2 +-
 vcl/source/outdev/text.cxx  |   14 +++---
 vcl/source/text/TextLayoutCache.cxx |   36 
 vcl/source/window/window3.cxx   |2 +-
 19 files changed, 96 insertions(+), 64 deletions(-)

New commits:
commit 229136b7c9363bc758c9e925ccfd0c9bb34ceaec
Author: Chris Sherlock 
AuthorDate: Sun Aug 29 00:59:08 2021 +1000
Commit: Tomaž Vajngerl 
CommitDate: Mon Aug 30 02:46:33 2021 +0200

vcl: move TextLayoutCache into vcl::text namespace

Placed TextLayoutCache function into own source file and moved it into
the new vcl::text namespace. With this patch we will have these vcl::*
namespaces:

namespace vcl::bitmap
namespace vcl::CommandInfoProvider
namespace vcl::detail
namespace vcl::drawmode
namespace vcl::fileregistration
namespace vcl::filter
namespace vcl::font
namespace vcl::graphic
namespace vcl::lok
namespace vcl::pdf
namespace vcl::table
namespace vcl::test
  namespace vcl::text
namespace vcl::unohelper
namespace vcl::unotools

Change-Id: Ia38c2d73715676a924cdbb0de6308a72a40ec3b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121206
Reviewed-by: Hossein 
Reviewed-by: Tomaž Vajngerl 
Tested-by: Tomaž Vajngerl 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index da8c0d5a1595..709b42038a0e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4543,7 +4543,7 @@ static bool doc_paste(LibreOfficeKitDocument* pThis, 
const char* pMimeType, cons
 
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence(
 {
-{"AnchorType", 
uno::makeAny(static_cast(text::TextContentAnchorType_AS_CHARACTER))},
+{"AnchorType", 
uno::makeAny(static_cast(css::text::TextContentAnchorType_AS_CHARACTER))},
 {"IgnoreComments", uno::makeAny(true)},
 }));
 if (!comphelper::dispatchCommand(".uno:Paste", aPropertyValues))
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 144a52308a3e..402b998bc1aa 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -101,12 +101,15 @@ namespace vcl
 class ExtOutDevData;
 class ITextLayout;
 struct FontCapabilities;
-class TextLayoutCache;
 class Window;
 class WindowOutputDevice;
 namespace font {
 struct Feature;
 }
+
+namespace text {
+class TextLayoutCache;
+}
 }
 
 namespace basegfx {
@@ -1027,7 +1030,7 @@ public:
 See also GetTextBoundRect() for more explanation + code examples.
 */
 tools::LongGetTextWidth( const OUString& rStr, 
sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
-  vcl::TextLayoutCache const* = nullptr,
+  vcl::text::TextLayoutCache const* = nullptr,
   SalLayoutGlyphs const*const pLayoutCache = 
nullptr) const;
 
 /** Height where any character of the current font fits; in logic 
coordinates.
@@ -1045,7 +1048,7 @@ public:
const SalLayoutGlyphs* 
pLayoutCache = nullptr);
 tools::LongGetTextArray( const OUString& rStr, 
tools::Long* pDXAry,
   sal_Int32 nIndex = 0, sal_Int32 
nLen = -1,
-  vcl::TextLayoutCache const* = 
nullptr,
+  vcl::text::TextLayoutCache 
const* = nullptr,
   SalLayoutGlyphs const*const 
pLayoutCache = nullptr) const;
 
 voidGetCaretPositions( const OUString&, 
tools::Long* pCaretXArray,
@@ -1057,14 +1060,14 @@ public:
 sal_Int32   GetTextBreak( const OUString& rStr, 
tools::Long nTextWidth,
   sal_Int32 nIndex, sal_Int32 nLen 
= -1,
   tools::Long nCharExtra = 0,
-  vcl::TextLayoutCache const* = 
nullptr,
+   

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

2021-08-29 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/itiff/ccidecom.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d350a1364a1c34b96d00f2f716c44882b7b57fe9
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 15:18:08 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 22:11:51 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/vcl/source/filter/itiff/ccidecom.cxx 
b/vcl/source/filter/itiff/ccidecom.cxx
index 407aab17d669..a1dbd8256201 100644
--- a/vcl/source/filter/itiff/ccidecom.cxx
+++ b/vcl/source/filter/itiff/ccidecom.cxx
@@ -795,7 +795,7 @@ bool CCIDecompressor::Read2DTag()
 {
 // read a bit and return sal_True if it's 0, otherwise return sal_False
 if (nInputBitsBufSize==0) {
-sal_uInt8 nByte;
+sal_uInt8 nByte(0);
 pIStream->ReadUChar( nByte );
 if ( nOptions & CCI_OPTION_INVERSEBITORDER )
 nByte = pByteSwap[ nByte ];
@@ -811,7 +811,7 @@ sal_uInt8 CCIDecompressor::ReadBlackOrWhite()
 {
 // read a bit and deliver 0x00 if it's 0, otherwise 0xff
 if (nInputBitsBufSize==0) {
-sal_uInt8 nByte;
+sal_uInt8 nByte(0);
 pIStream->ReadUChar( nByte );
 if ( nOptions & CCI_OPTION_INVERSEBITORDER )
 nByte = pByteSwap[ nByte ];


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

2021-08-29 Thread Eike Rathke (via logerrit)
 sc/source/ui/dbgui/scuiasciiopt.cxx |   89 
 sc/source/ui/docshell/docsh.cxx |   43 +
 sc/source/ui/inc/scuiasciiopt.hxx   |5 +-
 3 files changed, 117 insertions(+), 20 deletions(-)

New commits:
commit 451e4abb5377f6d923860e9adfce82d46f31e049
Author: Eike Rathke 
AuthorDate: Sun Aug 29 18:23:35 2021 +0200
Commit: Eike Rathke 
CommitDate: Sun Aug 29 22:09:29 2021 +0200

Resolves: tdf#117868 CSV: support sep=; and "sep=;" separator setting

When reading CSV the separator (any BMP character) is taken from
an initial

sep=;
or
"sep=;"

single field if that is the only row content.
The quoted form is preserved as (unquoted) cell content, of the
unquoted form the separator is discarded as contextually it is a
real field separator.

When writing CSV an existing single top left cell's content if
that is the only cell in the row is adapted to the current
separator (any BMP character) in the quoted form

"sep=;"

(if quotes / text delimiters aren't set empty ...) and always uses
the ASCII '"' double quote character.

Change-Id: I854477bd0f9d1cafaa51a2130b616292347519cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121232
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 3ed0b05cf677..7390786c5cd9 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -381,14 +381,6 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 if (nFromRow != 1)
 mxNfRow->set_value(nFromRow);
 
-if ( bIsTSV )
-mxCkbTab->set_active(true);
-else
-SetSeparators(); // Set Separators in the dialog from 
maFieldSeparators (empty are not set)
-
-// Get Separators from the dialog (empty are set from default)
-maFieldSeparators = GetSeparators();
-
 // Clipboard is always Unicode, else detect.
 rtl_TextEncoding ePreselectUnicode = (meCall == SC_IMPORTFILE ?
 RTL_TEXTENCODING_DONTKNOW : RTL_TEXTENCODING_UNICODE);
@@ -438,6 +430,40 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 mnStreamPos = mpDatStream->Tell();
 }
 
+if (bIsTSV)
+SetSeparators('\t');
+else
+{
+// Some MS-Excel convention is the first line containing the field
+// separator as "sep=|" (without quotes and any field separator
+// character). The second possibility seems to be it is present *with*
+// quotes so it shows up as cell content *including* the separator and
+// can be preserved during round trips. Check for an exact match of
+// any such and set separator.
+/* TODO: it is debatable whether the unquoted form should rather be
+ * treated special to actually include the separator in the field data.
+ * Currently it does not. */
+sal_Unicode cSep = 0;
+OUString aLine;
+// Try to read one more character, if more than 7 it can't be an exact
+// match of any.
+mpDatStream->ReadUniOrByteStringLine( aLine, 
mpDatStream->GetStreamCharSet(), 8);
+mpDatStream->Seek(mnStreamPos);
+if (aLine.getLength() == 8)
+;   // nothing
+else if (aLine.getLength() == 5 && 
aLine.startsWithIgnoreAsciiCase("sep="))
+cSep = aLine[4];
+else if (aLine.getLength() == 7 && aLine[6] == '"' && 
aLine.startsWithIgnoreAsciiCase("\"sep="))
+cSep = aLine[5];
+
+// Set Separators in the dialog from maFieldSeparators (empty are not
+// set) or an optionally defined by file content field separator.
+SetSeparators(cSep);
+}
+
+// Get Separators from the dialog (empty are set from default)
+maFieldSeparators = GetSeparators();
+
 mxNfRow->connect_value_changed( LINK( this, ScImportAsciiDlg, FirstRowHdl 
) );
 
 // *** Separator characters ***
@@ -650,19 +676,46 @@ void ScImportAsciiDlg::SaveParameters()
  mxCkbSkipEmptyCells->get_active(), 
mxCkbRemoveSpace->get_active(), meCall );
 }
 
-void ScImportAsciiDlg::SetSeparators()
+void ScImportAsciiDlg::SetSeparators( sal_Unicode cSep )
 {
-for (sal_Int32 i = 0; i < maFieldSeparators.getLength(); ++i)
+if (cSep)
 {
-switch (maFieldSeparators[i])
+// Exclusively set a separator, maFieldSeparators needs not be
+// modified, it's obtained by GetSeparators() after this call.
+constexpr sal_Unicode aSeps[] = { '\t', ';', ',', ' ' };
+for (const sal_Unicode c : aSeps)
 {
-case '\t':  mxCkbTab->set_active(true);break;
-case ';':   mxCkbSemicolon->set_active(true);  break;
-case ',':   mxCkbComma->set_active(true);  break;
-case ' ':   mxCkbSpace->set_ac

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

2021-08-29 Thread Caolán McNamara (via logerrit)
 sd/source/filter/ppt/pptin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 182971bd9fa8c9057d1478af15a14b2b6357a2a4
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 17:06:35 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 21:47:45 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index e4bd9b24bb42..f998e57c73e9 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -252,7 +252,7 @@ bool ImplSdPPTImport::Import()
 {
 PropItem aPropItem;
 
-sal_uInt32 nType, nPropCount;
+sal_uInt32 nType(0), nPropCount(0);
 
 pDInfoSec2->Read();
 


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 emfio/source/reader/emfreader.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 16b24385331d85763759291eccfb0344a65e7540
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 11:05:09 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 20:39:25 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/emfio/source/reader/emfreader.cxx 
b/emfio/source/reader/emfreader.cxx
index 8fed29a17f50..f3c1fffdfd77 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1121,8 +1121,8 @@ namespace emfio
 
 case EMR_MODIFYWORLDTRANSFORM :
 {
-sal_uInt32  nMode;
-XForm   aTempXForm;
+sal_uInt32 nMode(0);
+XForm aTempXForm;
 *mpInputStream >> aTempXForm;
 mpInputStream->ReadUInt32( nMode );
 ModifyWorldTransform( aTempXForm, nMode );


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 include/vcl/RawBitmap.hxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 72da4c623baf60eb2b7073697cd36ffb3022847d
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 16:58:11 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 20:39:00 2021 +0200

ofz#37796 limit to numeric_limits::max

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

diff --git a/include/vcl/RawBitmap.hxx b/include/vcl/RawBitmap.hxx
index b26d532a4032..19fe94cd2c59 100644
--- a/include/vcl/RawBitmap.hxx
+++ b/include/vcl/RawBitmap.hxx
@@ -31,6 +31,10 @@ public:
 , mnBitCount(nBitCount)
 {
 assert(nBitCount == 24 || nBitCount == 32);
+if (rSize.getWidth() > std::numeric_limits::max() || 
rSize.getWidth() < 0)
+throw std::bad_alloc();
+if (rSize.getHeight() > std::numeric_limits::max() || 
rSize.getHeight() < 0)
+throw std::bad_alloc();
 sal_Int32 nRowSize, nDataSize;
 if (o3tl::checked_multiply(rSize.getWidth(), nBitCount / 8, 
nRowSize)
 || o3tl::checked_multiply(nRowSize, rSize.getHeight(), 
nDataSize)


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 filter/source/msfilter/svdfppt.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 9f9d075f3f814a2c6c53063cb7f3a582f6bff514
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 15:24:50 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 20:38:39 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index aae85106042b..3e3bc3a69f9c 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -585,6 +585,11 @@ void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, 
DffRecordHeader& rHd,
 r = rs;
 b = bs;
 }
+if (!rSt.good())
+{
+SAL_WARN("filter.ms", "ProcessClientAnchor2: short read");
+return;
+}
 Scale( l );
 Scale( t );
 Scale( r );


GSoC - Final Report - Table styles

2021-08-29 Thread Balázs Sántha
Dear Community!

I would like to give you the link to my final report of my project.:
https://wiki.documentfoundation.org/User:Santhab

During the summer, GSoC was a really good opportunity to work on real-life
problems, which helped me learn a lot about programming itself, and to
learn how to deal with stress, and frustration. This is why I am grateful
for the community to let me participate in this project. I hope that my
work during the summer has helped to improve LibreOffice, and I definitely
plan to continue my contribution towards LibreOffice. I am very thankful
for my mentors, Németh László and Michael Stahl, for helping me during the
summer. They helped me not only with the technical problems, but with the
mental challenge the project gave to me.
The LibreOffice community is a great community, and I am happy that I got
to be a part of it. It was a nice experience that whenever I hopped on the
IRC dev chat, I always got someone to help with my problem.
All in all, I am really happy to be able to get participate in this project!

Regards,
Balázs Sántha, santhab


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 hwpfilter/source/hgzip.cxx   |3 +++
 hwpfilter/source/hwpread.cxx |2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 8d07df00118b5ac82880fdea000df350c3bf379c
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 15:56:31 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 17:54:29 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/hwpfilter/source/hgzip.cxx b/hwpfilter/source/hgzip.cxx
index 56dc6268c273..ed8ef8a75f54 100644
--- a/hwpfilter/source/hgzip.cxx
+++ b/hwpfilter/source/hgzip.cxx
@@ -156,6 +156,9 @@ size_t gz_read(gz_stream * file, voidp buf, unsigned len)
 if (s == nullptr)
 return 0;
 
+if (s->z_eof)
+return 0;
+
 if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)
 return 0;
 if (s->z_err == Z_STREAM_END)
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index 45d156b00399..d739e033f65b 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -502,8 +502,6 @@ bool Picture::Read(HWPFile & hwpf)
 ishyper = true;
 }
 }
-else
-fprintf(stderr, "arse\n");
 }
 
 if( pictype != 3 )


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 sc/source/filter/qpro/qproform.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit d9dc4071d0d4064449a6bdbfd176445abd97fc86
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 14:44:59 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 17:46:07 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/sc/source/filter/qpro/qproform.cxx 
b/sc/source/filter/qpro/qproform.cxx
index 412528b95937..9ece7da03fc4 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -189,7 +189,7 @@ do { \
 
 ConvErr QProToSc::Convert( const ScDocument& rDoc, 
std::unique_ptr& pArray )
 {
-sal_uInt8 nFmla[ nBufSize ];
+sal_uInt8 nFmla[ nBufSize ] = {0};
 sal_uInt8 nArgArray[ nBufSize ] = {0};
 sal_Int8 nCol, nPage;
 sal_uInt16 nIntCount = 0, nStringCount = 0, nFloatCount = 0, nDLLCount = 
0, nArgCount = 0;
@@ -214,7 +214,6 @@ ConvErr QProToSc::Convert( const ScDocument& rDoc, 
std::unique_ptr
 {
 for( sal_uInt16 i=0; i < nRef; i++)
 {
-nFmla[i] = 0;
 maIn.ReadUChar( nFmla[i] );
 
 if( nFmla[ i ] == 0x05 )
@@ -338,9 +337,8 @@ ConvErr QProToSc::Convert( const ScDocument& rDoc, 
std::unique_ptr
 break;
 
 case FT_FuncVar:{ // Sum of a sequence of numbers
-sal_uInt8 nArgs;
 i++;
-nArgs = nFmla[ i ];
+sal_uInt8 nArgs = nFmla[ i ];
 DoFunc( eOc, nArgs, nullptr );
 }
 break;


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

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

New commits:
commit 11f430fd5d6b866483c8bde646f3ef2746e980c0
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 15:08:33 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 17:37:04 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/vcl/source/filter/idxf/dxftblrd.cxx 
b/vcl/source/filter/idxf/dxftblrd.cxx
index 5077b687bed8..7e20e6c69238 100644
--- a/vcl/source/filter/idxf/dxftblrd.cxx
+++ b/vcl/source/filter/idxf/dxftblrd.cxx
@@ -27,6 +27,7 @@ DXFLType::DXFLType()
 , nFlags(0)
 , nDashCount(0)
 , fPatternLength(0.0)
+, fDash{0.0}
 {
 }
 


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/svm/SvmReader.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 567c6c123094bf58c14ddac94e962cc62bc839b3
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 10:52:16 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 16:32:29 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/vcl/source/filter/svm/SvmReader.cxx 
b/vcl/source/filter/svm/SvmReader.cxx
index 8aec254cfdb9..7e0780b93e1a 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -79,7 +79,7 @@ SvStream& SvmReader::Read(GDIMetaFile& rMetaFile, 
ImplMetaReadData* pData)
 aId[0] = 0;
 aId[6] = 0;
 mrStream.ReadBytes(aId, 6);
-if (!strcmp(aId, "VCLMTF"))
+if (mrStream.good() && !strcmp(aId, "VCLMTF"))
 {
 // new format
 sal_uInt32 nStmCompressMode = 0;


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 sc/source/filter/lotus/op.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 53e02d723d1e91f94d6788d1b2d3c637b2e359f8
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 10:56:50 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 16:19:51 2021 +0200

be a little more readable

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

diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 62b5ebc8e220..44c766f8c163 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -205,7 +205,7 @@ void OP_NamedRange(LotusContext& rContext, SvStream& r, 
sal_uInt16 /*n*/)
 if (!r.good())
 return;
 
-if (!(rContext.rDoc.ValidColRow( static_cast(nColSt), nRowSt) && 
rContext.rDoc.ValidColRow( static_cast(nColEnd), nRowEnd)))
+if (!rContext.rDoc.ValidColRow(static_cast(nColSt), nRowSt) || 
!rContext.rDoc.ValidColRow(static_cast(nColEnd), nRowEnd))
 return;
 
 std::unique_ptr pRange;


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 sc/source/filter/lotus/op.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 03a04f350594e3b1372acb880ca5e23ea3e48146
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 10:56:03 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 16:19:12 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index c886ace340f1..62b5ebc8e220 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -202,6 +202,9 @@ void OP_NamedRange(LotusContext& rContext, SvStream& r, 
sal_uInt16 /*n*/)
 
 r.ReadUInt16( nColSt ).ReadUInt16( nRowSt ).ReadUInt16( nColEnd 
).ReadUInt16( nRowEnd );
 
+if (!r.good())
+return;
+
 if (!(rContext.rDoc.ValidColRow( static_cast(nColSt), nRowSt) && 
rContext.rDoc.ValidColRow( static_cast(nColEnd), nRowEnd)))
 return;
 


[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: sc/source

2021-08-29 Thread Caolán McNamara (via logerrit)
 sc/source/filter/lotus/lotimpop.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit ba367806deb5e5b63996f2965fe3d9677921af26
Author: Caolán McNamara 
AuthorDate: Sat Aug 28 09:56:52 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 15:16:40 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/sc/source/filter/lotus/lotimpop.cxx 
b/sc/source/filter/lotus/lotimpop.cxx
index cb74275221ca..38a0337a9d25 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -69,6 +69,9 @@ void ImportLotus::Bof()
 Skip( 1 );
 Read( nFlags );
 
+if (!pIn->good())
+return;
+
 if( nFileSub == 0x0004 )
 {
 if( nFileCode == 0x1000 )
@@ -84,7 +87,7 @@ void ImportLotus::Bof()
 
 bool ImportLotus::BofFm3()
 {
-sal_uInt16  nFileCode, nFileSub;
+sal_uInt16 nFileCode(0), nFileSub(0);
 
 Read( nFileCode );
 Read( nFileSub );


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/imet/ios2met.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bf5fc53cf7f35f7c39d0d8d8b871096b8ca2d042
Author: Caolán McNamara 
AuthorDate: Sun Aug 29 11:00:11 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 15:16:23 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/vcl/source/filter/imet/ios2met.cxx 
b/vcl/source/filter/imet/ios2met.cxx
index 1d0b83ba1fb3..fc6f8c2fc595 100644
--- a/vcl/source/filter/imet/ios2met.cxx
+++ b/vcl/source/filter/imet/ios2met.cxx
@@ -2555,7 +2555,6 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, 
sal_uInt16 nFieldSize)
 case EndGrfObjMagic: {
 SvStream * pSave;
 sal_uInt16 nOrderID, nOrderLen;
-sal_uInt8 nbyte;
 
 if (!xOrdFile)
 break;
@@ -2571,6 +2570,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, 
sal_uInt16 nFieldSize)
 pOS2MET->Seek(0);
 
 // "Segment header":
+sal_uInt8 nbyte(0);
 pOS2MET->ReadUChar( nbyte );
 if (nbyte==0x70) { // header exists
 pOS2MET->SeekRel(15); // but we don't need it


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 sc/source/filter/xml/XMLConverter.hxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit ad33f461929e99b496869b831f83159bfb7ac40f
Author: Caolán McNamara 
AuthorDate: Sat Aug 28 10:07:49 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 12:58:19 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/sc/source/filter/xml/XMLConverter.hxx 
b/sc/source/filter/xml/XMLConverter.hxx
index 52d0f2ba77cc..76e0fcad8c11 100644
--- a/sc/source/filter/xml/XMLConverter.hxx
+++ b/sc/source/filter/xml/XMLConverter.hxx
@@ -127,6 +127,14 @@ struct ScXMLConditionParseResult
 OUStringmaOperand1; /// First operand of the token or 
comparison value.
 OUStringmaOperand2; /// Second operand of 'between' 
conditions.
 sal_Int32   mnEndIndex; /// Index of first character 
following the condition.
+
+ScXMLConditionParseResult()
+: meToken(XML_COND_INVALID)
+, meValidation(css::sheet::ValidationType_ANY)
+, meOperator(css::sheet::ConditionOperator_NONE)
+, mnEndIndex(-1)
+{
+}
 };
 
 namespace ScXMLConditionHelper


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 emfio/source/reader/emfreader.cxx |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 7362351b62b0f3c2967e11b96b9c55a94ee68925
Author: Caolán McNamara 
AuthorDate: Sat Aug 28 21:48:21 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 12:57:53 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/emfio/source/reader/emfreader.cxx 
b/emfio/source/reader/emfreader.cxx
index c0aecda9f680..8fed29a17f50 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1383,12 +1383,17 @@ namespace emfio
 {
 sal_Int32 nStartX, nStartY, nEndX, nEndY;
 mpInputStream->ReadInt32( nX32 ).ReadInt32( nY32 
).ReadInt32( nx32 ).ReadInt32( ny32 ).ReadInt32( nStartX ).ReadInt32( nStartY 
).ReadInt32( nEndX ).ReadInt32( nEndY );
-SAL_INFO( "emfio", "\t\t Bounds: " << nX32 << ":" << 
nY32 << ", " << nx32 << ":" << ny32 << ", Start: " << nStartX << ":" << nStartY 
<< ", End: " << nEndX << ":" << nEndY );
-tools::Polygon aPoly( ReadRectangle( nX32, nY32, nx32, 
ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), PolyStyle::Arc );
-if ( nRecType == EMR_CHORD )
-DrawPolygon( aPoly, mbRecordPath );
+if (!mpInputStream->good())
+bStatus = false;
 else
-DrawPolyLine( aPoly, nRecType == EMR_ARCTO, 
mbRecordPath );
+{
+SAL_INFO( "emfio", "\t\t Bounds: " << nX32 << ":" 
<< nY32 << ", " << nx32 << ":" << ny32 << ", Start: " << nStartX << ":" << 
nStartY << ", End: " << nEndX << ":" << nEndY );
+tools::Polygon aPoly( ReadRectangle( nX32, nY32, 
nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), PolyStyle::Arc 
);
+if ( nRecType == EMR_CHORD )
+DrawPolygon( aPoly, mbRecordPath );
+else
+DrawPolyLine( aPoly, nRecType == EMR_ARCTO, 
mbRecordPath );
+}
 }
 break;
 


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/ipsd/ipsd.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e251bb6a6ce846944595954d38595a807689fa0b
Author: Caolán McNamara 
AuthorDate: Sat Aug 28 10:18:57 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 11:47:07 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/vcl/source/filter/ipsd/ipsd.cxx b/vcl/source/filter/ipsd/ipsd.cxx
index 623a2b14a84e..4c12770275fe 100644
--- a/vcl/source/filter/ipsd/ipsd.cxx
+++ b/vcl/source/filter/ipsd/ipsd.cxx
@@ -616,7 +616,7 @@ bool PSDReader::ImplReadBody()
 if (mpFileHeader->nMode == PSD_CMYK && m_rPSD.good())
 {
 sal_uInt32  nBlack, nBlackMax = 0;
-std::unique_ptr pBlack(new sal_uInt8[ 
mpFileHeader->nRows * mpFileHeader->nColumns ]);
+std::vector aBlack(mpFileHeader->nRows * 
mpFileHeader->nColumns, 0);
 nY = 0;
 while (nY < mpFileHeader->nRows && m_rPSD.good())
 {
@@ -645,7 +645,7 @@ bool PSDReader::ImplReadBody()
 nBlack = mpBitmap->GetPixel( nY, nX ).GetBlue() + 
nDat;
 if ( nBlack > nBlackMax )
 nBlackMax = nBlack;
-pBlack[ nX + nY * mpFileHeader->nColumns ] = nDat 
^ 0xff;
+aBlack[ nX + nY * mpFileHeader->nColumns ] = nDat 
^ 0xff;
 if ( ++nX == mpFileHeader->nColumns )
 {
 nX = 0;
@@ -672,7 +672,7 @@ bool PSDReader::ImplReadBody()
 nBlack = mpBitmap->GetPixel( nY, nX ).GetBlue() + 
nDat;
 if ( nBlack > nBlackMax )
 nBlackMax = nBlack;
-pBlack[ nX + nY * mpFileHeader->nColumns ] = nDat 
^ 0xff;
+aBlack[ nX + nY * mpFileHeader->nColumns ] = nDat 
^ 0xff;
 if ( ++nX == mpFileHeader->nColumns )
 {
 nX = 0;
@@ -688,7 +688,7 @@ bool PSDReader::ImplReadBody()
 {
 for ( nX = 0; nX < mpFileHeader->nColumns; nX++ )
 {
-sal_Int32 nDAT = pBlack[ nX + nY * 
mpFileHeader->nColumns ] * ( nBlackMax - 256 ) / 0x1ff;
+sal_Int32 nDAT = aBlack[ nX + nY * 
mpFileHeader->nColumns ] * ( nBlackMax - 256 ) / 0x1ff;
 
 aBitmapColor = mpBitmap->GetPixel( nY, nX );
 sal_uInt8 cR = static_cast(MinMax( 
aBitmapColor.GetRed() - nDAT, 0, 255L ));


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

2021-08-29 Thread Caolán McNamara (via logerrit)
 starmath/source/mathtype.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5ecc01990dbdd21501d49a1a5a66a2348d0e229b
Author: Caolán McNamara 
AuthorDate: Sat Aug 28 10:23:50 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 29 11:46:39 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index acdeba5fcfb6..b32ad0c555ec 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -2815,8 +2815,8 @@ void MathType::HandleEmblishments()
 
 void MathType::HandleSetSize()
 {
-sal_uInt8 nTemp;
-pS->ReadUChar( nTemp );
+sal_uInt8 nTemp(0);
+pS->ReadUChar(nTemp);
 switch (nTemp)
 {
 case 101:


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

2021-08-29 Thread Pranam Lashkari (via logerrit)
 sc/source/ui/view/viewdata.cxx |   34 --
 1 file changed, 20 insertions(+), 14 deletions(-)

New commits:
commit ed5794b9088a0e5a97d7f4a0dbf4ee1b07828cc7
Author: Pranam Lashkari 
AuthorDate: Thu Aug 26 22:09:31 2021 +0530
Commit: Andras Timar 
CommitDate: Sun Aug 29 11:46:40 2021 +0200

LOK: avoid writing freeze pans data to file if not set

Change-Id: I9bc4023ae1673a2ae68db584357fb6c6643342a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121125
Reviewed-by: Dennis Francis 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index e4b0af86df85..49abd351c0d3 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -543,20 +543,26 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence 

 pSettings[SC_CURSOR_X].Value <<= sal_Int32(nCurX);
 pSettings[SC_CURSOR_Y].Name = SC_CURSORPOSITIONY;
 pSettings[SC_CURSOR_Y].Value <<= sal_Int32(nCurY);
-pSettings[SC_HORIZONTAL_SPLIT_MODE].Name = SC_HORIZONTALSPLITMODE;
-pSettings[SC_HORIZONTAL_SPLIT_MODE].Value <<= sal_Int16(eExHSplitMode);
-pSettings[SC_VERTICAL_SPLIT_MODE].Name = SC_VERTICALSPLITMODE;
-pSettings[SC_VERTICAL_SPLIT_MODE].Value <<= sal_Int16(eExVSplitMode);
-pSettings[SC_HORIZONTAL_SPLIT_POSITION].Name = SC_HORIZONTALSPLITPOSITION;
-if (eExHSplitMode == SC_SPLIT_FIX)
-pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= 
sal_Int32(nExFixPosX);
-else
-pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= 
sal_Int32(nExHSplitPos);
-pSettings[SC_VERTICAL_SPLIT_POSITION].Name = SC_VERTICALSPLITPOSITION;
-if (eExVSplitMode == SC_SPLIT_FIX)
-pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nExFixPosY);
-else
-pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= 
sal_Int32(nExVSplitPos);
+
+// Write freezepan data only when freeze pans are set
+if(nExFixPosX != 0 || nExFixPosY != 0 || nExHSplitPos != 0 || nExVSplitPos 
!= 0)
+{
+pSettings[SC_HORIZONTAL_SPLIT_MODE].Name = SC_HORIZONTALSPLITMODE;
+pSettings[SC_HORIZONTAL_SPLIT_MODE].Value <<= sal_Int16(eExHSplitMode);
+pSettings[SC_VERTICAL_SPLIT_MODE].Name = SC_VERTICALSPLITMODE;
+pSettings[SC_VERTICAL_SPLIT_MODE].Value <<= sal_Int16(eExVSplitMode);
+pSettings[SC_HORIZONTAL_SPLIT_POSITION].Name = 
SC_HORIZONTALSPLITPOSITION;
+if (eExHSplitMode == SC_SPLIT_FIX)
+pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= 
sal_Int32(nExFixPosX);
+else
+pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= 
sal_Int32(nExHSplitPos);
+pSettings[SC_VERTICAL_SPLIT_POSITION].Name = SC_VERTICALSPLITPOSITION;
+if (eExVSplitMode == SC_SPLIT_FIX)
+pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= 
sal_Int32(nExFixPosY);
+else
+pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= 
sal_Int32(nExVSplitPos);
+}
+
 // Prevent writing odd settings that would make crash versions that
 // don't apply SanitizeWhichActive() when reading the settings.
 // See tdf#117093


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

2021-08-29 Thread Noel Grandin (via logerrit)
 sw/source/core/table/swtable.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit e3ea0e32657a41b48d9d9d28f6ad15af4c2a7abc
Author: Noel Grandin 
AuthorDate: Sat Aug 28 17:28:34 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Aug 29 09:33:52 2021 +0200

tdf#135683 speed up large writer table load

no need to do this reregister check during import

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

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index fb5839ea687b..51e57b57b9ac 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1679,6 +1679,7 @@ SwFrameFormat* SwTableBox::ClaimFrameFormat()
 // If other SwTableBox objects currently listen to the same 
SwTableBoxFormat as
 // this one, something needs to be done
 SwTableBoxFormat *pRet = static_cast(GetFrameFormat());
+const bool bInImport = pRet->GetDoc()->IsInWriterfilterImport();
 SwIterator aIter( *pRet );
 for( SwTableBox* pLast = aIter.First(); pLast; pLast = aIter.Next() )
 {
@@ -1694,10 +1695,13 @@ SwFrameFormat* SwTableBox::ClaimFrameFormat()
 pNewFormat->UnlockModify();
 
 // re-register SwCellFrame objects that know me
-SwIterator aFrameIter( *pRet );
-for( SwCellFrame* pCell = aFrameIter.First(); pCell; pCell = 
aFrameIter.Next() )
-if( pCell->GetTabBox() == this )
-pCell->RegisterToFormat( *pNewFormat );
+if (!bInImport)
+{
+SwIterator aFrameIter( *pRet );
+for( SwCellFrame* pCell = aFrameIter.First(); pCell; pCell = 
aFrameIter.Next() )
+if( pCell->GetTabBox() == this )
+pCell->RegisterToFormat( *pNewFormat );
+}
 
 // re-register myself
 pNewFormat->Add( this );


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

2021-08-29 Thread Noel Grandin (via logerrit)
 sw/source/core/text/porlay.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 3b15eda58e11a3a46319d4e0489391cb78cec0ab
Author: Noel Grandin 
AuthorDate: Sat Aug 28 19:08:43 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Aug 29 09:33:30 2021 +0200

no need for a vector here

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

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 9c214ac714ce..2aeced43f463 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -185,18 +185,15 @@ void SwLineLayout::DeleteNext()
 {
 if (!m_pNext)
 return;
-std::vector aNexts;
 SwLineLayout* pNext = m_pNext;
 do
 {
-aNexts.push_back(pNext);
 SwLineLayout* pLastNext = pNext;
 pNext = pNext->GetNext();
 pLastNext->SetNext(nullptr);
+delete pLastNext;
 }
 while (pNext);
-for (auto a : aNexts)
-delete a;
 }
 
 void SwLineLayout::Height(const sal_uInt32 nNew, const bool bText)