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

2023-10-14 Thread Gökay Şatır (via logerrit)
 filter/source/svg/presentation_engine.js |   69 ++-
 sc/source/ui/view/output2.cxx|   11 +---
 2 files changed, 71 insertions(+), 9 deletions(-)

New commits:
commit d521062dd38a0c7faf26da55574648ae0c475771
Author: Gökay Şatır 
AuthorDate: Tue Oct 3 10:53:31 2023 +0300
Commit: Caolán McNamara 
CommitDate: Sat Oct 14 16:49:51 2023 +0200

Impress presentation engine (svg):

   * Add handlers for w and b chars.
  * These hide the content and set the color of the view to either 
black or white.
   * Add handler for p char:
  * This changes the cursor to pointer and back to default with key 
presses.

Signed-off-by: Gökay Şatır 
Change-Id: I566f485aa676f0707a31f25a0b71f64970de2a26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157511
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 427e8c0a8d9a534c54e07414cfe66648c9a90d26)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157958
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index ba585b6f4b3c..839bd1676ffd 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -2756,6 +2756,56 @@ function getElementsByProperty( node, name )
 return elements;
 }
 
+// User can hide / show the presentation content.
+// For that purpose, we change the background color of root node to either 
black or white.
+// To set it back to its original color (for showing the content back), we 
should have the initial background color saved somewhere to read back.
+// There may be no initial color at all, so the initial value of the saved 
initial is undefined.
+var rootNodeInitialBackgroundColor = undefined;
+
+function changeRootNodeBackgroundTo(color) {
+   if (rootNodeInitialBackgroundColor === undefined)
+   rootNodeInitialBackgroundColor = 
ROOT_NODE.style.backgroundColor;
+
+   if (color === 'initial')
+   ROOT_NODE.style.backgroundColor = 
rootNodeInitialBackgroundColor;
+   else
+   ROOT_NODE.style.backgroundColor = color;
+}
+
+var isContentHidden = false;
+var contentInitialVisibilityValues = null;
+
+function getInitialVisibilityValues() {
+   var list = ROOT_NODE.querySelectorAll('g');
+   contentInitialVisibilityValues = [];
+   for (var i = 0; i < list.length; i++) {
+   var temp = {};
+   temp.object = list[i];
+   temp.visibility = list[i].style.visibility;
+   contentInitialVisibilityValues.push(temp);
+   }
+}
+
+function hideShowContent(color) {
+   if (contentInitialVisibilityValues === null)
+   getInitialVisibilityValues();
+
+   if (isContentHidden) {
+   for (var i = 0; i < contentInitialVisibilityValues.length; i++)
+   
contentInitialVisibilityValues[i].object.style.visibility = 
contentInitialVisibilityValues[i].visibility;
+
+   changeRootNodeBackgroundTo('initial');
+   isContentHidden = false;
+   }
+   else {
+   for (var i = 0; i < contentInitialVisibilityValues.length; i++)
+   
contentInitialVisibilityValues[i].object.style.visibility = 'hidden';
+
+   changeRootNodeBackgroundTo(color);
+   isContentHidden = true;
+   }
+}
+
 /** Event handler for key press.
  *
  *  @param aEvt the event
@@ -2765,7 +2815,7 @@ function onKeyDown( aEvt )
 if ( !aEvt )
 aEvt = window.event;
 
-var code = aEvt.keyCode || aEvt.charCode;
+var code = aEvt.keyCode || aEvt.charCode || aEvt.code;
 
 // console.log('===> onKeyDown: ' + code);
 
@@ -2788,6 +2838,20 @@ function onKeyDown( aEvt )
 
 // console.log(' now: ' + code);
 }
+   else if (code === P_KEY) {
+   aEvt.preventDefault();
+   if (ROOT_NODE.style.cursor === 'pointer')
+   ROOT_NODE.style.cursor = 'default';
+   else
+   ROOT_NODE.style.cursor = 'pointer';
+   }
+   else if (code === W_KEY) {
+   hideShowContent('white');
+   }
+   else if (code === B_KEY) {
+   hideShowContent('black');
+   }
+
 
 if( !processingEffect && keyCodeDictionary[currentMode] && 
keyCodeDictionary[currentMode][code] )
 {
@@ -4505,7 +4569,10 @@ var END_KEY = 35;   // end keycode
 var ENTER_KEY = 13;
 var SPACE_KEY = 32;
 var ESCAPE_KEY = 27;
+var B_KEY = 66;
+var P_KEY = 80;
 var Q_KEY = 81;
+var W_KEY = 87;
 
 // Visibility Values
 var HIDDEN = 0;
commit ef4f9dca33bf38de3c2175cc4304e42281d729c2
Author: Caolán McNamara 
AuthorDate: Fri Oct 13 10:31:48 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sat Oct 14 16:49:43 2023 +0200

don't bother checking existing mode before seting new 

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

2021-08-30 Thread Caolán McNamara (via logerrit)
 filter/source/graphicfilter/icgm/class4.cxx |   33 ++--
 sc/source/filter/lotus/op.cxx   |2 -
 2 files changed, 27 insertions(+), 8 deletions(-)

New commits:
commit c93f941be682d767636110ab10da9a55833370f4
Author: Caolán McNamara 
AuthorDate: Mon Aug 30 15:15:24 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 30 21:38:57 2021 +0200

ofz#37831 avoid Integer-overflow

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

diff --git a/filter/source/graphicfilter/icgm/class4.cxx 
b/filter/source/graphicfilter/icgm/class4.cxx
index 7fdd13455f68..7561e2240576 100644
--- a/filter/source/graphicfilter/icgm/class4.cxx
+++ b/filter/source/graphicfilter/icgm/class4.cxx
@@ -422,13 +422,32 @@ void CGM::ImplDoClass4()
 
 if ( mbFigure )
 {
-tools::Rectangle aBoundingBox(aCenterPoint.X - 
fRadius, aCenterPoint.Y - fRadius);
-aBoundingBox.SaturatingSetSize(Size(2 * fRadius, 2 * 
fRadius));
-tools::Polygon aPolygon( aBoundingBox, Point( 
static_cast(aStartingPoint.X), 
static_cast(aStartingPoint.Y) ) ,Point( 
static_cast(aEndingPoint.X), 
static_cast(aEndingPoint.Y) ), PolyStyle::Arc );
-if ( nSwitch )
-mpOutAct->RegPolyLine( aPolygon, true );
-else
-mpOutAct->RegPolyLine( aPolygon );
+double fLeft = aCenterPoint.X - fRadius;
+double fTop = aCenterPoint.Y - fRadius;
+double fRight = fLeft + (2 * fRadius);
+double fBottom = fTop + (2 * fRadius);
+bUseless = useless(fLeft) || useless(fTop) || 
useless(fRight) || useless(fBottom);
+if (!bUseless)
+{
+double fWidth = fLeft + fRight;
+bUseless = !o3tl::convertsToAtLeast(fWidth, 
std::numeric_limits::min()) ||
+   !o3tl::convertsToAtMost(fWidth, 
std::numeric_limits::max());
+}
+if (!bUseless)
+{
+double fHeight = fTop + fBottom;
+bUseless = !o3tl::convertsToAtLeast(fHeight, 
std::numeric_limits::min()) ||
+   !o3tl::convertsToAtMost(fHeight, 
std::numeric_limits::max());
+}
+if (!bUseless)
+{
+tools::Rectangle aBoundingBox(fLeft, fTop, fRight, 
fBottom);
+tools::Polygon aPolygon( aBoundingBox, Point( 
static_cast(aStartingPoint.X), 
static_cast(aStartingPoint.Y) ) ,Point( 
static_cast(aEndingPoint.X), 
static_cast(aEndingPoint.Y) ), PolyStyle::Arc );
+if ( nSwitch )
+mpOutAct->RegPolyLine( aPolygon, true );
+else
+mpOutAct->RegPolyLine( aPolygon );
+}
 }
 else
 {
commit 31d0b43edfc304b7d69adb49ab8e5892726ed0cb
Author: Caolán McNamara 
AuthorDate: Mon Aug 30 17:07:23 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 30 21:38:42 2021 +0200

make this more readable

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

diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index b245e0f04987..4f9ed6e2679b 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -244,7 +244,7 @@ void OP_SymphNamedRange(LotusContext& rContext, SvStream& 
r, sal_uInt16 /*n*/)
 
 r.ReadUInt16( nColSt ).ReadUInt16( nRowSt ).ReadUInt16( nColEnd 
).ReadUInt16( nRowEnd ).ReadUChar( nType );
 
-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: 2 commits - filter/source sc/source

2019-10-01 Thread Muhammet Kara (via logerrit)
 filter/source/pdf/pdfexport.cxx   |3 +++
 sc/source/filter/oox/workbookfragment.cxx |4 
 sc/source/ui/docshell/docsh.cxx   |4 
 sc/source/ui/optdlg/calcoptionsdlg.cxx|5 +
 sc/source/ui/optdlg/tpformula.cxx |   12 
 5 files changed, 28 insertions(+)

New commits:
commit 32f28dfa4c1de2b92664a5c0c3eca4fffecc0b28
Author: Muhammet Kara 
AuthorDate: Tue Oct 1 11:22:21 2019 +0200
Commit: Muhammet Kara 
CommitDate: Tue Oct 1 21:56:25 2019 +0200

Avoid unnecessary iterations in for loop

Change-Id: I9f2d0fba4754b8d4db906012dc1429640fe444b5
Reviewed-on: https://gerrit.libreoffice.org/79944
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 9c023010f9ac..7368512293bf 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -200,7 +200,10 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& 
rPDFWriter,
 for( sal_Int32 nProperty = 0, nPropertyCount = 
aRenderer.getLength(); nProperty < nPropertyCount; ++nProperty )
 {
 if ( aRenderer[ nProperty ].Name == "PageSize" )
+{
 aRenderer[ nProperty].Value >>= aPageSize;
+break;
+}
 }
 
 rPDFExtOutDevData.SetCurrentPageNumber( nCurrentPage );
commit dc1f304de78ccf20b3264cbc904d65f78864ec63
Author: Gabor Kelemen 
AuthorDate: Thu Aug 2 01:02:56 2018 +0200
Commit: Eike Rathke 
CommitDate: Tue Oct 1 21:56:22 2019 +0200

tdf#119021 Support lock down settings of Formula tab page

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

diff --git a/sc/source/filter/oox/workbookfragment.cxx 
b/sc/source/filter/oox/workbookfragment.cxx
index 540c2b3b89de..7e7edc655a59 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -525,6 +525,7 @@ public:
 {
 }
 bool get_active() const { return m_xWarningOnBox->get_active(); }
+void hide_ask() const { m_xWarningOnBox->set_visible(false); };
 };
 
 }
@@ -547,6 +548,9 @@ void WorkbookFragment::recalcFormulaCells()
 
aQueryBox.set_primary_text(ScResId(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
 aQueryBox.set_default_response(RET_YES);
 
+if ( 
officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::isReadOnly() )
+aQueryBox.hide_ask();
+
 bHardRecalc = aQueryBox.run() == RET_YES;
 
 if (aQueryBox.get_active())
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 42b538035405..0fce15e67a72 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -433,6 +433,7 @@ public:
 {
 }
 bool get_active() const { return m_xWarningOnBox->get_active(); }
+void hide_ask() const { m_xWarningOnBox->set_visible(false); };
 };
 
 
@@ -511,6 +512,9 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const 
css::uno::Reference< css
 
aQueryBox.set_primary_text(ScResId(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS));
 aQueryBox.set_default_response(RET_YES);
 
+if ( 
officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::isReadOnly() )
+aQueryBox.hide_ask();
+
 bHardRecalc = aQueryBox.run() == RET_YES;
 
 if (aQueryBox.get_active())
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx 
b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 43533c4df530..a3e9d73935d1 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -9,6 +9,8 @@
 
 #include 
 
+#include 
+
 #include 
 #include "calcoptionsdlg.hxx"
 
@@ -66,13 +68,16 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(weld::Window* 
pParent, const ScCalcConf
 {
 mxConversion->set_active(static_cast(rConfig.meStringConversion));
 mxConversion->connect_changed(LINK(this, ScCalcOptionsDialog, 
ConversionModifiedHdl));
+mxConversion->set_sensitive( 
!officecfg::Office::Calc::Formula::Syntax::StringConversion::isReadOnly() );
 
 mxEmptyAsZero->set_active(rConfig.mbEmptyStringAsZero);
 mxEmptyAsZero->connect_toggled(LINK(this, ScCalcOptionsDialog, 
AsZeroModifiedHdl));
 CoupleEmptyAsZeroToStringConversion();
+mxEmptyAsZero->set_sensitive ( 
!officecfg::Office::Calc::Formula::Syntax::EmptyStringAsZero::isReadOnly() );
 
 mxSyntax->set_active(toSelectedItem(rConfig.meStringRefAddressSyntax));
 mxSyntax->connect_changed(LINK(this, ScCalcOptionsDialog, 
SyntaxModifiedHdl));
+mxSyntax->set_sensitive ( 
!officecfg::Office::Calc::Formula::Syntax::StringRefAddressSyntax::isReadOnly() 
);
 
 mxCurrentDocOnly->set_active(!mbWriteConfig);
 

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

2018-08-16 Thread Libreoffice Gerrit user
 filter/source/flash/swfwriter.cxx  |5 +++--
 filter/source/flash/swfwriter.hxx  |5 +
 filter/source/flash/swfwriter1.cxx |2 +-
 sc/source/ui/docshell/olinefun.cxx |4 +---
 sc/source/ui/inc/olinefun.hxx  |2 +-
 sc/source/ui/view/dbfunc3.cxx  |4 ++--
 6 files changed, 9 insertions(+), 13 deletions(-)

New commits:
commit 899fbd617b32771bc8c14effc52a7153465adf5d
Author: Noel Grandin 
AuthorDate: Tue Aug 14 17:11:26 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 16 11:51:20 2018 +0200

loplugin:returnconstant in ScOutlineDocFunc

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

diff --git a/sc/source/ui/docshell/olinefun.cxx 
b/sc/source/ui/docshell/olinefun.cxx
index 90df8eb475ba..4060625466fa 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -637,7 +637,7 @@ bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& 
rRange, bool bRecord )
 return bDone;
 }
 
-bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 
nLevel, sal_uInt16 nEntry,
+void ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 
nLevel, sal_uInt16 nEntry,
 bool bRecord, bool bPaint )
 {
 ScDocument& rDoc = rDocShell.GetDocument();
@@ -723,8 +723,6 @@ bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool 
bColumns, sal_uInt16 nLevel
 rDocShell.SetDocumentModified();
 
 lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
-
-return true;//! always ???
 }
 
 bool ScOutlineDocFunc::HideOutline( SCTAB nTab, bool bColumns, sal_uInt16 
nLevel, sal_uInt16 nEntry,
diff --git a/sc/source/ui/inc/olinefun.hxx b/sc/source/ui/inc/olinefun.hxx
index 6129cb49801d..89e34eca32c4 100644
--- a/sc/source/ui/inc/olinefun.hxx
+++ b/sc/source/ui/inc/olinefun.hxx
@@ -44,7 +44,7 @@ public:
 boolShowMarkedOutlines( const ScRange& rRange, bool bRecord );
 boolHideMarkedOutlines( const ScRange& rRange, bool bRecord );
 
-boolShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel, 
sal_uInt16 nEntry,
+voidShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel, 
sal_uInt16 nEntry,
 bool bRecord, bool bPaint );
 boolHideOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel, 
sal_uInt16 nEntry,
 bool bRecord, bool bPaint );
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 008d57eb9f49..f5b1e6b9d670 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -253,9 +253,9 @@ void ScDBFunc::ShowOutline( bool bColumns, sal_uInt16 
nLevel, sal_uInt16 nEntry,
 ScDocShell* pDocSh = GetViewData().GetDocShell();
 ScOutlineDocFunc aFunc(*pDocSh);
 
-bool bOk = aFunc.ShowOutline( nTab, bColumns, nLevel, nEntry, bRecord, 
bPaint );
+aFunc.ShowOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint );
 
-if ( bOk && bPaint )
+if ( bPaint )
 UpdateScrollBars(bColumns ? COLUMN_HEADER : ROW_HEADER);
 }
 
commit fbba9324c7df5f459dfe10795021ad3bf77da423
Author: Noel Grandin 
AuthorDate: Tue Aug 14 10:06:13 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 16 11:51:10 2018 +0200

loplugin:useuniqueptr in swf::Writer

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

diff --git a/filter/source/flash/swfwriter.cxx 
b/filter/source/flash/swfwriter.cxx
index b2e22b9685c0..04b47a640e25 100644
--- a/filter/source/flash/swfwriter.cxx
+++ b/filter/source/flash/swfwriter.cxx
@@ -128,11 +128,12 @@ void ImplCopySvStreamToXOutputStream( SvStream& rIn, 
Reference< XOutputStream >
 
 void Writer::storeTo( Reference< XOutputStream > const  )
 {
-for (auto const& font : maFonts)
+for (auto & font : maFonts)
 {
 font->write( *mpFontsStream );
-delete font;
+font.reset();
 }
+maFonts.clear();
 
 // Endtag
 mpMovieStream->WriteUInt16( 0 );
diff --git a/filter/source/flash/swfwriter.hxx 
b/filter/source/flash/swfwriter.hxx
index da781c2cf4da..68c349934ba5 100644
--- a/filter/source/flash/swfwriter.hxx
+++ b/filter/source/flash/swfwriter.hxx
@@ -156,9 +156,6 @@ private:
 std::vector< sal_uInt16 > maGlyphOffsets;
 };
 
-typedef std::vector FontMap;
-
-
 /** this class helps creating flash tags */
 class Tag : public SvMemoryStream
 {
@@ -363,7 +360,7 @@ private:
 private:
 css::uno::Reference< css::i18n::XBreakIterator > mxBreakIterator;
 
-FontMap maFonts;
+std::vector> maFonts;
 
 sal_Int32 mnDocWidth;
 sal_Int32 mnDocHeight;
diff --git a/filter/source/flash/swfwriter1.cxx 
b/filter/source/flash/swfwriter1.cxx
index 882a4794401d..067f238bd31c 100644

[Libreoffice-commits] core.git: 2 commits - filter/source sc/source solenv/gbuild

2017-09-20 Thread Michael Stahl
 filter/source/msfilter/msdffimp.cxx |   21 -
 filter/source/msfilter/svdfppt.cxx  |   17 +
 sc/source/filter/excel/xiescher.cxx |   23 ---
 sc/source/filter/inc/xiescher.hxx   |8 
 solenv/gbuild/platform/com_MSC_class.mk |6 --
 5 files changed, 45 insertions(+), 30 deletions(-)

New commits:
commit 0581342a5beffefe96ac3b10f46763cda93285a8
Author: Michael Stahl 
Date:   Wed Sep 20 12:44:47 2017 +0200

gbuild: remove obsolete comment

There is only one PCH since commit "kill gb_NoexPrecompiledHeader"
2bf530153e9fb24aef62bf5e16e23ea1412887dd

Change-Id: I1b31462227df021068e8a6320d0613809d2503bc

diff --git a/solenv/gbuild/platform/com_MSC_class.mk 
b/solenv/gbuild/platform/com_MSC_class.mk
index 8fadf93bb50c..85701a3fbda1 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -63,12 +63,6 @@ endef
 
 # PrecompiledHeader class
 
-# Note: MSVC has a race condition when dealing with .pdb files, that can 
result in error C1033 when
-# the .pdb file already exists and two cl.exe invocations try to modify it at 
the same time (which
-# is apparently most likely when generating both .pch files). The 
no-exceptions variant should be
-# rarely needed now, but in case this turns out to be a problem in practice, 
this will need to
-# be handled somehow (such as order-dependency of one on another).
-
 gb_PrecompiledHeader_get_enableflags = -Yu$(1).hxx \
-FI$(1).hxx \
-Fp$(call gb_PrecompiledHeader_get_target,$(1)) \
commit adbf0374e92508ff7170cc1bde9ca63de112ca11
Author: Michael Stahl 
Date:   Wed Sep 20 12:36:41 2017 +0200

filter,sc: try to prevent potential SeekToEndOfRecord infinite loops

SeekToEndOfRecord() now doesn't seek to EOF if the offset is too large;
break out of loops in the obvious cases where this could be problematic.

But don't use SAL_WARN_UNUSED_RESULT because unfortunately GCC doesn't
allow to explicitly suppress that with a (void) cast.

Change-Id: Ie0211075bf0f4ef271bb26bdfead5fb070875a2b

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index ac04412ca3f4..48d2f2952121 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3210,7 +3210,11 @@ bool SvxMSDffManager::SeekToShape( SvStream& rSt, void* 
/* pClientData */, sal_u
 if (!ReadDffRecordHeader(rSt, aEscherObjListHd))
 break;
 if ( aEscherObjListHd.nRecVer != 0xf )
-aEscherObjListHd.SeekToEndOfRecord( rSt );
+{
+bool bSeekSuccess = 
aEscherObjListHd.SeekToEndOfRecord(rSt);
+if (!bSeekSuccess)
+break;
+}
 else if ( aEscherObjListHd.nRecType == 
DFF_msofbtSpContainer )
 {
 DffRecordHeader aShapeHd;
@@ -3225,7 +3229,9 @@ bool SvxMSDffManager::SeekToShape( SvStream& rSt, void* 
/* pClientData */, sal_u
 break;
 }
 }
-aEscherObjListHd.SeekToEndOfRecord( rSt );
+bool bSeekSuccess = 
aEscherObjListHd.SeekToEndOfRecord(rSt);
+if (!bSeekSuccess)
+break;
 }
 }
 }
@@ -3596,7 +3602,9 @@ void SvxMSDffManager::ReadObjText( SvStream& rStream, 
SdrObject* pObj )
 default:
 break;
 }
-aHd.SeekToEndOfRecord( rStream );
+bool bSeekSuccess = aHd.SeekToEndOfRecord(rStream);
+if (!bSeekSuccess)
+break;
 }
 }
 }
@@ -3782,9 +3790,12 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& 
rSt, SfxItemSet& rSet, cons
 Still no luck, lets look at the end of this record for a FBSE 
pool,
 this fallback is a specific case for how word does it sometimes
 */
-rObjData.rSpHd.SeekToEndOfRecord( rSt );
+bool bOk = rObjData.rSpHd.SeekToEndOfRecord( rSt );
 DffRecordHeader aHd;
-bool bOk = ReadDffRecordHeader(rSt, aHd);
+if (bOk)
+{
+bOk = ReadDffRecordHeader(rSt, aHd);
+}
 if (bOk && DFF_msofbtBSE == aHd.nRecType)
 {
 const sal_uLong nSkipBLIPLen = 20;
diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index f39a726413e0..2bbadab82d74 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -559,7 +559,7 @@ bool SdrEscherImport::ReadString( OUString& 

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

2017-04-08 Thread Markus Mohrhard
 filter/source/msfilter/msdffimp.cxx |9 ++---
 sc/source/core/data/column.cxx  |   20 
 2 files changed, 22 insertions(+), 7 deletions(-)

New commits:
commit 32e9332a218f9e7441df158c81869b924e520193
Author: Markus Mohrhard 
Date:   Sat Apr 8 19:56:28 2017 +0200

support normal mark in deletion code

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

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index c8a450e5aca0..1f081ca09e98 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -469,11 +469,23 @@ void ScColumn::ClearSelectionItems( const sal_uInt16* 
pWhich,const ScMarkData& r
 SCROW nTop;
 SCROW nBottom;
 
-if ( pAttrArray && rMark.IsMultiMarked() )
+if (pAttrArray)
 {
-ScMultiSelIter aMultiIter( rMark.GetMultiSelData(), nCol );
-while (aMultiIter.Next( nTop, nBottom ))
-pAttrArray->ClearItems(nTop, nBottom, pWhich);
+if (rMark.IsMultiMarked() )
+{
+ScMultiSelIter aMultiIter( rMark.GetMultiSelData(), nCol );
+while (aMultiIter.Next( nTop, nBottom ))
+pAttrArray->ClearItems(nTop, nBottom, pWhich);
+}
+else if (rMark.IsMarked())
+{
+ScRange aRange;
+rMark.GetMarkArea(aRange);
+if (aRange.aStart.Col() <= nCol && nCol <= aRange.aEnd.Col())
+{
+pAttrArray->ClearItems(aRange.aStart.Row(), aRange.aEnd.Row(), 
pWhich);
+}
+}
 }
 }
 
commit 79890a6d1bccbba8c40e42566c3d437d7a1aaace
Author: Caolán McNamara 
Date:   Sat Apr 8 20:31:35 2017 +0100

limit symbol visibility

Change-Id: I54d5fbe1cd9d5ae94cb134f08fc00593c802ebee

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index c3b428655b37..e13d0c317294 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -222,10 +222,13 @@ DffPropertyReader::DffPropertyReader( const 
SvxMSDffManager& rMan )
 InitializePropSet( DFF_msofbtOPT );
 }
 
-bool checkSeek(SvStream , sal_uInt32 nOffset)
+namespace
 {
-const sal_uInt64 nMaxSeek(rSt.Tell() + rSt.remainingSize());
-return (nOffset <= nMaxSeek && rSt.Seek(nOffset) == nOffset);
+bool checkSeek(SvStream , sal_uInt32 nOffset)
+{
+const sal_uInt64 nMaxSeek(rSt.Tell() + rSt.remainingSize());
+return (nOffset <= nMaxSeek && rSt.Seek(nOffset) == nOffset);
+}
 }
 
 void DffPropertyReader::SetDefaultPropSet( SvStream& rStCtrl, sal_uInt32 
nOffsDgg ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-09-15 Thread Caolán McNamara
 filter/source/svg/svgexport.cxx  |   22 +-
 filter/source/svg/svgfilter.hxx  |   18 --
 sc/source/ui/inc/undostyl.hxx|9 -
 sc/source/ui/undo/undostyl.cxx   |   24 +---
 sw/source/filter/ww8/ww8par.hxx  |9 ++---
 sw/source/filter/ww8/ww8par2.cxx |6 +++---
 sw/source/filter/ww8/ww8par6.cxx |   13 ++---
 7 files changed, 33 insertions(+), 68 deletions(-)

New commits:
commit 6dee1b1a8c12770d1e8139819aa532056deb3ed5
Author: Caolán McNamara 
Date:   Thu Sep 15 12:02:44 2016 +0100

use std::unique_ptr

Change-Id: Ibdbb7c32435684c7166ff3437a9fe812b3760356

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 9c9ac5f..77964a8 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -373,48 +373,36 @@ SVGExport::SVGExport(
 XML_NAMESPACE_ANIMATION);
 }
 
-
 SVGExport::~SVGExport()
 {
 GetDocHandler()->endDocument();
 }
 
-
-ObjectRepresentation::ObjectRepresentation() :
-mpMtf( nullptr )
+ObjectRepresentation::ObjectRepresentation()
 {
 }
 
-
 ObjectRepresentation::ObjectRepresentation( const Reference< XInterface >& 
rxObject,
 const GDIMetaFile& rMtf ) :
 mxObject( rxObject ),
-mpMtf( new GDIMetaFile( rMtf ) )
+mxMtf( new GDIMetaFile( rMtf ) )
 {
 }
 
-
 ObjectRepresentation::ObjectRepresentation( const ObjectRepresentation& 
rPresentation ) :
 mxObject( rPresentation.mxObject ),
-mpMtf( rPresentation.mpMtf ? new GDIMetaFile( *rPresentation.mpMtf ) : 
nullptr )
-{
-}
-
-
-ObjectRepresentation::~ObjectRepresentation()
+mxMtf( rPresentation.mxMtf ? new GDIMetaFile( *rPresentation.mxMtf ) : 
nullptr )
 {
-delete mpMtf;
 }
 
-
 ObjectRepresentation& ObjectRepresentation::operator=( const 
ObjectRepresentation& rPresentation )
 {
 // Check for self-assignment
 if (this == )
 return *this;
+
 mxObject = rPresentation.mxObject;
-delete mpMtf;
-mpMtf = rPresentation.mpMtf ? new GDIMetaFile( *rPresentation.mpMtf ) : 
nullptr;
+mxMtf.reset(rPresentation.mxMtf ? new GDIMetaFile(*rPresentation.mxMtf) : 
nullptr);
 
 return *this;
 }
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 447bf77..2d47638 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -123,21 +123,19 @@ class ObjectRepresentation
 private:
 
 Reference< XInterface > mxObject;
-GDIMetaFile*mpMtf;
+std::unique_ptrmxMtf;
 
 public:
+ObjectRepresentation();
+ObjectRepresentation(const Reference< XInterface >& rxIf,
+ const GDIMetaFile& rMtf);
+ObjectRepresentation(const ObjectRepresentation& rPresentation);
 
-  ObjectRepresentation();
-  ObjectRepresentation( const Reference< 
XInterface >& rxIf,
-const GDIMetaFile& 
rMtf );
-  ObjectRepresentation( const 
ObjectRepresentation& rPresentation );
-  ~ObjectRepresentation();
-
-ObjectRepresentation& operator=( const ObjectRepresentation& 
rPresentation );
+ObjectRepresentation& operator=(const ObjectRepresentation& rPresentation);
 
 const Reference< XInterface >&GetObject() const { return mxObject; }
-bool  HasRepresentation() const { return mpMtf != 
nullptr; }
-const GDIMetaFile&GetRepresentation() const { return 
*mpMtf; }
+bool  HasRepresentation() const { return 
static_cast(mxMtf); }
+const GDIMetaFile&GetRepresentation() const { return 
*mxMtf; }
 };
 
 struct PagePropertySet
diff --git a/sc/source/ui/inc/undostyl.hxx b/sc/source/ui/inc/undostyl.hxx
index 3674b31..d7d96ab 100644
--- a/sc/source/ui/inc/undostyl.hxx
+++ b/sc/source/ui/inc/undostyl.hxx
@@ -31,19 +31,18 @@ class ScStyleSaveData
 private:
 OUStringaName;
 OUStringaParent;
-SfxItemSet* pItems;
+std::unique_ptr  xItems;
 
 public:
-ScStyleSaveData();
-ScStyleSaveData( const ScStyleSaveData& rOther );
-~ScStyleSaveData();
+ScStyleSaveData();
+ScStyleSaveData( const ScStyleSaveData& rOther );
 ScStyleSaveData&operator=( const ScStyleSaveData& rOther );
 
 voidInitFromStyle( const SfxStyleSheetBase* pSource );
 
 const OUString& GetName() const { return aName; }
 const OUString& GetParent() const   { return aParent; }
-const SfxItemSet*   GetItems() const{ return pItems; }
+const SfxItemSet*   GetItems() const{ return xItems.get(); }
 };
 
 class ScUndoModifyStyle: public ScSimpleUndo
diff --git