[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-04-03 Thread Armin Le Grand (via logerrit)
 sw/source/core/doc/notxtfrm.cxx |   29 +++--
 1 file changed, 27 insertions(+), 2 deletions(-)

New commits:
commit c2ae30b19d8145271f1189c9757d59d43de391c7
Author: Armin Le Grand 
AuthorDate: Tue Apr 2 17:59:40 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Apr 3 12:32:38 2019 +0200

tdf#124272 use ClipRegion's geometry if not a rectangle

By error the ClipRegion's geometry was replaced by it's
BoundRect expanded to PixelBounds. If the ClipRegion
is not a rectangle, this will create wrong results. To
do both - extend to PixelBounds and have the original
geometry included - use the PolyPolygon topology as
needed (see comment in code for details)

Reviewed-on: https://gerrit.libreoffice.org/70146
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 
(cherry picked from commit 362c1cf2bd580f6dc8bf27bdcd79174111bc1b5c)

Conflicts:
sw/source/core/doc/notxtfrm.cxx

Change-Id: If3f75223144eba8eb23909a7c701ad544346099b
Reviewed-on: https://gerrit.libreoffice.org/70158
Tested-by: Xisco Faulí 
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 6dd910fab9ee..6055384ac8a7 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -988,9 +988,34 @@ void paintGraphicUsingPrimitivesHelper(
 ceil(aClipRange.getMaxX() + aSinglePixelXY.getX()),
 ceil(aClipRange.getMaxY() + aSinglePixelXY.getY()));
 
+// create the enclosing rectangle as polygon
+basegfx::B2DPolyPolygon 
aTarget(basegfx::utils::createPolygonFromRect(aExpandedClipRange));
+
+// tdf#124272 the fix above (tdf#114076) was too rough - the
+// clip region used may be a PolyPolygon. In that case that
+// PolyPolygon would have to be scaled to mentioned 
PixelBounds.
+// Since that is not really possible geometrically (would need
+// more some 'grow in outside direction' but with unequal grow
+// values in all directions - just maaany problems
+// involved), use a graphical trick: The topology of the
+// PolyPolygon uses the stndard FillRule, so adding the now
+// guaranteed to be bigger or equal bounding (enclosing)
+// rectangle twice as polygon will expand the BoundRange, but
+// not change the geometry visualization at all
+if(!rOutputDevice.GetClipRegion().IsRectangle())
+{
+// double the outer rectangle range polygon to have it
+// included twice
+aTarget.append(aTarget.getB2DPolygon(0));
+
+// add the original clip 'inside' (due to being smaller
+// or equal). That PolyPolygon may have an unknown number
+// of polygons (>=1)
+aTarget.append(aClip);
+}
+
 aContent[0] = new drawinglayer::primitive2d::MaskPrimitive2D(
-basegfx::B2DPolyPolygon(
-
basegfx::utils::createPolygonFromRect(aExpandedClipRange)),
+aTarget,
 aContent);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-03-27 Thread Caolán McNamara (via logerrit)
 sw/source/core/unocore/unostyle.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit cdef6e5f4053adf5413781a9282285eab3923373
Author: Caolán McNamara 
AuthorDate: Mon Mar 25 12:06:20 2019 +
Commit: Xisco Faulí 
CommitDate: Wed Mar 27 16:33:31 2019 +0100

Resolves: tdf#124142 don't deref nullptr

Change-Id: Ie14600e9f9a1e1c4e99c7a872f5d677453481888
Reviewed-on: https://gerrit.libreoffice.org/69666
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit ac7ce7a64ef903bad1476f5635a7b2a1e951a7a3)
Reviewed-on: https://gerrit.libreoffice.org/69694
Reviewed-by: Xisco Faulí 

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 6fe6857b72d1..dc619361a7e7 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -195,7 +195,8 @@ namespace sw
 , m_pBasePool(pDocShell->GetStyleSheetPool())
 , m_pDocShell(pDocShell)
 {
-StartListening(*m_pBasePool);
+if (m_pBasePool) //tdf#124142 html docs can have no styles
+StartListening(*m_pBasePool);
 }
 
 //XIndexAccess
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-03-22 Thread Libreoffice Gerrit user
 sw/source/core/text/itradj.cxx  |   11 +++
 sw/source/core/text/portxt.cxx  |3 +--
 sw/source/core/txtnode/fntcache.cxx |9 +++--
 3 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit be189bfc1709dce48111eed49d847c05ef82164e
Author: Khaled Hosny 
AuthorDate: Thu Mar 21 15:00:22 2019 +0200
Commit: Xisco Faulí 
CommitDate: Fri Mar 22 10:02:28 2019 +0100

tdf#124109: Revert "Only do kashida insertion with fonts that have non-zero 
width kashidas"

This reverts commit c45b23377bb2fe44c26f1287ff38495344e4ca50.

This commit breaks Kashida justification when a document is first opened 
(the
kashida justification will be disabled and spaces will be used untill the 
text
is changed). Probably it is checking for width of Kashida glyph too early. 
Also
I'm not sure what the reverted commit was trying to fix since we already do
kashida justification in fonts that has non-zero width Kashida and it has 
been
the case for a long time.

This does not fix the original issue in the document attched with the bug
report, but if fixes kashida not being applied when opening the document.

Change-Id: Ic95859bca94fa792793e3223d2adb465bc6d880f
Reviewed-on: https://gerrit.libreoffice.org/69509
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 
(cherry picked from commit 0a8e9cc5c1782f1cd50ef338ec2aa4f6776a4c0e)
Reviewed-on: https://gerrit.libreoffice.org/69519
Reviewed-by: Khaled Hosny 

diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 8383292105bc..bacc39e348b1 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -113,9 +113,6 @@ void SwTextAdjuster::FormatBlock( )
 static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& 
rInf, SwTextIter& rItr,
 sal_Int32& rKashidas, TextFrameIndex& nGluePortion)
 {
-if ( rInf.GetOut()->GetMinKashida() <= 0 )
-return false;
-
 // i60594 validate Kashida justification
 TextFrameIndex nIdx = rItr.GetStart();
 TextFrameIndex nEnd = rItr.GetEnd();
@@ -153,6 +150,12 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, 
SwTextSizeInfo& rInf,
 sal_Int32 nKashidasInAttr = rSI.KashidaJustify ( nullptr, nullptr, 
nIdx, nNext - nIdx );
 if (nKashidasInAttr > 0)
 {
+// Kashida glyph looks suspicious, skip Kashida justification
+if ( rInf.GetOut()->GetMinKashida() <= 0 )
+{
+return false;
+}
+
 sal_Int32 nKashidasDropped = 0;
 if ( !SwScriptInfo::IsArabicText( rInf.GetText(), nIdx, nNext - 
nIdx ) )
 {
@@ -212,7 +215,7 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, 
SwTextSizeInfo& rInf, SwT
 sal_Int32 nKashidasInAttr = rSI.KashidaJustify ( nullptr, nullptr, 
nIdx, nNext - nIdx );
 
 long nFontMinKashida = rInf.GetOut()->GetMinKashida();
-if ( nKashidasInAttr > 0 && SwScriptInfo::IsArabicText( 
rInf.GetText(), nIdx, nNext - nIdx ) )
+if ( nFontMinKashida && nKashidasInAttr > 0 && 
SwScriptInfo::IsArabicText( rInf.GetText(), nIdx, nNext - nIdx ) )
 {
 sal_Int32 nKashidasDropped = 0;
 while ( rKashidas && nGluePortion && nKashidasInAttr > 0 &&
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 69593f8d157c..f520130458e2 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -115,8 +115,7 @@ static TextFrameIndex lcl_AddSpace(const SwTextSizeInfo 
,
 // Kashida Justification: Insert Kashidas
 if ( nEnd > nPos && pSI && COMPLEX == nScript )
 {
-if ( SwScriptInfo::IsArabicText( *pStr, nPos, nEnd - nPos ) && 
rInf.GetOut()->GetMinKashida()
-&& pSI->CountKashida() )
+if ( SwScriptInfo::IsArabicText( *pStr, nPos, nEnd - nPos ) && 
pSI->CountKashida() )
 {
 const sal_Int32 nKashRes = pSI->KashidaJustify( nullptr, nullptr, 
nPos, nEnd - nPos );
 // i60591: need to check result of KashidaJustify
diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index a0a38aa94364..5c7ab0e0ad93 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1249,8 +1249,7 @@ void SwFntObj::DrawText( SwDrawTextInfo  )
 // Kashida Justification
 if ( SwFontScript::CTL == nActual && nSpaceAdd )
 {
-if ( SwScriptInfo::IsArabicText( rInf.GetText(), 
rInf.GetIdx(), rInf.GetLen() )
-&& rInf.GetOut().GetMinKashida() )
+if ( SwScriptInfo::IsArabicText( rInf.GetText(), 
rInf.GetIdx(), rInf.GetLen() ) )
 {
 if ( pSI && pSI->CountKashida() &&
 pSI->KashidaJustify( pKernArray.get(), nullptr, 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-03-13 Thread Libreoffice Gerrit user
 sw/source/ui/misc/outline.cxx |   27 ++-
 1 file changed, 22 insertions(+), 5 deletions(-)

New commits:
commit 718e49e1f4281cfc77d05e537aab0cf701f6e341
Author: Julien Nabet 
AuthorDate: Tue Feb 19 23:24:58 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Wed Mar 13 17:00:40 2019 +0100

tdf#123547: do the same as in lcl_DrawBullet from cui/numpages.cxx

See bt https://bugs.documentfoundation.org/attachment.cgi?id=149389
It seems the method from cui/numpages.cxx takes more things into account

At least, it doesn't crash for the attachment of this tracker

Change-Id: I05ca0b019ac483890bea4acdbb695d73b660e638
Reviewed-on: https://gerrit.libreoffice.org/68033
Tested-by: Jenkins
(cherry picked from commit 684fcf2fce915f3e3e553c67fb57bdbfc8f159d5)
Reviewed-on: https://gerrit.libreoffice.org/68843
Reviewed-by: Michael Stahl 
(cherry picked from commit 7f2322afea3b25bc45f438b8ae9d4977ac378c1c)
Reviewed-on: https://gerrit.libreoffice.org/69172
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index c23794861501..23bb9c66ca4d 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -822,13 +822,30 @@ static long lcl_DrawBullet(vcl::RenderContext* pVDev, 
const SwNumFormat& rFormat
 {
 vcl::Font aTmpFont(pVDev->GetFont());
 
-vcl::Font aFont(*rFormat.GetBulletFont());
-aFont.SetFontSize(rSize);
+// via Uno it's possible that no font has been set!
+vcl::Font aFont(rFormat.GetBulletFont() ? *rFormat.GetBulletFont() : 
aTmpFont);
+Size aTmpSize(rSize);
+aTmpSize.setWidth( aTmpSize.Width() * ( rFormat.GetBulletRelSize()) );
+aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
+aTmpSize.setHeight( aTmpSize.Height() * ( rFormat.GetBulletRelSize()) );
+aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
+// in case of a height of zero it is drawn in original height
+if(!aTmpSize.Height())
+aTmpSize.setHeight( 1 );
+aFont.SetFontSize(aTmpSize);
 aFont.SetTransparent(true);
-pVDev->SetFont(aFont);
+Color aBulletColor = rFormat.GetBulletColor();
+if(aBulletColor == COL_AUTO)
+aBulletColor = pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK;
+else if(aBulletColor == pVDev->GetFillColor())
+aBulletColor.Invert();
+aFont.SetColor(aBulletColor);
+pVDev->SetFont( aFont );
 OUString aText(rFormat.GetBulletChar());
-pVDev->DrawText(Point(nXStart, nYStart), aText);
-const long nRet = pVDev->GetTextWidth(aText);
+long nY = nYStart;
+nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
+pVDev->DrawText( Point(nXStart, nY), aText );
+long nRet = pVDev->GetTextWidth(aText);
 
 pVDev->SetFont(aTmpFont);
 return nRet;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-03-11 Thread Libreoffice Gerrit user
 sw/source/filter/xml/xmlimp.cxx |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit f053400c3f8c89ae122387dc64c63d2cfba86bbb
Author: Michael Stahl 
AuthorDate: Wed Mar 6 12:03:32 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Mar 12 04:15:07 2019 +0100

tdf#116195 sw: remove DisableOffPagePositioning handling from ODF import

SwXMLImport::SetConfigurationSettings() needs to handle only those
settings for which the default is different vs. old OOo/LO versions;
DisableOffPagePositioning however defaults to false, so we can just rely
on that default.  The inverted bDisableOffPagePositioning check is
wrong.

(regression from fe3d5766fa3c42f6cf8d1ea47af820e0b1c1cf48)

Change-Id: I300fa597f58b586b49089bb555a00a6923862abe
Reviewed-on: https://gerrit.libreoffice.org/68801
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 8f3df3a5a1570eea4d931f737c474df8601377ec)
Reviewed-on: https://gerrit.libreoffice.org/69037
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index d838a8adb8a6..1f4d243f6c93 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1358,7 +1358,6 @@ void SwXMLImport::SetConfigurationSettings(const Sequence 
< PropertyValue > & aC
 aExcludeWhenNotLoadingUserSettings.insert("TabOverMargin");
 
aExcludeWhenNotLoadingUserSettings.insert("PropLineSpacingShrinksFirstLine");
 aExcludeWhenNotLoadingUserSettings.insert("SubtractFlysAnchoredAtFlys");
-aExcludeWhenNotLoadingUserSettings.insert("DisableOffPagePositioning");
 
 sal_Int32 nCount = aConfigProps.getLength();
 const PropertyValue* pValues = aConfigProps.getConstArray();
@@ -1392,7 +1391,6 @@ void SwXMLImport::SetConfigurationSettings(const Sequence 
< PropertyValue > & aC
 bool bTabOverMargin = false;
 bool bPropLineSpacingShrinksFirstLine = false;
 bool bSubtractFlysAnchoredAtFlys = false;
-bool bDisableOffPagePositioning = false;
 bool bCollapseEmptyCellPara = false;
 
 const PropertyValue* currentDatabaseDataSource = nullptr;
@@ -1486,8 +1484,6 @@ void SwXMLImport::SetConfigurationSettings(const Sequence 
< PropertyValue > & aC
 bPropLineSpacingShrinksFirstLine = true;
 else if (pValues->Name == "SubtractFlysAnchoredAtFlys")
 bSubtractFlysAnchoredAtFlys = true;
-else if (pValues->Name == "DisableOffPagePositioning")
-bDisableOffPagePositioning = true;
 else if (pValues->Name == "CollapseEmptyCellPara")
 bCollapseEmptyCellPara = true;
 }
@@ -1650,9 +1646,6 @@ void SwXMLImport::SetConfigurationSettings(const Sequence 
< PropertyValue > & aC
 if (!bSubtractFlysAnchoredAtFlys)
 xProps->setPropertyValue("SubtractFlysAnchoredAtFlys", makeAny(true));
 
-if ( bDisableOffPagePositioning )
-xProps->setPropertyValue("DisableOffPagePositioning", makeAny(true));
-
 if (!bCollapseEmptyCellPara)
 xProps->setPropertyValue("CollapseEmptyCellPara", makeAny(false));
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-02-13 Thread Libreoffice Gerrit user
 sw/source/uibase/uno/unotxdoc.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 2ab2280f21fa491154e17c303dc70fcf059123b3
Author: Samuel Mehrbrodt 
AuthorDate: Wed Feb 13 09:51:29 2019 +0100
Commit: Xisco Faulí 
CommitDate: Wed Feb 13 12:45:26 2019 +0100

Revert "tdf#121962 Update fields after layout has been calculated"

See tdf#123378 for the problem caused by this.
I have a fix at https://gerrit.libreoffice.org/#/c/67754/
but I prefer to revert the fix on 6-1 branch since this is the last
release in this series and I'm not sure if the fix has other side effects.

This reverts commit d9f02548f29678b8b7fc3a6c714ab144bd728005.

Change-Id: If9298b9cafaf6984ce25ba78b2c7a79171567840
Reviewed-on: https://gerrit.libreoffice.org/67755
Tested-by: Xisco Faulí 
Reviewed-by: Xisco Faulí 

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 6e9701c765eb..1db55d3c5831 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2630,6 +2630,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
 bStateChanged = true;
 }
 
+// #122919# Force field update before PDF export
+pViewShell->SwViewShell::UpdateFields(true);
 if( bStateChanged )
 pRenderDocShell->EnableSetModified();
 
@@ -2639,9 +2641,6 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
 pViewShell->CalcLayout();
 pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() );
 
-// #122919# Force field update before PDF export, but after layout 
init (tdf#121962)
-pViewShell->SwViewShell::UpdateFields(true);
-
 pViewShell->SetPDFExportOption( false );
 
 // enable view again
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-02-11 Thread Libreoffice Gerrit user
 sw/source/ui/chrdlg/drpcps.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit ad4e32ce3696de21d797e200b565e830320e14eb
Author: Caolán McNamara 
AuthorDate: Mon Feb 11 11:13:49 2019 +
Commit: Xisco Faulí 
CommitDate: Mon Feb 11 17:40:20 2019 +0100

Resolves: tdf#123320 non-existing drop caps char style

Change-Id: I416e3fcffe7da549ffd3b82cb912d78d1ca02339
Reviewed-on: https://gerrit.libreoffice.org/67684
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 854e3f29fcf3..176efeaccdd5 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -549,9 +549,14 @@ void  SwDropCapsPage::Reset(const SfxItemSet *rSet)
 m_xTemplateBox->insert_text(0, SwResId(SW_STR_NONE));
 
 // Reset format
-m_xTemplateBox->set_active(0);
+int nSelect = 0;
 if (aFormatDrop.GetCharFormat())
-
m_xTemplateBox->set_active_text(aFormatDrop.GetCharFormat()->GetName());
+{
+int nPos = 
m_xTemplateBox->find_text(aFormatDrop.GetCharFormat()->GetName());
+if (nPos != -1)
+nSelect = nPos;
+}
+m_xTemplateBox->set_active(nSelect);
 
 // Enable controls
 m_xDropCapsBox->set_active(aFormatDrop.GetLines() > 1);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-02-07 Thread Libreoffice Gerrit user
 sw/source/core/layout/frmtool.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit e6e8f02407ea781a3634fd2669ad6467e9587db4
Author: Caolán McNamara 
AuthorDate: Wed Feb 6 12:34:26 2019 +
Commit: Michael Stahl 
CommitDate: Thu Feb 7 10:59:58 2019 +0100

Resolves: tdf#123163 avoid null deref

one RemoveDrawObjFromPage is already null-deref protected,
do the same for the other

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

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 5c5ea5d1e76c..ab7799a350a7 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2406,7 +2406,8 @@ static void lcl_RemoveObjsFromPage( SwFrame* _pFrame )
 {
 if (pObj->GetFrameFormat().GetAnchor().GetAnchorId() != 
RndStdIds::FLY_AS_CHAR)
 {
-pObj->GetPageFrame()->RemoveDrawObjFromPage(
+if (SwPageFrame *pPg = pObj->GetPageFrame())
+pPg->RemoveDrawObjFromPage(
 *static_cast(pObj) );
 }
 }
@@ -2747,8 +2748,8 @@ static void lcl_Regist( SwPageFrame *pPage, const SwFrame 
*pAnch )
 if ( pPage != pObj->GetPageFrame() )
 {
 // #i28701#
-if ( pObj->GetPageFrame() )
-pObj->GetPageFrame()->RemoveDrawObjFromPage( *pObj );
+if (SwPageFrame *pPg = pObj->GetPageFrame())
+pPg->RemoveDrawObjFromPage( *pObj );
 pPage->AppendDrawObjToPage( *pObj );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-02-05 Thread Libreoffice Gerrit user
 sw/source/core/graphic/ndgrf.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 71021e2f2619ed3c363e1d4cc1cde79bb1f2bd29
Author: Tomaž Vajngerl 
AuthorDate: Sun Feb 3 21:16:40 2019 +0100
Commit: Xisco Faulí 
CommitDate: Tue Feb 5 16:04:54 2019 +0100

tdf#119661 remove the original URL when removing a graphic link

Change-Id: I8c875202ba8af9cbcd7eb9ce0db78f97d56a07a8
Reviewed-on: https://gerrit.libreoffice.org/67337
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 6a36bedd0a418ce12543f797ab46f24ee57feb6c)
Reviewed-on: https://gerrit.libreoffice.org/67349
Reviewed-by: Xisco Faulí 

diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 5cfd3ce51508..66b1d56d0d91 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -612,7 +612,7 @@ void SwGrfNode::ReleaseLink()
 {
 if( refLink.is() )
 {
-const Graphic aLocalGraphic(maGrfObj.GetGraphic());
+Graphic aLocalGraphic(maGrfObj.GetGraphic());
 const bool bHasOriginalData(aLocalGraphic.IsGfxLink());
 
 {
@@ -624,6 +624,7 @@ void SwGrfNode::ReleaseLink()
 
 getIDocumentLinksAdministration().GetLinkManager().Remove( 
refLink.get() );
 refLink.clear();
+aLocalGraphic.setOriginURL("");
 
 // #i15508# added extra processing after getting rid of the link. Use 
whatever is
 // known from the formerly linked graphic to get to a state as close 
to a directly
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-02-01 Thread Libreoffice Gerrit user
 sw/source/core/crsr/crstrvl.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ffccaf2110a25f0b05174e6e9728e4e860c6398b
Author: Michael Stahl 
AuthorDate: Wed Jan 30 12:16:30 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Fri Feb 1 09:31:16 2019 +0100

sw: fix use-after-free in SwCursorShell::MoveFieldType()

Change-Id: Ie272373bcef3459b05dc29bf874ecc3fdfa31d4a
Reviewed-on: https://gerrit.libreoffice.org/67151
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit 1ec8caedace2de2b7e6bf91468301548b54a28a8)
Reviewed-on: https://gerrit.libreoffice.org/67173
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index cef97092485c..2586ed6483cf 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -737,8 +737,9 @@ bool SwCursorShell::MoveFieldType(
 
 if( bDelField )
 {
-delete static_cast(>GetAttr());
+auto const 
pFormat(static_cast(>GetAttr()));
 delete pTextField;
+delete pFormat;
 }
 
 if( it != aSrtLst.end() && isSrch ) // found
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-01-09 Thread Libreoffice Gerrit user
 sw/source/uibase/wrtsh/wrtundo.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit fd373f5f584d9de82cce76b98bd21f7dfe38844c
Author: Caolán McNamara 
AuthorDate: Tue Jan 8 13:46:53 2019 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Jan 9 15:00:32 2019 +0100

Resolves: tdf#121940 mnemonic ends up in tooltip text

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

diff --git a/sw/source/uibase/wrtsh/wrtundo.cxx 
b/sw/source/uibase/wrtsh/wrtundo.cxx
index 27c7f0e34ed6..293b130405e4 100644
--- a/sw/source/uibase/wrtsh/wrtundo.cxx
+++ b/sw/source/uibase/wrtsh/wrtundo.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 // Undo ends all modes. If a selection is emerged by the Undo,
 // this must be considered for further action.
@@ -108,7 +109,7 @@ OUString SwWrtShell::GetDoString( DoType eDoType ) const
 default:;//prevent warning
 }
 
-return SvtResId(pResStr) + aUndoStr;
+return MnemonicGenerator::EraseAllMnemonicChars(SvtResId(pResStr)) + 
aUndoStr;
 }
 
 void SwWrtShell::GetDoStrings( DoType eDoType, SfxStringListItem& rStrs ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2019-01-07 Thread Libreoffice Gerrit user
 sw/source/uibase/docvw/edtwin.cxx |   10 +-
 sw/source/uibase/inc/edtwin.hxx   |2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3d6ca7b271de18ba27a4d71ca7feef452e38c47c
Author: Mike Kaganski 
AuthorDate: Thu Jan 3 16:43:30 2019 +0300
Commit: Caolán McNamara 
CommitDate: Mon Jan 7 10:48:19 2019 +0100

tdf#122442: use Timer to detect single-clicks vs double-clicks

Regression from commit 821ae0fb9fa63e0171f987d5ec210ec121978b8f which
appeared after commits changing scheduler/main loop in the range

e6e8a060ecc6e4fd51cfe88e00d841d546ed5915..9b4abcd1c45a646a1ac9120fe1c489ba6bb44e95

Change-Id: I6cf58c1e83aa9621bdd4b5c14f8565d5c69e20c1
Reviewed-on: https://gerrit.libreoffice.org/65837
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 6207c51880c9165eedb1d1af7fdc5e179bc8844d)
Reviewed-on: https://gerrit.libreoffice.org/65842
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 3be0d47726de..c892f902fed0 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4761,12 +4761,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 rSh.EnterStdMode();
 rSh.SetVisibleCursor(aDocPt);
 bCallBase = false;
-m_aTemplateIdle.Stop();
+m_aTemplateTimer.Stop();
 }
 else if(rMEvt.GetClicks() == 1)
 {
 // no selection -> so turn off watering can
-m_aTemplateIdle.Start();
+m_aTemplateTimer.Start();
 }
 }
 }
@@ -5007,9 +5007,9 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView 
):
 m_aKeyInputFlushTimer.SetInvokeHandler(LINK(this, SwEditWin, 
KeyInputFlushHandler));
 
 // TemplatePointer for colors should be resetted without
-// selection after single click
-m_aTemplateIdle.SetPriority(TaskPriority::LOWEST);
-m_aTemplateIdle.SetInvokeHandler(LINK(this, SwEditWin, TemplateTimerHdl));
+// selection after single click, but not after double-click (tdf#122442)
+
m_aTemplateTimer.SetTimeout(GetSettings().GetMouseSettings().GetDoubleClickTime());
+m_aTemplateTimer.SetInvokeHandler(LINK(this, SwEditWin, TemplateTimerHdl));
 
 // temporary solution!!! Should set the font of the current
 // insert position at every cursor movement!
diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx
index 091b787d3a3c..b383025d5e57 100644
--- a/sw/source/uibase/inc/edtwin.hxx
+++ b/sw/source/uibase/inc/edtwin.hxx
@@ -80,7 +80,7 @@ class SwEditWin final : public vcl::Window,
 Point   m_aStartPos;
 Point   m_aMovePos;
 Point   m_aRszMvHdlPt;
-Idlem_aTemplateIdle;
+Timer   m_aTemplateTimer;
 
 // type/object where the mouse pointer is
 SwCallMouseEvent m_aSaveCallEvent;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-12-21 Thread Libreoffice Gerrit user
 sw/source/core/edit/edfcol.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 027e592758421287463b1a3bf64cb32d3ef96601
Author: Mike Kaganski 
AuthorDate: Tue Dec 18 09:19:06 2018 +0300
Commit: Caolán McNamara 
CommitDate: Fri Dec 21 09:59:53 2018 +0100

tdf#116496: don't add header when setting empty watermark

Regression from commit 22e94ab1860b1bdea8d107d4e8824f63c6b1c8c5

Change-Id: I66a6e0b5069fe459b887a52f1ea26904dfc2d37b
Reviewed-on: https://gerrit.libreoffice.org/65303
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit c4f3bd7c94cacb52f7a791a0d364818cee6080b6)
Reviewed-on: https://gerrit.libreoffice.org/65416
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 6486de18a102..ee76998aac75 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -1600,6 +1600,7 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& 
rWatermark)
 SwDocShell* pDocShell = GetDoc()->GetDocShell();
 if (!pDocShell)
 return;
+const bool bNoWatermark = rWatermark.GetText().isEmpty();
 
 uno::Reference xModel = pDocShell->GetBaseModel();
 uno::Reference 
xStyleFamiliesSupplier(xModel, uno::UNO_QUERY);
@@ -1615,7 +1616,12 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& 
rWatermark)
 bool bHeaderIsOn = false;
 xPageStyle->getPropertyValue(UNO_NAME_HEADER_IS_ON) >>= bHeaderIsOn;
 if (!bHeaderIsOn)
+{
+if (bNoWatermark)
+continue; // the style doesn't have any watermark - no need to 
do anything
+
 xPageStyle->setPropertyValue(UNO_NAME_HEADER_IS_ON, 
uno::makeAny(true));
+}
 
 // backup header height
 bool bDynamicHeight = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-12-15 Thread Libreoffice Gerrit user
 sw/source/uibase/uno/unotxdoc.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit d9f02548f29678b8b7fc3a6c714ab144bd728005
Author: Samuel Mehrbrodt 
AuthorDate: Thu Dec 13 19:58:36 2018 +0100
Commit: Thorsten Behrens 
CommitDate: Sun Dec 16 01:30:09 2018 +0100

tdf#121962 Update fields after layout has been calculated

Change-Id: Ic4a49494652dab416ddb1545da02eb8a7f533828
Reviewed-on: https://gerrit.libreoffice.org/65126
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit 2bc1d00af6863d5c92389f1f4a99d2ab9bb73f81)
Reviewed-on: https://gerrit.libreoffice.org/65201
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 1db55d3c5831..6e9701c765eb 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2630,8 +2630,6 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
 bStateChanged = true;
 }
 
-// #122919# Force field update before PDF export
-pViewShell->SwViewShell::UpdateFields(true);
 if( bStateChanged )
 pRenderDocShell->EnableSetModified();
 
@@ -2641,6 +2639,9 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
 pViewShell->CalcLayout();
 pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() );
 
+// #122919# Force field update before PDF export, but after layout 
init (tdf#121962)
+pViewShell->SwViewShell::UpdateFields(true);
+
 pViewShell->SetPDFExportOption( false );
 
 // enable view again
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-12-11 Thread Libreoffice Gerrit user
 sw/source/uibase/app/apphdl.cxx |   17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 1ae5f5274011e42dfa85dca5f472ff8bbeecaa4e
Author: Mike Kaganski 
AuthorDate: Thu Dec 6 23:36:04 2018 +0300
Commit: Thorsten Behrens 
CommitDate: Wed Dec 12 00:46:22 2018 +0100

tdf#121606: displaying Mail Merge toolbar shouldn't activate connection

At least I think so. Thus now the code that queries the state of the
toolbar controls only queries dataset if connection is active.

Operating the navigation buttons (next/prev) will, naturally, activate
connection if not yet active. This should also enable the other controls
that may be initially disabled: create/save/print/email documents. Thus,
the navigation controls also check if they have activated the connection,
and invalidate said document creation controls state. Possibly there's a
better place for the invalidation of the controls, but I was unable to
find one.

Regression after commit 5c2c5ff01c23e4f7a8947746afc13a46cbef5bec

Change-Id: I76f895c871718c9c761339ba03963baf6837b592
Reviewed-on: https://gerrit.libreoffice.org/64738
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 60714a814847f6d10f00aa6809a3896a48741e0b)
Reviewed-on: https://gerrit.libreoffice.org/64746
Reviewed-by: Katarina Behrens 
(cherry picked from commit b27a9058c706d70adddc71544b74b1f9607185bb)
Reviewed-on: https://gerrit.libreoffice.org/64959
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 8bd7c3b62a63..5ffb6f06c4ca 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -187,7 +187,8 @@ void SwModule::StateOther(SfxItemSet )
 xConfigItem = pView->GetMailMergeConfigItem();
 if (!xConfigItem)
 rSet.DisableItem(nWhich);
-else
+else if (xConfigItem->GetConnection().is()
+ && !xConfigItem->GetConnection()->isClosed())
 {
 bool bFirst, bLast;
 bool bValid = xConfigItem->IsResultSetFirstLast(bFirst, 
bLast);
@@ -240,6 +241,8 @@ void SwModule::StateOther(SfxItemSet )
 // #i51949# hide e-Mail option if e-Mail is not supported
 // #i63267# printing might be disabled
 if (!xConfigItem ||
+!xConfigItem->GetConnection().is() ||
+xConfigItem->GetConnection()->isClosed() ||
 !xConfigItem->GetResultSet().is() ||
 xConfigItem->GetCurrentDBData().sDataSource.isEmpty() ||
 xConfigItem->GetCurrentDBData().sCommand.isEmpty() ||
@@ -778,6 +781,9 @@ void SwModule::ExecOther(SfxRequest& rReq)
 if (!xConfigItem)
 return;
 
+const bool bHadConnection
+= xConfigItem->GetConnection().is() && 
!xConfigItem->GetConnection()->isClosed();
+
 sal_Int32 nPos = xConfigItem->GetResultSetPosition();
 switch (nWhich)
 {
@@ -815,6 +821,15 @@ void SwModule::ExecOther(SfxRequest& rReq)
 rBindings.Invalidate(FN_MAILMERGE_LAST_ENTRY);
 rBindings.Invalidate(FN_MAILMERGE_CURRENT_ENTRY);
 rBindings.Invalidate(FN_MAILMERGE_EXCLUDE_ENTRY);
+if (!bHadConnection && xConfigItem->GetConnection().is()
+&& !xConfigItem->GetConnection()->isClosed())
+{
+// The connection has been activated. Update controls that 
were disabled
+rBindings.Invalidate(FN_MAILMERGE_CREATE_DOCUMENTS);
+rBindings.Invalidate(FN_MAILMERGE_SAVE_DOCUMENTS);
+rBindings.Invalidate(FN_MAILMERGE_PRINT_DOCUMENTS);
+rBindings.Invalidate(FN_MAILMERGE_EMAIL_DOCUMENTS);
+}
 rBindings.Update();
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-12-05 Thread Libreoffice Gerrit user
 sw/source/uibase/shells/textsh1.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7be57e1f047a11cea355232db6926879199f198b
Author: Michael Stahl 
AuthorDate: Fri Nov 23 14:14:17 2018 +0100
Commit: Miklos Vajna 
CommitDate: Wed Dec 5 19:06:44 2018 +0100

sw: fix wrong title of AutoFormat with redlining dialog

(regression from 9fcef57a34dbd88a98621dfaf8668fa076dd98f1)

(cherry picked from commit 564260804ee3a8846b921188e36bc269fc8ba98e)

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

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 96fe601d5546..503f52b502fc 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -290,6 +290,7 @@ static short lcl_AskRedlineFlags(weld::Window *pWin)
 {
 std::unique_ptr xBuilder(Application::CreateBuilder(pWin, 
"modules/swriter/ui/queryredlinedialog.ui"));
 std::unique_ptr 
xQBox(xBuilder->weld_message_dialog("QueryRedlineDialog"));
+xQBox->set_title(SwResId(STR_AUTOCORRECT));
 return xQBox->run();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-12-04 Thread Libreoffice Gerrit user
 sw/source/core/access/acccell.cxx  |2 +-
 sw/source/core/access/accframebase.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a9d6f0e078e5e6653bd620ddbdbc24de93c7ae51
Author: Michael Stahl 
AuthorDate: Mon Dec 3 12:18:57 2018 +0100
Commit: Caolán McNamara 
CommitDate: Tue Dec 4 16:40:19 2018 +0100

sw: convert assert(bSelected out of sync) to SAL_WARN for now

This evidently happens sometimes, but when it does it it's
impossible to reproduce... Let's use SAL_WARN for now.

Change-Id: Id724fd52060bfae45f9eeb16163ddfc94e53af03
Reviewed-on: https://gerrit.libreoffice.org/64447
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit d1138d72ed4f5c2ada2dd53f4b091964d8a284e6)
Reviewed-on: https://gerrit.libreoffice.org/64451
(cherry picked from commit 8f85d3db0b8b1dcfc399be4afbbc68a04c558a64)
Reviewed-on: https://gerrit.libreoffice.org/64514
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/access/acccell.cxx 
b/sw/source/core/access/acccell.cxx
index f75a6fda8cdd..9196f1d3e8da 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -91,7 +91,7 @@ void SwAccessibleCell::GetStates( 
::utl::AccessibleStateSetHelper& rStateSet )
 if( IsSelected() )
 {
 rStateSet.AddState( AccessibleStateType::SELECTED );
-assert(m_bIsSelected && "bSelected out of sync");
+SAL_WARN_IF(!m_bIsSelected, "sw.a11y", "bSelected out of sync");
 ::rtl::Reference < SwAccessibleContext > xThis( this );
 GetMap()->SetCursorContext( xThis );
 }
diff --git a/sw/source/core/access/accframebase.cxx 
b/sw/source/core/access/accframebase.cxx
index d173c1166ecb..87b2246bb64a 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -82,7 +82,7 @@ void SwAccessibleFrameBase::GetStates(
 if( IsSelected() )
 {
 rStateSet.AddState( AccessibleStateType::SELECTED );
-assert(m_bIsSelected && "bSelected out of sync");
+SAL_WARN_IF(!m_bIsSelected, "sw.a11y", "bSelected out of sync");
 ::rtl::Reference < SwAccessibleContext > xThis( this );
 GetMap()->SetCursorContext( xThis );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-11-27 Thread Libreoffice Gerrit user
 sw/source/core/doc/docftn.cxx |   71 ++
 1 file changed, 51 insertions(+), 20 deletions(-)

New commits:
commit 912c1584cbdb5eaedb079755df1150b95e8f7329
Author: Bjoern Michaelsen 
AuthorDate: Sat Nov 10 20:22:50 2018 +0100
Commit: Xisco Faulí 
CommitDate: Tue Nov 27 21:14:02 2018 +0100

tdf#120115: Dont crash on Footnote/Table undo/redo

brown paperbag commit:

- for one, we only want to use the anchor format when we dont have
  another one, not the other way around
- also we want to update the anchor format (not the char format) when it
  tells us so.
- finally, keep the selected Char and AnchorFormat in Sync between
  SwEndnoteInfo and the underlying DocumentStylePoolManager

Change-Id: Ic599dc1290c4e30d1746e5eefe6fed27b0ccdfe9
Reviewed-on: https://gerrit.libreoffice.org/63306
Tested-by: Jenkins
Tested-by: Xisco Faulí 
Reviewed-by: Xisco Faulí 

diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index ffbb49c35623..8f8f43d3a500 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -138,39 +138,69 @@ void SwEndNoteInfo::SetFootnoteTextColl(SwTextFormatColl& 
rFormat)
 aDepends.StartListening(pTextFormatColl);
 }
 
-SwCharFormat* SwEndNoteInfo::GetCharFormat(SwDoc ) const
+SwCharFormat* SwEndNoteInfo::GetCharFormat(SwDoc& rDoc) const
 {
-if (!pCharFormat)
+auto pCharFormatFromDoc = 
rDoc.getIDocumentStylePoolAccess().GetCharFormatFromPool( 
static_cast(
+m_bEndNote ? RES_POOLCHR_ENDNOTE : RES_POOLCHR_FOOTNOTE ) );
+if (pCharFormat != pCharFormatFromDoc)
 {
-pCharFormat = 
rDoc.getIDocumentStylePoolAccess().GetCharFormatFromPool( 
static_cast(
-m_bEndNote ? RES_POOLCHR_ENDNOTE : RES_POOLCHR_FOOTNOTE ) );
-aDepends.StartListening(pCharFormat);
+aDepends.EndListening(pCharFormat);
+aDepends.StartListening(pCharFormatFromDoc);
+pCharFormat = pCharFormatFromDoc;
 }
 return pCharFormat;
 }
 
-void SwEndNoteInfo::SetCharFormat( SwCharFormat* pChFormat )
+namespace
 {
-aDepends.EndListening(pCharFormat);
-pCharFormat = pChFormat;
-aDepends.StartListening(pCharFormat);
+void lcl_ResetPoolIdForDocAndSync(const sal_uInt16 nId, SwCharFormat* 
pFormat, SwEndNoteInfo& rInfo)
+{
+auto pDoc = pFormat->GetDoc();
+if(!pDoc)
+return;
+for(auto pDocFormat : *pDoc->GetCharFormats())
+{
+if(pDocFormat == pFormat)
+pDocFormat->SetPoolFormatId(nId);
+else if(pDocFormat->GetPoolFormatId() == nId)
+pDocFormat->SetPoolFormatId(0);
+}
+rInfo.GetCharFormat(*pDoc);
+rInfo.GetAnchorCharFormat(*pDoc);
+}
+}
+
+void SwEndNoteInfo::SetCharFormat(SwCharFormat* pFormat)
+{
+lcl_ResetPoolIdForDocAndSync(
+static_cast(m_bEndNote
+? RES_POOLCHR_ENDNOTE
+: RES_POOLCHR_FOOTNOTE),
+pFormat,
+*this);
 }
 
 SwCharFormat* SwEndNoteInfo::GetAnchorCharFormat(SwDoc& rDoc) const
 {
-if(!pAnchorFormat)
+auto pAnchorFormatFromDoc = 
rDoc.getIDocumentStylePoolAccess().GetCharFormatFromPool( 
static_cast(
+m_bEndNote ? RES_POOLCHR_ENDNOTE_ANCHOR : RES_POOLCHR_FOOTNOTE_ANCHOR 
) );
+if(pAnchorFormat != pAnchorFormatFromDoc)
 {
-pAnchorFormat = 
rDoc.getIDocumentStylePoolAccess().GetCharFormatFromPool( 
static_cast(
-m_bEndNote ? RES_POOLCHR_ENDNOTE_ANCHOR : 
RES_POOLCHR_FOOTNOTE_ANCHOR ) );
-aDepends.StartListening(pAnchorFormat);
+aDepends.EndListening(pAnchorFormat);
+aDepends.StartListening(pAnchorFormatFromDoc);
+pAnchorFormat = pAnchorFormatFromDoc;
 }
 return pAnchorFormat;
 }
 
 void SwEndNoteInfo::SetAnchorCharFormat(SwCharFormat* pFormat)
 {
-pAnchorFormat = pFormat;
-aDepends.StartListening(pAnchorFormat);
+lcl_ResetPoolIdForDocAndSync(
+static_cast(m_bEndNote
+? RES_POOLCHR_ENDNOTE_ANCHOR
+: RES_POOLCHR_FOOTNOTE_ANCHOR),
+pFormat,
+*this);
 }
 
 SwCharFormat* SwEndNoteInfo::GetCurrentCharFormat(const bool bAnchor) const
@@ -187,7 +217,7 @@ void SwEndNoteInfo::SwClientNotify( const SwModify& 
rModify, const SfxHint& rHin
 const sal_uInt16 nWhich = pLegacyHint->m_pOld ? 
pLegacyHint->m_pOld->Which() : pLegacyHint->m_pNew ? 
pLegacyHint->m_pNew->Which() : 0 ;
 if (RES_ATTRSET_CHG == nWhich || RES_FMT_CHG == nWhich)
 {
-auto pFormat = GetCurrentCharFormat(pCharFormat != nullptr);
+auto pFormat = GetCurrentCharFormat(pCharFormat == nullptr);
 if (!pFormat || !aDepends.IsListeningTo(pFormat) || 
pFormat->IsFormatInDTOR())
 return;
 SwDoc* pDoc = pFormat->GetDoc();
@@ -207,14 +237,15 @@ void SwEndNoteInfo::SwClientNotify( const 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-11-27 Thread Libreoffice Gerrit user
 sw/source/uibase/app/apphdl.cxx |   21 +
 1 file changed, 21 insertions(+)

New commits:
commit cbf3e0d241f9fa3a9ffddd52acdbe03958be83da
Author: Caolán McNamara 
AuthorDate: Thu Nov 22 11:34:00 2018 +
Commit: Christian Lohmaier 
CommitDate: Tue Nov 27 12:42:28 2018 +0100

tdf#121607 defer other requests until password dialog is dismissed

Change-Id: I82b308f482cc5eb40a00afd01a6848afc3fb8ab1
Reviewed-on: https://gerrit.libreoffice.org/63796
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 804e358418ef..8bd7c3b62a63 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -216,9 +216,27 @@ void SwModule::StateOther(SfxItemSet )
 {
 SwView* pView = ::GetActiveView();
 std::shared_ptr xConfigItem;
+bool bUnLockDispatcher = false;
+SfxDispatcher* pDispatcher = nullptr;
 if (pView)
+{
 xConfigItem = pView->EnsureMailMergeConfigItem();
 
+// tdf#121607 lock the dispatcher while processing
+// this request, and release it afterwards,
+// that means that if this request pops up a dialog
+// any other pending requests will be deferred
+// until this request is finished, i.e. they won't
+// be dispatched by the dispatcher timeout until
+// unlock is called, serializing the password dialogs
+pDispatcher = pView->GetViewFrame()->GetDispatcher();
+if (!pDispatcher->IsLocked())
+{
+pDispatcher->Lock(true);
+bUnLockDispatcher = true;
+}
+}
+
 // #i51949# hide e-Mail option if e-Mail is not supported
 // #i63267# printing might be disabled
 if (!xConfigItem ||
@@ -230,6 +248,9 @@ void SwModule::StateOther(SfxItemSet )
 {
 rSet.DisableItem(nWhich);
 }
+
+if (bUnLockDispatcher)
+pDispatcher->Lock(false);
 }
 break;
 default:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-11-26 Thread Libreoffice Gerrit user
 sw/source/ui/misc/outline.cxx|6 --
 sw/source/uibase/inc/outline.hxx |2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit d3a79b489adc6a40b3c4063c1ec324d36686853b
Author: Caolán McNamara 
AuthorDate: Thu Nov 22 16:53:36 2018 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 26 15:39:07 2018 +0100

tdf#120426 save the style names when set or changed

instead of waiting until gaining focus of the listbox,
because of the differences in what that focus means in
the different backends. It was an odd way to do things anyway.

Change-Id: I072e3da04db184b49a86a9888080b60223813729
Reviewed-on: https://gerrit.libreoffice.org/63822
Tested-by: Jenkins
Tested-by: Xisco Faulí 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index ea75b1761586..c23794861501 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -410,7 +410,6 @@ 
SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(TabPageParent pPage,
 m_xLevelLB->connect_changed(LINK(this,SwOutlineSettingsTabPage, 
LevelHdl));
 m_xAllLevelNF->connect_value_changed(LINK(this, SwOutlineSettingsTabPage, 
ToggleComplete));
 m_xCollBox->connect_changed(LINK(this,SwOutlineSettingsTabPage, 
CollSelect));
-m_xCollBox->connect_focus_in(LINK(this,  SwOutlineSettingsTabPage, 
CollSelectGetFocus));
 m_xNumberBox->connect_changed(LINK(this,  SwOutlineSettingsTabPage, 
NumberSelect));
 m_xPrefixED->connect_changed(LINK(this,   SwOutlineSettingsTabPage, 
DelimModify));
 m_xSuffixED->connect_changed(LINK(this,   SwOutlineSettingsTabPage, 
DelimModify));
@@ -608,9 +607,10 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, 
weld::ComboBoxText&, rBox, void
 }
 
 SetModified();
+CollSave();
 }
 
-IMPL_LINK_NOARG(SwOutlineSettingsTabPage, CollSelectGetFocus, weld::Widget&, 
void)
+void SwOutlineSettingsTabPage::CollSave()
 {
 for (sal_uInt8 i = 0; i < MAXLEVEL; ++i)
 aSaveCollNames[i] =  pCollNames[i];
@@ -723,6 +723,8 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* 
pShell)
 pNumRule = 
static_cast(GetDialogController())->GetNumRule();
 pCollNames = 
static_cast(GetDialogController())->GetCollNames();
 
+CollSave();
+
 m_aPreviewWIN.SetNumRule(pNumRule);
 m_aPreviewWIN.SetOutlineNames(pCollNames);
 // set start value - nActLevel must be 1 here
diff --git a/sw/source/uibase/inc/outline.hxx b/sw/source/uibase/inc/outline.hxx
index d009b1d60226..f47d809fe261 100644
--- a/sw/source/uibase/inc/outline.hxx
+++ b/sw/source/uibase/inc/outline.hxx
@@ -100,7 +100,7 @@ class SwOutlineSettingsTabPage : public SfxTabPage
 DECL_LINK( LevelHdl, weld::TreeView&, void );
 DECL_LINK( ToggleComplete, weld::SpinButton&, void );
 DECL_LINK( CollSelect, weld::ComboBoxText&, void );
-DECL_LINK( CollSelectGetFocus, weld::Widget&, void );
+void CollSave();
 DECL_LINK( NumberSelect, weld::ComboBoxText&, void );
 DECL_LINK( DelimModify, weld::Entry&, void );
 DECL_LINK( StartModified, weld::SpinButton&, void );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-11-19 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/docxattributeoutput.cxx |  131 +--
 sw/source/filter/ww8/docxattributeoutput.hxx |3 
 2 files changed, 68 insertions(+), 66 deletions(-)

New commits:
commit 21467c1c0fea676a33c7b7e75648947efea18fcb
Author: Markus Mohrhard 
AuthorDate: Sun Nov 18 22:00:23 2018 +0100
Commit: Caolán McNamara 
CommitDate: Mon Nov 19 16:00:53 2018 +0100

tdf#108022, don't overwrite chart export information

Change-Id: I47d8a817022829c8cada614469303e440f377299
Reviewed-on: https://gerrit.libreoffice.org/63536
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 9ccdf4d8abf6ec6612c88ab65be25eb6be89b455)
Reviewed-on: https://gerrit.libreoffice.org/63540
Tested-by: Xisco Faulí 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 689bbbf8c712..a73f90de5153 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4796,8 +4796,7 @@ bool DocxAttributeOutput::WriteOLEChart( const SdrObject* 
pSdrObj, const Size& r
 if (!SotExchange::IsChart(aClassID))
 return false;
 
-m_postponedChart = pSdrObj;
-m_postponedChartSize = rSize;
+m_aPostponedCharts.push_back(std::pair(pSdrObj, 
rSize));
 return true;
 }
 
@@ -4806,81 +4805,86 @@ bool DocxAttributeOutput::WriteOLEChart( const 
SdrObject* pSdrObj, const Size& r
  */
 void DocxAttributeOutput::WritePostponedChart()
 {
-if(m_postponedChart == nullptr)
+if (m_aPostponedCharts.empty())
 return;
-uno::Reference< chart2::XChartDocument > xChartDoc;
-uno::Reference< drawing::XShape > xShape( 
const_cast(m_postponedChart)->getUnoShape(), uno::UNO_QUERY );
-if( xShape.is() )
-{
-uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY 
);
-if( xPropSet.is() )
-xChartDoc.set( xPropSet->getPropertyValue( "Model" ), 
uno::UNO_QUERY );
-}
 
-if( xChartDoc.is() )
+for (const auto& itr : m_aPostponedCharts)
 {
-SAL_INFO("sw.ww8", "DocxAttributeOutput::WriteOLE2Obj: export chart ");
-m_pSerializer->startElementNS( XML_w, XML_drawing,
-FSEND );
-m_pSerializer->startElementNS( XML_wp, XML_inline,
-XML_distT, "0", XML_distB, "0", XML_distL, "0", XML_distR, "0",
-FSEND );
+uno::Reference< chart2::XChartDocument > xChartDoc;
+uno::Reference< drawing::XShape > xShape( 
const_cast(itr.first)->getUnoShape(), uno::UNO_QUERY );
+if( xShape.is() )
+{
+uno::Reference< beans::XPropertySet > xPropSet( xShape, 
uno::UNO_QUERY );
+if( xPropSet.is() )
+xChartDoc.set( xPropSet->getPropertyValue( "Model" ), 
uno::UNO_QUERY );
+}
 
-OString aWidth( OString::number( TwipsToEMU( 
m_postponedChartSize.Width() ) ) );
-OString aHeight( OString::number( TwipsToEMU( 
m_postponedChartSize.Height() ) ) );
-m_pSerializer->singleElementNS( XML_wp, XML_extent,
-XML_cx, aWidth.getStr(),
-XML_cy, aHeight.getStr(),
-FSEND );
-// TODO - the right effectExtent, extent including the effect
-m_pSerializer->singleElementNS( XML_wp, XML_effectExtent,
-XML_l, "0", XML_t, "0", XML_r, "0", XML_b, "0",
-FSEND );
+if( xChartDoc.is() )
+{
+SAL_INFO("sw.ww8", "DocxAttributeOutput::WriteOLE2Obj: export 
chart ");
+m_pSerializer->startElementNS( XML_w, XML_drawing,
+FSEND );
+m_pSerializer->startElementNS( XML_wp, XML_inline,
+XML_distT, "0", XML_distB, "0", XML_distL, "0", XML_distR, 
"0",
+FSEND );
 
-OUString sName("Object 1");
-uno::Reference< container::XNamed > xNamed( xShape, uno::UNO_QUERY );
-if( xNamed.is() )
-sName = xNamed->getName();
+OString aWidth( OString::number( TwipsToEMU( itr.second.Width() ) 
) );
+OString aHeight( OString::number( TwipsToEMU( itr.second.Height() 
) ) );
+m_pSerializer->singleElementNS( XML_wp, XML_extent,
+XML_cx, aWidth.getStr(),
+XML_cy, aHeight.getStr(),
+FSEND );
+// TODO - the right effectExtent, extent including the effect
+m_pSerializer->singleElementNS( XML_wp, XML_effectExtent,
+XML_l, "0", XML_t, "0", XML_r, "0", XML_b, "0",
+FSEND );
 
-/* If there is a scenario where a chart is followed by a shape
-   which is being exported as an alternate content then, the
-   docPr Id is being repeated, ECMA 20.4.2.5 says that the
-   docPr Id should be unique, ensuring the same here.
-*/
-m_pSerializer->singleElementNS( 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-11-17 Thread Libreoffice Gerrit user
 sw/source/uibase/utlui/content.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 9968f6bc25c3ec416a6db863a8d8642ae9a26126
Author: Michael Stahl 
AuthorDate: Mon Nov 5 13:41:29 2018 +0100
Commit: Caolán McNamara 
CommitDate: Sat Nov 17 17:44:36 2018 +0100

sw: fix crash in SwContentTree::HasContentChanged()

Remove() will remove the node including its children, but
SvTreeList::Next() will actually return the first child, so the pChild
points to an entry that has been deleted.

Change-Id: Ia4bd75d64c8436ea03c0727a8d49ee0c34fda16f
(cherry picked from commit cdbe48633f198250e883837dac5d93f93a42888d)
Reviewed-on: https://gerrit.libreoffice.org/63427
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index b6d5946c9b23..9c6c26c1e47b 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2187,14 +2187,11 @@ bool SwContentTree::HasContentChanged()
 }
 if(bRemoveChildren)
 {
-SvTreeListEntry* pChild = FirstChild(pEntry);
-SvTreeListEntry* pRemove = pChild;
 for(size_t j = 0; j < nChildCount; ++j)
 {
-pChild = Next(pRemove);
+SvTreeListEntry *const pRemove = 
FirstChild(pEntry);
 assert(pRemove);
 GetModel()->Remove(pRemove);
-pRemove = pChild;
 }
 }
 if(!nChildCount)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-11-12 Thread Libreoffice Gerrit user
 sw/source/filter/xml/xmlexp.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit 8d2abb388b0a2423c9b7e1f52373e1b06dd9786f
Author: Miklos Vajna 
AuthorDate: Mon Nov 5 21:07:42 2018 +0100
Commit: Caolán McNamara 
CommitDate: Mon Nov 12 13:10:06 2018 +0100

tdf#120515 ODT filter: relax layout requirement before export

This reverts commit 343af46fc301a984929e071d477b8fb9f211e289 (ODT
filter: make sure we have a layout before export, 2017-11-29) as it
causes a performance problem with large documents (see bugreport).

I added it initially for the EPUB export, but there this is no longer
needed as commit 3ed8466b55ace15a28761e06b6bb76ebd8758106 (EPUB export,
fixed layout: switch to a metafile-based approach, 2017-12-01) switched
to the better metafile-based approach.

(cherry picked from commit e83c1f0ef999bdedaf9a5d5903aa5423c40f6d95)

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

diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index eb13bc3db732..7537d13ffb34 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -128,11 +128,6 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
 if (!pDoc)
 return ERR_SWG_WRITE_ERROR;
 
-// Make sure the layout is available to have more stability in the output
-// markup.
-if (SwViewShell* pViewShell = 
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell())
-pViewShell->CalcLayout();
-
 if( getExportFlags() & 
(SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES|
 
SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-10-29 Thread Libreoffice Gerrit user
 sw/source/core/layout/paintfrm.cxx |   20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

New commits:
commit ea7d9105456537d2e0a6b7dcf051fee1fa259954
Author: Armin Le Grand 
AuthorDate: Sat Oct 27 23:20:06 2018 +0200
Commit: Armin Le Grand 
CommitDate: Mon Oct 29 11:02:28 2018 +0100

tdf#115296 extend vertical FrameBorders for joined Frames

This feature was lost on my changes for FrameBorder primitive
creation. It was calculated/applied formally in
lcl_PaintLeftRightLine

Change-Id: Ie44619a4c4e44ff4584533685cb21882c323742e
Reviewed-on: https://gerrit.libreoffice.org/62451
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 
(cherry picked from commit e89e8941e114d4d1adf76df995a3f1a8d1bff4b1)
Reviewed-on: https://gerrit.libreoffice.org/62475

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index b684c5ac1b2c..b684232ba78d 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5103,14 +5103,30 @@ void SwFrame::PaintSwFrameShadowAndBorder(
 // if ContentFrame and joined Prev/Next, reset top/bottom as needed
 if(IsContentFrame())
 {
+const SwFrame* pDirRefFrame(IsCellFrame() ? FindTabFrame() : this);
+const SwRectFnSet aRectFnSet(pDirRefFrame);
+const SwRectFn& _rRectFn(aRectFnSet.FnRect());
+
 if(rAttrs.JoinedWithPrev(*this))
 {
-pTopBorder = nullptr;
+// tdf#115296 re-add adaption of vert distance to clos ethe 
evtl.
+// existing gap to previous frame
+const SwFrame* pPrevFrame(GetPrev());
+(aRect.*_rRectFn->fnSetTop)( 
(pPrevFrame->*_rRectFn->fnGetPrtBottom)() );
+
+// ...and disable top border paint/creation
+pTopBorder = nullptr;
 }
 
 if(rAttrs.JoinedWithNext(*this))
 {
-pBottomBorder = nullptr;
+// tdf#115296 re-add adaption of vert distance to clos ethe 
evtl.
+// existing gap to next frame
+const SwFrame* pNextFrame(GetNext());
+(aRect.*_rRectFn->fnSetBottom)( 
(pNextFrame->*_rRectFn->fnGetPrtTop)() );
+
+// ...and disable bottom border paint/creation
+pBottomBorder = nullptr;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-10-27 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/ww8par.hxx  |2 -
 sw/source/filter/ww8/ww8par2.cxx |   47 ++-
 2 files changed, 38 insertions(+), 11 deletions(-)

New commits:
commit 6253b1a29c8c1bcd7fd9efb07ca1a12fb0fc1746
Author: Caolán McNamara 
AuthorDate: Sat Oct 27 19:45:34 2018 +0100
Commit: Michael Stahl 
CommitDate: Sun Oct 28 00:44:57 2018 +0200

ofz#11125 pass param len around

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

diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 6ef295050919..b4fbecfef440 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1038,7 +1038,7 @@ struct WW8TabBandDesc
 static void setcelldefaults(WW8_TCell *pCells, short nCells);
 void ReadDef(bool bVer67, const sal_uInt8* pS, short nLen);
 void ProcessDirection(const sal_uInt8* pParams);
-void ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* pParamsTSetBRC);
+void ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* pParamsTSetBRC, 
sal_uInt16 nParamsLen);
 void ProcessSprmTTableBorders(int nBrcVer, const sal_uInt8* pParams, 
sal_uInt16 nParamsLen);
 void ProcessSprmTDxaCol(const sal_uInt8* pParamsTDxaCol);
 void ProcessSprmTDelete(const sal_uInt8* pParamsTDelete);
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 89e3950c6717..91b2f6c3d733 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1224,11 +1224,17 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const 
sal_uInt8* pS, short nLen)
 }
 }
 
-void WW8TabBandDesc::ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* 
pParamsTSetBRC)
+void WW8TabBandDesc::ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* 
pParamsTSetBRC, sal_uInt16 nParamsLen)
 {
 if( !pParamsTSetBRC || !pTCs ) // set one or more cell border(s)
 return;
 
+if (nParamsLen < 3)
+{
+SAL_WARN("sw.ww8", "table border property is too short");
+return;
+}
+
 sal_uInt8 nitcFirst= pParamsTSetBRC[0];// first col to be changed
 sal_uInt8 nitcLim  = pParamsTSetBRC[1];// (last col to be changed)+1
 sal_uInt8 nFlag= *(pParamsTSetBRC+2);
@@ -1247,11 +1253,33 @@ void WW8TabBandDesc::ProcessSprmTSetBRC(int nBrcVer, 
const sal_uInt8* pParamsTSe
 WW8_TCell* pCurrentTC  = pTCs + nitcFirst;
 WW8_BRCVer9 brcVer9;
 if( nBrcVer == 6 )
+{
+if (nParamsLen < sizeof(WW8_BRCVer6) + 3)
+{
+SAL_WARN("sw.ww8", "table border property is too short");
+return;
+}
 brcVer9 = WW8_BRCVer9(WW8_BRC(*reinterpret_cast(pParamsTSetBRC+3)));
+}
 else if( nBrcVer == 8 )
+{
+static_assert(sizeof (WW8_BRC) == 4, "this has to match the msword 
size");
+if (nParamsLen < sizeof(WW8_BRC) + 3)
+{
+SAL_WARN("sw.ww8", "table border property is too short");
+return;
+}
 brcVer9 = WW8_BRCVer9(*reinterpret_cast(pParamsTSetBRC+3));
+}
 else
+{
+if (nParamsLen < sizeof(WW8_BRCVer9) + 3)
+{
+SAL_WARN("sw.ww8", "table border property is too short");
+return;
+}
 brcVer9 = *reinterpret_cast(pParamsTSetBRC+3);
+}
 
 for( int i = nitcFirst; i < nitcLim; ++i, ++pCurrentTC )
 {
@@ -1264,7 +1292,6 @@ void WW8TabBandDesc::ProcessSprmTSetBRC(int nBrcVer, 
const sal_uInt8* pParamsTSe
 if( bChangeRight )
 pCurrentTC->rgbrc[ WW8_RIGHT ] = brcVer9;
 }
-
 }
 
 void WW8TabBandDesc::ProcessSprmTTableBorders(int nBrcVer, const sal_uInt8* 
pParams, sal_uInt16 nParamsLen)
@@ -1782,7 +1809,8 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP 
nStartCp) :
 sal_uInt16 nTableBordersLen = 0;
 const sal_uInt8* pTableBorders90 = nullptr;
 sal_uInt16 nTableBorders90Len = 0;
-std::vector aTSetBrcs, aTSetBrc90s;
+// params, len
+std::vector> aTSetBrcs, 
aTSetBrc90s;
 WW8_TablePos *pTabPos  = nullptr;
 
 // search end of a tab row
@@ -1885,10 +1913,10 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, 
WW8_CP nStartCp) :
 }
 break;
 case sprmTSetBrc:
-aTSetBrcs.push_back(pParams); // process at end
+aTSetBrcs.emplace_back(pParams, nLen); // process at 
end
 break;
 case sprmTSetBrc90:
-aTSetBrc90s.push_back(pParams); // process at end
+aTSetBrc90s.emplace_back(pParams, nLen); // process at 
end
 break;
 case sprmTDxaCol:
 pNewBand->ProcessSprmTDxaCol(pParams);
@@ -1936,11 +1964,10 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-10-26 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/docxattributeoutput.cxx |   13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

New commits:
commit 98c8fefd8aa416a475a80675ef5d458d817b14fd
Author: Caolán McNamara 
AuthorDate: Fri Oct 19 13:03:36 2018 +0100
Commit: Michael Stahl 
CommitDate: Fri Oct 26 20:51:04 2018 +0200

permissionIdAndName is empty in permission-for-user case

merge the two identical branches and make it do what it probably wants to do

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 24e628d50bda..689bbbf8c712 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1555,17 +1555,8 @@ void DocxAttributeOutput::DoWritePermissionTagEnd(const 
OUString & permission)
 {
 OUString permissionIdAndName;
 
-if (permission.startsWith("permission-for-group:", ))
-{
-const sal_Int32 sparatorIndex = permissionIdAndName.indexOf(':');
-const OUString permissionId   = permissionIdAndName.copy(0, 
sparatorIndex);
-const OString rId = 
OUStringToOString(BookmarkToWord(permissionId), RTL_TEXTENCODING_UTF8).getStr();
-
-m_pSerializer->singleElementNS(XML_w, XML_permEnd,
-FSNS(XML_w, XML_id), rId.getStr(),
-FSEND);
-}
-else // if (permission.startsWith("permission-for-user:", 
))
+if (permission.startsWith("permission-for-group:", ) ||
+permission.startsWith("permission-for-user:", ))
 {
 const sal_Int32 sparatorIndex = permissionIdAndName.indexOf(':');
 const OUString permissionId   = permissionIdAndName.copy(0, 
sparatorIndex);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-10-20 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/ww8par.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit fe6a98ed8fe863dd5a5aee5becb6e989c1f6a457
Author: Caolán McNamara 
AuthorDate: Tue Oct 16 09:57:36 2018 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Oct 20 10:48:07 2018 +0200

ofz#10994 move the reset of trailing fly paras to before redline processing

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

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index e2a18452cf90..bcc16adc2d98 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5324,6 +5324,9 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const 
*pGloss)
 // stacks etc. are destroyed, and before fields
 // are updated
 m_aExtraneousParas.delete_all_from_doc();
+// ofz#10994 remove any trailing fly paras before processing redlines
+m_xWFlyPara.reset();
+m_xSFlyPara.reset();
 m_xRedlineStack->closeall(*m_pPaM->GetPoint());
 while (!m_aFrameRedlines.empty())
 m_aFrameRedlines.pop();
@@ -5417,9 +5420,6 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const 
*pGloss)
 
 UpdateFields();
 
-m_xWFlyPara.reset();
-m_xSFlyPara.reset();
-
 // delete the pam before the call for hide all redlines (Bug 73683)
 if (m_bNewDoc)
   m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags(eMode);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-10-16 Thread Libreoffice Gerrit user
 sw/source/uibase/sidebar/PageFormatPanel.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 577e16a03f689ac906cbe68e8528b422ecccf99b
Author: Ilhan Yesil 
AuthorDate: Thu Aug 30 09:21:36 2018 +0200
Commit: Caolán McNamara 
CommitDate: Tue Oct 16 12:34:41 2018 +0200

tdf#113848 Sidebar: Get user-defined sizes while changing orientation

If the orientation of the page is changed, the user
defined page sizes are now accessed directly to swap the sizes
correctly.

Change-Id: I91d256d35dcd910a8c3151a3f9e669413c9a57db
Reviewed-on: https://gerrit.libreoffice.org/59577
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 
(cherry picked from commit 32bf352c61754fe5ef39e0794b5d6dc71be99194)
Reviewed-on: https://gerrit.libreoffice.org/61667
Reviewed-by: Thorsten Behrens 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx 
b/sw/source/uibase/sidebar/PageFormatPanel.cxx
index 82c182dd8a36..3c0dbeaeebe1 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx
@@ -215,9 +215,14 @@ void PageFormatPanel::NotifyItemUpdate(
 IMPL_LINK_NOARG(PageFormatPanel, PaperFormatModifyHdl, ListBox&, void)
 {
 Paper ePaper = mpPaperSizeBox->GetSelection();
-Size  aSize(SvxPaperInfo::GetPaperSize(ePaper, meUnit));
+Size  aSize;
 
-if(mpPaperOrientation->GetSelectedEntryPos() == 1)
+if(ePaper!=PAPER_USER)
+   aSize = SvxPaperInfo::GetPaperSize(ePaper, meUnit);
+else
+   aSize = Size(GetCoreValue( *mpPaperWidth, meUnit ), GetCoreValue( 
*mpPaperHeight, meUnit));
+
+if(mpPaperOrientation->GetSelectedEntryPos() == 1 || ePaper==PAPER_USER)
 Swap(aSize);
 
 mpPageItem->SetLandscape(mpPaperOrientation->GetSelectedEntryPos() == 1);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-10-15 Thread Libreoffice Gerrit user
 sw/source/uibase/docvw/edtwin2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2e27d2e3397efc1fcc4478bce286c5ec64c118e9
Author: Michael Stahl 
AuthorDate: Thu Oct 11 10:57:05 2018 +0200
Commit: Miklos Vajna 
CommitDate: Mon Oct 15 09:40:21 2018 +0200

sw: fix invalid cast in SwEditWin::RequestHelp()

This results in a garbage OUString.

Change-Id: I03b8030a812d7016df5c29f1341749fbdedf1729
Reviewed-on: https://gerrit.libreoffice.org/61652
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit bf0276f0b53c01ac434fef88e97f6b0dd4c41787)
Reviewed-on: https://gerrit.libreoffice.org/61673
Reviewed-by: Thorsten Behrens 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index 9e4658eacf4a..af88607cb9e5 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -170,7 +170,7 @@ void SwEditWin::RequestHelp(const HelpEvent )
 
 case IsAttrAtPos::InetAttr:
 {
-sText = static_cast(aContentAtPos.aFnd.pAttr)->GetValue();
+sText = static_cast(aContentAtPos.aFnd.pAttr)->GetValue();
 sText = URIHelper::removePassword( sText,
 
INetURLObject::EncodeMechanism::WasEncoded,

INetURLObject::DecodeMechanism::Unambiguous);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-10-13 Thread Libreoffice Gerrit user
 sw/source/uibase/docvw/PostItMgr.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit f1e09253316d9db39b7adab6d31e759c09de3406
Author: Caolán McNamara 
AuthorDate: Thu Oct 11 15:39:37 2018 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Oct 13 20:45:02 2018 +0200

Resolves: tdf#120487 postit losing focus triggering recreation of postit

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

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index 2cd8d420db70..4565d4843ac7 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -309,8 +309,11 @@ void SwPostItMgr::RemoveItem( SfxBroadcaster* pBroadcast )
 SwSidebarItem* p = (*i);
 if (GetActiveSidebarWin() == p->pPostIt)
 SetActiveSidebarWin(nullptr);
-p->pPostIt.disposeAndClear();
+// tdf#120487 remove from list before dispose, so comment window
+// won't be recreated due to the entry still in the list if focus
+// transferring from the pPostIt triggers relayout of postits
 mvPostItFields.erase(i);
+p->pPostIt.disposeAndClear();
 delete p;
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-10-04 Thread Libreoffice Gerrit user
 sw/source/core/doc/docnew.cxx |   44 +-
 1 file changed, 35 insertions(+), 9 deletions(-)

New commits:
commit 12db0c2a7b240b73a9445fffa026c4d1c349814c
Author: Michael Stahl 
AuthorDate: Wed Sep 26 14:42:44 2018 +0200
Commit: Caolán McNamara 
CommitDate: Thu Oct 4 11:05:28 2018 +0200

sw: fix copying of PageDesc follows in SwDoc::AppendDoc

The problem in the bugdoc is that there are 2 styles; "First Page"
has "Default Style" as the follow, and vice versa.

When the "First Page" style is copied, its follow is copied as well, but
the follow of the follow doesn't point to the *new* "First PageN" style
that was just created, but the original "First Page" one.

Change-Id: Ie5b0064581a585a3a545360ea5c05f60652f0d4e
Reviewed-on: https://gerrit.libreoffice.org/60993
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit a6a4fa526b8ad19ff6d44a89ee56d4268c8e90be)
Reviewed-on: https://gerrit.libreoffice.org/61062
Reviewed-by: Thorsten Behrens 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 07fca37917bb..6940e86acc94 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -943,19 +943,45 @@ static void lcl_CopyFollowPageDesc(
 const sal_uLong nDocNo )
 {
 //now copy the follow page desc, too
-const SwPageDesc* pFollowPageDesc = rSourcePageDesc.GetFollow();
-OUString sFollowPageDesc = pFollowPageDesc->GetName();
-if( sFollowPageDesc != rSourcePageDesc.GetName() )
+// note: these may at any point form a cycle, so a loop is needed and it
+// must be detected that the last iteration closes the cycle and doesn't
+// copy the first page desc of the cycle again.
+std::map followMap{ { rSourcePageDesc.GetName(), 
rTargetPageDesc.GetName() } };
+SwPageDesc const* pCurSourcePageDesc();
+SwPageDesc const* pCurTargetPageDesc();
+do
 {
+const SwPageDesc* pFollowPageDesc = pCurSourcePageDesc->GetFollow();
+OUString sFollowPageDesc = pFollowPageDesc->GetName();
+if (sFollowPageDesc == pCurSourcePageDesc->GetName())
+{
+break;
+}
 SwDoc* pTargetDoc = rTargetShell.GetDoc();
-OUString sNewFollowPageDesc = lcl_FindUniqueName(, 
sFollowPageDesc, nDocNo );
-SwPageDesc* pTargetFollowPageDesc = 
pTargetDoc->MakePageDesc(sNewFollowPageDesc);
-
-pTargetDoc->CopyPageDesc(*pFollowPageDesc, *pTargetFollowPageDesc, 
false);
-SwPageDesc aDesc(rTargetPageDesc);
+SwPageDesc* pTargetFollowPageDesc(nullptr);
+auto const itMapped(followMap.find(sFollowPageDesc));
+if (itMapped == followMap.end())
+{
+OUString sNewFollowPageDesc = lcl_FindUniqueName(, 
sFollowPageDesc, nDocNo);
+pTargetFollowPageDesc = 
pTargetDoc->MakePageDesc(sNewFollowPageDesc);
+pTargetDoc->CopyPageDesc(*pFollowPageDesc, *pTargetFollowPageDesc, 
false);
+}
+else
+{
+pTargetFollowPageDesc = pTargetDoc->FindPageDesc(itMapped->second);
+}
+SwPageDesc aDesc(*pCurTargetPageDesc);
 aDesc.SetFollow(pTargetFollowPageDesc);
-pTargetDoc->ChgPageDesc(rTargetPageDesc.GetName(), aDesc);
+pTargetDoc->ChgPageDesc(pCurTargetPageDesc->GetName(), aDesc);
+if (itMapped != followMap.end())
+{
+break; // was already copied
+}
+pCurSourcePageDesc = pCurSourcePageDesc->GetFollow();
+pCurTargetPageDesc = pTargetFollowPageDesc;
+followMap[pCurSourcePageDesc->GetName()] = 
pCurTargetPageDesc->GetName();
 }
+while (true);
 }
 
 // appends all pages of source SwDoc - based on SwFEShell::Paste( SwDoc* )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-21 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/ww8par3.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b8525055c6734baa36c1da0aaf33654a865e2021
Author: Caolán McNamara 
AuthorDate: Thu Sep 20 16:03:24 2018 +0100
Commit: Michael Stahl 
CommitDate: Fri Sep 21 10:28:28 2018 +0200

ofz#10523 guard aginst 0 pF->nLCode

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

diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 542f6fed46dd..f4b3a886d5ff 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -90,7 +90,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* 
pF, OUString& rStr )
 {
 WW8FormulaEditBox aFormula(*this);
 
-if (rStr[pF->nLCode-1]==0x01) {
+if (pF->nLCode && rStr[pF->nLCode-1]==0x01) {
 ImportFormulaControl(aFormula,pF->nSCode+pF->nLCode-1, WW8_CT_EDIT);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-20 Thread Libreoffice Gerrit user
 sw/source/core/doc/DocumentRedlineManager.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit ad304d978b1a88d3ecadfef88d3a7a4c2475be5e
Author: Michael Stahl 
AuthorDate: Mon Aug 6 14:07:26 2018 +0200
Commit: Caolán McNamara 
CommitDate: Thu Sep 20 17:42:38 2018 +0200

sw: fix return value of DocumentRedlineManager::AppendRedline()

If a footnote is inserted, a redline that includes the start/end node of
the footnote is created, but that is not a valid redline (as far as
HasValidRange() is concerned), so instead a different redline without
start/end nodes is inserted, but pNewRedl is reset and so AppendRedline()
returns IGNORED, and then we get an assert in Undo from
SwRedlineSaveData::RedlineToDoc().

Change-Id: I92253e1a40ba98e34e0bca601b4e3b6ef3751b08
(cherry picked from commit deacee23d9530350988eef68b0e9bb5cfcf2fde3)
Reviewed-on: https://gerrit.libreoffice.org/60750
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 4f12cd39d827..ca6fd3ac539e 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1680,7 +1680,14 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* 
pNewRedl, bool const bCall
 pNewRedl = nullptr;
 }
 else
-mpRedlineTable->Insert( pNewRedl );
+{
+bool const ret = mpRedlineTable->Insert( pNewRedl );
+assert(ret || !pNewRedl);
+if (ret && !pNewRedl)
+{
+bMerged = true; // treat InsertWithValidRanges as "merge"
+}
+}
 }
 
 if( bCompress )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-20 Thread Libreoffice Gerrit user
 sw/source/core/undo/undobj.cxx |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 2b3cbeb76247e9819d60d661a4f3546ec731ea80
Author: Michael Stahl 
AuthorDate: Thu Aug 16 12:55:59 2018 +0200
Commit: Caolán McNamara 
CommitDate: Thu Sep 20 17:40:12 2018 +0200

sw: fix 0-length delete redlines in SwUndoSaveSection::SaveSection

The delete redlines aren't restored properly on Undo because they are
squashed into a point by DelBookmarks.

(regression from 6af2caab7271e11d9501fd6a597e05194d33fd10)

Change-Id: I34ea66b5ab0d441c42570e25ea374cb2d0cfc780
(cherry picked from commit 251b88be7fdca54c38cc7632a85184577f719180)
Reviewed-on: https://gerrit.libreoffice.org/60745
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 252557ac08b6..f54e297e85ef 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1211,6 +1211,17 @@ void SwUndoSaveSection::SaveSection(
 
 // delete all footnotes, fly frames, bookmarks
 DelContentIndex( *aPam.GetMark(), *aPam.GetPoint() );
+
+// redlines *before* CorrAbs, because DelBookmarks will make them 0-length
+// but *after* DelContentIndex because that also may use FillSaveData (in
+// flys) and that will be restored *after* this one...
+pRedlSaveData = new SwRedlineSaveDatas;
+if (!SwUndo::FillSaveData( aPam, *pRedlSaveData ))
+{
+delete pRedlSaveData;
+pRedlSaveData = nullptr;
+}
+
 {
 // move certain indexes out of deleted range
 SwNodeIndex aSttIdx( aPam.Start()->nNode.GetNode() );
@@ -1219,13 +1230,6 @@ void SwUndoSaveSection::SaveSection(
 SwDoc::CorrAbs( aSttIdx, aEndIdx, SwPosition( aMvStt ), true );
 }
 
-pRedlSaveData = new SwRedlineSaveDatas;
-if( !SwUndo::FillSaveData( aPam, *pRedlSaveData ))
-{
-delete pRedlSaveData;
-pRedlSaveData = nullptr;
-}
-
 nStartPos = rRange.aStart.GetIndex();
 
 --aPam.GetPoint()->nNode;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-20 Thread Libreoffice Gerrit user
 sw/source/core/undo/unovwr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 55210211d899e3929fb8d7760483206937a3b0e4
Author: Michael Stahl 
AuthorDate: Fri Sep 7 14:27:46 2018 +0200
Commit: Caolán McNamara 
CommitDate: Thu Sep 20 17:39:09 2018 +0200

sw: fix usage of wrong string in SwUndoOverwrite::RedoImpl()

At this point the "aDelStr" is in the document, don't use invalid index.

Change-Id: I0aae8839e9669e3a474266a345b54a1e7e6db38f
(cherry picked from commit a44d7917655dfec3f6a101752c68de8c46aeb822)
Reviewed-on: https://gerrit.libreoffice.org/60748
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index beafde6a4773..dbc82afc684f 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -267,7 +267,7 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & 
rContext)
 {
 rIdx.Assign( pTextNd, nSttContent );
 pCurrentPam->SetMark();
-pCurrentPam->GetMark()->nContent += aInsStr.getLength();
+pCurrentPam->GetMark()->nContent += aDelStr.getLength();
 pDoc->getIDocumentRedlineAccess().DeleteRedline( *pCurrentPam, false, 
USHRT_MAX );
 pCurrentPam->DeleteMark();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-20 Thread Libreoffice Gerrit user
 sw/source/core/layout/trvlfrm.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 27170680e82a927b88e6a1ccee63b7ddf8082d01
Author: Michael Stahl 
AuthorDate: Tue Aug 7 10:33:08 2018 +0200
Commit: Caolán McNamara 
CommitDate: Thu Sep 20 17:38:23 2018 +0200

sw: avoid asserts from SwSortedObjs::Insert()

The first frame is almost certainly already inserted in line 2057;
This causes " - already contains object".

Change-Id: I4a785accdec033865da971bf25d0ebe06ec2e765
(cherry picked from commit 7f406cbacf9c3abc45c7241535472ffab807e2f0)
Reviewed-on: https://gerrit.libreoffice.org/60744
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/layout/trvlfrm.cxx 
b/sw/source/core/layout/trvlfrm.cxx
index 14887a9e274f..eb6417197829 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2494,7 +2494,10 @@ void SwRootFrame::CalcFrameRects(SwShellCursor )
 if ( pContent->IsInFly() )
 {
 const SwAnchoredObject* pObj = pContent->FindFlyFrame();
-aSortObjs.Insert( *const_cast(pObj) );
+if (!aSortObjs.Contains(*pObj))
+{   // is this even possible, assuming valid cursor pos.?
+aSortObjs.Insert( *const_cast(pObj) );
+}
 }
 
 // Consider only frames which have the same IsInDocBody value like 
pStartFrame
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-20 Thread Libreoffice Gerrit user
 sw/source/uibase/shells/txtattr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e204c41262f4c587964c128296d45ec93009f2ac
Author: Caolán McNamara 
AuthorDate: Thu Sep 20 11:14:29 2018 +0100
Commit: Michael Stahl 
CommitDate: Thu Sep 20 14:12:25 2018 +0200

StartUndo with END arg should have been EndUndo

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

diff --git a/sw/source/uibase/shells/txtattr.cxx 
b/sw/source/uibase/shells/txtattr.cxx
index 8178633720fb..51af7b8362b2 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -492,7 +492,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest )
 rSh.ReplaceDropText(static_cast(pItem)->GetValue());
 }
 rSh.SetAttrSet(*pDlg->GetOutputItemSet());
-rSh.StartUndo( SwUndoId::END );
+rSh.EndUndo( SwUndoId::END );
 rSh.EndAction();
 rReq.Done(*pDlg->GetOutputItemSet());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-20 Thread Libreoffice Gerrit user
 sw/source/filter/xml/xmlexp.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 7d703f00ed94b0d6ea44132896f1926fb68c1c04
Author: Julien Nabet 
AuthorDate: Wed Sep 12 21:37:43 2018 +0200
Commit: Michael Stahl 
CommitDate: Thu Sep 20 14:11:05 2018 +0200

tdf#108402: avoid crash if filter doesn't match

See bt https://bugs.documentfoundation.org/attachment.cgi?id=134006
+ display warning

Change-Id: I38496364c0965015ea54f753f3d3550f317d88d8
Reviewed-on: https://gerrit.libreoffice.org/60413
Reviewed-by: Julien Nabet 
(cherry picked from commit 475ea37809b5bec369d02a5ab500fac46ab40f0a)
Reviewed-on: https://gerrit.libreoffice.org/60791
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 8a7da0693df1..eb13bc3db732 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -125,6 +125,8 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
 }
 
 SwDoc *pDoc = getDoc();
+if (!pDoc)
+return ERR_SWG_WRITE_ERROR;
 
 // Make sure the layout is available to have more stability in the output
 // markup.
@@ -515,6 +517,12 @@ SwDoc* SwXMLExport::getDoc()
 if( m_pDoc != nullptr )
 return m_pDoc;
 Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
+if (!xTextDoc)
+{
+SAL_WARN("sw.filter", "Problem of mismatching filter for export.");
+return nullptr;
+}
+
 Reference < XText > xText = xTextDoc->getText();
 Reference xTextTunnel( xText, UNO_QUERY);
 assert( xTextTunnel.is());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-20 Thread Libreoffice Gerrit user
 sw/source/core/edit/editsh.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 2755bf801ee7105fdaee8221714909f839e2ca78
Author: Caolán McNamara 
AuthorDate: Tue Sep 18 13:00:34 2018 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 20 12:00:54 2018 +0200

tdf#119770 nullptr GetGraphic return

Change-Id: I9e76b6704e7f82cd9d200ed6c5802101de264242
Reviewed-on: https://gerrit.libreoffice.org/60685
Tested-by: Jenkins
Tested-by: Xisco Faulí 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index e3f443b25eec..e93ef829f83d 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -605,7 +605,8 @@ Graphic SwEditShell::GetIMapGraphic() const
 }
 else if ( rNd.IsOLENode() )
 {
-aRet = *static_cast(rNd).GetGraphic();
+if (const Graphic* pGraphic = 
static_cast(rNd).GetGraphic())
+aRet = *pGraphic;
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-10 Thread Libreoffice Gerrit user
 sw/source/core/crsr/crstrvl.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 860eca91ed159db46b527ebb2fc592e8d5423356
Author: Juergen Funk 
AuthorDate: Fri Sep 7 10:25:16 2018 +0200
Commit: Michael Stahl 
CommitDate: Mon Sep 10 18:46:29 2018 +0200

sw: tdf#119742 fix null pointer in SetCursorInHdFt

In SwWrtShell::ChangeHeaderOrFooter the ChgPageDesc destroys the frames
of the header, that's why GetCurrFrame returns null later.

Change-Id: I26915237c8b455a5b8ad0bbd5c2de38537dfef08
Reviewed-on: https://gerrit.libreoffice.org/60130
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 
(cherry picked from commit 77d075facaf4fc8954666ad541ed14f75d964fba)
Reviewed-on: https://gerrit.libreoffice.org/60249
Tested-by: Jenkins

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 7a7d67d4fe86..cef97092485c 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -199,7 +199,8 @@ bool SwCursorShell::SetCursorInHdFt( size_t nDescNo, bool 
bInHeader )
 if( SIZE_MAX == nDescNo )
 {
 // take the current one
-const SwPageFrame* pPage = GetCurrFrame()->FindPageFrame();
+const SwContentFrame *pCurrFrame = GetCurrFrame();
+const SwPageFrame* pPage = (pCurrFrame == nullptr) ? nullptr : 
pCurrFrame->FindPageFrame();
 if( pPage && pMyDoc->ContainsPageDesc(
 pPage->GetPageDesc(), ) )
 pDesc = pPage->GetPageDesc();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-04 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/ww8par.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 887ee9111f42847406c5ffc85a0ba635080de3de
Author: Caolán McNamara 
AuthorDate: Mon Sep 3 17:20:21 2018 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 4 16:19:29 2018 +0200

ofz#10198 reset uncommitted fly stuff & pams before applying redlining

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

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0f2206c711b1..c4fd1cd33125 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5391,6 +5391,9 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const 
*pGloss)
 
 UpdateFields();
 
+m_xWFlyPara.reset();
+m_xSFlyPara.reset();
+
 // delete the pam before the call for hide all redlines (Bug 73683)
 if (m_bNewDoc)
   m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags(eMode);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-09-03 Thread Libreoffice Gerrit user
 sw/source/core/unocore/unocrsrhelper.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit d3e07a584fc92c548d6356116448e202a2766d11
Author: Caolán McNamara 
AuthorDate: Thu Aug 30 16:59:40 2018 +0100
Commit: Miklos Vajna 
CommitDate: Mon Sep 3 16:36:17 2018 +0200

Resolves: tdf#119607 crash in calling getPropertyState on TextParagraph

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

diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index ad54ef7383e1..227c08f131bc 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -599,8 +599,11 @@ bool getCursorPropertyValue(const 
SfxItemPropertySimpleEntry& rEntry
 SwTextNode* pTextNode = 
rPam.GetPoint()->nNode.GetNode().GetTextNode();
 if (pTextNode)
 {
-uno::Reference xParagraph = 
SwXParagraph::CreateXParagraph(*pTextNode->GetDoc(), pTextNode);
-*pAny <<= xParagraph;
+if (pAny)
+{
+uno::Reference xParagraph = 
SwXParagraph::CreateXParagraph(*pTextNode->GetDoc(), pTextNode);
+*pAny <<= xParagraph;
+}
 }
 else
 eNewState = PropertyState_DEFAULT_VALUE;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-31 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4235206c340f0a8e8cc38b18403a7f0fbee04f7a
Author: Justin Luth 
AuthorDate: Wed Aug 22 14:22:48 2018 +0300
Commit: Miklos Vajna 
CommitDate: Fri Aug 31 09:53:34 2018 +0200

tdf#91292 docx export: COL_AUTO != cleared fill

required for tdf#90906.

If the color was COL_AUTO, then the fill was already
marked as NONE, so that doesn't indicate a "change"
made by the user since the document opened, and thus
the original information shouldn't be tossed.

Change-Id: I2e20c228c2a5f61826320798a2f07d94f0da024c
Reviewed-on: https://gerrit.libreoffice.org/59442
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 2902771581ccd6465b3e8cdca0aa3fcb6d51ca60)
Reviewed-on: https://gerrit.libreoffice.org/59535
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8529a06ad0bf..bd0fc3272407 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -8358,7 +8358,7 @@ void DocxAttributeOutput::FormatFillStyle( const 
XFillStyleItem& rFillStyle )
 m_bIgnoreNextFill = false;
 
 // Don't round-trip grabbag OriginalBackground if the background has been 
cleared.
-if ( m_pBackgroundAttrList.is() && rFillStyle.GetValue() == 
drawing::FillStyle_NONE )
+if ( m_pBackgroundAttrList.is() && m_sOriginalBackgroundColor != "auto" && 
rFillStyle.GetValue() == drawing::FillStyle_NONE )
 m_pBackgroundAttrList.clear();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-30 Thread Libreoffice Gerrit user
 sw/source/uibase/app/apphdl.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit cb954f0486b78131876b92190d840ba1b1636eb4
Author: Ilhan Yesil 
AuthorDate: Tue Aug 28 18:39:57 2018 +0200
Commit: Michael Stahl 
CommitDate: Thu Aug 30 17:26:26 2018 +0200

tdf#117823 Save mail merge config item in new view

The config object is now saved in a newly created document.

Regression from commit id 00fa85e701d4a8984cfa3a24c9b7a3963b031fa0.

Change-Id: I2265de1dd69038d447e28dfda2e85c7cf89903c6
Reviewed-on: https://gerrit.libreoffice.org/59728
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 9d847ff825c1c94286e8ab864a88fc5375d9341c)
Reviewed-on: https://gerrit.libreoffice.org/59802

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 90688e0648b9..804e358418ef 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -516,6 +516,7 @@ IMPL_LINK_NOARG( SwMailMergeWizardExecutor, EndDialogHdl, 
Dialog&, void )
 std::shared_ptr xMMConfig = 
m_pView->GetMailMergeConfigItem();
 if (pNewView)
 {
+pNewView->SetMailMergeConfigItem(xMMConfig);
 m_pView = pNewView;
 xMMConfig->DocumentReloaded();
 //new source view!
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-30 Thread Libreoffice Gerrit user
 sw/source/ui/envelp/envfmt.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1fd55c3a58ff171a39586fb0e5dd140e82718aed
Author: Caolán McNamara 
AuthorDate: Thu Aug 30 11:09:55 2018 +0100
Commit: Caolán McNamara 
CommitDate: Thu Aug 30 14:37:59 2018 +0200

Resolves: tdf#119572 addressee/sender formatting swapped

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

diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index b46b795fdaac..ac02d23dc88a 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -225,12 +225,12 @@ IMPL_LINK( SwEnvFormatPage, ModifyHdl, 
weld::MetricSpinButton&, rEdit, void )
 
 IMPL_LINK(SwEnvFormatPage, AddrEditHdl, const OString&, rIdent, void)
 {
-Edit(rIdent, true);
+Edit(rIdent, false);
 }
 
 IMPL_LINK(SwEnvFormatPage, SendEditHdl, const OString&, rIdent, void)
 {
-Edit(rIdent, false);
+Edit(rIdent, true);
 }
 
 void SwEnvFormatPage::Edit(const OString& rIdent, bool bSender)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-25 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/docxexport.cxx |4 ++-
 sw/source/filter/ww8/docxexport.hxx |2 -
 sw/source/filter/ww8/rtfexport.cxx  |4 ++-
 sw/source/filter/ww8/rtfexport.hxx  |2 -
 sw/source/filter/ww8/wrtww8.cxx |   42 ++--
 sw/source/filter/ww8/wrtww8.hxx |6 ++---
 6 files changed, 42 insertions(+), 18 deletions(-)

New commits:
commit 5be8cbdb87462cb157a98013e254de3b269c
Author: Stephan Bergmann 
AuthorDate: Thu Aug 23 18:10:01 2018 +0200
Commit: Caolán McNamara 
CommitDate: Sat Aug 25 20:35:39 2018 +0200

Related rhbz#1618703: Properly handle failure encoding MS file

...when e.g. FIPS mode makes EncryptRC4 (in sw/source/filter/ww8/wrtww8.cxx)
fail, but which hadn't been propagated out to SwWW8Writer::WriteStorage (in
sw/source/filter/ww8/wrtww8.cxx)

Reviewed-on: https://gerrit.libreoffice.org/59518
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit 229340812f6e6cc8c868915055583f60c82a8cf3)
Conflicts:
sw/source/filter/ww8/docxexport.cxx

...plus cherry-pick of follow-up 8114f976b897c4717368146a49d5404ef970c77a
"coverity#1438527 Nesting level does not match indentation"

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

diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index 6199cbf94acd..1e3f8b86b2b2 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -504,7 +504,7 @@ void DocxExport::OutputDML(uno::Reference 
const & xShape)
 aExport.WriteShape(xShape);
 }
 
-void DocxExport::ExportDocument_Impl()
+ErrCode DocxExport::ExportDocument_Impl()
 {
 // Set the 'Track Revisions' flag in the settings structure
 m_aSettings.trackRevisions = bool( RedlineFlags::On & m_nOrigRedlineFlags 
);
@@ -544,6 +544,8 @@ void DocxExport::ExportDocument_Impl()
 m_pStyles = nullptr;
 delete m_pSections;
 m_pSections = nullptr;
+
+return ERRCODE_NONE;
 }
 
 void DocxExport::AppendSection( const SwPageDesc *pPageDesc, const 
SwSectionFormat* pFormat, sal_uLong nLnNum )
diff --git a/sw/source/filter/ww8/docxexport.hxx 
b/sw/source/filter/ww8/docxexport.hxx
index 12813a33f507..1f9f188e6225 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -191,7 +191,7 @@ public:
 
 protected:
 /// Format-dependent part of the actual export.
-virtual void ExportDocument_Impl() override;
+virtual ErrCode ExportDocument_Impl() override;
 
 /// Output SwEndNode
 virtual void OutputEndNode( const SwEndNode& ) override;
diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index 7c5e096ea5b3..4736c21ca2f7 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -674,7 +674,7 @@ void RtfExport::WritePageDescTable()
 m_pTableInfo = std::make_shared();
 }
 
-void RtfExport::ExportDocument_Impl()
+ErrCode RtfExport::ExportDocument_Impl()
 {
 // Make the header
 Strm()
@@ -945,6 +945,8 @@ void RtfExport::ExportDocument_Impl()
 WriteMainText();
 
 Strm().WriteChar('}');
+
+return ERRCODE_NONE;
 }
 
 void RtfExport::PrepareNewPageDesc(const SfxItemSet* pSet, const SwNode& rNd,
diff --git a/sw/source/filter/ww8/rtfexport.hxx 
b/sw/source/filter/ww8/rtfexport.hxx
index fd2c7a285e7b..a1255cac5a11 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -118,7 +118,7 @@ public:
 
 protected:
 /// Format-dependent part of the actual export.
-void ExportDocument_Impl() override;
+ErrCode ExportDocument_Impl() override;
 
 void SectionBreaksAndFrames(const SwTextNode& /*rNode*/) override {}
 
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c158514fdd2c..745907044b52 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3119,7 +3119,7 @@ namespace
 {
 const sal_uLong WW_BLOCKSIZE = 0x200;
 
-void EncryptRC4(msfilter::MSCodec_Std97& rCtx, SvStream , SvStream 
)
+ErrCode EncryptRC4(msfilter::MSCodec_Std97& rCtx, SvStream , SvStream 
)
 {
 rIn.Seek(STREAM_SEEK_TO_END);
 sal_uLong nLen = rIn.Tell();
@@ -3130,14 +3130,17 @@ namespace
 {
 std::size_t nBS = std::min(nLen - nI, WW_BLOCKSIZE);
 nBS = rIn.ReadBytes(in, nBS);
-rCtx.InitCipher(nBlock);
+if (!rCtx.InitCipher(nBlock)) {
+return ERRCODE_IO_NOTSUPPORTED;
+}
 rCtx.Encode(in, nBS, in, nBS);
 rOut.WriteBytes(in, nBS);
 }
+return ERRCODE_NONE;
 }
 }
 
-void MSWordExportBase::ExportDocument( bool bWriteAll )
+ErrCode MSWordExportBase::ExportDocument( bool bWriteAll )
 {
 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-22 Thread Libreoffice Gerrit user
 sw/source/core/doc/doc.cxx |   49 +
 1 file changed, 32 insertions(+), 17 deletions(-)

New commits:
commit b14bc12eee887b8a892f2bb114ffd50448a74d74
Author: Mike Kaganski 
AuthorDate: Thu Aug 16 13:56:07 2018 +0300
Commit: Michael Stahl 
CommitDate: Wed Aug 22 18:36:48 2018 +0200

tdf#119294: reimplement fix for tdf#118859

When removing paragraphs with mail mere fields, both field type reference
and node reference could get invalid, because field type will be destroyed
when its last field is gone; and node will be destroyed if it is in a fly
with anchor in another node which gets destroyed.

To avoid use-after-delete, we will use an SwClient on field types, thus
detecting if a collected field type got destroyed; iterating over fields
using SwIterator is safe, because removing a node with fields would update
the iterator.

Change-Id: Id8b555ef7015b13ab70ebb41845d34c477ac6b31
Reviewed-on: https://gerrit.libreoffice.org/59164
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit c883d5e073d2ac5b2d55126c929d7bf3e6d295e8)
Reviewed-on: https://gerrit.libreoffice.org/59175
Tested-by: Xisco Faulí 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 32b522e69767..450fc3aed05c 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -46,6 +46,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -125,7 +126,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1343,8 +1343,9 @@ void RemoveOrDeleteContents(SwTextNode* pTextNd, 
IDocumentContentOperations& xOp
 xOperations.DelFullPara(aPam);
 }
 }
-// Returns the node pointer which needs to hide, or nullptr if this field does 
not hide a node
-SwTextNode* HandleHidingField(SwFormatField& rFormatField, const SwNodes& 
rNodes)
+// Returns if the data was actually modified
+bool HandleHidingField(SwFormatField& rFormatField, const SwNodes& rNodes,
+   IDocumentContentOperations& xOperations)
 {
 SwTextNode* pTextNd;
 if (rFormatField.GetTextField()
@@ -1352,9 +1353,10 @@ SwTextNode* HandleHidingField(SwFormatField& 
rFormatField, const SwNodes& rNodes
 && pTextNd->GetpSwpHints() && pTextNd->IsHiddenByParaField()
 && >GetNodes() == )
 {
-return pTextNd;
+RemoveOrDeleteContents(pTextNd, xOperations);
+return true;
 }
-return nullptr;
+return false;
 }
 }
 
@@ -1393,25 +1395,38 @@ bool SwDoc::RemoveInvisibleContent()
 GetIDocumentUndoRedo().StartUndo( SwUndoId::UI_DELETE_INVISIBLECNTNT, 
nullptr );
 
 {
+class FieldTypeGuard : public SwClient
+{
+public:
+explicit FieldTypeGuard(SwFieldType* pType)
+: SwClient(pType)
+{
+}
+const SwFieldType* get() const
+{
+return static_cast(GetRegisteredIn());
+}
+};
 // Removing some nodes for one SwFieldIds::Database type might remove 
the type from
-// document's field types, or try to remove already removed nodes, 
invalidating iterators.
-// So, we need to create own list of nodes prior to removing them.
-std::set aHiddenNodes;
-for (const auto* pType : *getIDocumentFieldsAccess().GetFieldTypes())
+// document's field types, invalidating iterators. So, we need to 
create own list of
+// matching types prior to processing them.
+std::vector> aHidingFieldTypes;
+for (SwFieldType* pType : *getIDocumentFieldsAccess().GetFieldTypes())
 {
 if (FieldCanHidePara(pType->Which()))
+
aHidingFieldTypes.push_back(o3tl::make_unique(pType));
+}
+for (const auto& pTypeGuard : aHidingFieldTypes)
+{
+if (const SwFieldType* pType = pTypeGuard->get())
 {
 SwIterator aIter(*pType);
-for (auto* pField = aIter.First(); pField; pField = 
aIter.Next())
-if (SwTextNode* pHiddenNode = HandleHidingField(*pField, 
GetNodes()))
-aHiddenNodes.insert(pHiddenNode);
+for (SwFormatField* pFormatField = aIter.First(); pFormatField;
+ pFormatField = aIter.Next())
+bRet |= HandleHidingField(*pFormatField, GetNodes(),
+  getIDocumentContentOperations());
 }
 }
-for (SwTextNode* pHiddenNode : aHiddenNodes)
-{
-bRet = true;
-RemoveOrDeleteContents(pHiddenNode, 
getIDocumentContentOperations());
-}
 }
 
 // Remove any hidden paragraph (hidden text attribute)
___
Libreoffice-commits mailing list

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-20 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/ww8scan.cxx |   39 +--
 sw/source/filter/ww8/ww8scan.hxx |2 +-
 2 files changed, 14 insertions(+), 27 deletions(-)

New commits:
commit 121ebbf097045c0dbb3eb8cb2b0cf2ffc1c4cd09
Author: Caolán McNamara 
AuthorDate: Wed Aug 15 17:28:41 2018 +0100
Commit: Michael Stahl 
CommitDate: Mon Aug 20 12:14:27 2018 +0200

ofz#9917 use a WW8SprmIter to find the sprm

extend WW8SprmIter to support the needed paramater match feature and
drop the custom WW8PLCFx_SEPX::HasSprm logic

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

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index a7e91b17aadd..16cc14b4132d 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -916,7 +916,7 @@ void WW8SprmIter::UpdateMyMembers()
 }
 }
 
-SprmResult WW8SprmIter::FindSprm(sal_uInt16 nId)
+SprmResult WW8SprmIter::FindSprm(sal_uInt16 nId, sal_uInt8* pNextByteMatch)
 {
 while (GetSprms())
 {
@@ -924,7 +924,13 @@ SprmResult WW8SprmIter::FindSprm(sal_uInt16 nId)
 {
 sal_uInt16 nFixedLen =  mrSprmParser.DistanceToData(nId);
 sal_uInt16 nL = mrSprmParser.GetSprmSize(nId, GetSprms(), 
GetRemLen());
-return SprmResult(GetCurrentParams(), nL - nFixedLen); // SPRM 
found!
+SprmResult aRet(GetCurrentParams(), nL - nFixedLen); // SPRM found!
+// typically pNextByteMatch is nullptr and we just return the 
first match
+if (!pNextByteMatch)
+return aRet;
+// very occasionally we want one with a specific following byte
+if (aRet.nRemainingData >= 1 && *aRet.pSprm == *pNextByteMatch)
+return aRet;
 }
 advance();
 }
@@ -3834,32 +3840,13 @@ bool WW8PLCFx_SEPX::Find4Sprms(sal_uInt16 
nId1,sal_uInt16 nId2,sal_uInt16 nId3,s
 
 SprmResult WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, sal_uInt8 n2nd ) const
 {
-if (!pPLCF)
-return SprmResult();
-
-sal_uInt8* pSp = pSprms.get();
-size_t i = 0;
-while (i + maSprmParser.MinSprmLen() <= nSprmSiz)
+SprmResult aRet;
+if (pPLCF)
 {
-// Sprm found?
-const sal_uInt16 nCurrentId = maSprmParser.GetSprmId(pSp);
-const sal_uInt16 x = maSprmParser.GetSprmSize(nCurrentId, pSp, 
nSprmSiz - i);
-if (nCurrentId == nId)
-{
-sal_uInt16 nFixedLen =  maSprmParser.DistanceToData(nId);
-const sal_uInt8 *pRet = pSp + nFixedLen;
-SprmResult aRet(pRet, x - nFixedLen);
-if (aRet.nRemainingData >= 1 && *aRet.pSprm == n2nd)
-{
-return aRet;
-}
-}
-// increment pointer so that it points to next SPRM
-i += x;
-pSp += x;
+WW8SprmIter aIter(pSprms.get(), nSprmSiz, maSprmParser);
+aRet = aIter.FindSprm(nId, );
 }
-
-return SprmResult();   // Sprm not found
+return aRet;
 }
 
 WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, const WW8Fib& rFib,
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 69ff529233a2..e3331305e5a2 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -282,7 +282,7 @@ public:
 explicit WW8SprmIter(const sal_uInt8* pSprms_, sal_Int32 nLen_,
 const wwSprmParser );
 void  SetSprms(const sal_uInt8* pSprms_, sal_Int32 nLen_);
-SprmResult FindSprm(sal_uInt16 nId);
+SprmResult FindSprm(sal_uInt16 nId, sal_uInt8* pNextByteMatch = nullptr);
 void  advance();
 const sal_uInt8* GetSprms() const
 { return ( pSprms && (0 < nRemLen) ) ? pSprms : nullptr; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-20 Thread Libreoffice Gerrit user
 sw/source/core/layout/trvlfrm.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 81818670fe90fca438dfb0c22903474745112cfe
Author: Caolán McNamara 
AuthorDate: Thu Aug 16 14:24:46 2018 +0100
Commit: Michael Stahl 
CommitDate: Mon Aug 20 11:58:19 2018 +0200

tdf#119224 start and end are expected to exist for the scope of this 
function

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

diff --git a/sw/source/core/layout/trvlfrm.cxx 
b/sw/source/core/layout/trvlfrm.cxx
index 22273e0173e6..14887a9e274f 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2040,13 +2040,15 @@ void SwRootFrame::CalcFrameRects(SwShellCursor )
 
 //First obtain the ContentFrames for the start and the end - those are 
needed
 //anyway.
-SwContentFrame const* pStartFrame = pStartPos->nNode.GetNode().
+SwContentFrame* pStartFrame = pStartPos->nNode.GetNode().
 GetContentNode()->getLayoutFrame( this, (), 
pStartPos );
 
-SwContentFrame const* pEndFrame   = pEndPos->nNode.GetNode().
+SwContentFrame* pEndFrame   = pEndPos->nNode.GetNode().
 GetContentNode()->getLayoutFrame( this, (), pEndPos 
);
 
-OSL_ENSURE( (pStartFrame && pEndFrame), "No ContentFrames found." );
+assert(pStartFrame && pEndFrame && "No ContentFrames found.");
+//tdf#119224 start and end are expected to exist for the scope of this 
function
+SwFrameDeleteGuard aStartFrameGuard(pStartFrame), 
aEndFrameGuard(pEndFrame);
 
 //Do not subtract the FlyFrames in which selected Frames lie.
 SwSortedObjs aSortObjs;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-20 Thread Libreoffice Gerrit user
 sw/source/core/layout/flowfrm.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit d1b9cbe749fc3329bda1e8ddaee6d8a6f783ad82
Author: Caolán McNamara 
AuthorDate: Tue Aug 14 15:22:58 2018 +0100
Commit: Michael Stahl 
CommitDate: Mon Aug 20 12:20:03 2018 +0200

tdf#117086 crash on deleted SwFootnoteBossFrame

use SwFrameDeleteGuard to lock pOldBoss to exist over the range
its directly accessed

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

diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 46af46fbe942..4366c98af710 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1871,6 +1871,8 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool 
bPageBreak, bool bMoveAlways )
 }
 }
 
+std::unique_ptr xDeleteGuard(bMakePage ? new 
SwFrameDeleteGuard(pOldBoss) : nullptr);
+
 bool bSamePage = true;
 SwLayoutFrame *pNewUpper =
 m_rThis.GetLeaf( bMakePage ? MAKEPAGE_INSERT : MAKEPAGE_NONE, true 
);
@@ -1909,6 +1911,8 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool 
bPageBreak, bool bMoveAlways )
 pOldBoss = pOldBoss->FindFootnoteBossFrame( true );
 SwPageFrame* pNewPage = pOldPage;
 
+xDeleteGuard.reset();
+
 // First, we move the footnotes.
 bool bFootnoteMoved = false;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-17 Thread Libreoffice Gerrit user
 sw/source/ui/envelp/envprt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2b52e332b7d6cd18cb024295c1218517cf6d27d9
Author: Caolán McNamara 
AuthorDate: Thu Aug 16 15:13:59 2018 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 17 11:00:19 2018 +0200

insert->envelope->printer->setup crashes

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

diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index fee13aabad94..c25a1ff7eb08 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -118,7 +118,7 @@ IMPL_LINK(SwEnvPrtPage, ButtonHdl, weld::Button&, rBtn, 
void)
 // Call printer setup
 if (m_xPrt)
 {
-PrinterSetupDialog aDlg(GetTabDialog()->GetFrameWeld());
+PrinterSetupDialog aDlg(GetDialogController()->getDialog());
 aDlg.SetPrinter(m_xPrt);
 aDlg.execute();
 rBtn.grab_focus();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-16 Thread Libreoffice Gerrit user
 sw/source/core/layout/pagechg.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit ab8b8fdbb32ad4da5af521b1b982189786bcdcb4
Author: Stephan Bergmann 
AuthorDate: Tue Aug 14 17:21:01 2018 +0200
Commit: Christian Lohmaier 
CommitDate: Thu Aug 16 12:06:25 2018 +0200

tdf#119252: Revert "Remove < USHRT_MAX check that is presumably no longer

...needed"

This reverts commit 4a61006255c67bb6f9ac99107093a424a9de441e, as it turns 
out
to actually break things.  I'm not quite sure how I came across that code 
and
the attempted fix back then, but at least ASan+UBSan `make check` still 
works
after the revert (and UBSan seems the most likely reason I came across 
this).

I know too little about that Writer table layout code to know whether the
original code is actually good, or would need some other fixing, so lets 
just
revert for now.

Change-Id: I1e88372a3b688a5fdd4c1bf88033b51287195799
Reviewed-on: https://gerrit.libreoffice.org/59002
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit d9c312d1917bc039bb0354c8c3f5c9dbbb758cf1)
Reviewed-on: https://gerrit.libreoffice.org/59039
Tested-by: Xisco Faulí 
Reviewed-by: Christian Lohmaier 

diff --git a/sw/source/core/layout/pagechg.cxx 
b/sw/source/core/layout/pagechg.cxx
index 036e3371e97c..ac6c74f4fc57 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1764,10 +1764,10 @@ void SwRootFrame::ImplCalcBrowseWidth()
 SwBorderAttrAccess aAccess( SwFrame::GetCache(), pFrame );
 const SwBorderAttrs  = *aAccess.Get();
 const SwFormatHoriOrient  = 
rAttrs.GetAttrSet().GetHoriOrient();
-if ( text::HoriOrientation::FULL != rHori.GetHoriOrient() )
+long nWidth = rAttrs.GetSize().Width();
+if ( nWidth < USHRT_MAX-2000 && //-2k, because USHRT_MAX gets 
missing while trying to resize!
+ text::HoriOrientation::FULL != rHori.GetHoriOrient() )
 {
-long nWidth = rAttrs.GetSize().Width();
-
 const SwHTMLTableLayout *pLayoutInfo =
 static_cast(pFrame)->GetTable()
 ->GetHTMLTableLayout();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-16 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/ww8graf.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit ca3038a05188084b012dd3c799494f30bc5c47ef
Author: Caolán McNamara 
AuthorDate: Wed Aug 15 10:27:22 2018 +0100
Commit: Christian Lohmaier 
CommitDate: Thu Aug 16 11:54:53 2018 +0200

ofz#9908 validate no negative editengine selection positions

Change-Id: I37dace2051518224c55756362facd3edba4a9571
Reviewed-on: https://gerrit.libreoffice.org/59059
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 53a3c3289f71..36a4aea53df8 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -581,7 +581,9 @@ namespace
 bool IsValidSel(const EditEngine& rEngine, const ESelection& rSel)
 {
 const auto nParaCount = rEngine.GetParagraphCount();
-return rSel.nStartPara < nParaCount && rSel.nEndPara < nParaCount;
+if (rSel.nStartPara < nParaCount && rSel.nEndPara < nParaCount)
+return rSel.nStartPos >= 0 && rSel.nEndPos >= 0;
+return false;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-15 Thread Libreoffice Gerrit user
 sw/source/core/unocore/unochart.cxx |   47 +---
 1 file changed, 17 insertions(+), 30 deletions(-)

New commits:
commit 20baed78792b39e43d1315552cc06b1fc29a45ba
Author: Caolán McNamara 
AuthorDate: Wed Aug 15 14:13:02 2018 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 15 18:32:10 2018 +0200

outer loop unrelated to inner loop

since original checkin of...

commit 9cddf9da7fb256418e1bc3b4719abb55e3b0604c
Date:   Tue May 22 15:33:44 2007 +

INTEGRATION: CWS chart2mst3 (1.1.2); FILE ADDED
...
2006/12/13 12:31:03 tl 1.1.2.38: #i71244# update charts in writer

where I think this LockUnlockAllCharts chart2 loop was modelled on
the previous chart[1] styles loop of e.g. DoUpdateAllCharts which
loop over tables.

chart2 objects are unrelated to these tables, so remove the outer
loop, which then means the ofz#9689 ofz#9856 ofz9874 crashes that
made me look at it will get fixed

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

diff --git a/sw/source/core/unocore/unochart.cxx 
b/sw/source/core/unocore/unochart.cxx
index 130f0fa22181..442079fbee18 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -118,43 +118,30 @@ void SwChartLockController_Helper::LockUnlockAllCharts( 
bool bLock )
 if (!pDoc)
 return;
 
-const SwFrameFormats& rTableFormats = *pDoc->GetTableFrameFormats();
-for( size_t n = 0; n < rTableFormats.size(); ++n )
+uno::Reference< frame::XModel > xRes;
+SwOLENode *pONd;
+SwStartNode *pStNd;
+SwNodeIndex aIdx( 
*pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
+while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
 {
-SwTable* pTmpTable;
-const SwTableNode* pTableNd;
-const SwFrameFormat* pFormat = rTableFormats[ n ];
-
-if( nullptr != ( pTmpTable = SwTable::FindTable( pFormat ) ) &&
-nullptr != ( pTableNd = pTmpTable->GetTableNode() ) &&
-pTableNd->GetNodes().IsDocNodes() )
+++aIdx;
+if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) &&
+!pONd->GetChartTableName().isEmpty() /* is chart object? */)
 {
-uno::Reference< frame::XModel > xRes;
-SwOLENode *pONd;
-SwStartNode *pStNd;
-SwNodeIndex aIdx( 
*pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
-while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
+uno::Reference < embed::XEmbeddedObject > xIP = 
pONd->GetOLEObj().GetOleRef();
+if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
 {
-++aIdx;
-if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) &&
-!pONd->GetChartTableName().isEmpty() /* is chart object? 
*/)
+xRes.set( xIP->getComponent(), uno::UNO_QUERY );
+if (xRes.is())
 {
-uno::Reference < embed::XEmbeddedObject > xIP = 
pONd->GetOLEObj().GetOleRef();
-if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
-{
-xRes.set( xIP->getComponent(), uno::UNO_QUERY );
-if (xRes.is())
-{
-if (bLock)
-xRes->lockControllers();
-else
-xRes->unlockControllers();
-}
-}
+if (bLock)
+xRes->lockControllers();
+else
+xRes->unlockControllers();
 }
-aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
 }
 }
+aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
 }
 
 bIsLocked = bLock;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-15 Thread Libreoffice Gerrit user
 sw/source/core/unocore/unotbl.cxx |   22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

New commits:
commit 31374100da4062eab9cdd171cea27c0965ded5ac
Author: Caolán McNamara 
AuthorDate: Tue Aug 14 12:30:36 2018 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 15 17:31:25 2018 +0200

tdf#117127 crash on inspecting value describing a table

since...

commit f86d0413f7cedf096b285c2eb6698653dd99c21e
Date:   Mon Mar 30 01:26:21 2015 +0200

SwXCellRange:: and SwXTextTable::getDataArray() do the same

which used to have more checks than its replacement

Change-Id: Id931882ef7c749ffa18ef3474e3e661ba8614ab0
Reviewed-on: https://gerrit.libreoffice.org/58977
Tested-by: Jenkins
Tested-by: Xisco Faulí 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 1d28972928c2..be2b71758a61 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2313,7 +2313,7 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL 
SwXTextTable::getDataArray()
 std::pair const 
RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this));
 uno::Reference const xAllRange(
 getCellRangeByPosition(0, 0, RowsAndColumns.second-1, 
RowsAndColumns.first-1),
-uno::UNO_QUERY);
+uno::UNO_QUERY_THROW);
 return xAllRange->getDataArray();
 }
 
@@ -2323,7 +2323,7 @@ void SAL_CALL SwXTextTable::setDataArray(const 
uno::Sequence< uno::Sequence< uno
 std::pair const 
RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this));
 uno::Reference const xAllRange(
 getCellRangeByPosition(0, 0, RowsAndColumns.second-1, 
RowsAndColumns.first-1),
-uno::UNO_QUERY);
+uno::UNO_QUERY_THROW);
 return xAllRange->setDataArray(rArray);
 }
 
@@ -2333,7 +2333,7 @@ uno::Sequence< uno::Sequence< double > > 
SwXTextTable::getData()
 std::pair const 
RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this));
 uno::Reference const xAllRange(
 getCellRangeByPosition(0, 0, RowsAndColumns.second-1, 
RowsAndColumns.first-1),
-uno::UNO_QUERY);
+uno::UNO_QUERY_THROW);
 static_cast(xAllRange.get())->SetLabels(
 m_pImpl->m_bFirstRowAsLabel, m_pImpl->m_bFirstColumnAsLabel);
 return xAllRange->getData();
@@ -2345,7 +2345,7 @@ void SwXTextTable::setData(const uno::Sequence< 
uno::Sequence< double > >& rData
 std::pair const 
RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this));
 uno::Reference const xAllRange(
 getCellRangeByPosition(0, 0, RowsAndColumns.second-1, 
RowsAndColumns.first-1),
-uno::UNO_QUERY);
+uno::UNO_QUERY_THROW);
 static_cast(xAllRange.get())->SetLabels(
 m_pImpl->m_bFirstRowAsLabel, m_pImpl->m_bFirstColumnAsLabel);
 xAllRange->setData(rData);
@@ -2359,7 +2359,7 @@ uno::Sequence SwXTextTable::getRowDescriptions()
 std::pair const 
RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this));
 uno::Reference const xAllRange(
 getCellRangeByPosition(0, 0, RowsAndColumns.second-1, 
RowsAndColumns.first-1),
-uno::UNO_QUERY);
+uno::UNO_QUERY_THROW);
 static_cast(xAllRange.get())->SetLabels(
 m_pImpl->m_bFirstRowAsLabel, m_pImpl->m_bFirstColumnAsLabel);
 return xAllRange->getRowDescriptions();
@@ -2371,7 +2371,7 @@ void SwXTextTable::setRowDescriptions(const 
uno::Sequence& rRowDesc)
 std::pair const 
RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this));
 uno::Reference const xAllRange(
 getCellRangeByPosition(0, 0, RowsAndColumns.second-1, 
RowsAndColumns.first-1),
-uno::UNO_QUERY);
+uno::UNO_QUERY_THROW);
 static_cast(xAllRange.get())->SetLabels(
 m_pImpl->m_bFirstRowAsLabel, m_pImpl->m_bFirstColumnAsLabel);
 xAllRange->setRowDescriptions(rRowDesc);
@@ -2383,7 +2383,7 @@ uno::Sequence 
SwXTextTable::getColumnDescriptions()
 std::pair const 
RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this));
 uno::Reference const xAllRange(
 getCellRangeByPosition(0, 0, RowsAndColumns.second-1, 
RowsAndColumns.first-1),
-uno::UNO_QUERY);
+uno::UNO_QUERY_THROW);
 static_cast(xAllRange.get())->SetLabels(
 m_pImpl->m_bFirstRowAsLabel, m_pImpl->m_bFirstColumnAsLabel);
 return xAllRange->getColumnDescriptions();
@@ -2395,7 +2395,7 @@ void SwXTextTable::setColumnDescriptions(const 
uno::Sequence& rColumnD
 std::pair const 
RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this));
 uno::Reference const xAllRange(
 getCellRangeByPosition(0, 0, RowsAndColumns.second-1, 
RowsAndColumns.first-1),
-uno::UNO_QUERY);
+uno::UNO_QUERY_THROW);
 static_cast(xAllRange.get())->SetLabels(
 m_pImpl->m_bFirstRowAsLabel, m_pImpl->m_bFirstColumnAsLabel);
 return 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-08 Thread Libreoffice Gerrit user
 sw/source/uibase/uiview/viewmdi.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit bb43add6896e9689c08c191f6ab6d87c420b0584
Author: Jim Raykowski 
AuthorDate: Sun May 13 08:30:15 2018 -0800
Commit: Miklos Vajna 
CommitDate: Wed Aug 8 11:07:56 2018 +0200

tdf#117553 Change navigate behavior when in footnote frame

This patch changes navigate behavior to move to prev/next footnote text
when in footnote frame.

Change-Id: If206098d8817b74ab484a1039371c058d321fda2
Reviewed-on: https://gerrit.libreoffice.org/54195
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 
(cherry picked from commit 215e5adf4977a175bb8cc89dcbd48ef443ac8f10)
Reviewed-on: https://gerrit.libreoffice.org/58304
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/uiview/viewmdi.cxx 
b/sw/source/uibase/uiview/viewmdi.cxx
index 08af720f9e4a..bc76c064adeb 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -389,10 +389,26 @@ IMPL_LINK( SwView, MoveNavigationHdl, void*, p, void )
 bNext ? rSh.GoNextCursor() : rSh.GoPrevCursor();
 break;
 case NID_FTN:
+{
+bool bFrameTypeFootnote(rSh.GetFrameType(nullptr, false) & 
FrameTypeFlags::FOOTNOTE);
+
+if (bFrameTypeFootnote)
+{
+rSh.LockView(true);
+rSh.GotoFootnoteAnchor();
+}
+
 rSh.EnterStdMode();
 bNext ?
 rSh.GotoNextFootnoteAnchor() :
 rSh.GotoPrevFootnoteAnchor();
+
+if (bFrameTypeFootnote)
+{
+rSh.LockView(false);
+rSh.GotoFootnoteText();
+}
+}
 break;
 case NID_MARK:
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-07 Thread Libreoffice Gerrit user
 sw/source/core/doc/doc.cxx |   34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)

New commits:
commit 3c20597ada7f74a4a96dec841264593fdbf0bcd5
Author: Mike Kaganski 
AuthorDate: Sun Aug 5 14:23:44 2018 +0300
Commit: Michael Stahl 
CommitDate: Tue Aug 7 18:46:40 2018 +0200

tdf#118859: Avoid trying to remove already removed nodes

Regression from commit db04be037b611e296ef9f2542322c52ed82d7a2b

Change-Id: I530c00f6357b4822654add6e5f2eecb3252b88ae
Reviewed-on: https://gerrit.libreoffice.org/58612
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 576fac6f6199a87fb07e4a067abaa18c89b6d7ea)
Reviewed-on: https://gerrit.libreoffice.org/58619
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 43eee2ebad05..32b522e69767 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -125,6 +125,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1342,9 +1343,8 @@ void RemoveOrDeleteContents(SwTextNode* pTextNd, 
IDocumentContentOperations& xOp
 xOperations.DelFullPara(aPam);
 }
 }
-// Returns if the data was actually modified
-bool HandleHidingField(SwFormatField& rFormatField, const SwNodes& rNodes,
-   IDocumentContentOperations& xOperations)
+// Returns the node pointer which needs to hide, or nullptr if this field does 
not hide a node
+SwTextNode* HandleHidingField(SwFormatField& rFormatField, const SwNodes& 
rNodes)
 {
 SwTextNode* pTextNd;
 if (rFormatField.GetTextField()
@@ -1352,10 +1352,9 @@ bool HandleHidingField(SwFormatField& rFormatField, 
const SwNodes& rNodes,
 && pTextNd->GetpSwpHints() && pTextNd->IsHiddenByParaField()
 && >GetNodes() == )
 {
-RemoveOrDeleteContents(pTextNd, xOperations);
-return true;
+return pTextNd;
 }
-return false;
+return nullptr;
 }
 }
 
@@ -1387,6 +1386,7 @@ bool SwDoc::FieldHidesPara(const SwField& rField) const
 }
 
 /// Remove the invisible content from the document e.g. hidden areas, hidden 
paragraphs
+// Returns if the data was actually modified
 bool SwDoc::RemoveInvisibleContent()
 {
 bool bRet = false;
@@ -1394,21 +1394,23 @@ bool SwDoc::RemoveInvisibleContent()
 
 {
 // Removing some nodes for one SwFieldIds::Database type might remove 
the type from
-// document's field types, invalidating iterators. So, we need to 
create own list of
-// matching types prior to processing them.
-std::vector aHidingFieldTypes;
+// document's field types, or try to remove already removed nodes, 
invalidating iterators.
+// So, we need to create own list of nodes prior to removing them.
+std::set aHiddenNodes;
 for (const auto* pType : *getIDocumentFieldsAccess().GetFieldTypes())
 {
 if (FieldCanHidePara(pType->Which()))
-aHidingFieldTypes.push_back(pType);
+{
+SwIterator aIter(*pType);
+for (auto* pField = aIter.First(); pField; pField = 
aIter.Next())
+if (SwTextNode* pHiddenNode = HandleHidingField(*pField, 
GetNodes()))
+aHiddenNodes.insert(pHiddenNode);
+}
 }
-for (const auto* pType : aHidingFieldTypes)
+for (SwTextNode* pHiddenNode : aHiddenNodes)
 {
-SwIterator aIter(*pType);
-for (SwFormatField* pFormatField = aIter.First(); pFormatField;
- pFormatField = aIter.Next())
-bRet |= HandleHidingField(*pFormatField, GetNodes(),
-  getIDocumentContentOperations());
+bRet = true;
+RemoveOrDeleteContents(pHiddenNode, 
getIDocumentContentOperations());
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-07 Thread Libreoffice Gerrit user
 sw/source/filter/ww8/ww8par.cxx  |1 +
 sw/source/filter/ww8/ww8par.hxx  |2 +-
 sw/source/filter/ww8/ww8par5.cxx |6 ++
 3 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 679ab387954b2c8c00a8e9c9b6ad67a65fa432cd
Author: Caolán McNamara 
AuthorDate: Thu Aug 2 21:18:15 2018 +0100
Commit: Michael Stahl 
CommitDate: Tue Aug 7 17:24:56 2018 +0200

forcepoint#69 ditch any unclosed m_pPosAfterTOC before dropping cursor

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

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index c9b994a76f94..236b4a578443 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5385,6 +5385,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const 
*pGloss)
 m_xLstManager.reset();
 }
 
+m_pPosAfterTOC.reset();
 mpCursor.reset();
 m_pPaM = nullptr;
 
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 37d74e6c0d26..a3f8bb6a5745 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1354,7 +1354,7 @@ private:
 // Indicate that current on loading a hyperlink, which is inside a TOC; 
Managed by Read_F_Hyperlink() and End_Field()
 bool m_bLoadingTOXHyperlink;
 // a document position recorded the after-position of TOC section, managed 
by Read_F_TOX() and End_Field()
-SwPaM* m_pPosAfterTOC;
+std::unique_ptr m_pPosAfterTOC;
 // used for some dropcap tweaking
 SwTextNode* m_pPreviousNode;
 
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 978c9f877e3e..efd87ee64a05 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -569,8 +569,7 @@ sal_uInt16 SwWW8ImplReader::End_Field()
 if (m_pPosAfterTOC)
 {
 *m_pPaM = *m_pPosAfterTOC;
-delete m_pPosAfterTOC;
-m_pPosAfterTOC = nullptr;
+m_pPosAfterTOC.reset();
 }
 }
 }
@@ -3410,8 +3409,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, 
OUString& rStr )
 
 //The TOC field representation contents should be inserted into TOC 
section, but not after TOC section.
 //So we need update the document position when loading TOC representation 
and after loading TOC;
-delete m_pPosAfterTOC;
-m_pPosAfterTOC = new SwPaM(*m_pPaM, m_pPaM);
+m_pPosAfterTOC.reset(new SwPaM(*m_pPaM, m_pPaM));
 (*m_pPaM).Move(fnMoveBackward);
 SwPaM aRegion(*m_pPaM, m_pPaM);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-07 Thread Libreoffice Gerrit user
 sw/source/core/inc/wrong.hxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 5fce37bd1dbd6135e5e51356da6acd8326717ab3
Author: Stephan Bergmann 
AuthorDate: Tue Aug 7 11:14:30 2018 +0200
Commit: Michael Stahl 
CommitDate: Tue Aug 7 16:17:33 2018 +0200

Ensure consistent pointer-to-member representation on MSVC

...even with --disable-pch, where CppunitTest_sw_macros_test failed because
creating the three iterWrong, iterGrammar, iterSmartTags in
SwTextFrame::PaintSwFrame (sw/source/core/text/frmpaint.cxx) happend to 
have a
differnt idea about the size of pointer-to-SwTextNode-member than the
WrongListIterator ctor in sw/source/core/text/wrong.cxx.

Change-Id: I6acef19c798991cc0fd65f6e8d5cf44485b6d2c6
Reviewed-on: https://gerrit.libreoffice.org/58670
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit f96ba2d948deb4a14dd686d74c758e1429c239a4)
Reviewed-on: https://gerrit.libreoffice.org/58678
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx
index 7b3e6476a1cb..c7985d85e645 100644
--- a/sw/source/core/inc/wrong.hxx
+++ b/sw/source/core/inc/wrong.hxx
@@ -34,6 +34,13 @@
 #include 
 #include "TextFrameIndex.hxx"
 
+#if defined _MSC_VER
+// For MSVC (without /vmg) SwTextNode must consistently be defined for
+// WrongListIterator::m_pGetWrongList of pointer-to-SwTextNode-member type to 
consitently have the
+// same size in all translation units that include this file:
+#include 
+#endif
+
 class SwWrongList;
 
 enum WrongAreaLineType
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-07 Thread Libreoffice Gerrit user
 sw/source/core/layout/frmtool.cxx |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 9959d003d3b266954815f10b9e14068ee170c2eb
Author: Michael Stahl 
AuthorDate: Mon Aug 6 19:03:22 2018 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Aug 7 15:35:44 2018 +0200

sw: fix ignored frames in AppendAllObjs()

The problem is that AppendAllObjs() doesn't check if MakeFrames()
actually created frames, it just assumes success.

If there are frames anchored in frames, then it could go through
the circular_buffer, find a dependent frame before its anchor frame,
unsuccessfully call MakeFrames(), then call MakeFrames() on the anchor
frame, and then the vector is empty.

A surprising aspect is that push_back on a boost::circular_buffer will
silently pop the first element if it's already "full".  Possibly this
is what caused tdf#112447.

1. insert section
2. in paragraph in section, insert frame
3. repeat 2
4. drag anchor of frame 1 into body of frame 2
5. edit section, click hide
6. edit section, un-click hide
7. only one frame is displayed

(regression from 575e222a1742918be052f2b716ddf57ce0008404 and/or
 ce2fce9a41729774689080c8b5552b60c2e6ee2d)

Change-Id: Ie782252ac388524dfb083f655320a50e95239b24
Reviewed-on: https://gerrit.libreoffice.org/58676
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 31e66bd07c1082bb375be8aaf7835f019351d9bb)
Reviewed-on: https://gerrit.libreoffice.org/58679
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 37fc4a808157..1fce3519f635 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1189,18 +1189,24 @@ void AppendAllObjs(const SwFrameFormats* pTable, const 
SwFrame* pSib)
 if(!isConnected)
 {
 pFormat->MakeFrames();
-pFirstRequeued = nullptr;
+
pFormat->CallSwClientNotify(sw::GetObjectConnectedHint(isConnected, pRoot));
 }
-else
+// do this *before* push_back! the circular_buffer can be "full"!
+vFormatsToConnect.pop_front();
+if (!isConnected)
 {
 if(pFirstRequeued == pFormat)
 // If nothing happens anymore we can stop.
 break;
 if(!pFirstRequeued)
 pFirstRequeued = pFormat;
+assert(!vFormatsToConnect.full());
 vFormatsToConnect.push_back(pFormat);
 }
-vFormatsToConnect.pop_front();
+else
+{
+pFirstRequeued = nullptr;
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-03 Thread Libreoffice Gerrit user
 sw/source/core/unocore/unoframe.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit ec79d0127f90d65d722e46688b6cfcf2f5e59794
Author: Caolán McNamara 
AuthorDate: Wed Aug 1 20:11:08 2018 +0100
Commit: Michael Stahl 
CommitDate: Fri Aug 3 11:16:04 2018 +0200

forcepoint#67 null deref

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

diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index b193f8ed757d..c3d409e02fec 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -3181,12 +3181,14 @@ uno::Reference< text::XTextCursor >  
SwXTextFrame::createTextCursor()
 uno::Reference< text::XTextCursor >  
SwXTextFrame::createTextCursorByRange(const uno::Reference< text::XTextRange > 
& aTextPosition)
 {
 SolarMutexGuard aGuard;
-uno::Reference< text::XTextCursor >  aRef;
 SwFrameFormat* pFormat = GetFrameFormat();
+if (!pFormat)
+throw uno::RuntimeException();
 SwUnoInternalPaM aPam(*GetDoc());
-if (!pFormat || !::sw::XTextRangeToSwPaM(aPam, aTextPosition))
+if (!::sw::XTextRangeToSwPaM(aPam, aTextPosition))
 throw uno::RuntimeException();
 
+uno::Reference  aRef;
 SwNode& rNode = pFormat->GetContent().GetContentIdx()->GetNode();
 if(aPam.GetNode().FindFlyStartNode() == rNode.FindFlyStartNode())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-03 Thread Libreoffice Gerrit user
 sw/source/core/text/pormulti.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 8f3922d3485fbaec032458653f42ccfcbab88e84
Author: Caolán McNamara 
AuthorDate: Wed Aug 1 11:25:22 2018 +0100
Commit: Michael Stahl 
CommitDate: Fri Aug 3 10:51:01 2018 +0200

forcepoint#61 null deref

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

diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 13b7207b71d9..78423e440a6f 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -2094,11 +2094,13 @@ bool SwTextFormatter::BuildMultiPortion( 
SwTextFormatInfo ,
 
 BuildPortions( aTmp );
 
-if ( rMulti.OnRight() )
+const SwLinePortion *pRightPortion = rMulti.OnRight() ?
+ 
rMulti.GetRoot().GetNext()->GetPortion() : nullptr;
+if (pRightPortion)
 {
 // The ruby text on the right is vertical.
 // The width and the height are swapped.
-SwTwips nHeight = 
rMulti.GetRoot().GetNext()->GetPortion()->Height();
+SwTwips nHeight = pRightPortion->Height();
 // Keep room for the ruby text.
 rMulti.GetRoot().FindLastPortion()->AddPrtWidth( nHeight );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-08-02 Thread Libreoffice Gerrit user
 sw/source/uibase/uiview/pview.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit e9c56f20687b9c950977e095476c18ff510fae1e
Author: Mike Kaganski 
AuthorDate: Wed Aug 1 21:20:10 2018 +0200
Commit: Michael Stahl 
CommitDate: Thu Aug 2 16:31:08 2018 +0200

tdf#119042: Also check if SfxViewFrame::Current() is nullptr

Change-Id: I5ac43ff626bfb4e2e754cacead5bf87115f3ce4b
Reviewed-on: https://gerrit.libreoffice.org/58447
Reviewed-by: Xisco Faulí 
Tested-by: Jenkins
(cherry picked from commit d0a481d09e696f6d5a2a0d40a9d5c48cfca559bf)
Reviewed-on: https://gerrit.libreoffice.org/58457
Reviewed-by: Michael Stahl 

diff --git a/sw/source/uibase/uiview/pview.cxx 
b/sw/source/uibase/uiview/pview.cxx
index 7b71101baa8a..d0c2cbbbf0a3 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1248,8 +1248,9 @@ SwPagePreview::~SwPagePreview()
 delete pVShell;
 
 m_pViewWin.disposeAndClear();
-if (auto& pBar = 
SfxViewFrame::Current()->GetWindow().GetSystemWindow()->GetNotebookBar())
-pBar->ControlListener(false);
+if (SfxViewFrame* pCurrent = SfxViewFrame::Current())
+if (auto& pBar = 
pCurrent->GetWindow().GetSystemWindow()->GetNotebookBar())
+pBar->ControlListener(false);
 m_pScrollFill.disposeAndClear();
 m_pHScrollbar.disposeAndClear();
 m_pVScrollbar.disposeAndClear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-31 Thread Libreoffice Gerrit user
 sw/source/uibase/docvw/edtwin.cxx |   30 ++
 1 file changed, 26 insertions(+), 4 deletions(-)

New commits:
commit b917fe54aa1ab2b39d7a0b6ed7f66fc9c4f6d74e
Author: Xisco Fauli 
AuthorDate: Mon Jul 30 13:12:43 2018 +0200
Commit: Xisco Faulí 
CommitDate: Tue Jul 31 11:10:21 2018 +0200

tdf#118971: allow arrow keys to move images or drawing objects

Partially revert 2d5ce0e1b233c83f91481cd6b9306ac8de7f5ff8

Change-Id: Ie4c91529c1ce878f4b0474d815a3a88ed48769c2
Reviewed-on: https://gerrit.libreoffice.org/58318
Reviewed-by: Heiko Tietze 
Tested-by: Heiko Tietze 
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit e1d73cb5552c2566c6d7463ce001e23f3d92)
Reviewed-on: https://gerrit.libreoffice.org/58342
Reviewed-by: Xisco Faulí 

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 5e509ee18ec3..3be0d47726de 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -1768,7 +1768,11 @@ KEYINPUT_CHECKTABLE:
 eFlyState = SwKeyState::Fly_Change;
 nDir = MOVE_LEFT_BIG;
 }
-break;
+goto KEYINPUT_CHECKTABLE_INSDEL;
+}
+case KEY_RIGHT | KEY_MOD1:
+{
+goto KEYINPUT_CHECKTABLE_INSDEL;
 }
 case KEY_UP:
 case KEY_UP | KEY_MOD1:
@@ -1779,7 +1783,7 @@ KEYINPUT_CHECKTABLE:
 eFlyState = SwKeyState::Fly_Change;
 nDir = MOVE_UP_BIG;
 }
-break;
+goto KEYINPUT_CHECKTABLE_INSDEL;
 }
 case KEY_DOWN:
 case KEY_DOWN | KEY_MOD1:
@@ -1790,8 +1794,26 @@ KEYINPUT_CHECKTABLE:
 eFlyState = SwKeyState::Fly_Change;
 nDir = MOVE_DOWN_BIG;
 }
-break;
+goto KEYINPUT_CHECKTABLE_INSDEL;
+}
+
+KEYINPUT_CHECKTABLE_INSDEL:
+if( rSh.IsTableMode() || !rSh.GetTableFormat() )
+{
+const SelectionType nSelectionType = 
rSh.GetSelectionType();
+
+eKeyState = SwKeyState::KeyToView;
+if(SwKeyState::KeyToView != eFlyState)
+{
+if((nSelectionType & 
(SelectionType::DrawObject|SelectionType::DbForm))  &&
+rSh.GetDrawView()->AreObjectsMarked())
+eKeyState = SwKeyState::Draw_Change;
+else if(nSelectionType & 
(SelectionType::Frame|SelectionType::Ole|SelectionType::Graphic))
+eKeyState = SwKeyState::Fly_Change;
+}
 }
+break;
+
 
 case KEY_DELETE:
 if ( !rSh.HasReadonlySel() || rSh.CursorInsideInputField())
@@ -1968,7 +1990,7 @@ KEYINPUT_CHECKTABLE:
 {
 eFlyState = SwKeyState::Fly_Change;
 nDir = MOVE_RIGHT_BIG;
-break;
+goto KEYINPUT_CHECKTABLE_INSDEL;
 }
 case KEY_TAB:
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-30 Thread Libreoffice Gerrit user
 sw/source/ui/fldui/DropDownFieldDialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 15f8f0be29c42ac0c10af679ff5bb51b29bb3bd1
Author: Caolán McNamara 
AuthorDate: Mon Jul 30 11:12:04 2018 +0100
Commit: Xisco Faulí 
CommitDate: Mon Jul 30 16:08:28 2018 +0200

Resolves: tdf#118965 fix input list edit button

regression since...

commit 7d5245848c28f5786258476cd7aa2a4523645de3
Date:   Fri Sep 15 17:39:48 2017 +0200

tdf#79877 revert to old behavior when clicking on input fields.

Change-Id: I5e67a8f0c8d2599c139d3d728298c30f4a31c8d1
Reviewed-on: https://gerrit.libreoffice.org/58315
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sw/source/ui/fldui/DropDownFieldDialog.cxx 
b/sw/source/ui/fldui/DropDownFieldDialog.cxx
index d467cfa3470e..655f2d60c086 100644
--- a/sw/source/ui/fldui/DropDownFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFieldDialog.cxx
@@ -117,7 +117,7 @@ bool sw::DropDownFieldDialog::NextButtonPressed() const
 IMPL_LINK_NOARG(sw::DropDownFieldDialog, EditHdl, weld::Button&, void)
 {
 m_pPressedButton = m_xEditPB.get();
-m_xDialog->response(RET_OK);
+m_xDialog->response(RET_YES);
 }
 
 IMPL_LINK_NOARG(sw::DropDownFieldDialog, PrevHdl, weld::Button&, void)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-27 Thread Libreoffice Gerrit user
 sw/source/uibase/dochdl/swdtflvr.cxx |   23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

New commits:
commit 73bd150048d056fb6e00de3f8b91347b7f642e91
Author: László Németh 
AuthorDate: Fri Jul 20 17:49:21 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Jul 27 11:31:34 2018 +0200

tdf#37223 Writer: insert 1-cell tables as text instead of OLE object

to get a user-friendly solution to copy Calc cell content to a text
document and to its native tables.

NOTE: MSO does the same for copying 1-cell tables, while LibreOffice
was able to do this only with paste special as RTF.

Change-Id: I6156333055aa9bed4cf56ff12f913e89d3f5700c
Reviewed-on: https://gerrit.libreoffice.org/57783
Tested-by: Jenkins
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/57814
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 4e69db27180e..2eac04a31e5d 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -1128,6 +1128,7 @@ bool SwTransferable::Paste(SwWrtShell& rSh, 
TransferableDataHelper& rData, RndSt
 SotExchangeDest nDestination = SwTransferable::GetSotDestination( rSh );
 SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
 SotExchangeActionFlags nActionFlags = SotExchangeActionFlags::NONE;
+bool bSingleCellTable = false;
 
 if( GetSwTransferable( rData ) )
 {
@@ -1153,8 +1154,26 @@ bool SwTransferable::Paste(SwWrtShell& rSh, 
TransferableDataHelper& rData, RndSt
  );
 }
 
-// special case for tables from draw application
-if( EXCHG_OUT_ACTION_INSERT_DRAWOBJ == nAction )
+// content of 1-cell tables is inserted as simple text
+if( EXCHG_OUT_ACTION_INSERT_OLE == nAction && ( rData.HasFormat( 
SotClipboardFormatId::SYLK ) ||
+  rData.HasFormat( SotClipboardFormatId::SYLK_BIGCAPS ) ) )
+{
+OUString aExpand;
+if( rData.GetString( SotClipboardFormatId::STRING, aExpand ))
+{
+const sal_Int32 
nNewlines{comphelper::string::getTokenCount(aExpand, '\n')};
+const sal_Int32 nRows = nNewlines ? nNewlines-1 : 0;
+if ( nRows == 1 )
+{
+const sal_Int32 nCols = 
comphelper::string::getTokenCount(aExpand.getToken(0, '\n'), '\t');
+if (nCols == 1)
+bSingleCellTable = true;
+}
+}
+}
+
+// special case for tables from draw application or 1-cell tables
+if( EXCHG_OUT_ACTION_INSERT_DRAWOBJ == nAction || bSingleCellTable )
 {
 if( rData.HasFormat( SotClipboardFormatId::RTF ) )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-25 Thread Libreoffice Gerrit user
 sw/source/uibase/uiview/viewstat.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 545ddabc6614e751c807e9d1e1cbf7c617fc4141
Author: Katarina Behrens 
AuthorDate: Tue Jul 24 19:03:23 2018 +0200
Commit: Michael Stahl 
CommitDate: Wed Jul 25 20:42:16 2018 +0200

tdf#118777: Disable signature line slot if non-text object

in 6.1 only in sw, the functionality ain't there yet in sc

Change-Id: I54f7ec336026013d09ac6262779e7fcbd17c2084
Reviewed-on: https://gerrit.libreoffice.org/57949
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 
Reviewed-on: https://gerrit.libreoffice.org/57990
Reviewed-by: Michael Stahl 

diff --git a/sw/source/uibase/uiview/viewstat.cxx 
b/sw/source/uibase/uiview/viewstat.cxx
index 73661dca0b1b..04e344d0b10e 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -97,12 +97,18 @@ void SwView::GetState(SfxItemSet )
 break;
 
 case SID_INSERT_GRAPHIC:
-case SID_INSERT_SIGNATURELINE:
 if( m_pWrtShell->CursorInsideInputField() )
 {
 rSet.DisableItem(nWhich);
 }
 break;
+case SID_INSERT_SIGNATURELINE:
+if( !( m_nSelectionType & SelectionType::Text ||
+m_nSelectionType & SelectionType::NumberList ) )
+{
+rSet.DisableItem(nWhich);
+}
+break;
 case SID_EDIT_SIGNATURELINE:
 case SID_SIGN_SIGNATURELINE:
 if (!isSignatureLineSelected())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-25 Thread Libreoffice Gerrit user
 sw/source/core/inc/rowfrm.hxx|2 +-
 sw/source/core/layout/tabfrm.cxx |   12 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 6db143f43874a817b7a920dea41939bf9439ca9b
Author: Justin Luth 
AuthorDate: Wed Jul 18 09:01:43 2018 +0300
Commit: Miklos Vajna 
CommitDate: Wed Jul 25 10:19:40 2018 +0200

tdf#118528 sw layout: only direct formatting for EmulateTableKeep

Emulating MSWord's way of keeping a table with the next paragraph
has caused a few complaints, but never anything that seemed
to clearly indicate a real problem - usually just badly designed
documents. But a common theme has been the keep attribute coming
through styles. Since our export-emulation writes directly
to the paragraph properties, lets make the emulation dependent
on direct formatting to avoid some of these complaints.

Change-Id: I008fc7b6a7083292463c20972ad209761ec97601
Reviewed-on: https://gerrit.libreoffice.org/57613
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit ef86b2e7a08ea25c434db85087d094f030f762cc)
Reviewed-on: https://gerrit.libreoffice.org/57697
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx
index 9ff22cc0a125..c3724667cdaf 100644
--- a/sw/source/core/inc/rowfrm.hxx
+++ b/sw/source/core/inc/rowfrm.hxx
@@ -97,7 +97,7 @@ public:
 // <-- split table rows
 
 // #131283# Table row keep feature
-bool ShouldRowKeepWithNext() const;
+bool ShouldRowKeepWithNext( const bool bCheckParents = true ) const;
 
 // #i4032# NEW TABLES
 bool IsRowSpanLine() const { return m_bIsRowSpanLine; }
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 8fad05cf2508..ae20788f9da0 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1777,16 +1777,16 @@ SwFrame* sw_FormatNextContentForKeep( SwTabFrame* 
pTabFrame )
 }
 
 namespace {
-bool AreAllRowsKeepWithNext( const SwRowFrame* pFirstRowFrame )
+bool AreAllRowsKeepWithNext( const SwRowFrame* pFirstRowFrame, const bool 
bCheckParents = true  )
 {
 bool bRet = pFirstRowFrame != nullptr &&
-pFirstRowFrame->ShouldRowKeepWithNext();
+pFirstRowFrame->ShouldRowKeepWithNext( bCheckParents );
 
 while ( bRet && pFirstRowFrame->GetNext() != nullptr )
 {
 pFirstRowFrame = dynamic_cast(pFirstRowFrame->GetNext());
 bRet = pFirstRowFrame != nullptr &&
-   pFirstRowFrame->ShouldRowKeepWithNext();
+   pFirstRowFrame->ShouldRowKeepWithNext( bCheckParents );
 }
 
 return bRet;
@@ -1863,8 +1863,8 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 const SwBorderAttrs *pAttrs = pAccess->Get();
 
 const bool bLargeTable = GetTable()->GetTabLines().size() > 64;  
//arbitrary value, virtually guaranteed to be larger than one page.
+const bool bEmulateTableKeep = !bLargeTable && AreAllRowsKeepWithNext( 
GetFirstNonHeadlineRow(), /*bCheckParents=*/false );
 // The beloved keep attribute
-const bool bEmulateTableKeep = !bLargeTable && AreAllRowsKeepWithNext( 
GetFirstNonHeadlineRow() );
 const bool bKeep = IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), 
bEmulateTableKeep);
 
 // All rows should keep together
@@ -4613,7 +4613,7 @@ bool SwRowFrame::IsRowSplitAllowed() const
 return rLP.GetValue();
 }
 
-bool SwRowFrame::ShouldRowKeepWithNext() const
+bool SwRowFrame::ShouldRowKeepWithNext( const bool bCheckParents ) const
 {
 // No KeepWithNext if nested in another table
 if ( GetUpper()->GetUpper()->IsCellFrame() )
@@ -4623,7 +4623,7 @@ bool SwRowFrame::ShouldRowKeepWithNext() const
 const SwFrame* pText = pCell->Lower();
 
 return pText && pText->IsTextFrame() &&
-   static_cast(pText)->GetTextNodeForParaProps()->GetSwAttrSet().GetKeep().GetValue();
+   static_cast(pText)->GetTextNodeForParaProps()->GetSwAttrSet().GetKeep(bCheckParents).GetValue();
 }
 
 SwCellFrame::SwCellFrame(const SwTableBox , SwFrame* pSib, bool 
bInsertContent)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-24 Thread Libreoffice Gerrit user
 sw/source/uibase/uiview/viewdlg2.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 84a0cdf166ea9ab5073b085193d0f10958897437
Author: Michael Stahl 
AuthorDate: Tue Jul 24 13:05:26 2018 +0200
Commit: Caolán McNamara 
CommitDate: Tue Jul 24 17:31:38 2018 +0200

sw,sc: Signature Line: fix VclPtr assertion

Insert a Signature Line, right click, Sign..., Cancel

include/vcl/vclptr.hxx:116: VclPtr::~VclPtr() [with reference_type = 
AbstractSignSignatureLineDialog]: Assertion `(!m_rInnerRef.get() || 
m_rInnerRef->isDisposed() || m_rInnerRef->getRefCount() > 1) && "someone forgot 
to call dispose()"' failed.

Reviewed-on: https://gerrit.libreoffice.org/57913
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 6de194cb685dbe105a73812afa73070d04341bfb)
(The sc part is missing in libreoffice-6-1 so only fix sw)

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

diff --git a/sw/source/uibase/uiview/viewdlg2.cxx 
b/sw/source/uibase/uiview/viewdlg2.cxx
index 41bec30c8023..3e5174475249 100644
--- a/sw/source/uibase/uiview/viewdlg2.cxx
+++ b/sw/source/uibase/uiview/viewdlg2.cxx
@@ -84,8 +84,8 @@ void SwView::ExecDlgExt(SfxRequest const )
 assert(pFact && "VclAbstractDialogFactory fail!");
 
 const uno::Reference xModel(GetCurrentDocument());
-VclPtr pDialog
-= pFact->CreateSignSignatureLineDialog(GetFrameWeld(), xModel);
+ScopedVclPtr pDialog(
+pFact->CreateSignSignatureLineDialog(GetFrameWeld(), xModel));
 assert(pDialog && "Dialog creation failed!");
 
 if (pDialog)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-24 Thread Libreoffice Gerrit user
 sw/source/core/text/porfld.cxx  |2 +-
 sw/source/uibase/uiview/viewtab.cxx |   12 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit af7b9609fee603756f8cb0668ae45af37c5fb4fb
Author: Noel Grandin 
AuthorDate: Mon Jul 23 15:08:41 2018 +0200
Commit: Xisco Faulí 
CommitDate: Tue Jul 24 15:13:52 2018 +0200

tdf#118716 Inner border of an embedded table can't be dragged around

regression from
commit f14b9d30293f180500fc56d81e5390021758e7c1
convert (a>b?a:b) to std::max(a,b)

In this code
   int a;
   std::max(a,0)
std::max will first convert a and b to sal_uInt16, therefore potentially
converting a negative number to a positive number due to the conversion
rules. Then it will take the larger number.

While this code
int a;
static_cast(a > 0 ? a : 0)
will compare first, and then convert the larger number to sal_uInt16,
which might result in making a "a" that is larger than 2^16 into a
smaller value, but which will never convert a negative "a" value into a
positive value.

Change-Id: Id4f6df0089b1a74ea4ac1c5d05655e7c1d8f0c7f
Reviewed-on: https://gerrit.libreoffice.org/57846
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit c13865a4caf7898c4e59a5b22bbd493d6dad9661)
Reviewed-on: https://gerrit.libreoffice.org/57908
Tested-by: Xisco Faulí 
Reviewed-by: Xisco Faulí 

diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index d40ff3ed3dc0..ac3596f78262 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -830,7 +830,7 @@ bool SwGrfNumPortion::Format( SwTextFormatInfo  )
 const bool bFull = rInf.Width() < rInf.X() + Width();
 const bool bFly = rInf.GetFly() ||
 ( rInf.GetLast() && rInf.GetLast()->IsFlyPortion() );
-SetAscent( std::max(GetRelPos(), 0) );
+SetAscent( GetRelPos() > 0 ? GetRelPos() : 0 );
 if( GetAscent() > Height() )
 Height( GetAscent() );
 
diff --git a/sw/source/uibase/uiview/viewtab.cxx 
b/sw/source/uibase/uiview/viewtab.cxx
index 4dab2bb0a4bf..545b3f2e48ab 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1700,8 +1700,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 const int nRgt = (bTableVertical ? nPageHeight : nPageWidth) -
  (aTabCols.GetLeftMin() + aTabCols.GetRight());
 
-const sal_uInt16 nL = std::max< sal_uInt16 >(nLft, 0);
-const sal_uInt16 nR = std::max< sal_uInt16 >(nRgt, 0);
+const sal_uInt16 nL = static_cast< sal_uInt16 >(std::max(nLft, 
0));
+const sal_uInt16 nR = static_cast< sal_uInt16 >(std::max(nRgt, 
0));
 
 SvxColumnItem aColItem(nNum, nL, nR);
 
@@ -1937,8 +1937,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 const int nRgt = (bVerticalWriting ? nPageWidth : nPageHeight) 
-
  (aTabCols.GetLeftMin() + aTabCols.GetRight());
 
-const sal_uInt16 nL = std::max< sal_uInt16 >(nLft, 0);
-const sal_uInt16 nR = std::max< sal_uInt16 >(nRgt, 0);
+const sal_uInt16 nL = static_cast< sal_uInt16 >(std::max(nLft, 
0));
+const sal_uInt16 nR = static_cast< sal_uInt16 >(std::max(nRgt, 
0));
 
 SvxColumnItem aColItem(0, nL, nR);
 
@@ -2011,8 +2011,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 const int nLft = aTabCols.GetLeftMin() + 
aTabCols.GetLeft();
 const int nRgt = nPageWidth -(aTabCols.GetLeftMin() + 
aTabCols.GetRight());
 
-const sal_uInt16 nL = std::max< sal_uInt16 >(nLft, 0);
-const sal_uInt16 nR = std::max< sal_uInt16 >(nRgt, 0);
+const sal_uInt16 nL = static_cast< sal_uInt16 
>(std::max(nLft, 0));
+const sal_uInt16 nR = static_cast< sal_uInt16 
>(std::max(nRgt, 0));
 
 aRectangle.SetLeft( nL );
 if(nNum > 1)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-19 Thread Libreoffice Gerrit user
 sw/source/uibase/misc/redlndlg.cxx  |2 +-
 sw/source/uibase/shells/textfld.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 80e083c17422c464981d959b87589a5efc987dd8
Author: Caolán McNamara 
AuthorDate: Thu Jul 19 10:54:39 2018 +0100
Commit: Christian Lohmaier 
CommitDate: Thu Jul 19 22:05:25 2018 +0200

Resolves: tdf#118827 SetCareWin should be SetCareDialog

Change-Id: I84c00a193e65a18b3ba82351c07be0b63e0cd5d4
Reviewed-on: https://gerrit.libreoffice.org/57720
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/sw/source/uibase/misc/redlndlg.cxx 
b/sw/source/uibase/misc/redlndlg.cxx
index e6de1254c8b6..645956b731e9 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -1128,8 +1128,8 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, CommandHdl, 
SvSimpleTable*, void)
 m_pTable->SetEntryText(sMsg.replace('\n', ' '), pEntry, 3);
 }
 
-pDlg.disposeAndClear();
 SwViewShell::SetCareDialog(nullptr);
+pDlg.disposeAndClear();
 }
 }
 else if (nRet)
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index d5d68916c371..9d89701232a1 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -617,8 +617,8 @@ void SwTextShell::ExecField(SfxRequest )
 rSh.SetRedlineComment(sMsg);
 }
 
+SwViewShell::SetCareDialog(nullptr);
 pDlg.disposeAndClear();
-SwViewShell::SetCareWin(nullptr);
 g_bNoInterrupt = false;
 rSh.ClearMark();
 GetView().AttrChangedNotify(GetShellPtr());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-19 Thread Libreoffice Gerrit user
 sw/source/filter/html/swhtml.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit c715fd34f3c5c843e7ba6fbc781fbf76935b4509
Author: Caolán McNamara 
AuthorDate: Wed Jul 18 16:13:19 2018 +0100
Commit: Christian Lohmaier 
CommitDate: Thu Jul 19 12:18:04 2018 +0200

tdf#118579 ignore body in body instead of flagging as an error

Change-Id: Ie6626a320a5264aea004f7c57244643798703de8
Reviewed-on: https://gerrit.libreoffice.org/57653
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index dbf0da0a0d5e..508bbc1a4671 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -1279,9 +1279,7 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken )
 switch( nToken )
 {
 case HtmlTokenId::BODY_ON:
-if (m_bBodySeen)
-eState = SvParserState::Error;
-else
+if (!m_bBodySeen)
 {
 m_bBodySeen = true;
 if( !m_aStyleSource.isEmpty() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-19 Thread Libreoffice Gerrit user
 sw/source/ui/table/tabledlg.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit de607309e27616a9e53eadee2bab9cd0de74cae3
Author: Caolán McNamara 
AuthorDate: Mon Jul 16 13:57:06 2018 +0100
Commit: Christian Lohmaier 
CommitDate: Thu Jul 19 12:12:08 2018 +0200

tdf#118635 relative checkbox disabled on reopen

Change-Id: Ic52737e5122b1ae37390061a5f7cf17b69e7e665
Reviewed-on: https://gerrit.libreoffice.org/57499
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index d650e10f422a..12004dd51a5a 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -176,14 +176,14 @@ IMPL_LINK( SwFormatTablePage, RelWidthClickHdl, 
weld::ToggleButton&, rBtn, void
 bModified = true;
 }
 
-IMPL_LINK(SwFormatTablePage, AutoClickHdl, weld::ToggleButton&, rControl, void)
+IMPL_LINK_NOARG(SwFormatTablePage, AutoClickHdl, weld::ToggleButton&, void)
 {
 bool bRestore = true,
  bLeftEnable = false,
  bRightEnable= false,
  bWidthEnable= false,
  bOthers = true;
-if ( == m_xFullBtn.get())
+if (m_xFullBtn->get_active())
 {
 m_xLeftMF->SetPrcntValue(0);
 m_xRightMF->SetPrcntValue(0);
@@ -192,26 +192,26 @@ IMPL_LINK(SwFormatTablePage, AutoClickHdl, 
weld::ToggleButton&, rControl, void)
 bFull = true;
 bRestore = false;
 }
-else if ( == m_xLeftBtn.get())
+else if (m_xLeftBtn->get_active())
 {
 bRightEnable = bWidthEnable = true;
 m_xLeftMF->SetPrcntValue(0);
 }
-else if ( == m_xFromLeftBtn.get())
+else if (m_xFromLeftBtn->get_active())
 {
 bLeftEnable = bWidthEnable = true;
 m_xRightMF->SetPrcntValue(0);
 }
-else if ( == m_xRightBtn.get())
+else if (m_xRightBtn->get_active())
 {
 bLeftEnable = bWidthEnable = true;
 m_xRightMF->SetPrcntValue(0);
 }
-else if ( == m_xCenterBtn.get())
+else if (m_xCenterBtn->get_active())
 {
 bLeftEnable = bWidthEnable = true;
 }
-else if ( == m_xFreeBtn.get())
+else if (m_xFreeBtn->get_active())
 {
 RightModify();
 bLeftEnable = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-18 Thread Libreoffice Gerrit user
 sw/source/filter/html/htmlgrin.cxx |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 72dc4c2633fb866cc8b42dc742bffc57c23e9889
Author: Caolán McNamara 
AuthorDate: Tue Jul 17 09:58:56 2018 +0100
Commit: Eike Rathke 
CommitDate: Wed Jul 18 21:18:02 2018 +0200

put load of html images (to measure dimensions) under referer control

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

diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index 0a9050f3475a..8e61296d5389 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -299,6 +299,20 @@ void SwHTMLParser::GetDefaultScriptType( ScriptType& rType,
 rTypeStr = GetScriptTypeString( pHeaderAttrs );
 }
 
+namespace
+{
+bool allowAccessLink(SwDoc& rDoc)
+{
+OUString sReferer;
+SfxObjectShell * sh = rDoc.GetPersist();
+if (sh != nullptr && sh->HasName())
+{
+sReferer = sh->GetMedium()->GetName();
+}
+return !SvtSecurityOptions().isUntrustedReferer(sReferer);
+}
+}
+
 /*  */
 
 void SwHTMLParser::InsertImage()
@@ -627,7 +641,7 @@ IMAGE_SETEVENT:
 bool bSetScaleImageMap = false;
 sal_uInt8 nPrcWidth = 0, nPrcHeight = 0;
 
-if (!nWidth || !nHeight)
+if ((!nWidth || !nHeight) && allowAccessLink(*m_xDoc))
 {
 GraphicDescriptor aDescriptor(aGraphicURL);
 if (aDescriptor.Detect(/*bExtendedInfo=*/true))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-18 Thread Libreoffice Gerrit user
 sw/source/core/layout/layact.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 7cca3ff7d0c2d1bf6e47fa69c4edb939e51d098c
Author: Caolán McNamara 
AuthorDate: Tue Jul 17 16:26:35 2018 +0100
Commit: Xisco Faulí 
CommitDate: Wed Jul 18 18:12:10 2018 +0200

Resolves: tdf#118545 restore to historic logic

revert

commit 9eff9e699e17cc5a8a25895bd28dc8e4ceb8071e
Date:   Wed Aug 10 09:47:40 2016 +0200

Don't re-check valid SwPageDescs when layouting

and then revert

commit 60d34e1c840d2c317bb7d0a5b14f4602c22b3fcc
Date:   Wed Nov 12 20:33:06 2014 +

coverity#735517 Logically dead code

its possible that this was the original intent, maybe

Change-Id: Iff45f1e7f3d7e3791d984eb117779a6f39ebb19c
Reviewed-on: https://gerrit.libreoffice.org/57578
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 761a85c51741..30f6499b01f9 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -444,10 +444,8 @@ void SwLayAction::InternalAction(OutputDevice* 
pRenderContext)
 sal_uInt16 nPercentPageNum = 0;
 while ( (pPage && !IsInterrupt()) || m_nCheckPageNum != USHRT_MAX )
 {
-// nCheckPageNum is set to USHRT_MAX in this code path after we have
-// checked the SwPageDescs and set tos the minimal changed SwPageDesc.
-// We don't need to check the SwPageDescs without changes.
-if ( (m_nCheckPageNum != USHRT_MAX) && (!pPage || 
pPage->GetPhyPageNum() >= m_nCheckPageNum) )
+if ( !pPage && m_nCheckPageNum != USHRT_MAX &&
+ (!pPage || pPage->GetPhyPageNum() >= m_nCheckPageNum) )
 {
 if ( !pPage || pPage->GetPhyPageNum() > m_nCheckPageNum )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-13 Thread Eike Rathke
 sw/source/uibase/utlui/content.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit ff0e7e5427c2851341d01e8917a1b5df0c08e557
Author: Eike Rathke 
Date:   Thu Jul 12 14:29:38 2018 +0200

SvTreeListBox::DoubleClickHdl: SwContentTree more, tdf#115950 related

 This is a combination of 2 commits.

SvTreeListBox::DoubleClickHdl: SwContentTree more, tdf#115950 related

(cherry picked from commit 60c2f6d7f167cc313b33d29531f8c7320903e78d)

SvTreeListBox::DoubleClickHdl: SwContentTree more, tdf#115950 related

(cherry picked from commit 446f9cf176038881af166e46489bb1880b22174d)

86b5275484754b222698fb8c4540ff66bd6c962a

Change-Id: Id3d1e070467bdb681919b380c0d2ace78ebd388d
Reviewed-on: https://gerrit.libreoffice.org/57342
Reviewed-by: Eike Rathke 
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 1eeb25ef635f..b6d5946c9b23 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1541,7 +1541,9 @@ IMPL_LINK_NOARG(SwContentTree, ContentDoubleClickHdl, 
SvTreeListBox*, bool)
 if(pEntry)
 {
 if(lcl_IsContentType(pEntry) && !pEntry->HasChildren())
+{
 RequestingChildren(pEntry);
+}
 else if (!lcl_IsContentType(pEntry) && (State::HIDDEN != m_eState))
 {
 if (State::CONSTANT == m_eState)
@@ -1555,7 +1557,9 @@ IMPL_LINK_NOARG(SwContentTree, ContentDoubleClickHdl, 
SvTreeListBox*, bool)
 GotoContent(pCnt);
 if(pCnt->GetParent()->GetType() == ContentTypeId::FRAME)
 m_pActiveShell->EnterStdMode();
+return false;   // treelist processing finished
 }
+return true;// signal more to be done, i.e. expand/collapse 
children
 }
 return false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-12 Thread Thorsten Behrens
 sw/source/uibase/uno/unotxdoc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 796ca86ce151b1887dd1dc2c6eac217d7835095d
Author: Thorsten Behrens 
Date:   Thu Jul 12 00:11:30 2018 +0200

Make setPagePrintSettings() accept IsLandscape again

Regression from 80c35d97b9b3b60a091aae77de0ffef38cbf531a - invert
the check for boost::optional validity.

Change-Id: If4e041e1fe349c1fcb2c74b2e5780bf57300486f
Reviewed-on: https://gerrit.libreoffice.org/57309
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 0853b05b1fabb231a7d57d811c5a06ee542d3295)
Reviewed-on: https://gerrit.libreoffice.org/57316

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 0a22921c96e6..1db55d3c5831 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1142,7 +1142,7 @@ void SwXTextDocument::setPagePrintSettings(const 
Sequence< beans::PropertyValue
 else if(sName == "IsLandscape")
 {
 auto b = o3tl::tryAccess(rVal);
-bException = bool(b);
+bException = !b;
 if (b)
 {
 aData.SetLandscape(*b);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-12 Thread Eike Rathke
 sw/source/ui/chrdlg/swuiccoll.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 32003187445f62fa6f390a09a85949b6d42b55f7
Author: Eike Rathke 
Date:   Thu Jul 12 14:51:00 2018 +0200

SvTreeListBox::DoubleClickHdl: SwCondCollPage more, tdf#115950 related

Change-Id: I179c791aac5eb522aefb3ce20931fe44dd7248c6
(cherry picked from commit 3d73f76a91260becf171ea77589190714577b267)
Reviewed-on: https://gerrit.libreoffice.org/57344
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx 
b/sw/source/ui/chrdlg/swuiccoll.cxx
index 5767642ac6d9..59c00d5622c1 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -228,7 +228,7 @@ IMPL_LINK( SwCondCollPage, AssignRemoveClickHdl, Button*, 
pBtn, void)
 IMPL_LINK( SwCondCollPage, AssignRemoveTreeListBoxHdl, SvTreeListBox*, pBtn, 
bool)
 {
 AssignRemove(pBtn);
-return false;
+return true;// signal more to be done
 }
 IMPL_LINK( SwCondCollPage, AssignRemoveHdl, ListBox&, rBox, void)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-11 Thread Mike Kaganski
 sw/source/ui/fldui/flddb.cxx |   20 +++-
 1 file changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 39ba5e3bde93358af1b363da8f850bdc96806cfa
Author: Mike Kaganski 
Date:   Wed Jul 4 01:33:38 2018 +1000

tdf#116543: don't forget to commit registrations in DB field editor

This avoids revoking the uncommitted registration when any mailmerge
doc is destroyed.

Also don't forget to pass relevant SwDocShell when registering data
source. This allows to register the data source for current document.

Change-Id: Id89be82b0120661700e9fee6a075e5877d76e3b0
Reviewed-on: https://gerrit.libreoffice.org/56891
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 54d76f5203aa5f3ef0e5afdca9d131dadeb3794e)
Reviewed-on: https://gerrit.libreoffice.org/57005
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 6da535c89b69..7447a7708c87 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "flddb.hxx"
 #include 
@@ -78,6 +79,14 @@ SwFieldDBPage::~SwFieldDBPage()
 
 void SwFieldDBPage::dispose()
 {
+SwWrtShell* pSh = GetWrtShell();
+if (!pSh)
+pSh = ::GetActiveWrtShell();
+// This would cleanup in the case of cancelled dialog
+SwDBManager* pDbManager = pSh->GetDoc()->GetDBManager();
+if (pDbManager)
+pDbManager->RevokeLastRegistrations();
+
 m_pTypeLB.clear();
 m_pDatabaseTLB.clear();
 m_pAddDBPB.clear();
@@ -208,6 +217,10 @@ bool SwFieldDBPage::FillItemSet(SfxItemSet* )
 if(!pSh)
 pSh = ::GetActiveWrtShell();
 
+SwDBManager* pDbManager = pSh->GetDoc()->GetDBManager();
+if (pDbManager)
+pDbManager->CommitLastRegistrations();
+
 if (aData.sDataSource.isEmpty())
 aData = pSh->GetDBData();
 
@@ -477,7 +490,12 @@ IMPL_LINK( SwFieldDBPage, TreeSelectHdl, SvTreeListBox *, 
pBox, void )
 
 IMPL_LINK_NOARG(SwFieldDBPage, AddDBHdl, Button*, void)
 {
-OUString sNewDB = SwDBManager::LoadAndRegisterDataSource(GetFrameWeld());
+SwWrtShell* pSh = GetWrtShell();
+if (!pSh)
+pSh = ::GetActiveWrtShell();
+
+OUString sNewDB
+= SwDBManager::LoadAndRegisterDataSource(GetFrameWeld(), 
pSh->GetDoc()->GetDocShell());
 if(!sNewDB.isEmpty())
 {
 m_pDatabaseTLB->AddDataSource(sNewDB);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-11 Thread Justin Luth
 sw/source/filter/ww8/ww8atr.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 33aa5fb4281ed91a0d1a2a83e759ac4e6157646b
Author: Justin Luth 
Date:   Sat Jun 30 12:25:31 2018 +0300

tdf#86371 sw export: SvxInterLineSpaceRule::Off == single spacing

This affects doc/docx/rtf exporting.

Ultimately, this was due to the way the UI works. When you
select Single, it just turns spacing off, but doesn't reset
the proportional value. If instead of choosing single, you
change the proportional percent to 100, then you wouldn't
see this problem. I can see why this could be useful in the
UI (allowing them to remember the previous proportional
value) although it doesn't use it right now...

Because it is all based on sw internals, it would be
very difficult to create a unit test - not worth the effort.

Change-Id: Id17a42878f73266e19219bcd88e2decdaf3b72f2
Reviewed-on: https://gerrit.libreoffice.org/56749
Reviewed-by: Justin Luth 
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit 59fe3d7d231e4acb0635ac899a0ab2dee6c59289)
Reviewed-on: https://gerrit.libreoffice.org/57080

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index b57dcf28d06f..b222af685980 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4676,9 +4676,9 @@ void AttributeOutputBase::ParaLineSpacing( const 
SvxLineSpacingItem& rSpacing )
 }
 else // Proportional
 {
-nSpace = static_cast( ( 240L * 
rSpacing.GetPropLineSpace() ) / 100L );
+if ( rSpacing.GetInterLineSpaceRule() != 
SvxInterLineSpaceRule::Off )
+nSpace = static_cast( ( 240L * 
rSpacing.GetPropLineSpace() ) / 100L );
 nMulti = 1;
-break;
 }
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-10 Thread Michael Stahl
 sw/source/uibase/uiview/view2.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 41ffdacaaadce2c1bbbff216c86359e9813efb21
Author: Michael Stahl 
Date:   Mon Jul 9 17:57:13 2018 +0200

tdf#118578 sw: allow inserting only TextDocument

There are 3 sw document services: TextDocument, WebDocument and
GlobalDocument.

The current logic in SwView::InsertDoc() and
SwView_Impl::StartDocumentInserter() is to request a filter with the
same document service as the existing target document, so you can insert
only a GlobalDocument into a GlobalDocument, which doesn't make much
sense.

As it happens there are 2 different HTML import filters: "HTML" and
"HTML (StarWriter)", the latter using the TextDocument service.

So just hard-code to allow TextDocument regardless of the target
document.

(regression from 805fd1ca343d6295b8114a24cc29bdac332f266d)

Change-Id: I7dc0dd4789fba8b61625ca8eae74a864aea383b0
Reviewed-on: https://gerrit.libreoffice.org/57193
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 572b298e636612416b8223ff6e6f2d26ab51a243)
Reviewed-on: https://gerrit.libreoffice.org/57222
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index 87e42fcb7131..4a76ca612eef 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -2108,7 +2108,8 @@ long SwView::InsertDoc( sal_uInt16 nSlotId, const 
OUString& rFileName, const OUS
 else
 {
 m_pViewImpl->StartDocumentInserter(
-pDocSh->GetFactory().GetFactoryName(),
+// tdf#118578 allow inserting any Writer document except GlobalDoc
+SwDocShell::Factory().GetFactoryName(),
 LINK( this, SwView, DialogClosedHdl ),
 nSlotId
 );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-07 Thread Michael Stahl
 sw/source/uibase/utlui/content.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 018b59833878afc6f1a4a2489e83235d508e2702
Author: Michael Stahl 
Date:   Fri Jul 6 18:39:20 2018 +0200

tdf#115890 sw: fix invalid cast in SwContentTree::GetEntryAltText()

AccessibleListBoxEntry calls this for any entry.

This was always broken but now we have asserts to tell us about it.

Change-Id: I7094a1dfbffd359e0f536ca60cba2478e2a62464
Reviewed-on: https://gerrit.libreoffice.org/57086
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit 2986f4baa8bdef1f9ab9108240ea890075321be1)
Reviewed-on: https://gerrit.libreoffice.org/57099
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index cc554dbd6ea1..1eeb25ef635f 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -902,7 +902,7 @@ Size SwContentTree::GetOptimalSize() const
 
 OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const
 {
-if( pEntry == nullptr)
+if (pEntry == nullptr || !lcl_IsContent(pEntry))
 return OUString();
 
 assert(pEntry->GetUserData() == nullptr || 
dynamic_cast(static_cast(pEntry->GetUserData(;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-06 Thread Michael Stahl
 sw/source/core/text/itratr.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 1a72ccd57909bf795fe60fafbdcb7ed5566d61cc
Author: Michael Stahl 
Date:   Thu Jul 5 15:58:05 2018 +0200

tdf#118414 sw: fix fieldmarks in GetNextAttr()

Apparently this needs to stop both before and after the CH_TXT_ATR_*.

(regression from 3e724847308c0d9cdd727898faaeb347c5f0643a)

Change-Id: Iff3d594d2eec59436ad683b9cc7aca04f7527bd5
Reviewed-on: https://gerrit.libreoffice.org/57017
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 2b0a7c346f8e3c5823a9e032a4501f20bc712914)
Reviewed-on: https://gerrit.libreoffice.org/57043

diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index d1f77e062ee9..b6e53480d6e4 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -674,9 +674,11 @@ static sal_Int32 GetNextAttrImpl(SwTextNode const*const 
pTextNode,
 }
 }
 assert(p <= nNext);
-if (p < l && nPosition < p)
+if (p < l)
 {
-nNext=p;
+// found a CH_TXT_ATR_FIELD*: if it's same as current position,
+// skip behind it so that both before- and after-positions are returned
+nNext = (nPosition < p) ? p : p + 1;
 }
 return nNext;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-07-03 Thread Justin Luth
 sw/source/core/layout/tabfrm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit d96ba7a7df7d28558adaaf9b28026dd73855c3cb
Author: Justin Luth 
Date:   Mon Jun 25 19:39:55 2018 +0300

tdf#108000 sw layout: ignore emulated keep on large tables

There is no point in a very large (multipage) table keeping with
the following content and it just makes the layout more complex.
This is especially true when we are emulating this using
MSWord's convention, and not LO's native table-keep option.

This patch only affects my earlier code for emulated tables.
Otherwise, something about the general logic could loop
forever in certain huge tables. This seemed like a very
reasonable compromise.

Change-Id: Ic1bde12b266e71fc9f608ec4d1223277108750fa
Reviewed-on: https://gerrit.libreoffice.org/56314
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit fc90f7ea8034e9585486ea9cc3e55771aca85540)
Reviewed-on: https://gerrit.libreoffice.org/56791
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 9817b082b688..8fad05cf2508 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1862,8 +1862,9 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 auto pAccess = o3tl::make_unique(SwFrame::GetCache(), 
this);
 const SwBorderAttrs *pAttrs = pAccess->Get();
 
+const bool bLargeTable = GetTable()->GetTabLines().size() > 64;  
//arbitrary value, virtually guaranteed to be larger than one page.
 // The beloved keep attribute
-const bool bEmulateTableKeep = AreAllRowsKeepWithNext( 
GetFirstNonHeadlineRow() );
+const bool bEmulateTableKeep = !bLargeTable && AreAllRowsKeepWithNext( 
GetFirstNonHeadlineRow() );
 const bool bKeep = IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), 
bEmulateTableKeep);
 
 // All rows should keep together
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-26 Thread Caolán McNamara
 sw/source/core/inc/scriptinfo.hxx |4 ++--
 sw/source/core/text/itradj.cxx|   13 +++--
 sw/source/core/text/porlay.cxx|4 ++--
 3 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit dea1fae8502d2614f57ed94a967db1cb36eb4a5e
Author: Caolán McNamara 
Date:   Tue Jun 26 12:45:19 2018 +0100

forcepoint#49 survive more kashidas than expected

Change-Id: I66aa5389b3d80d1fe2f6898e8920eb37ca064381

contains...

can use simple vector here

Change-Id: Ia1565a946f9ac6d607fb6802b19e561fc9afc66d

and...

pass vector as arg, rather than raw pointer

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

diff --git a/sw/source/core/inc/scriptinfo.hxx 
b/sw/source/core/inc/scriptinfo.hxx
index 9386f1309e8e..e3d64b1627f3 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -306,11 +306,11 @@ public:
 
 /** retrieves kashida opportunities for a given text range.
 
-   pKashidaPositions: buffer to receive the char indices of the
+   rKashidaPositions: buffer to receive the char indices of the
   kashida opportunities relative to the paragraph
 */
 void GetKashidaPositions(TextFrameIndex nStt, TextFrameIndex nLen,
-TextFrameIndex* pKashidaPosition);
+ std::vector& rKashidaPosition);
 
 /** Use regular blank justification instead of kashdida justification for the 
given line of text.
nStt Start char index of the line referring to the paragraph.
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 76e115318422..8383292105bc 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -132,9 +132,10 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, 
SwTextSizeInfo& rInf,
 
 // kashida positions found in SwScriptInfo are not necessarily valid in 
every font
 // if two characters are replaced by a ligature glyph, there will be no 
place for a kashida
-std::unique_ptr pKashidaPos(new 
TextFrameIndex[rKashidas]);
-std::unique_ptr pKashidaPosDropped(new 
TextFrameIndex[rKashidas]);
-rSI.GetKashidaPositions ( nIdx, rItr.GetLength(), pKashidaPos.get() );
+std::vector aKashidaPos;
+rSI.GetKashidaPositions(nIdx, rItr.GetLength(), aKashidaPos);
+assert(aKashidaPos.size() >= static_cast(rKashidas));
+std::vector aKashidaPosDropped(aKashidaPos.size());
 sal_Int32 nKashidaIdx = 0;
 while ( rKashidas && nIdx < nEnd )
 {
@@ -165,12 +166,12 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, 
SwTextSizeInfo& rInf,
 nKashidasDropped = rInf.GetOut()->ValidateKashidas(
 rInf.GetText(), sal_Int32(nIdx), sal_Int32(nNext - nIdx),
 nKashidasInAttr,
-reinterpret_cast(pKashidaPos.get() + 
nKashidaIdx),
-reinterpret_cast(pKashidaPosDropped.get()));
+reinterpret_cast(aKashidaPos.data() + 
nKashidaIdx),
+reinterpret_cast(aKashidaPosDropped.data()));
 rInf.GetOut()->SetLayoutMode ( nOldLayout );
 if ( nKashidasDropped )
 {
-rSI.MarkKashidasInvalid(nKashidasDropped, 
pKashidaPosDropped.get());
+rSI.MarkKashidasInvalid(nKashidasDropped, 
aKashidaPosDropped.data());
 rKashidas -= nKashidasDropped;
 nGluePortion -= TextFrameIndex(nKashidasDropped);
 }
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 06baf68a148c..11e78a915433 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1977,7 +1977,7 @@ void SwScriptInfo::MarkKashidaInvalid(size_t const 
nKashPos)
 // retrieve the kashida positions in the given text range
 void SwScriptInfo::GetKashidaPositions(
 TextFrameIndex const nStt, TextFrameIndex const nLen,
-TextFrameIndex *const pKashidaPosition)
+std::vector& rKashidaPosition)
 {
 size_t nCntKash = 0;
 while( nCntKash < CountKashida() )
@@ -1994,7 +1994,7 @@ void SwScriptInfo::GetKashidaPositions(
 {
 if ( nEnd <= GetKashida( nCntKashEnd ) )
 break;
-pKashidaPosition [ nCntKashEnd - nCntKash ] = GetKashida ( nCntKashEnd 
);
+rKashidaPosition.push_back(GetKashida(nCntKashEnd));
 nCntKashEnd++;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-26 Thread Caolán McNamara
 sw/source/core/unocore/unoportenum.cxx |   26 ++
 1 file changed, 14 insertions(+), 12 deletions(-)

New commits:
commit 3e641f8f101e1064862972327d8562f4b0f756a1
Author: Caolán McNamara 
Date:   Tue Jun 26 12:15:19 2018 +0100

forcepoint#48 null deref

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

diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index 2506285ad866..85877cbdf81d 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -286,25 +286,27 @@ namespace
 ::sw::mark::AnnotationMark* const pAnnotationMark =
 dynamic_cast< ::sw::mark::AnnotationMark* >(ppMark->get());
 
-if ( pAnnotationMark == nullptr )
-{
+if (!pAnnotationMark)
 continue;
-}
 
 const SwPosition& rStartPos = pAnnotationMark->GetMarkStart();
-if ( rStartPos.nNode == nOwnNode )
+if (rStartPos.nNode != nOwnNode)
+continue;
+
+const SwFormatField* pAnnotationFormatField = 
pAnnotationMark->GetAnnotationFormatField();
+if (!pAnnotationFormatField)
 {
-const SwFormatField* pAnnotationFormatField = 
pAnnotationMark->GetAnnotationFormatField();
-assert(pAnnotationFormatField != nullptr);
-rAnnotationStartArr.insert(
-std::make_shared(
-SwXTextField::CreateXTextField(,
-pAnnotationFormatField),
-rStartPos));
+SAL_WARN("sw.core", "missing annotation format field");
+continue;
 }
+
+rAnnotationStartArr.insert(
+std::make_shared(
+SwXTextField::CreateXTextField(,
+pAnnotationFormatField),
+rStartPos));
 }
 }
-
 }
 
 const uno::Sequence< sal_Int8 > & SwXTextPortionEnumeration::getUnoTunnelId()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-25 Thread Michael Stahl
 sw/source/core/crsr/crstrvl.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit ce2cb181b4feea28c97afba6265c9ec1b0f8290c
Author: Michael Stahl 
Date:   Mon Jun 25 16:21:09 2018 +0200

tdf#118219 sw: fix SwCursorShell::GetContentAtPos() redline crash

The problem is that CalcStartEnd() will not return the length of the
node, but COMPLETE_STRING if the redline ends in a subsequent node.

(regression from 4966b1d4d0dc7bce0a1741f9347dada7406a7fb4)

Change-Id: Ic0a27f87b79f6841842c611c2129fdc9b1f9
Reviewed-on: https://gerrit.libreoffice.org/56402
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 2bdb926bd6afa01cc3cad013317a1e0ecbde0735)
Reviewed-on: https://gerrit.libreoffice.org/56411
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 7c3fd04d256d..7a7d67d4fe86 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1502,6 +1502,17 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
 sal_Int32 nStart;
 sal_Int32 nEnd;
 pRedl->CalcStartEnd(pTextNd->GetIndex(), nStart, 
nEnd);
+if (nStart == COMPLETE_STRING)
+{
+// consistency: found pRedl, so there must be
+// something in pTextNd
+assert(nEnd != COMPLETE_STRING);
+nStart = 0;
+}
+if (nEnd == COMPLETE_STRING)
+{
+nEnd = pTextNd->Len();
+}
 //get bounding box of range
 SwRect aStart;
 pFrame->GetCharRect(aStart, SwPosition(*pTextNd, 
nStart), );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-25 Thread Xisco Fauli
 sw/source/ui/config/optload.cxx  |2 ++
 sw/source/uibase/inc/cption.hxx  |   12 
 sw/source/uibase/inc/optload.hxx |   15 +++
 3 files changed, 17 insertions(+), 12 deletions(-)

New commits:
commit fa2e9cd1cb9a37028c4a1107b6a58e1ac701993b
Author: Xisco Fauli 
Date:   Tue Jun 19 17:12:09 2018 +0200

tdf#118240 Filter category in Autocaption as done in insert caption

Change-Id: I138a47419a7c18f59ecc1e0935b669546fcee6e6
Reviewed-on: https://gerrit.libreoffice.org/56115
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit b34ed105d5eead1cb7657d0a8fc23a524cf28d31)
Reviewed-on: https://gerrit.libreoffice.org/56374
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index fc16a924ea11..19da228727e9 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -463,12 +463,14 @@ SwCaptionOptPage::SwCaptionOptPage(vcl::Window* pParent, 
const SfxItemSet& rSet)
 , m_sNone(SwResId(SW_STR_NONE))
 , pMgr(new SwFieldMgr())
 , bHTMLMode(false)
+, m_aTextFilter(m_sNone)
 {
 get(m_pCheckLB, "objects");
 get(m_pLbCaptionOrder, "captionorder");
 get(m_pPreview, "preview");
 get(m_pSettingsGroup, "settings");
 get(m_pCategoryBox, "category");
+m_pCategoryBox->SetTextFilter(_aTextFilter);
 get(m_pFormatText, "numberingft");
 get(m_pFormatBox, "numbering");
 get(m_pNumberingSeparatorFT, "numseparatorft");
diff --git a/sw/source/uibase/inc/cption.hxx b/sw/source/uibase/inc/cption.hxx
index ded6d36b9dc8..a9a877da3736 100644
--- a/sw/source/uibase/inc/cption.hxx
+++ b/sw/source/uibase/inc/cption.hxx
@@ -35,18 +35,6 @@
 class SwFieldMgr;
 class SwView;
 
-class TextFilterAutoConvert : public TextFilter
-{
-private:
-OUString m_sLastGoodText;
-OUString m_sNone;
-public:
-TextFilterAutoConvert(const OUString )
-: m_sNone(rNone)
-{
-}
-virtual OUString filter(const OUString ) override;
-};
 
 class SwCaptionDialog : public SvxStandardDialog
 {
diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx
index 5b98e6508463..d97ba7d96abd 100644
--- a/sw/source/uibase/inc/optload.hxx
+++ b/sw/source/uibase/inc/optload.hxx
@@ -43,6 +43,19 @@ public:
 static FieldUnit GetValue(sal_uInt32 i);
 };
 
+class TextFilterAutoConvert : public TextFilter
+{
+private:
+OUString m_sLastGoodText;
+OUString m_sNone;
+public:
+TextFilterAutoConvert(const OUString )
+: m_sNone(rNone)
+{
+}
+virtual OUString filter(const OUString ) override;
+};
+
 class SwLoadOptPage : public SfxTabPage
 {
 private:
@@ -172,6 +185,8 @@ private:
 SwFieldMgr* pMgr;
 bool bHTMLMode;
 
+TextFilterAutoConvert m_aTextFilter;
+
 DECL_LINK(SelectHdl, ComboBox&, void);
 DECL_LINK(SelectListBoxHdl, ListBox&, void);
 DECL_LINK(ModifyHdl, Edit&, void);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-18 Thread Caolán McNamara
 sw/source/ui/dialog/docstdlg.cxx  |   81 +-
 sw/source/uibase/inc/docstdlg.hxx |   33 ++-
 2 files changed, 43 insertions(+), 71 deletions(-)

New commits:
commit 61f794af9bcebeab3aa399fe02fb5f4976c176ba
Author: Caolán McNamara 
Date:   Mon Jun 18 09:37:26 2018 +0100

weld SwDocStatPage

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

diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index 5ac763710466..24c286a4f7c1 100644
--- a/sw/source/ui/dialog/docstdlg.cxx
+++ b/sw/source/ui/dialog/docstdlg.cxx
@@ -36,60 +36,38 @@
 
 VclPtr SwDocStatPage::Create(TabPageParent pParent, const 
SfxItemSet *rSet)
 {
-return VclPtr::Create(pParent.pParent, *rSet);
+return VclPtr::Create(pParent, *rSet);
 }
 
-SwDocStatPage::SwDocStatPage(vcl::Window *pParent, const SfxItemSet )
-
-: SfxTabPage(pParent, "StatisticsInfoPage", 
"modules/swriter/ui/statisticsinfopage.ui", )
-
+SwDocStatPage::SwDocStatPage(TabPageParent pParent, const SfxItemSet )
+: SfxTabPage(pParent, "modules/swriter/ui/statisticsinfopage.ui", 
"StatisticsInfoPage", )
+, m_xPageNo(m_xBuilder->weld_label("nopages"))
+, m_xTableNo(m_xBuilder->weld_label("notables"))
+, m_xGrfNo(m_xBuilder->weld_label("nogrfs"))
+, m_xOLENo(m_xBuilder->weld_label("nooles"))
+, m_xParaNo(m_xBuilder->weld_label("noparas"))
+, m_xWordNo(m_xBuilder->weld_label("nowords"))
+, m_xCharNo(m_xBuilder->weld_label("nochars"))
+, m_xCharExclSpacesNo(m_xBuilder->weld_label("nocharsexspaces"))
+, m_xLineLbl(m_xBuilder->weld_label("lineft"))
+, m_xLineNo(m_xBuilder->weld_label("nolines"))
+, m_xUpdatePB(m_xBuilder->weld_button("update"))
 {
-get(m_pPageNo, "nopages");
-get(m_pTableNo, "notables");
-get(m_pGrfNo, "nogrfs");
-get(m_pOLENo, "nooles");
-get(m_pParaNo, "noparas");
-get(m_pWordNo, "nowords");
-get(m_pCharNo, "nochars");
-get(m_pCharExclSpacesNo, "nocharsexspaces");
-
-get(m_pLineLbl, "lineft");
-get(m_pLineNo, "nolines");
-get(m_pUpdatePB, "update");
-
 Update();
-m_pUpdatePB->SetClickHdl(LINK(this, SwDocStatPage, UpdateHdl));
+m_xUpdatePB->connect_clicked(LINK(this, SwDocStatPage, UpdateHdl));
 //#111684# is the current view a page preview no SwFEShell can be found -> 
hide the update button
 SwDocShell* pDocShell = static_cast( 
SfxObjectShell::Current() );
 SwFEShell* pFEShell = pDocShell->GetFEShell();
 if(!pFEShell)
 {
-m_pUpdatePB->Show(false);
-m_pLineLbl->Show(false);
-m_pLineNo->Show(false);
+m_xUpdatePB->show(false);
+m_xLineLbl->show(false);
+m_xLineNo->show(false);
 }
-
 }
 
 SwDocStatPage::~SwDocStatPage()
 {
-disposeOnce();
-}
-
-void SwDocStatPage::dispose()
-{
-m_pPageNo.clear();
-m_pTableNo.clear();
-m_pGrfNo.clear();
-m_pOLENo.clear();
-m_pParaNo.clear();
-m_pWordNo.clear();
-m_pCharNo.clear();
-m_pCharExclSpacesNo.clear();
-m_pLineLbl.clear();
-m_pLineNo.clear();
-m_pUpdatePB.clear();
-SfxTabPage::dispose();
 }
 
 // Description: fill ItemSet when changed
@@ -106,14 +84,14 @@ void  SwDocStatPage::Reset(const SfxItemSet *)
 void SwDocStatPage::SetData(const SwDocStat )
 {
 const LocaleDataWrapper& rLocaleData = 
GetSettings().GetUILocaleDataWrapper();
-m_pTableNo->SetText(rLocaleData.getNum(rStat.nTable, 0));
-m_pGrfNo->SetText(rLocaleData.getNum(rStat.nGrf, 0));
-m_pOLENo->SetText(rLocaleData.getNum(rStat.nOLE, 0));
-m_pPageNo->SetText(rLocaleData.getNum(rStat.nPage, 0));
-m_pParaNo->SetText(rLocaleData.getNum(rStat.nPara, 0));
-m_pWordNo->SetText(rLocaleData.getNum(rStat.nWord, 0));
-m_pCharNo->SetText(rLocaleData.getNum(rStat.nChar, 0));
-
m_pCharExclSpacesNo->SetText(rLocaleData.getNum(rStat.nCharExcludingSpaces, 0));
+m_xTableNo->set_label(rLocaleData.getNum(rStat.nTable, 0));
+m_xGrfNo->set_label(rLocaleData.getNum(rStat.nGrf, 0));
+m_xOLENo->set_label(rLocaleData.getNum(rStat.nOLE, 0));
+m_xPageNo->set_label(rLocaleData.getNum(rStat.nPage, 0));
+m_xParaNo->set_label(rLocaleData.getNum(rStat.nPara, 0));
+m_xWordNo->set_label(rLocaleData.getNum(rStat.nWord, 0));
+m_xCharNo->set_label(rLocaleData.getNum(rStat.nChar, 0));
+
m_xCharExclSpacesNo->set_label(rLocaleData.getNum(rStat.nCharExcludingSpaces, 
0));
 }
 
 // Description: update statistics
@@ -139,14 +117,13 @@ void SwDocStatPage::Update()
 SetData(aDocStat);
 }
 
-IMPL_LINK_NOARG(SwDocStatPage, UpdateHdl, Button*, void)
+IMPL_LINK_NOARG(SwDocStatPage, UpdateHdl, weld::Button&, void)
 {
 Update();
 SwDocShell* pDocShell = static_cast( 
SfxObjectShell::Current());
 SwFEShell* pFEShell = pDocShell->GetFEShell();
-if(pFEShell)
-

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-18 Thread Caolán McNamara
 sw/source/core/fields/reffld.cxx |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 0c75367ae5ac257310541ca3c1972b5c9977f452
Author: Caolán McNamara 
Date:   Sun Jun 17 16:35:52 2018 +0100

crashtesting: export of ooo24533-1.sxw to docx

a problem (I assume) since...

commit d7d5fa52b03fe058759f90f489a5071a39883ed7
Date:   Tue May 22 10:49:36 2018 +0200

sw_redlinehide: trivial conversions in reffld.cxx

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

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 8143aff1c470..9f6ec1998185 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -98,6 +98,9 @@ bool IsFrameBehind( const SwTextNode& rMyNd, sal_Int32 
nMySttPos,
 const SwTextFrame *pMyFrame = 
static_cast(rMyNd.getLayoutFrame( 
rMyNd.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, 
nullptr, false) ),
*pFrame = 
static_cast(rBehindNd.getLayoutFrame( 
rBehindNd.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, 
nullptr, false) );
 
+if( !pFrame || !pMyFrame)
+return false;
+
 TextFrameIndex const nMySttPosIndex(pMyFrame->MapModelToView(, 
nMySttPos));
 TextFrameIndex const nSttPosIndex(pFrame->MapModelToView(, 
nSttPos));
 while (pFrame && !pFrame->IsInside(nSttPosIndex))
@@ -568,9 +571,12 @@ void SwGetRefField::UpdateField( const SwTextField* 
pFieldTextAttr )
 {
 const SwTextFrame* pFrame = 
static_cast(pTextNd->getLayoutFrame( 
pDoc->getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, nullptr, false)),
 *pSave = pFrame;
-TextFrameIndex const 
nNumStartIndex(pFrame->MapModelToView(pTextNd, nNumStart));
-while (pFrame && !pFrame->IsInside(nNumStartIndex))
-pFrame = pFrame->GetFollow();
+if (pFrame)
+{
+TextFrameIndex const 
nNumStartIndex(pFrame->MapModelToView(pTextNd, nNumStart));
+while (pFrame && !pFrame->IsInside(nNumStartIndex))
+pFrame = pFrame->GetFollow();
+}
 
 if( pFrame || nullptr != ( pFrame = pSave ))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-18 Thread Bjoern Michaelsen
 sw/source/core/layout/frmtool.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 009c36b0bf59adadc643dc94fe30c18485f89c6d
Author: Bjoern Michaelsen 
Date:   Fri Jun 15 01:05:09 2018 +0200

tdf#117723: nullcheck the ContentAnchor before deref

Change-Id: I4043efc204c8e3af8463ecd325313c99a9d61128
Reviewed-on: https://gerrit.libreoffice.org/55839
Reviewed-by: Björn Michaelsen 
Tested-by: Björn Michaelsen 
(cherry picked from commit d8142da066b6ee80444694e0eb6b0da9375a89c7)
Reviewed-on: https://gerrit.libreoffice.org/55958
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index fc62869a2590..37fc4a808157 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1171,8 +1171,9 @@ void AppendAllObjs(const SwFrameFormats* pTable, const 
SwFrame* pSib)
 // frames nor objects which are anchored to character bounds.
 if ((rAnch.GetAnchorId() != RndStdIds::FLY_AT_PAGE) && 
(rAnch.GetAnchorId() != RndStdIds::FLY_AS_CHAR))
 {
+auto pContentAnchor = rAnch.GetContentAnchor();
 // formats in header/footer have no dependencies
-
if(pFormat->GetDoc()->IsInHeaderFooter(rAnch.GetContentAnchor()->nNode))
+if(pContentAnchor && 
pFormat->GetDoc()->IsInHeaderFooter(pContentAnchor->nNode))
 pFormat->MakeFrames();
 else
 vFormatsToConnect.push_back(pFormat);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source sw/uiconfig

2018-06-16 Thread Caolán McNamara
 sw/source/ui/chrdlg/numpara.cxx   |  267 +++---
 sw/source/ui/chrdlg/pardlg.cxx|4 
 sw/source/ui/fmtui/tmpdlg.cxx |4 
 sw/source/uibase/inc/numpara.hxx  |   51 +++---
 sw/uiconfig/swriter/ui/numparapage.ui |   16 +-
 5 files changed, 156 insertions(+), 186 deletions(-)

New commits:
commit 2d0ac1a3581088f7f779c7ad6b0f9f80026ee44b
Author: Caolán McNamara 
Date:   Fri Jun 15 10:51:30 2018 +0100

weld SwParagraphNumTabPage

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

diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index 589e808fe4e7..fda0958c26a7 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -42,40 +42,36 @@ const sal_uInt16 SwParagraphNumTabPage::aPageRg[] = {
 0
 };
 
-SwParagraphNumTabPage::SwParagraphNumTabPage(vcl::Window* pParent, const 
SfxItemSet& rAttr ) :
-SfxTabPage(pParent, "NumParaPage", "modules/swriter/ui/numparapage.ui", 
),
-
-msOutlineNumbering( SwResId( STR_OUTLINE_NUMBERING ) ),
-bModified(false),
-bCurNumrule(false)
+SwParagraphNumTabPage::SwParagraphNumTabPage(TabPageParent pParent, const 
SfxItemSet& rAttr)
+: SfxTabPage(pParent, "modules/swriter/ui/numparapage.ui", "NumParaPage", 
)
+, msOutlineNumbering(SwResId(STR_OUTLINE_NUMBERING ))
+, bModified(false)
+, bCurNumrule(false)
+, m_xOutlineStartBX(m_xBuilder->weld_widget("boxOUTLINE"))
+, m_xOutlineLvLB(m_xBuilder->weld_combo_box_text("comboLB_OUTLINE_LEVEL"))
+, m_xNumberStyleBX(m_xBuilder->weld_widget("boxNUMBER_STYLE"))
+, m_xNumberStyleLB(m_xBuilder->weld_combo_box_text("comboLB_NUMBER_STYLE"))
+, m_xEditNumStyleBtn(m_xBuilder->weld_button("editnumstyle"))
+, m_xNewStartCB(m_xBuilder->weld_check_button("checkCB_NEW_START"))
+, m_xNewStartBX(m_xBuilder->weld_widget("boxNEW_START"))
+, 
m_xNewStartNumberCB(m_xBuilder->weld_check_button("checkCB_NUMBER_NEW_START"))
+, m_xNewStartNF(m_xBuilder->weld_spin_button("spinNF_NEW_START"))
+, m_xCountParaFram(m_xBuilder->weld_widget("frameFL_COUNT_PARA"))
+, m_xCountParaCB(m_xBuilder->weld_check_button("checkCB_COUNT_PARA"))
+, 
m_xRestartParaCountCB(m_xBuilder->weld_check_button("checkCB_RESTART_PARACOUNT"))
+, m_xRestartBX(m_xBuilder->weld_widget("boxRESTART_NO"))
+, m_xRestartNF(m_xBuilder->weld_spin_button("spinNF_RESTART_PARA"))
 {
-get(m_pOutlineStartBX, "boxOUTLINE");
-get(m_pOutlineLvLB,"comboLB_OUTLINE_LEVEL");
-
-get(m_pNumberStyleBX,  "boxNUMBER_STYLE");
-get(m_pNumberStyleLB,  "comboLB_NUMBER_STYLE");
-get(m_pEditNumStyleBtn,"editnumstyle");
-get(m_pNewStartBX, "boxNEW_START");
-get(m_pNewStartCB, "checkCB_NEW_START");
-m_pNewStartCB->SetState(TRISTATE_FALSE);
-get(m_pNewStartNumberCB,   "checkCB_NUMBER_NEW_START");
-m_pNewStartNumberCB->SetState(TRISTATE_FALSE);
-get(m_pNewStartNF, "spinNF_NEW_START");
-
-get(m_pCountParaFram,  "frameFL_COUNT_PARA");
-get(m_pCountParaCB,"checkCB_COUNT_PARA");
-m_pCountParaCB->SetState(TRISTATE_FALSE);
-get(m_pRestartParaCountCB, "checkCB_RESTART_PARACOUNT");
-m_pRestartParaCountCB->SetState(TRISTATE_FALSE);
-
-get(m_pRestartBX,  "boxRESTART_NO");
-get(m_pRestartNF,  "spinNF_RESTART_PARA");
-
-sal_Int32 numSelectPos = m_pNumberStyleLB->GetSelectedEntryPos();
-if ( numSelectPos == 0 )
-m_pEditNumStyleBtn->Disable();
+m_xNewStartCB->set_state(TRISTATE_FALSE);
+m_xNewStartNumberCB->set_state(TRISTATE_FALSE);
+m_xCountParaCB->set_state(TRISTATE_FALSE);
+m_xRestartParaCountCB->set_state(TRISTATE_FALSE);
+
+int numSelectPos = m_xNumberStyleLB->get_active();
+if (numSelectPos == 0)
+m_xEditNumStyleBtn->set_sensitive(false);
 else
-m_pEditNumStyleBtn->Enable();
+m_xEditNumStyleBtn->set_sensitive(true);
 
 const SfxPoolItem* pItem;
 SfxObjectShell* pObjSh;
@@ -86,53 +82,32 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(vcl::Window* 
pParent, const SfxItem
 const sal_uInt16 nHtmlMode = static_cast(pItem)->GetValue();
 
 if (HTMLMODE_ON & nHtmlMode)
-m_pCountParaFram->Hide();
+m_xCountParaFram->hide();
 }
 
-m_pNewStartCB->SetClickHdl(LINK(this, SwParagraphNumTabPage, 
NewStartHdl_Impl));
-m_pNewStartNumberCB->SetClickHdl(LINK(this, SwParagraphNumTabPage, 
NewStartHdl_Impl));
-m_pNumberStyleLB->SetSelectHdl(LINK(this, SwParagraphNumTabPage, 
StyleHdl_Impl));
-m_pCountParaCB->SetClickHdl(LINK(this, SwParagraphNumTabPage, 
LineCountHdl_Impl));
-m_pRestartParaCountCB->SetClickHdl( LINK(this, SwParagraphNumTabPage, 
LineCountHdl_Impl));
-

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-15 Thread Caolán McNamara
 sw/source/ui/misc/outline.cxx |2 +-
 sw/source/uibase/inc/num.hxx  |2 +-
 sw/source/uibase/inc/numprevw.hxx |6 +++---
 sw/source/uibase/inc/outline.hxx  |2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 95dc6c49348496210d3178f20e4460ad4471ea02
Author: Caolán McNamara 
Date:   Thu Jun 14 13:26:45 2018 +0100

rename SwNumberingPreview back to NumberingPreview now

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

diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index e1d428e23ef8..ea75b1761586 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -851,7 +851,7 @@ static long lcl_DrawGraphic(vcl::RenderContext* pVDev, 
const SwNumFormat 
 return nRet;
 }
 
-void SwNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&)
+void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&)
 {
 const Size aSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
 
diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx
index f882c1d8ee3f..d17a6894647e 100644
--- a/sw/source/uibase/inc/num.hxx
+++ b/sw/source/uibase/inc/num.hxx
@@ -49,7 +49,7 @@ class SwNumPositionTabPage : public SfxTabPage
 boolbInInintControl : 1;  // work around modify-error; 
should be resolved from 391 on
 boolbLabelAlignmentPosAndSpaceModeActive;
 
-SwNumberingPreview  m_aPreviewWIN;
+NumberingPreview  m_aPreviewWIN;
 
 std::unique_ptr m_xLevelLB;
 std::unique_ptr m_xPositionFrame;
diff --git a/sw/source/uibase/inc/numprevw.hxx 
b/sw/source/uibase/inc/numprevw.hxx
index cb8cc0b4dedd..6f74db1aa01c 100644
--- a/sw/source/uibase/inc/numprevw.hxx
+++ b/sw/source/uibase/inc/numprevw.hxx
@@ -26,7 +26,7 @@
 class SwNumRule;
 namespace rtl { class OUString; }
 
-class SwNumberingPreview : public weld::CustomWidgetController
+class NumberingPreview : public weld::CustomWidgetController
 {
 const SwNumRule*pActNum;
 vcl::Font   aStdFont;
@@ -39,8 +39,8 @@ private:
 virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override;
 
 public:
-SwNumberingPreview()
-   : pActNum(nullptr)
+NumberingPreview()
+: pActNum(nullptr)
 , nPageWidth(0)
 , pOutlineNames(nullptr)
 , bPosition(false)
diff --git a/sw/source/uibase/inc/outline.hxx b/sw/source/uibase/inc/outline.hxx
index 223d6f226d4f..d009b1d60226 100644
--- a/sw/source/uibase/inc/outline.hxx
+++ b/sw/source/uibase/inc/outline.hxx
@@ -84,7 +84,7 @@ class SwOutlineSettingsTabPage : public SfxTabPage
 SwNumRule*  pNumRule;
 OUString*   pCollNames;
 sal_uInt16  nActLevel;
-SwNumberingPreview  m_aPreviewWIN;
+NumberingPreview  m_aPreviewWIN;
 
 std::unique_ptr m_xLevelLB;
 std::unique_ptr m_xCollBox;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-14 Thread Stephan Bergmann
 sw/source/core/text/inftxt.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b60cc77d26dd1cfd25e60a53bf3403b3790b54b8
Author: Stephan Bergmann 
Date:   Wed Jun 13 13:40:03 2018 +0200

Avoid -fsanitize=null

...during JunitTest_sw_unoapi_4:

[...]
> checking: 
[sw.SwXTextViewCursor::com::sun::star::style::CharacterProperties] is iface: 
[com.sun.star.beans.XPropertySet] testcode: [ifc.style._CharacterProperties]
> LOG> Execute: CharFontName
> LOG> try to set:
> LOG> old = Liberation Serif
> LOG> new = Times New Roman
> LOG> Property CharFontName is void
> LOG> Property 'CharFontName' OK
> LOG> result = Times New Roman
> Method CharFontName finished with state OK
> LOG> CharFontName: COMPLETED.OK
>
[...]
>
> LOG> Execute: CharCombinePrefix
> LOG> try to set:
> LOG> old =
> LOG> new = New
> sw/source/core/text/inftxt.cxx:1794:69: runtime error: reference binding 
to null pointer of type 'const SwWrongList'
>  #0 in SwTextSlot::SwTextSlot(SwTextSizeInfo const*, SwLinePortion 
const*, bool, bool, rtl::OUString const&) at 
sw/source/core/text/inftxt.cxx:1794:47 (instdir/program/../program/libswlo.so 
+0x826da0a)
>  #1 in SwExpandPortion::Paint(SwTextPaintInfo const&) const at 
sw/source/core/text/porexp.cxx:66:16 (instdir/program/../program/libswlo.so 
+0x8391b43)
>  #2 in SwBlankPortion::Paint(SwTextPaintInfo const&) const at 
sw/source/core/text/porexp.cxx:199:22 (instdir/program/../program/libswlo.so 
+0x8395368)
>  #3 in SwDoubleLinePortion::PaintBracket(SwTextPaintInfo&, long, bool) 
const at sw/source/core/text/pormulti.cxx:365:16 
(instdir/program/../program/libswlo.so +0x8449ab3)
>  #4 in SwTextPainter::PaintMultiPortion(SwRect const&, SwMultiPortion&, 
SwMultiPortion const*) at sw/source/core/text/pormulti.cxx:1580:51 
(instdir/program/../program/libswlo.so +0x8467d46)
>  #5 in SwTextPainter::DrawTextLine(SwRect const&, SwSaveClip&, bool) at 
sw/source/core/text/itrpaint.cxx:396:17 (instdir/program/../program/libswlo.so 
+0x83764cc)
>  #6 in SwTextFrame::PaintSwFrame(OutputDevice&, SwRect const&, 
SwPrintData const*) const at sw/source/core/text/frmpaint.cxx:697:23 
(instdir/program/../program/libswlo.so +0x822f5ab)
>  #7 in SwLayoutFrame::PaintSwFrame(OutputDevice&, SwRect const&, 
SwPrintData const*) const at sw/source/core/layout/paintfrm.cxx:3421:21 
(instdir/program/../program/libswlo.so +0x7c70a12)
>  #8 in SwLayoutFrame::PaintSwFrame(OutputDevice&, SwRect const&, 
SwPrintData const*) const at sw/source/core/layout/paintfrm.cxx:3421:21 
(instdir/program/../program/libswlo.so +0x7c70a12)
>  #9 in SwRootFrame::PaintSwFrame(OutputDevice&, SwRect const&, 
SwPrintData const*) const at sw/source/core/layout/paintfrm.cxx:3136:24 
(instdir/program/../program/libswlo.so +0x7c5032e)
>  #10 in SwViewShell::ImplEndAction(bool) at 
sw/source/core/view/viewsh.cxx:413:49 (instdir/program/../program/libswlo.so 
+0x95cd0ca)
>  #11 in SwViewShell::EndAction(bool) at sw/inc/viewsh.hxx:594:9 
(instdir/program/../program/libswlo.so +0x5f5b0a5)
>  #12 in SwCursorShell::EndAction(bool, bool) at 
sw/source/core/crsr/crsrsh.cxx:256:18 (instdir/program/../program/libswlo.so 
+0x5ef26ee)
>  #13 in SwRootFrame::EndAllAction(bool) at 
sw/source/core/layout/pagechg.cxx:1875:52 
(instdir/program/../program/libswlo.so +0x7bfe2ce)
>  #14 in UnoActionContext::~UnoActionContext() at 
sw/source/core/unocore/unoobj2.cxx:261:25 
(instdir/program/../program/libswlo.so +0x9110434)
>  #15 in SwUnoCursorHelper::SetCursorAttr(SwPaM&, SfxItemSet const&, 
SetAttrMode, bool) at sw/source/core/unocore/unoobj2.cxx:369:1 
(instdir/program/../program/libswlo.so +0x911327a)
>  #16 in SwUnoCursorHelper::SetPropertyValues(SwPaM&, SfxItemPropertySet 
const&, com::sun::star::uno::Sequence 
const&, SetAttrMode) at sw/source/core/unocore/unoobj.cxx:1839:17 
(instdir/program/../program/libswlo.so +0x90e0bff)
>  #17 in SwUnoCursorHelper::SetPropertyValue(SwPaM&, SfxItemPropertySet 
const&, rtl::OUString const&, com::sun::star::uno::Any const&, SetAttrMode) at 
sw/source/core/unocore/unoobj.cxx:1760:5 (instdir/program/../program/libswlo.so 
+0x90dfb0e)
>  #18 in SwXTextViewCursor::setPropertyValue(rtl::OUString const&, 
com::sun::star::uno::Any const&) at sw/source/uibase/uno/unotxvw.cxx:1441:5 
(instdir/program/../program/libswlo.so +0xafac835)
>  #19 in gcc3::callVirtualMethod(void*, unsigned int, void*, 
_typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, 
unsigned long*, double*) at 
bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5 
(instdir/program/libgcc3_uno.so +0xba96d)
>  #20 in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, 
bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, 
_typelib_MethodParameter*, void*, void**, _uno_Any**) at 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-14 Thread Michael Stahl
 sw/source/core/docnode/node.cxx  |   12 +---
 sw/source/core/txtnode/ndtxt.cxx |6 ++
 2 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit 3ddae0546ac127d5c00448f8521f3a9393500864
Author: Michael Stahl 
Date:   Wed Jun 13 11:30:46 2018 +0200

sw_redlinehide: try to fix UBSAN issue in ~SwContentNode

/sw/source/core/text/txtfrm.cxx:987:16: runtime error: downcast of address 
0x2b53270e5890 which does not point to an object of type 'const SwTextNode'
0x2b53270e5890: note: object is of type 'SwContentNode'
 00 00 00 00  70 f9 c7 cb 52 2b 00 00  60 5c 7a 00 e0 60 00 00  f0 5b 0e 27 
53 2b 00 00  40 15 18 00
  ^~~
  vptr for 'SwContentNode'
0 in SwTextFrame::GetTextNodeFirst() const 
/sw/source/core/text/txtfrm.cxx:987:16
1 in SwFrame::InvalidatePage(SwPageFrame const*) const 
/sw/source/core/layout/wsfrm.cxx:702:21
2 in SwContentFrame::Cut() /sw/source/core/layout/wsfrm.cxx::5
3 in SwContentNode::DelFrames(bool) /sw/source/core/docnode/node.cxx:1361:9
4 in SwContentNode::~SwContentNode() /sw/source/core/docnode/node.cxx:1017:5
5 in SwTextNode::~SwTextNode() /sw/source/core/txtnode/ndtxt.cxx:270:1

So call this from the ~SwTextNode instead, while it's still a
SwTextNode.

Also revert the order of resetting the wrong-flags
to what it was before b75e052d31ec8854cad3bda7d372dcfcd50c9609,
as DelFrames_TextNodePart() before DelFrames() will cause the
root's SetNeedGrammarCheck to be called, which nobody will notice in
practice, but...

Change-Id: I0f4f38a484a28dd13a0696bb083300f9ec1e0836
Reviewed-on: https://gerrit.libreoffice.org/55739
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins 
(cherry picked from commit 90802a1ee007be10239cb09db7a41580311cf075)

diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 337483f81de1..da7857d6def0 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1012,7 +1012,10 @@ SwContentNode::~SwContentNode()
 {
 // The base class SwClient of SwFrame excludes itself from the dependency 
list!
 // Thus, we need to delete all Frames in the dependency list.
-DelFrames(false);
+if (!IsTextNode()) // see ~SwTextNode
+{
+DelFrames(false);
+}
 
 m_aCondCollListener.EndListeningAll();
 m_pCondColl = nullptr;
@@ -1305,7 +1308,7 @@ void SwContentNode::MakeFrames( SwContentNode& rNode )
  *
  * An input param to identify if the acc table should be disposed.
  */
-void SwContentNode::DelFrames( bool bIsDisposeAccTable )
+void SwContentNode::DelFrames(bool /*removeme*/)
 {
 if( !HasWriterListeners() )
 return;
@@ -1359,11 +1362,6 @@ void SwContentNode::DelFrames( bool bIsDisposeAccTable )
 pFrame->Cut();
 SwFrame::DestroyFrame(pFrame);
 }
-
-if( bIsDisposeAccTable && IsTextNode() )
-{
-GetTextNode()->DelFrames_TextNodePart();
-}
 }
 
 SwContentNode *SwContentNode::JoinNext()
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 98ababf17492..448ba6cd44ce 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -263,10 +263,8 @@ SwTextNode::~SwTextNode()
 
 InitSwParaStatistics( false );
 
-if (HasWriterListeners())
-{
-DelFrames_TextNodePart();
-}
+DelFrames(false); // must be called here while it's still a SwTextNode
+DelFrames_TextNodePart();
 }
 
 void SwTextNode::FileLoadedInitHints()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-12 Thread Michael Weghorn
 sw/source/uibase/dbui/dbmgr.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit e8a46b0171a49e6b49a2e7b89c8bdfef84ef41ef
Author: Michael Weghorn 
Date:   Mon Jun 11 17:20:44 2018 +0200

tdf#118113 MM: Make sure page count is up to date

Since the page layout may have changed, e.g. due to
the visibility status of hidden sections having changed
in the call to 'pWorkShell->SwViewShell::UpdateFields()',
it's necessary to recalculate the layout to ensure that
the correct page count is retrieved when calling
'pWorkShell->CalcLayout()'.

This fixes a regression introduced by the performance
optimization done in commit
ae5afe9bcebdd220a457829d47882fe8a0cf69fd, while
still avoiding to have to do the expensive layout for the
target document.

Change-Id: I46f1b68758e4df330c17358a8e852e8b040a9520
Reviewed-on: https://gerrit.libreoffice.org/55636
Tested-by: Jenkins 
Reviewed-by: Luboš Luňák 
(cherry picked from commit 89f896d2cfd84b711583f98a6343e9835a9aed11)
Reviewed-on: https://gerrit.libreoffice.org/55707
Reviewed-by: Michael Weghorn 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 9b29507fa46b..77e8297f8892 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1550,6 +1550,8 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
 ++targetDocPageCount; // Docs always start on odd pages 
(so offset must be even).
 SwNodeIndex appendedDocStart = pTargetDoc->AppendDoc( 
*pWorkDoc,
 nStartingPageNo, !bWorkDocInitialized, targetDocPageCount, 
nDocNo);
+// ensure layout is up to date in order to get correct page 
count
+pWorkShell->CalcLayout();
 targetDocPageCount += pWorkShell->GetPageCnt();
 
 if ( (nMaxDumpDocs < 0) || (nDocNo <= nMaxDumpDocs) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source sw/uiconfig

2018-06-12 Thread Caolán McNamara
 sw/source/ui/table/tabledlg.cxx   |  228 --
 sw/source/uibase/table/tablepg.hxx|   39 ++---
 sw/uiconfig/swriter/ui/tablecolumnpage.ui |   91 ---
 3 files changed, 177 insertions(+), 181 deletions(-)

New commits:
commit daa91fedc4b6675f66a02265f596e06513171919
Author: Caolán McNamara 
Date:   Mon Jun 11 21:18:57 2018 +0100

weld SwTableColumnPage

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

diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 5375003065dc..d650e10f422a 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -132,7 +132,7 @@ void  SwFormatTablePage::Init()
 m_xRightBtn->connect_toggled( aLk2 );
 m_xCenterBtn->connect_toggled( aLk2 );
 
-Link aLk = LINK( this, SwFormatTablePage, 
UpDownHdl );
+Link aLk = LINK(this, SwFormatTablePage, 
ValueChangedHdl);
 m_xTopMF->connect_value_changed(aLk);
 m_xBottomMF->connect_value_changed(aLk);
 m_xRightMF->connect_value_changed(aLk);
@@ -257,9 +257,9 @@ void SwFormatTablePage::RightModify()
 }
 }
 
-IMPL_LINK( SwFormatTablePage, UpDownHdl, weld::MetricSpinButton&, rEdit, void )
+IMPL_LINK( SwFormatTablePage, ValueChangedHdl, weld::MetricSpinButton&, rEdit, 
void )
 {
-if( m_xRightMF->get() == )
+if (m_xRightMF->get() == )
 RightModify();
 ModifyHdl(rEdit);
 }
@@ -698,9 +698,8 @@ DeactivateRC SwFormatTablePage::DeactivatePage( SfxItemSet* 
_pSet )
 }
 
 //Description: Page column configuration
-SwTableColumnPage::SwTableColumnPage(vcl::Window* pParent, const SfxItemSet& 
rSet)
-: SfxTabPage(pParent, "TableColumnPage",
-"modules/swriter/ui/tablecolumnpage.ui", )
+SwTableColumnPage::SwTableColumnPage(TabPageParent pParent, const SfxItemSet& 
rSet)
+: SfxTabPage(pParent, "modules/swriter/ui/tablecolumnpage.ui", 
"TableColumnPage", )
 , pTableData(nullptr)
 , nTableWidth(0)
 , nMinWidth(MINLAY)
@@ -709,28 +708,25 @@ SwTableColumnPage::SwTableColumnPage(vcl::Window* 
pParent, const SfxItemSet& rSe
 , bModified(false)
 , bModifyTable(false)
 , bPercentMode(false)
+, m_aFieldArr { m_xBuilder->weld_metric_spin_button("width1", FUNIT_CM),
+m_xBuilder->weld_metric_spin_button("width2", FUNIT_CM),
+m_xBuilder->weld_metric_spin_button("width3", FUNIT_CM),
+m_xBuilder->weld_metric_spin_button("width4", FUNIT_CM),
+m_xBuilder->weld_metric_spin_button("width5", FUNIT_CM),
+m_xBuilder->weld_metric_spin_button("width6", FUNIT_CM) }
+, m_aTextArr { std::unique_ptr(m_xBuilder->weld_label("1")),
+   std::unique_ptr(m_xBuilder->weld_label("2")),
+   std::unique_ptr(m_xBuilder->weld_label("3")),
+   std::unique_ptr(m_xBuilder->weld_label("4")),
+   std::unique_ptr(m_xBuilder->weld_label("5")),
+   std::unique_ptr(m_xBuilder->weld_label("6")) }
+, m_xModifyTableCB(m_xBuilder->weld_check_button("adaptwidth"))
+, m_xProportionalCB(m_xBuilder->weld_check_button("adaptcolumns"))
+, m_xSpaceFT(m_xBuilder->weld_label("spaceft"))
+, m_xSpaceED(m_xBuilder->weld_metric_spin_button("space", FUNIT_CM))
+, m_xUpBtn(m_xBuilder->weld_button("next"))
+, m_xDownBtn(m_xBuilder->weld_button("back"))
 {
-get(m_pModifyTableCB, "adaptwidth");
-get(m_pProportionalCB, "adaptcolumns");
-get(m_pSpaceFT, "spaceft");
-get(m_pSpaceED, "space-nospin");
-get(m_pUpBtn, "next");
-get(m_pDownBtn, "back");
-
-m_aFieldArr[0].set(get("width1"));
-m_aFieldArr[1].set(get("width2"));
-m_aFieldArr[2].set(get("width3"));
-m_aFieldArr[3].set(get("width4"));
-m_aFieldArr[4].set(get("width5"));
-m_aFieldArr[5].set(get("width6"));
-
-m_pTextArr[0] = get("1");
-m_pTextArr[1] = get("2");
-m_pTextArr[2] = get("3");
-m_pTextArr[3] = get("4");
-m_pTextArr[4] = get("5");
-m_pTextArr[5] = get("6");
-
 SetExchangeSupport();
 
 const SfxPoolItem* pItem;
@@ -740,26 +736,11 @@ SwTableColumnPage::SwTableColumnPage(vcl::Window* 
pParent, const SfxItemSet& rSe
 
 SwTableColumnPage::~SwTableColumnPage()
 {
-disposeOnce();
-}
-
-void SwTableColumnPage::dispose()
-{
-m_pModifyTableCB.clear();
-m_pProportionalCB.clear();
-m_pSpaceFT.clear();
-m_pSpaceED.clear();
-m_pUpBtn.clear();
-m_pDownBtn.clear();
-for (auto& p : m_pTextArr)
-p.clear();
-SfxTabPage::dispose();
 }
 
-VclPtr SwTableColumnPage::Create( TabPageParent pParent,
-  const SfxItemSet* rAttrSet)
+VclPtr SwTableColumnPage::Create(TabPageParent pParent, const 
SfxItemSet* rAttrSet)
 {
-return VclPtr::Create( pParent.pParent, *rAttrSet 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-11 Thread Noel Grandin
 sw/source/core/layout/trvlfrm.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit ba6d941c89c13130fd8d5ab1d87123f53b5b18f2
Author: Noel Grandin 
Date:   Mon Jun 11 08:47:47 2018 +0200

tdf#102907 selection indicator missing on vertical text

regression from

commit 79800559268c636740fec69018b1f99f047c3f93
convert MT_ constants to scoped enum

The original code used bit-wise operations and some clever constant
values, which I did not convert correctly

Change-Id: I2fcd9e2584638d4a690773ef3f178415153b8b19
Reviewed-on: https://gerrit.libreoffice.org/55596
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 
(cherry picked from commit 16b1d80070142e2ffecaba64b62dbe836daafb4f)
Reviewed-on: https://gerrit.libreoffice.org/55598

diff --git a/sw/source/core/layout/trvlfrm.cxx 
b/sw/source/core/layout/trvlfrm.cxx
index 1586d7e5753d..6fb9da3731e5 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2245,7 +2245,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor )
 Sub( aRegion, aTmp );
 
 // The next statement means neither ruby nor rotate(90):
-if( MultiPortionType::RUBY != pEnd2Pos->nMultiType )
+if( MultiPortionType::RUBY != pEnd2Pos->nMultiType && 
MultiPortionType::ROT_90 != pEnd2Pos->nMultiType )
 {
 SwTwips nTmp = fnRectX.GetTop(pEnd2Pos->aLine);
 if( fnRectX.GetTop(aEndRect) != nTmp )
@@ -2340,7 +2340,9 @@ void SwRootFrame::CalcFrameRects(SwShellCursor )
 if( pStartFrame == pEndFrame )
 {
 bool bSameRotatedOrBidi = pSt2Pos && pEnd2Pos &&
-( MultiPortionType::BIDI == pSt2Pos->nMultiType ) &&
+( MultiPortionType::BIDI == pSt2Pos->nMultiType  ||
+  MultiPortionType::ROT_270 == pSt2Pos->nMultiType ||
+  MultiPortionType::ROT_90  == pSt2Pos->nMultiType ) &&
 pSt2Pos->aPortion == pEnd2Pos->aPortion;
 //case 1: (Same frame and same row)
 if( bSameRotatedOrBidi ||
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-07 Thread Julien Nabet
 sw/source/core/unocore/unomap.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 243b73546c0c0b291f5e05405ad24e48df625d64
Author: Julien Nabet 
Date:   Thu Jun 7 18:53:30 2018 +0200

tdf#118042: fix crash on Target box in Hyperlink dialog

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

diff --git a/sw/source/core/unocore/unomap.cxx 
b/sw/source/core/unocore/unomap.cxx
index 8445e08f935d..3dffbe6859fc 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -683,7 +683,7 @@ const SfxItemPropertyMapEntry* 
SwUnoPropertyMapProvider::GetPropertyMapEntries(s
 {
 static SfxItemPropertyMapEntry const aLinkTargetMap_Impl[] =
 {
-{ OUString(UNO_LINK_DISPLAY_BITMAP), 0, 
cppu::UnoType::get(), PropertyAttribute::READONLY, 0xff},
+{ OUString(UNO_LINK_DISPLAY_BITMAP), 0, 
cppu::UnoType::get(), PropertyAttribute::READONLY, 0xbf},
 { OUString(UNO_LINK_DISPLAY_NAME), 0,   
cppu::UnoType::get(), PropertyAttribute::READONLY, 0xbf},
 { OUString(), 0, css::uno::Type(), 0, 0 }
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

2018-06-07 Thread Caolán McNamara
 sw/source/uibase/dbui/dbmgr.cxx |   20 
 1 file changed, 20 insertions(+)

New commits:
commit 34a3231103adcbcc71e0cc5e8b8f8b0bc1edb520
Author: Caolán McNamara 
Date:   Wed Jun 6 12:59:58 2018 +0100

tdf#117824 switch embedded database storage away from doc on revoke

otherwise the database document still has the embedded storage
open when the attempt to remove the storage is made

Change-Id: Ie313923b969bdbc53b27b00e379ac20240ffb6e3
Reviewed-on: https://gerrit.libreoffice.org/55388
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 
(cherry picked from commit a432a2e481baffa77e6f25584efbfbb3b68bc9a6)
Reviewed-on: https://gerrit.libreoffice.org/55406
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index bae61f7e5be1..9b29507fa46b 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -100,6 +100,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2995,11 +2996,30 @@ OUString SwDBManager::LoadAndRegisterDataSource(const 
OUString , const OUSt
 return LoadAndRegisterDataSource_Impl( DBConnURIType::UNKNOWN, nullptr, 
INetURLObject(rURI), pDestDir, nullptr );
 }
 
+namespace
+{
+// tdf#117824 switch the embedded database away from using its current 
storage and point it to temporary storage
+// which allows the original storage to be deleted
+void switchEmbeddedDatabaseStorage(uno::Reference& 
rDatabaseContext, const OUString& rName)
+{
+uno::Reference 
xDS(rDatabaseContext->getByName(rName), uno::UNO_QUERY);
+if (!xDS)
+return;
+uno::Reference 
xStorageDoc(xDS->getDatabaseDocument(), uno::UNO_QUERY);
+if (!xStorageDoc)
+return;
+
xStorageDoc->switchToStorage(comphelper::OStorageHelper::GetTemporaryStorage());
+}
+}
+
 void SwDBManager::RevokeDataSource(const OUString& rName)
 {
 uno::Reference xDatabaseContext = 
sdb::DatabaseContext::create(comphelper::getProcessComponentContext());
 if (xDatabaseContext->hasByName(rName))
+{
+switchEmbeddedDatabaseStorage(xDatabaseContext, rName);
 xDatabaseContext->revokeObject(rName);
+}
 }
 
 void SwDBManager::LoadAndRegisterEmbeddedDataSource(const SwDBData& rData, 
const SwDocShell& rDocShell)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >