Source code comment appears in UI?

2023-11-27 Thread Daniel Toschläger

Hello
I am using LibreOffice 7.6. I have a Word document that when I save it 
in Word docx 2007 format it fills the document with !!br0ken!! comments. 
I attached the document.


I am doing a training for game programming with unity in Germany. The 
training is suited for 2018. Maybe the docx is as old as that. I altered 
it by answering the questions inside.


No sensitive data inside as far as I know.


Kind regards
Daniel

UTY14C_ausgefüllt_Mailinglist.docx
Description: MS-Word 2007 document


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

2023-06-20 Thread Daniel Lohmann (via logerrit)
 sd/source/ui/slideshow/slideshowimpl.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit ca90149fa3f7c8161393490d4c0149c1cbcc3c28
Author: Daniel Lohmann 
AuthorDate: Mon Jun 19 21:50:15 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jun 20 13:46:19 2023 +0200

tdf#155920: next effect in END mode should no resume show

When starting a presentation and moving over the last slide into the END
mode the next effect should not resume the presentation. Instead it
should exit the presentation. Furthermore, when hitting then the back
key it should show again the last slide (only resuming the presentation,
not directly resuming and moving back to the slide before the last.

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

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx 
b/sd/source/ui/slideshow/slideshowimpl.cxx
index a9f16b86b8d4..01165afaecd7 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -2758,7 +2758,7 @@ void SAL_CALL SlideshowImpl::gotoNextEffect(  )
 if( !(mxShow.is() && mpSlideController && mpShowWindow) )
 return;
 
-if( mbIsPaused )
+if( mbIsPaused && mpShowWindow->GetShowWindowMode() != SHOWWINDOWMODE_END )
 resume();
 
 const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
@@ -2784,13 +2784,10 @@ void SAL_CALL SlideshowImpl::gotoPreviousEffect(  )
 if( !(mxShow.is() && mpSlideController && mpShowWindow) )
 return;
 
-if( mbIsPaused )
-resume();
-
 const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
-if( (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) )
+if( (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) || 
mbIsPaused )
 {
-mpShowWindow->RestartShow();
+resume();
 }
 else
 {


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

2022-12-01 Thread Daniel Lohmann (via logerrit)
 sdext/source/presenter/PresenterScreen.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 9db4f60bfc5aa90a9062e429a07889b60ae99e9c
Author: Daniel Lohmann 
AuthorDate: Sun Nov 27 19:54:15 2022 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Thu Dec 1 10:53:32 2022 +0100

tdf#92717 Presenter screen on one monitor

If the presenter screen should be shown as normal window (not a
full screen window) the presenter screen can also be shown on one
monitor, as then the presenter screen can be minimized.

This is a follow up to a15bcda0e21be04bec424172192f2416b7f52422

Change-Id: I6fd19aa120a0b0e894b156b4bd10059741f91dc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143355
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Samuel Mehrbrodt 

diff --git a/sdext/source/presenter/PresenterScreen.cxx 
b/sdext/source/presenter/PresenterScreen.cxx
index c4f2cda50f3e..cf24a26f7bf1 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -465,17 +465,19 @@ sal_Int32 PresenterScreen::GetPresenterScreenNumber (
 // There is either only one screen or the full screen
 // presentation spans all available screens.  The presenter
 // screen is shown only when a special flag in the configuration
-// is set.
+// is set or when the presenter screen will be shown as
+// non-full screen window
 Reference xContext (mxContextWeak);
 PresenterConfigurationAccess aConfiguration (
 xContext,
 "/org.openoffice.Office.PresenterScreen/",
 PresenterConfigurationAccess::READ_ONLY);
 bool bStartAlways (false);
+bool bPresenterScreenFullScreen = 
isPresenterScreenFullScreen(xContext);
 if (aConfiguration.GetConfigurationNode(
 "Presenter/StartAlways") >>= bStartAlways)
 {
-if (bStartAlways)
+if (bStartAlways || !bPresenterScreenFullScreen)
 return GetPresenterScreenFromScreen(nScreenNumber);
 }
 return -1;


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

2022-11-27 Thread Daniel Lohmann (via logerrit)
 slideshow/source/engine/pointersymbol.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 54681a12b38db29b4d65e3c4f4c52a12436965d0
Author: Daniel Lohmann 
AuthorDate: Sun Nov 27 11:52:56 2022 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Nov 28 08:47:47 2022 +0100

Presenter screen wrong position of pointer

The pointer is drawn on the presenting screen and the presenter
console. In the presenter console the position of the pointer
is not matching the position on the slide or position in the impress
remote app. This fixed by this commit.

Change-Id: I5650f62304934d2acb558e32a8e9de78a9f0a12a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143341
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/slideshow/source/engine/pointersymbol.cxx 
b/slideshow/source/engine/pointersymbol.cxx
index 50f4421add5c..00832a4edf26 100644
--- a/slideshow/source/engine/pointersymbol.cxx
+++ b/slideshow/source/engine/pointersymbol.cxx
@@ -96,8 +96,8 @@ basegfx::B2DPoint 
PointerSymbol::calcSpritePos(UnoViewSharedPtr const & rView) c
 const geometry::IntegerSize2D realTranslationOffset ( 
rView->getTranslationOffset() );
 
 return basegfx::B2DPoint(
-realTranslationOffset.Width + ((aViewArea.Width - aViewArea.X) - 2 * 
realTranslationOffset.Width) * maPos.X,
-realTranslationOffset.Height + ((aViewArea.Height - aViewArea.Y) - 2 * 
realTranslationOffset.Height) * maPos.Y);
+realTranslationOffset.Width + (aViewArea.Width * maPos.X),
+realTranslationOffset.Height + (aViewArea.Height * maPos.Y));
 }
 
 void PointerSymbol::viewAdded( const UnoViewSharedPtr& rView )


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

2022-11-27 Thread Daniel Lohmann (via logerrit)
 slideshow/source/engine/slideshowimpl.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 176f77607ed1001efca402d1807e12b93d914847
Author: Daniel Lohmann 
AuthorDate: Sun Nov 27 11:45:48 2022 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Nov 28 08:46:52 2022 +0100

Do not draw pointer on paused mode screen

If the pointer is drawn on the paused mode screen, around the pointer
the slide will be visible. Everywhere where the pointer was will the
slide is visible. Preventing to draw the pointer in the paused mode will
fix this issue.

Change-Id: Ica8fedca5710adfc79ed78a30485bd755e3b3b31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143340
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index 1cbc167a4c4d..264a4dee8217 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -1750,7 +1750,9 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue 
const& rProperty )
 if (!(rProperty.Value >>= visible))
 return false;
 
-mpPointerSymbol->setVisible(visible);
+if (!mbShowPaused)
+mpPointerSymbol->setVisible(visible);
+
 return true;
 }
 
@@ -1760,7 +1762,9 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue 
const& rProperty )
 if (! (rProperty.Value >>= pos))
 return false;
 
-mpPointerSymbol->viewsChanged(pos);
+if (!mbShowPaused)
+mpPointerSymbol->viewsChanged(pos);
+
 return true;
 }
 


[Libreoffice-commits] core.git: officecfg/registry sdext/source sd/source sd/uiconfig

2022-11-16 Thread Daniel Lohmann (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Impress.xcs |7 ++
 sd/source/ui/app/optsitem.cxx   |   19 -
 sd/source/ui/dlg/tpoption.cxx   |   24 ---
 sd/source/ui/framework/factories/FullScreenPane.cxx |   23 ---
 sd/source/ui/framework/factories/FullScreenPane.hxx |3 
 sd/source/ui/inc/optsitem.hxx   |   39 ++--
 sd/source/ui/inc/tpoption.hxx   |1 
 sd/uiconfig/simpress/ui/optimpressgeneralpage.ui|   21 ++
 sdext/source/presenter/PresenterScreen.cxx  |   26 +++-
 sdext/source/presenter/PresenterScreen.hxx  |6 +
 10 files changed, 124 insertions(+), 45 deletions(-)

New commits:
commit a15bcda0e21be04bec424172192f2416b7f52422
Author: Daniel Lohmann 
AuthorDate: Mon Nov 14 19:17:14 2022 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Thu Nov 17 06:57:40 2022 +0100

tdf#33495: Allow presenter console in windowed mode

Added an option in the Impress settings window to set the presenter
console into fullscreen/windowed mode. This will then be used the
next time a presentation is started.

Two pictures of how the result looks are given in the bug tracker.

Change-Id: I231f9180301301a9eccf9984ea4dcd529bd7dfce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142359
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index acf2673f54a7..fefd4ba2f6bf 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -570,6 +570,13 @@
   
   true
 
+
+  
+   Indicates whether the Presenter Screen Console is shown in 
FullScreen mode.
+   Presenter Screen FullScreen
+ 
+ true
+   
   
   
 
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 5baff32e2df8..fb9aac86d491 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -409,7 +409,8 @@ SdOptionsMisc::SdOptionsMisc( bool bImpress, bool 
bUseConfig ) :
 bDoubleClickTextEdit( true ),
 bClickChangeRotation( false ),
 bEnableSdremote( false ),
-bEnablePresenterScreen( true),
+bEnablePresenterScreen( true ),
+bPresenterScreenFullScreen( true ),
 bSolidDragging( true ),
 bSummationOfParagraphs( false ),
 bTabBarVisible( true ),
@@ -443,7 +444,8 @@ bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) 
const
 IsDoubleClickTextEdit() == rOpt.IsDoubleClickTextEdit() &&
 IsClickChangeRotation() == rOpt.IsClickChangeRotation() &&
 IsEnableSdremote() == rOpt.IsEnableSdremote() &&
-IsEnablePresenterScreen() == rOpt.IsEnablePresenterScreen()&&
+IsEnablePresenterScreen() == rOpt.IsEnablePresenterScreen() &&
+IsPresenterScreenFullScreen() == 
rOpt.IsPresenterScreenFullScreen() &&
 IsSummationOfParagraphs() == rOpt.IsSummationOfParagraphs() &&
 IsTabBarVisible() == rOpt.IsTabBarVisible() &&
 IsSolidDragging() == rOpt.IsSolidDragging() &&
@@ -500,6 +502,7 @@ void SdOptionsMisc::GetPropNameArray( const char**& 
ppNames, sal_uLong& rCount )
 "PenWidth",
 "Start/EnableSdremote",
 "Start/EnablePresenterScreen",
+"Start/PresenterScreenFullScreen",
 "TabBarVisible"
 };
 
@@ -562,8 +565,11 @@ bool SdOptionsMisc::ReadData( const Any* pValues )
 if( pValues[25].hasValue() )
 SetEnablePresenterScreen( *o3tl::doAccess(pValues[ 25 ]) );
 
-if( pValues[26].hasValue() ) {
-SetTabBarVisible( *o3tl::doAccess(pValues[ 26 ]) );
+if (pValues[26].hasValue() )
+SetPresenterScreenFullScreen( *o3tl::doAccess(pValues[ 26 ]) 
);
+
+if( pValues[27].hasValue() ) {
+SetTabBarVisible( *o3tl::doAccess(pValues[ 27 ]) );
 }
 }
 
@@ -606,7 +612,8 @@ bool SdOptionsMisc::WriteData( Any* pValues ) const
 pValues[ 23 ] <<= GetPresentationPenWidth();
 pValues[ 24 ] <<= IsEnableSdremote();
 pValues[ 25 ] <<= IsEnablePresenterScreen();
-pValues[ 26 ] <<= IsTabBarVisible();
+pValues[ 26 ] <<= IsPresenterScreenFullScreen();
+pValues[ 27 ] <<= IsTabBarVisible();
 }
 
 return true;
@@ -633,6 +640,7 @@ SdOptionsMiscItem::SdOptionsMiscItem( SdOptions const * 
pOpts, ::sd::FrameView c
 maOptionsMisc.SetStartWithTemplate( pOpts->IsStartWithTemplate() );
 maOptionsMisc.SetEnableSdr

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

2022-05-06 Thread Daniel Kamil Kozar (via logerrit)
 include/svl/numformat.hxx|2 +-
 sc/inc/cellform.hxx  |7 ---
 sc/inc/column.hxx|   10 +-
 sc/inc/document.hxx  |2 +-
 sc/inc/table.hxx |2 +-
 sc/source/core/data/column3.cxx  |4 ++--
 sc/source/core/data/document.cxx |4 ++--
 sc/source/core/data/table2.cxx   |4 ++--
 sc/source/core/tool/cellform.cxx |6 +++---
 sc/source/ui/view/cellsh1.cxx|7 ---
 svl/source/numbers/zforlist.cxx  |5 +++--
 11 files changed, 28 insertions(+), 25 deletions(-)

New commits:
commit a88419f54b8aa9c23cd80e04bc47f1b5ef3931ca
Author: Daniel Kamil Kozar 
AuthorDate: Tue May 3 02:45:13 2022 +0200
Commit: Eike Rathke 
CommitDate: Fri May 6 14:16:12 2022 +0200

tdf#148383: Obtain start/end strings always in system locale

ScFillSeriesDlg always expects the strings describing the start and end 
values
to be in the system locale. This change ensures that and fixes the bug where
using non-locale-default data in the Fill Series dialog leads to an error.

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

diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx
index 2187810229aa..dc1c704d364d 100644
--- a/include/svl/numformat.hxx
+++ b/include/svl/numformat.hxx
@@ -203,7 +203,7 @@ public:
 in the filtering condition now), instead of the EditFormat string
 (e.g a not rounded value, which is visible during editing).*/
 void GetInputLineString(const double& fOutNumber, sal_uInt32 nFIndex, 
OUString& rOutString,
-bool bFiltering = false);
+bool bFiltering = false, bool bForceSystemLocale = 
false);
 
 /** Format a number according to a format code string to be scanned.
 @return
diff --git a/sc/inc/cellform.hxx b/sc/inc/cellform.hxx
index cd9b28f7692c..7fb072ee8578 100644
--- a/sc/inc/cellform.hxx
+++ b/sc/inc/cellform.hxx
@@ -46,13 +46,14 @@ public:
 // Note that if pShared is set and a value is returned that way, the 
returned OUString is empty.
 static OUString GetInputString(
 const ScRefCellValue& rCell, sal_uInt32 nFormat, SvNumberFormatter& 
rFormatter,
-const ScDocument& rDoc, const svl::SharedString** pShared = nullptr, 
bool bFiltering = false );
+const ScDocument& rDoc, const svl::SharedString** pShared = nullptr, 
bool bFiltering = false,
+bool bForceSystemLocale = false );
 
 static OUString GetInputString(
 const ScRefCellValue& rCell, sal_uInt32 nFormat, SvNumberFormatter& 
rFormatter,
-const ScDocument& rDoc, bool bFiltering)
+const ScDocument& rDoc, bool bFiltering, bool bForceSystemLocale = 
false )
 {
-return GetInputString( rCell, nFormat, rFormatter, rDoc, nullptr, 
bFiltering );
+return GetInputString( rCell, nFormat, rFormatter, rDoc, nullptr, 
bFiltering, bForceSystemLocale );
 }
 
 static OUString GetOutputString(
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index ed9ce2e0c77c..3f0785429ca9 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -442,11 +442,11 @@ public:
 { return GetString( GetCellValue( rBlockPos, nRow ), nRow, pContext ); 
}
 double* GetValueCell( SCROW nRow );
 // Note that if pShared is set and a value is returned that way, the 
returned OUString is empty.
-OUStringGetInputString( SCROW nRow, const svl::SharedString** pShared 
= nullptr ) const
-{ return GetInputString( GetCellValue( nRow ), nRow, pShared ); }
+OUStringGetInputString( SCROW nRow, const svl::SharedString** pShared 
= nullptr, bool bForceSystemLocale = false ) const
+{ return GetInputString( GetCellValue( nRow ), nRow, pShared, 
bForceSystemLocale ); }
 OUStringGetInputString( sc::ColumnBlockConstPosition& rBlockPos, SCROW 
nRow,
-const svl::SharedString** pShared = nullptr ) const
-{ return GetInputString( GetCellValue( rBlockPos, nRow ), nRow, 
pShared ); }
+const svl::SharedString** pShared = nullptr, bool 
bForceSystemLocale = false ) const
+{ return GetInputString( GetCellValue( rBlockPos, nRow ), nRow, 
pShared, bForceSystemLocale ); }
 double  GetValue( SCROW nRow ) const;
 const EditTextObject* GetEditText( SCROW nRow ) const;
 void RemoveEditTextCharAttribs( SCROW nRow, const ScPatternAttr& rAttr );
@@ -822,7 +822,7 @@ private:
 SCROW FindNextVisibleRow(SCROW nRow, bool bForward) const;
 
 OUString GetString( const ScRefCellValue& cell, SCROW nRow, const 
ScInterpreterContext* pContext = nullptr ) const;
-OUString GetInputString( const ScRefCellValue& cell, SCROW nRow, const 
svl::SharedString** pShared = nullptr ) const;
+OUString GetInputSt

Daniel Kamil Kozar license statement

2022-04-04 Thread Daniel Kamil Kozar
All of my past & future contributions to LibreOffice may be
licensed under the MPLv2/LGPLv3+ dual license.

Lots of love,
dkk


Error while building tmp/cciJbVUs.s:

2022-02-16 Thread Daniel Buch
Building Libreoffice in
5.13.0-28-generic #31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022 x86_64 
x86_64 x86_64 GNU/Linux
Xubuntu
Bug while running make

/tmp/cciJbVUs.s: Mensajes del ensamblador:
/tmp/cciJbVUs.s: Error interno (Violación de segmento).
Por favor reporte este bicho.
*** Failed compilation command follows: 
--
/usr/bin/ccache g++ -DHAVE_GCC_ATOMICS=0 -D_REENTRANT -DU_HAVE_ELF_H=1 
-DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=0 -DU_HAVE_STRING_VIEW=1 -I. -I../common 
-DU_ATTRIBUTE_DEPRECATED= -DU_I18N_IMPLEMENTATION -std=c++17 -O2 
-fno-strict-aliasing -W -Wall -pedantic -Wpointer-arith -Wwrite-strings 
-Wno-long-long -c -DPIC -fPIC -o dtfmtsym.o dtfmtsym.cpp
--- ( rebuild with "make VERBOSE=1 all" to show all parameters ) 
make[3]: *** [../config/mh-linux:57: dtfmtsym.o] Error 1
make[3]: *** Se espera a que terminen otras tareas
make[2]: *** [Makefile:153: all-recursive] Error 2
make[1]: *** [/home/usuario/core/external/icu/ExternalProject_icu.mk:69: 
/home/usuario/core/workdir/ExternalProject/icu/build] Error 1
make: *** [Makefile:299: build] Error 2

Sent with [ProtonMail](https://protonmail.com/) Secure Email.

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

2021-10-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/source/core/doc/docdesc.cxx |3 ---
 sw/source/uibase/shells/basesh.cxx |6 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit c3a0f570ece7799166d8b21dc7c7417fa6b19ec6
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Apr 26 15:04:17 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 13:11:15 2021 +0200

tdf#141613 sw: avoid possible crash when undoing header creation

Move the ClearRedo() call to the very end of the undo process in order to 
avoid heap use after free.

We still need to call ClearRedo() because there's no mechanism in place to 
Redo a header/footer change.

Regression from commit 65e52cb61d74b0c71b45b63b2da131bc6b621104
"tdf#141613 sw: fix crash at header/footer undo".

Change-Id: Ibd4604379c9791e85aef3d4dc6c29c9e3ecd5a28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115275
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 0cd000bb83719982c1fd2265ea040c82af5bf98e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123977
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 164404ce3016..d94f23b87fcb 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -498,9 +498,6 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc  
)
 lDelHFFormat(, 
rDescLeftFooterFormat.GetFooterFormat());
 else if (rDescFirstLeftFooterFormat.GetFooterFormat() && 
rDescFirstLeftFooterFormat != rChgedFirstLeftFooterFormat)
 lDelHFFormat(, 
rDescFirstLeftFooterFormat.GetFooterFormat());
-
-// FIXME: Disable redoing this change until we figure out how
-GetIDocumentUndoRedo().ClearRedo();
 }
 }
 ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 359dea043183..8d774615522e 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -557,6 +557,12 @@ void SwBaseShell::ExecUndo(SfxRequest )
 rWrtShell.Do( SwWrtShell::UNDO, nCnt );
 for (SwViewShell& rShell : rWrtShell.GetRingContainer())
 rShell.UnlockPaint();
+
+// tdf#141613 FIXME: Disable redoing header/footer changes for 
now.
+// The proper solution would be to write a SwUndoHeaderFooter 
class
+// to represent the addition of a header or footer to the 
current page.
+if (nUndoId == SwUndoId::HEADER_FOOTER)
+rUndoRedo.ClearRedo();
 }
 break;
 


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/uitest/writer_tests7/tdf46561.py |   13 +
 sw/source/core/doc/docdesc.cxx |   84 +
 2 files changed, 97 insertions(+)

New commits:
commit a456306df9d66e109a807a4245256b341e81040b
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Apr 26 15:04:17 2021 +0200
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 13:06:43 2021 +0200

tdf#141613 sw: fix crash at header/footer undo

Undoing the creation of a header/footer used to leave their
corresponding document nodes intact, causing the node index
of a previous undo entry to point to the wrong node.

We now force the destruction of the header/footer nodes manually.
We also cut the redo chain which loses the redo history, but solves
another crash for now (when redoing the creation of the header).

The proper solution would be to create a new SwUndo* derived class
from scratch to represent the creation of a new header/footer section
in the document.

Regression from commit 8d8486f43c1a8a51157bfc3e0b87090b05a9229e
(tdf#46561 sw: fix lost undo stack setting header/footer)

Change-Id: I97188aa8ded802bc6b6fa88ddd83a95c40de8bc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114667
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 65e52cb61d74b0c71b45b63b2da131bc6b621104)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123976
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/qa/uitest/writer_tests7/tdf46561.py 
b/sw/qa/uitest/writer_tests7/tdf46561.py
index 235136524903..02760cf76d96 100644
--- a/sw/qa/uitest/writer_tests7/tdf46561.py
+++ b/sw/qa/uitest/writer_tests7/tdf46561.py
@@ -102,4 +102,17 @@ class tdf46561(UITestCase):
 
 self.ui_test.close_doc()
 
+# Check that former crash has been fixed
+def test_tdf141613(self):
+self.ui_test.create_doc_in_start_center("writer")
+
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+xArgs = mkPropertyValues({"Text": "something"})
+self.xUITest.executeCommandWithParameters(".uno:InsertText", xArgs)
+self.xUITest.executeCommand(".uno:InsertPageHeader")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Undo")
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index a85975eac359..164404ce3016 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -419,6 +419,90 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc 
 )
 
 
GetIDocumentUndoRedo().AppendUndo(std::make_unique(rDesc, 
rChged, this));
 }
+else
+{
+SwUndoId nBeingUndone;
+GetIDocumentUndoRedo().GetFirstRedoInfo(nullptr, );
+if (SwUndoId::HEADER_FOOTER == nBeingUndone)
+{
+// The last format change is currently being undone. Remove 
header/footer and corresponding nodes.
+auto rDescMasterHeaderFormat = 
rDesc.GetMaster().GetFormatAttr(RES_HEADER);
+auto rDescLeftHeaderFormat = 
rDesc.GetLeft().GetFormatAttr(RES_HEADER);
+auto rDescFirstLeftHeaderFormat = 
rDesc.GetFirstLeft().GetFormatAttr(RES_HEADER);
+auto rDescMasterFooterFormat = 
rDesc.GetMaster().GetFormatAttr(RES_FOOTER);
+auto rDescLeftFooterFormat = 
rDesc.GetLeft().GetFormatAttr(RES_FOOTER);
+auto rDescFirstLeftFooterFormat = 
rDesc.GetFirstLeft().GetFormatAttr(RES_FOOTER);
+
+auto rChgedMasterHeaderFormat = 
rChged.GetMaster().GetFormatAttr(RES_HEADER);
+auto rChgedLeftHeaderFormat = 
rChged.GetLeft().GetFormatAttr(RES_HEADER);
+auto rChgedFirstLeftHeaderFormat = 
rChged.GetFirstLeft().GetFormatAttr(RES_HEADER);
+auto rChgedMasterFooterFormat = 
rChged.GetMaster().GetFormatAttr(RES_FOOTER);
+auto rChgedLeftFooterFormat = 
rChged.GetLeft().GetFormatAttr(RES_FOOTER);
+auto rChgedFirstLeftFooterFormat = 
rChged.GetFirstLeft().GetFormatAttr(RES_FOOTER);
+
+rDesc.GetMaster().ResetFormatAttr(RES_HEADER);
+rDesc.GetLeft().ResetFormatAttr(RES_HEADER);
+rDesc.GetFirstLeft().ResetFormatAttr(RES_HEADER);
+rDesc.GetMaster().ResetFormatAttr(RES_FOOTER);
+rDesc.GetLeft().ResetFormatAttr(RES_FOOTER);
+rDesc.GetFirstLeft().ResetFormatAttr(RES_FOOTER);
+
+auto lDelHFFormat = [this](SwClient* pToRemove, SwFrameFormat* 
pFormat)
+{
+// Code taken from lcl_DelHFFormat
+pFormat->Remove(pToRemove);
+SwFormatContent& rCnt = 
const_cast(pFormat->GetContent());
+if (rCnt.GetContentIdx())
+{
+   

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/uiwriter/uiwriter.cxx |4 -
 sw/qa/uitest/data/tdf46561.odt |binary
 sw/qa/uitest/writer_tests7/tdf46561.py |  105 +
 sw/source/core/doc/docdesc.cxx |   87 +--
 sw/source/core/layout/pagedesc.cxx |   27 +---
 5 files changed, 156 insertions(+), 67 deletions(-)

New commits:
commit 9b4b8c8cf0b17d8f217db3a8af56db192789bbd3
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Feb 22 16:59:38 2021 +0100
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 12:03:31 2021 +0200

tdf#46561 sw: fix lost undo stack setting header/footer

Changing 'shared' setting of left vs right or
first vs non-first page headers or footers removed
the whole undo stack.

Note: style changes before a 'shared' change
can still not be undone.

Co-authored-by: Attila Bakos (NISZ)

Change-Id: I6875bd0581869ffeb853911347dbc9f8c666214b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111635
Reviewed-by: László Németh 
Reviewed-by: Balazs Varga 
Tested-by: Balazs Varga 
(cherry picked from commit 8d8486f43c1a8a51157bfc3e0b87090b05a9229e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123973
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 702dc90636fd..f876e993db1f 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -2215,7 +2215,9 @@ void SwUiWriterTest::testTextCursorInvalidation()
 // this does not actually delete the header:
xPageStyle->setPropertyValue("HeaderIsOn", uno::makeAny(false));
 pWrtShell->ChangeHeaderOrFooter("Default Page Style", true, false, false);
 // must be disposed after deleting header
-CPPUNIT_ASSERT_THROW(xCursor->goRight(1, false), uno::RuntimeException);
+// cursor ends up in body
+// UPDATE: this behaviour has been corrected as a side effect of the fix 
to tdf#46561:
+//CPPUNIT_ASSERT_THROW(xCursor->goRight(1, false), uno::RuntimeException);
 }
 
 void SwUiWriterTest::testTdf68183()
diff --git a/sw/qa/uitest/data/tdf46561.odt b/sw/qa/uitest/data/tdf46561.odt
new file mode 100644
index ..c9f9942521d0
Binary files /dev/null and b/sw/qa/uitest/data/tdf46561.odt differ
diff --git a/sw/qa/uitest/writer_tests7/tdf46561.py 
b/sw/qa/uitest/writer_tests7/tdf46561.py
new file mode 100644
index ..235136524903
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf46561.py
@@ -0,0 +1,105 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import type_text
+import importlib
+import org.libreoffice.unotest
+import pathlib
+
+def get_url_for_data_file(file_name):
+return 
pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
+class tdf46561(UITestCase):
+def check_header_texts(self, master="", first="", left="", right=""):
+# Get the current header style and its text contents
+xPageStyle = self.document.getStyleFamilies().getByIndex(2)
+xHeaderText = xPageStyle.getByIndex(0).HeaderText.String
+xHeaderTextFirst = xPageStyle.getByIndex(0).HeaderTextFirst.String
+xHeaderTextLeft = xPageStyle.getByIndex(0).HeaderTextLeft.String
+xHeaderTextRight = xPageStyle.getByIndex(0).HeaderTextRight.String
+
+# Check the current values
+self.assertEqual(master, xHeaderText)
+self.assertEqual(first, xHeaderTextFirst)
+self.assertEqual(left, xHeaderTextLeft)
+self.assertEqual(right, xHeaderTextRight)
+
+def test_tdf46561(self):
+self.ui_test.load_file(get_url_for_data_file("tdf46561.odt"))
+self.document = self.ui_test.get_component()
+self.check_header_texts(master="right", first="1st", left="left", 
right="right")
+
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "2"}))
+self.xUITest.executeCommand(".uno:JumpToHeader")
+
+# Switch "same left and right page headers" on and off a few times
+for _ in range(4):
+self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+PageDialog = self.xUITest.getTopFocusWindow();
+
+xTabs = PageDialog.getChild(&quo

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/inc sw/qa sw/source

2021-10-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/inc/pagedesc.hxx |   17 +
 sw/qa/uitest/data/tdf140117.fodt|   95 
 sw/qa/uitest/writer_tests7/tdf140117.py |   70 +++
 sw/source/core/doc/docdesc.cxx  |   70 ++-
 sw/source/core/layout/pagedesc.cxx  |   73 
 5 files changed, 311 insertions(+), 14 deletions(-)

New commits:
commit 2ede6c34ad39569570521ac2fdbae6c722ba096b
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Jan 26 13:11:42 2021 +0100
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 11:52:46 2021 +0200

tdf#140117 sw UI: keep headers/footers when inactive

Custom left page and first headers (and footers) used to disappear
forever if hidden temporarily by checking the "Same content on left
and right pages" or "Same content on first page" options, respectively.
This commit stashes the endangered headers (footers) in SwPageDesc
and restores them on demand.

Change-Id: I1f6b605e2bd19af18726de1b825721487d29b4eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110398
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit f5dc6b11d2218d94c9effe7a1ab418d0133da5e3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123971
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 44bb7ee33b52..5e561623da69 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -148,6 +148,17 @@ class SW_DLLPUBLIC SwPageDesc
 // FIXME epicycles growing here - page margins need to be stored 
differently
 SwFrameFormatm_FirstMaster;
 SwFrameFormatm_FirstLeft;
+
+struct StashedPageDesc
+{
+std::shared_ptr m_pStashedFirst;
+std::shared_ptr m_pStashedLeft;
+std::shared_ptr m_pStashedFirstLeft;
+};
+
+mutable StashedPageDesc m_aStashedHeader;
+mutable StashedPageDesc m_aStashedFooter;
+
 sw::WriterMultiListener m_aDepends; ///< Because of grid alignment 
(Registerhaltigkeit).
 mutable const SwTextFormatColl* m_pTextFormatColl;
 SwPageDesc *m_pFollow;
@@ -206,6 +217,12 @@ public:
 bool IsHidden() const { return m_IsHidden; }
 void SetHidden(bool const bValue) { m_IsHidden = bValue; }
 
+/// Remember original header/footer formats even when they are hidden by 
"sharing".
+void StashFrameFormat(const SwFrameFormat& rFormat, bool bHeader, bool 
bLeft, bool bFirst);
+
+/// Used to restore hidden header/footer formats.
+const SwFrameFormat* GetStashedFrameFormat(bool bHeader, bool bLeft, bool 
bFirst) const;
+
 /// Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is 
not modified.
 inline void  SetUseOn( UseOnPage eNew );
 inline UseOnPage GetUseOn() const;
diff --git a/sw/qa/uitest/data/tdf140117.fodt b/sw/qa/uitest/data/tdf140117.fodt
new file mode 100644
index ..8487346d1d5c
--- /dev/null
+++ b/sw/qa/uitest/data/tdf140117.fodt
@@ -0,0 +1,95 @@
+
+http://www.w3.org/TR/css3-text/; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#; 
xmlns:xhtml="http://www.w3.org/1999/xhtml; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:xforms="http://www.w3.org/2002/xforms; 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:drawooo="http://openoffice.org/2010/draw; 
xmlns:math="http://www.w3.org/1998/Math/MathML; 
xmlns:tableooo="http://openoffice.org/2009/table; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:oooc="http://openoffice.org/2004/calc; 
xmlns:ooow="http://openoffice.org/200
 4/writer" 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:x

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa sw/source

2021-10-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf69635.docx   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx|5 +
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx|   56 +++
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |   22 +++---
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |6 -
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx |2 
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx |   12 +--
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |2 
 sw/source/filter/ww8/docxexport.cxx   |9 +-
 sw/source/filter/ww8/docxexport.hxx   |3 
 sw/source/filter/ww8/rtfexport.cxx|   10 +-
 sw/source/filter/ww8/rtfexport.hxx|6 +
 sw/source/filter/ww8/wrtw8sty.cxx |   95 +++---
 sw/source/filter/ww8/wrtww8.hxx   |8 +-
 14 files changed, 189 insertions(+), 47 deletions(-)

New commits:
commit d9caf9814696c747e4b0277bc7377ba09aead334
Author: Daniel Arato (NISZ) 
AuthorDate: Fri Feb 5 12:07:48 2021 +0100
Commit: Tünde Tóth 
CommitDate: Thu Oct 21 11:42:19 2021 +0200

tdf#69635 DOCX: export hidden (shared) headers/footers

Exporting to .docx used to lose all header and footer
content that was not visible in the document at the
moment of saving. This commit forces the DocxExport
class to output all headers and footers even when
the "Same content on left and right pages" option
is turned on.

Change-Id: I6a52f216f1e1b386d887ec614198766670b5bce3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113158
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 88e6a1bfeac86e0c89d2ff08c908c2b5ae061177)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123970
Tested-by: Tünde Tóth 
Reviewed-by: Tünde Tóth 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf69635.docx 
b/sw/qa/extras/ooxmlexport/data/tdf69635.docx
new file mode 100644
index ..94cced4d2ae4
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf69635.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index a740b6295999..2ee47d611adf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -671,7 +671,12 @@ 
DECLARE_OOXMLEXPORT_TEST(testTdf130167_spilloverHeaderShape, "testTdf130167_spil
 uno::Reference xNameAccess(
 xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY);
 // graphics from discarded headers were being added to the text body. 
Reduced from 5 to 2 shapes overall.
+<<<<<<< HEAD   (7b6bf0 tdf#142128 sw: set author-color strikethrough for 
AS_CHAR im)
 CPPUNIT_ASSERT(xNameAccess->getCount() < 4);
+===
+// CPPUNIT_ASSERT(xNameAccess->getCount() <= 4); -> What about hidden 
headers?
+CPPUNIT_ASSERT_LESS(sal_Int32(9), xNameAccess->getCount());
+>>>>>>> CHANGE (88e6a1 tdf#69635 DOCX: export hidden (shared) headers/footers)
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf124986, "tdf124986.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 7e890145210d..a20c8bfb9fe3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -50,6 +50,62 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, 
"tdf138892_noNumbering.docx"
 CPPUNIT_ASSERT_MESSAGE("Para3: ", 
getProperty(getParagraph(3), "NumberingStyleName").isEmpty());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf141231_arabicHebrewNumbering, 
"tdf141231_arabicHebrewNumbering.docx")
+{
+// The page's numbering type: instead of Hebrew, this was default 
style::NumberingType::ARABIC (4).
+auto nActual = 
getProperty(getStyles("PageStyles")->getByName("Standard"), 
"NumberingType");
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_HEBREW, nActual);
+
+// The footnote numbering type: instead of arabicAbjad, this was the 
default style::NumberingType::ARABIC.
+uno::Reference xFootnotesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xFootnoteSettings = 
xFootnotesSupplier->getFootnoteSettings();
+nActual = 
getProperty(xFootnotesSupplier->getFootnoteSettings(), 
"NumberingType");
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::CHARS_ARABIC_ABJAD, nActual);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testGutterLeft, "gutter-left.docx")
+{
+uno::Reference xPageStyle;
+getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
+sal_Int32 nGutterMargin{};
+xPageStyle->getPropertyValue("GutterMargin") >>= nGutterMargin;
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1270
+// - Actual  : 0
+// 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/qa sw/source

2021-10-04 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/layout/data/tdf141220.docx |binary
 sw/qa/extras/layout/layout2.cxx |   12 
 sw/source/core/draw/dcontact.cxx|6 +++---
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 7163450024000c01d2454aa7aad7f15a425f7ff2
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Sep 27 12:49:57 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Oct 4 13:44:19 2021 +0200

tdf#141220 sw: fix textbox popped out of off-page shape

When you moved it downwards off the page it was anchored to,
the textbox inside a shape used to appear exactly one page above
the shape it was supposed to follow. This is hopefully fixed by
the present commit.

Regression from c9eb53f200225f2ee6ca695e1326843a487aee51
(tdf#135198 sw editing: text box fell out of its shape).

Change-Id: Ib388292ca26444daa1900417347824059ee03f07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122687
Reviewed-by: László Németh 
Reviewed-by: Balazs Varga 
Tested-by: Balazs Varga 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123040
Tested-by: Jenkins

diff --git a/sw/qa/extras/layout/data/tdf141220.docx 
b/sw/qa/extras/layout/data/tdf141220.docx
new file mode 100644
index ..a65bdd4b8a51
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf141220.docx differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 1db5f1e69214..3586afe23d3d 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -1445,6 +1445,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127118)
 assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[1]/cell[1]/txt[1]", 
"WritingMode", "VertBTLR");
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf141220)
+{
+createSwDoc(DATA_DIRECTORY, "tdf141220.docx");
+
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nShapeTop
+= getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", 
"top").toInt32();
+sal_Int32 nTextBoxTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", 
"top").toInt32();
+// Make sure the textbox stays inside the shape.
+CPPUNIT_ASSERT_LESS(static_cast(15), nTextBoxTop - nShapeTop);
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf121509)
 {
 auto pDoc = createSwDoc(DATA_DIRECTORY, "Tdf121509.odt");
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 1f0632850ad2..d2554e0ab5ae 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1337,7 +1337,6 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 }
 
 // tdf#135198: keep text box together with its shape
-SwRect aObjRect(rObj.GetSnapRect());
 const SwPageFrame* rPageFrame = pAnchoredDrawObj->GetPageFrame();
 if (rPageFrame && rPageFrame->isFrameAreaPositionValid())
 {
@@ -1352,10 +1351,11 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 
 SfxItemSet aSyncSet(pDoc->GetAttrPool(),
 svl::Items{});
-aSyncSet.Put(SwFormatVertOrient(aObjRect.Top() - 
rPageFrame->getFrameArea().Top(),
+bool bRelToTableCell(false);
+
aSyncSet.Put(SwFormatVertOrient(pAnchoredDrawObj->GetRelPosToPageFrame(false, 
bRelToTableCell).getY(),
 text::VertOrientation::NONE,
 
text::RelOrientation::PAGE_FRAME));
-aSyncSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_PAGE, 
pAnchoredDrawObj->GetPageFrame()->GetPhyPageNum()));
+aSyncSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_PAGE, 
rPageFrame->GetPhyPageNum()));
 
 SwTextBoxHelper::syncFlyFrameAttr(*GetFormat(), aSyncSet);
 


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

2021-10-01 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/layout/data/tdf141220.docx |binary
 sw/qa/extras/layout/layout2.cxx |   12 
 sw/source/core/draw/dcontact.cxx|6 +++---
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 8da3586cff9cc11cf5db985d19851f21f0d42eb8
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Sep 27 12:49:57 2021 +0200
Commit: Balazs Varga 
CommitDate: Fri Oct 1 12:30:52 2021 +0200

tdf#141220 sw: fix textbox popped out of off-page shape

When you moved it downwards off the page it was anchored to,
the textbox inside a shape used to appear exactly one page above
the shape it was supposed to follow. This is hopefully fixed by
the present commit.

Regression from c9eb53f200225f2ee6ca695e1326843a487aee51
(tdf#135198 sw editing: text box fell out of its shape).

Change-Id: Ib388292ca26444daa1900417347824059ee03f07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122687
Reviewed-by: László Németh 
Reviewed-by: Balazs Varga 
Tested-by: Balazs Varga 

diff --git a/sw/qa/extras/layout/data/tdf141220.docx 
b/sw/qa/extras/layout/data/tdf141220.docx
new file mode 100644
index ..a65bdd4b8a51
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf141220.docx differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 91cb32016942..8c2624b1a389 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -1419,6 +1419,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127118)
 assertXPath(pXmlDoc, "/root/page[2]/body/tab/row[1]/cell[1]/txt[1]", 
"WritingMode", "VertBTLR");
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf141220)
+{
+createSwDoc(DATA_DIRECTORY, "tdf141220.docx");
+
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nShapeTop
+= getXPath(pXmlDoc, "//anchored/SwAnchoredDrawObject/bounds", 
"top").toInt32();
+sal_Int32 nTextBoxTop = getXPath(pXmlDoc, "//anchored/fly/infos/bounds", 
"top").toInt32();
+// Make sure the textbox stays inside the shape.
+CPPUNIT_ASSERT_LESS(static_cast(15), nTextBoxTop - nShapeTop);
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf121509)
 {
 auto pDoc = createSwDoc(DATA_DIRECTORY, "Tdf121509.odt");
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 7cd60ce197d0..762b27251cbe 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1342,7 +1342,6 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 }
 
 // tdf#135198: keep text box together with its shape
-SwRect aObjRect(rObj.GetSnapRect());
 const SwPageFrame* rPageFrame = pAnchoredDrawObj->GetPageFrame();
 if (rPageFrame && rPageFrame->isFrameAreaPositionValid() && 
!rObj.getChildrenOfSdrObject())
 {
@@ -1359,10 +1358,11 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 pDoc->GetAttrPool(),
 svl::Items);
 aSyncSet.Put(GetFormat()->GetHoriOrient());
-aSyncSet.Put(SwFormatVertOrient(aObjRect.Top() - 
rPageFrame->getFrameArea().Top(),
+bool bRelToTableCell(false);
+
aSyncSet.Put(SwFormatVertOrient(pAnchoredDrawObj->GetRelPosToPageFrame(false, 
bRelToTableCell).getY(),
 text::VertOrientation::NONE,
 
text::RelOrientation::PAGE_FRAME));
-aSyncSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_PAGE, 
pAnchoredDrawObj->GetPageFrame()->GetPhyPageNum()));
+aSyncSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_PAGE, 
rPageFrame->GetPhyPageNum()));
 
 auto pSdrObj = const_cast();
 if (pSdrObj != GetFormat()->FindRealSdrObject())


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2-2' - sc/qa sc/source

2021-09-28 Thread Daniel Arato (NISZ) (via logerrit)
 sc/qa/unit/data/ods/header-footer-content.ods |binary
 sc/qa/unit/subsequent_export-test2.cxx|   36 ++
 sc/source/filter/xml/XMLTableMasterPageExport.cxx |2 -
 3 files changed, 37 insertions(+), 1 deletion(-)

New commits:
commit f75ec59c9a77065d4a39a4b433b139cabe1405e1
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Sep 22 15:03:48 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Sep 29 07:38:33 2021 +0200

tdf#144184 sc: fix first page footer export

Due to a typical case of copy-paste oversight LO Calc used to lose
the first page footer when exporting to ODS. With the typo fixed,
the export now works again.

Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
"tdf#121715 XLSX: support custom first page header/footer".

Change-Id: If8f5ab4ff9a9392768789b886218d1d9c56ddbae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122455
Tested-by: László Németh 
Reviewed-by: László Németh 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122764
Tested-by: Jenkins
(cherry picked from commit ccd1393611ff7ea71d2dc5d75b0c27a4794ebdbb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122742
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/sc/qa/unit/data/ods/header-footer-content.ods 
b/sc/qa/unit/data/ods/header-footer-content.ods
new file mode 100644
index ..f365748ddc22
Binary files /dev/null and b/sc/qa/unit/data/ods/header-footer-content.ods 
differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index 77e4bc37673e..f3bf709500b4 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -82,6 +82,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -125,6 +126,7 @@ public:
 void testRefStringConfigXLSX();
 void testRefStringUnspecified();
 void testHeaderImageODS();
+void testHeaderFooterContentODS();
 
 void testTdf88657ODS();
 void testTdf41722();
@@ -227,6 +229,7 @@ public:
 CPPUNIT_TEST(testRefStringConfigXLSX);
 CPPUNIT_TEST(testRefStringUnspecified);
 CPPUNIT_TEST(testHeaderImageODS);
+CPPUNIT_TEST(testHeaderFooterContentODS);
 
 CPPUNIT_TEST(testTdf88657ODS);
 CPPUNIT_TEST(testTdf41722);
@@ -474,6 +477,39 @@ void ScExportTest2::testHeaderImageODS()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testHeaderFooterContentODS()
+{
+ScDocShellRef xShell = loadDoc(u"header-footer-content.", FORMAT_ODS);
+ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_ODS);
+uno::Reference 
xStyleFamiliesSupplier(xDocSh->GetModel(),
+ 
uno::UNO_QUERY);
+uno::Reference xStyleFamilies
+= xStyleFamiliesSupplier->getStyleFamilies();
+uno::Reference 
xPageStyles(xStyleFamilies->getByName("PageStyles"),
+   uno::UNO_QUERY);
+uno::Reference 
xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+
+uno::Reference xContent;
+xStyle->getPropertyValue("RightPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("RightPageFooterContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("footer"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageFooterContent") >>= xContent;
+// First page footer content used to be lost upon export.
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page footer"), 
xContent->getCenterText()->getString());
+
+xDocSh->DoClose();
+}
+
 void ScExportTest2::testTextDirectionXLSX()
 {
 ScDocShellRef xDocSh = loadDoc(u"writingMode.", FORMAT_XLSX);
diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx 
b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
index bf43b2c29fb2..59b29378ea16 100644
--- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx
+++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
@@ -187,7 +187,7 @@ void XMLTableMasterPageExport::exportMasterPageContent(
 
 bool bFirstFooter = (!::cppu::any2bool(rPropSet->getPropertyValue( 
SC_UNO_PAGE_FIRSTFTRSHARED )) && bFooter);
 
-exportHeaderFooter( xFooterLeft, XML_FOOTER_FIRST, bFirstFooter );
+exportHeaderFooter( xFooterFirst, XML_FOOTER_FIRST, bFirstFooter );
 }
 }
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/qa sc/source

2021-09-28 Thread Daniel Arato (NISZ) (via logerrit)
 sc/qa/unit/data/ods/header-footer-content.ods |binary
 sc/qa/unit/subsequent_export-test2.cxx|   36 ++
 sc/source/filter/xml/XMLTableMasterPageExport.cxx |2 -
 3 files changed, 37 insertions(+), 1 deletion(-)

New commits:
commit ccd1393611ff7ea71d2dc5d75b0c27a4794ebdbb
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Sep 22 15:03:48 2021 +0200
Commit: Michael Stahl 
CommitDate: Tue Sep 28 14:18:50 2021 +0200

tdf#144184 sc: fix first page footer export

Due to a typical case of copy-paste oversight LO Calc used to lose
the first page footer when exporting to ODS. With the typo fixed,
the export now works again.

Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
"tdf#121715 XLSX: support custom first page header/footer".

Change-Id: If8f5ab4ff9a9392768789b886218d1d9c56ddbae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122455
Tested-by: László Németh 
Reviewed-by: László Németh 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122764
Tested-by: Jenkins

diff --git a/sc/qa/unit/data/ods/header-footer-content.ods 
b/sc/qa/unit/data/ods/header-footer-content.ods
new file mode 100644
index ..f365748ddc22
Binary files /dev/null and b/sc/qa/unit/data/ods/header-footer-content.ods 
differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index dde758e2bd5b..dc72c46aebf4 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -82,6 +82,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -125,6 +126,7 @@ public:
 void testRefStringConfigXLSX();
 void testRefStringUnspecified();
 void testHeaderImageODS();
+void testHeaderFooterContentODS();
 
 void testTdf88657ODS();
 void testTdf41722();
@@ -227,6 +229,7 @@ public:
 CPPUNIT_TEST(testRefStringConfigXLSX);
 CPPUNIT_TEST(testRefStringUnspecified);
 CPPUNIT_TEST(testHeaderImageODS);
+CPPUNIT_TEST(testHeaderFooterContentODS);
 
 CPPUNIT_TEST(testTdf88657ODS);
 CPPUNIT_TEST(testTdf41722);
@@ -474,6 +477,39 @@ void ScExportTest2::testHeaderImageODS()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testHeaderFooterContentODS()
+{
+ScDocShellRef xShell = loadDoc(u"header-footer-content.", FORMAT_ODS);
+ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_ODS);
+uno::Reference 
xStyleFamiliesSupplier(xDocSh->GetModel(),
+ 
uno::UNO_QUERY);
+uno::Reference xStyleFamilies
+= xStyleFamiliesSupplier->getStyleFamilies();
+uno::Reference 
xPageStyles(xStyleFamilies->getByName("PageStyles"),
+   uno::UNO_QUERY);
+uno::Reference 
xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+
+uno::Reference xContent;
+xStyle->getPropertyValue("RightPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("RightPageFooterContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("footer"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageFooterContent") >>= xContent;
+// First page footer content used to be lost upon export.
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page footer"), 
xContent->getCenterText()->getString());
+
+xDocSh->DoClose();
+}
+
 void ScExportTest2::testTextDirectionXLSX()
 {
 ScDocShellRef xDocSh = loadDoc(u"writingMode.", FORMAT_XLSX);
diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx 
b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
index bf43b2c29fb2..59b29378ea16 100644
--- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx
+++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
@@ -187,7 +187,7 @@ void XMLTableMasterPageExport::exportMasterPageContent(
 
 bool bFirstFooter = (!::cppu::any2bool(rPropSet->getPropertyValue( 
SC_UNO_PAGE_FIRSTFTRSHARED )) && bFooter);
 
-exportHeaderFooter( xFooterLeft, XML_FOOTER_FIRST, bFirstFooter );
+exportHeaderFooter( xFooterFirst, XML_FOOTER_FIRST, bFirstFooter );
 }
 }
 


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

2021-09-28 Thread Daniel Arato (NISZ) (via logerrit)
 sc/qa/unit/data/ods/header-footer-content.ods |binary
 sc/qa/unit/subsequent_export_test2.cxx|   36 ++
 sc/source/filter/xml/XMLTableMasterPageExport.cxx |2 -
 3 files changed, 37 insertions(+), 1 deletion(-)

New commits:
commit 6f04952e6828cf1419b991e82070514bae24896c
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Sep 22 15:03:48 2021 +0200
Commit: László Németh 
CommitDate: Tue Sep 28 11:32:53 2021 +0200

tdf#144184 sc: fix first page footer export

Due to a typical case of copy-paste oversight LO Calc used to lose
the first page footer when exporting to ODS. With the typo fixed,
the export now works again.

Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
"tdf#121715 XLSX: support custom first page header/footer".

Change-Id: If8f5ab4ff9a9392768789b886218d1d9c56ddbae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122455
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sc/qa/unit/data/ods/header-footer-content.ods 
b/sc/qa/unit/data/ods/header-footer-content.ods
new file mode 100644
index ..f365748ddc22
Binary files /dev/null and b/sc/qa/unit/data/ods/header-footer-content.ods 
differ
diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index 41a25d2c0312..10743521d31c 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -83,6 +83,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -126,6 +127,7 @@ public:
 void testRefStringConfigXLSX();
 void testRefStringUnspecified();
 void testHeaderImageODS();
+void testHeaderFooterContentODS();
 
 void testTdf88657ODS();
 void testTdf41722();
@@ -233,6 +235,7 @@ public:
 CPPUNIT_TEST(testRefStringConfigXLSX);
 CPPUNIT_TEST(testRefStringUnspecified);
 CPPUNIT_TEST(testHeaderImageODS);
+CPPUNIT_TEST(testHeaderFooterContentODS);
 
 CPPUNIT_TEST(testTdf88657ODS);
 CPPUNIT_TEST(testTdf41722);
@@ -485,6 +488,39 @@ void ScExportTest2::testHeaderImageODS()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testHeaderFooterContentODS()
+{
+ScDocShellRef xShell = loadDoc(u"header-footer-content.", FORMAT_ODS);
+ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_ODS);
+uno::Reference 
xStyleFamiliesSupplier(xDocSh->GetModel(),
+ 
uno::UNO_QUERY);
+uno::Reference xStyleFamilies
+= xStyleFamiliesSupplier->getStyleFamilies();
+uno::Reference 
xPageStyles(xStyleFamilies->getByName("PageStyles"),
+   uno::UNO_QUERY);
+uno::Reference 
xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+
+uno::Reference xContent;
+xStyle->getPropertyValue("RightPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("RightPageFooterContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("footer"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageFooterContent") >>= xContent;
+// First page footer content used to be lost upon export.
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page footer"), 
xContent->getCenterText()->getString());
+
+xDocSh->DoClose();
+}
+
 void ScExportTest2::testTextDirectionXLSX()
 {
 ScDocShellRef xDocSh = loadDoc(u"writingMode.", FORMAT_XLSX);
diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx 
b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
index bf43b2c29fb2..59b29378ea16 100644
--- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx
+++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
@@ -187,7 +187,7 @@ void XMLTableMasterPageExport::exportMasterPageContent(
 
 bool bFirstFooter = (!::cppu::any2bool(rPropSet->getPropertyValue( 
SC_UNO_PAGE_FIRSTFTRSHARED )) && bFooter);
 
-exportHeaderFooter( xFooterLeft, XML_FOOTER_FIRST, bFirstFooter );
+exportHeaderFooter( xFooterFirst, XML_FOOTER_FIRST, bFirstFooter );
 }
 }
 


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

2021-09-21 Thread Daniel Arato (NISZ) (via logerrit)
 oox/qa/unit/data/tdf142602_CustomShapeArrows.odt |binary
 oox/qa/unit/export.cxx   |  190 
 oox/source/export/DMLPresetShapeExport.cxx   |  352 +--
 3 files changed, 516 insertions(+), 26 deletions(-)

New commits:
commit 504808fb5c372a94c6299eec90a281655eef47e4
Author: Daniel Arato (NISZ) 
AuthorDate: Fri Sep 10 13:51:24 2021 +0200
Commit: László Németh 
CommitDate: Tue Sep 21 13:26:54 2021 +0200

tdf#142602 DOCX: export adjustment points of custom shape arrows

When exporting custom shape arrows LO used to fall back to writing
out their plain vertex coordinates, losing the customizability of
the shape after loading from file. This commit changes the export
of some of the most commonly used arrow custom shapes to proper
adjustment value export.

Follow-up to commit 63cd67e5e18f01aca303131e148c80398a181a41
"tdf#92525 tdf#142398: fix export of simple custom shapes".

Change-Id: If248556764bdb7e00cfde4ebe5b32bb380b1fa19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121901
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/oox/qa/unit/data/tdf142602_CustomShapeArrows.odt 
b/oox/qa/unit/data/tdf142602_CustomShapeArrows.odt
new file mode 100644
index ..bc0357a1a867
Binary files /dev/null and b/oox/qa/unit/data/tdf142602_CustomShapeArrows.odt 
differ
diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx
index 0e597adb2854..b649d546ead9 100644
--- a/oox/qa/unit/export.cxx
+++ b/oox/qa/unit/export.cxx
@@ -154,6 +154,196 @@ CPPUNIT_TEST_FIXTURE(Test, testDmlGroupshapePolygon)
 assertXPath(pXmlDoc, "//wpg:grpSpPr/a:xfrm/a:chExt", "cx", "5328360");
 assertXPath(pXmlDoc, "//wps:spPr/a:xfrm/a:ext", "cx", "5328360");
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testCustomShapeArrowExport)
+{
+// Given a document with a few different kinds of arrow shapes in it:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf142602_CustomShapeArrows.odt";
+// When saving that to DOCX:
+loadAndSave(aURL, "Office Open XML Text");
+
+// Then the shapes should retain their correct control values.
+uno::Reference xNameAccess
+= packages::zip::ZipFileAccess::createWithURL(mxComponentContext, 
getTempFile().GetURL());
+uno::Reference 
xInputStream(xNameAccess->getByName("word/document.xml"),
+  uno::UNO_QUERY);
+std::unique_ptr 
pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
+xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+
+// Without the fix the output OOXML would have no  tags in it.
+
+// Right arrow
+assertXPath(pXmlDoc,
+
"//w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/"
+"a:graphicData/wps:wsp/wps:spPr/a:prstGeom",
+"prst", "rightArrow");
+assertXPath(pXmlDoc,
+
"//w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/"
+"a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]",
+"fmla", "val 5");
+assertXPath(pXmlDoc,
+
"//w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/"
+"a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]",
+"fmla", "val 46321");
+
+// Left arrow
+assertXPath(pXmlDoc,
+
"//w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/"
+"a:graphicData/wps:wsp/wps:spPr/a:prstGeom",
+"prst", "leftArrow");
+assertXPath(pXmlDoc,
+
"//w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/"
+"a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]",
+"fmla", "val 5");
+assertXPath(pXmlDoc,
+
"//w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/"
+"a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[2]",
+"fmla", "val 52939");
+
+// Down arrow
+assertXPath(pXmlDoc,
+
"//w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/a:graphic/"
+"a:graphicData/wps:wsp/wps:spPr/a:prstGeom",
+"prst", "downArrow");
+assertXPath(pXmlDoc,
+
"//w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/a:graphic/"
+"a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd[1]",
+"fmla", "va

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/qa sc/source

2021-09-01 Thread Daniel Arato (NISZ) (via logerrit)
 sc/qa/unit/data/xlsx/tdf142881.xlsx|binary
 sc/qa/unit/subsequent_export-test2.cxx |   37 +
 sc/source/filter/xcl97/xcl97rec.cxx|2 -
 3 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit 30128c2fea22ccd08678744c9501ab052a1fb074
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 30 14:13:52 2021 +0200
Commit: Xisco Fauli 
CommitDate: Wed Sep 1 11:31:53 2021 +0200

tdf#142881 XLSX import: fix shapes rotated exactly 45°,

135°, 225° and 315° by correcting their cell anchor points,
like MSO does. Previously the XLSX export with the bad
anchor points messed up the rotation of the shapes, resulting
also broken text content in LO and MSO.

Thanks to Regina Henschel for analyzing the problem.

Co-authored-by: Szabolcs Tóth 

Change-Id: Ica625545a22a74ed027ac0fa2bbf38804611c172
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121307
Tested-by: László Németh 
Reviewed-by: László Németh 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121407
Tested-by: Jenkins

diff --git a/sc/qa/unit/data/xlsx/tdf142881.xlsx 
b/sc/qa/unit/data/xlsx/tdf142881.xlsx
new file mode 100644
index ..a25dfec68551
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf142881.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index c467b19196aa..77e4bc37673e 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -153,6 +153,7 @@ public:
 void testTdf91634XLSX();
 void testTdf115159();
 void testTdf112567();
+void testTdf142881();
 void testTdf112567b();
 void testTdf123645XLSX();
 void testTdf125173XLSX();
@@ -254,6 +255,7 @@ public:
 CPPUNIT_TEST(testTdf91634XLSX);
 CPPUNIT_TEST(testTdf115159);
 CPPUNIT_TEST(testTdf112567);
+CPPUNIT_TEST(testTdf142881);
 CPPUNIT_TEST(testTdf112567b);
 CPPUNIT_TEST(testTdf123645XLSX);
 CPPUNIT_TEST(testTdf125173XLSX);
@@ -1365,6 +1367,41 @@ void ScExportTest2::testTdf112567()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testTdf142881()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf142881.", FORMAT_XLSX);
+CPPUNIT_ASSERT_MESSAGE("Failed to load tdf142881.xlsx", xDocSh.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX);
+xmlDocUniquePtr pDrawing1
+= XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/drawings/drawing1.xml");
+CPPUNIT_ASSERT(pDrawing1);
+
+// Verify that the shapes are rotated and positioned in the expected way
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:from/xdr:col", "11");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:from/xdr:row", "0");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:to/xdr:col", "12");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:to/xdr:row", "19");
+
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:from/xdr:col", "2");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:from/xdr:row", "8");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:to/xdr:col", "7");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:to/xdr:row", "10");
+
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:from/xdr:col", "10");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:from/xdr:row", "9");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:to/xdr:col", "11");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:to/xdr:row", "26");
+
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:from/xdr:col", "2");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:from/xdr:row", "17");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:to/xdr:col", "8");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:to/xdr:row", "19");
+
+xDocSh->DoClose();
+}
+
 void ScExportTest2::testTdf112567b()
 {
 // Set the system locale to Hungarian (a language with different range 
separator)
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 4cde52e362f1..b88604fb306d 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1108,7 +1108,7 @@ void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, 
const Re

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

2021-08-31 Thread Daniel Arato (NISZ) (via logerrit)
 sc/qa/unit/data/xlsx/tdf142881.xlsx|binary
 sc/qa/unit/subsequent_export-test2.cxx |   37 +
 sc/source/filter/xcl97/xcl97rec.cxx|2 -
 3 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit eae0636311d3a1b3a1af58a3e4df686b55afa3fa
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 30 14:13:52 2021 +0200
Commit: László Németh 
CommitDate: Tue Aug 31 13:56:38 2021 +0200

tdf#142881 XLSX import: fix shapes rotated exactly 45°,

135°, 225° and 315° by correcting their cell anchor points,
like MSO does. Previously the XLSX export with the bad
anchor points messed up the rotation of the shapes, resulting
also broken text content in LO and MSO.

Thanks to Regina Henschel for analyzing the problem.

Co-authored-by: Szabolcs Tóth 

Change-Id: Ica625545a22a74ed027ac0fa2bbf38804611c172
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121307
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sc/qa/unit/data/xlsx/tdf142881.xlsx 
b/sc/qa/unit/data/xlsx/tdf142881.xlsx
new file mode 100644
index ..a25dfec68551
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf142881.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index 36409864817b..a25babe59134 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -155,6 +155,7 @@ public:
 void testTdf115159();
 void testTdf112567();
 void testTdf122191();
+void testTdf142881();
 void testTdf112567b();
 void testTdf123645XLSX();
 void testTdf125173XLSX();
@@ -261,6 +262,7 @@ public:
 CPPUNIT_TEST(testTdf115159);
 CPPUNIT_TEST(testTdf112567);
 CPPUNIT_TEST(testTdf122191);
+CPPUNIT_TEST(testTdf142881);
 CPPUNIT_TEST(testTdf112567b);
 CPPUNIT_TEST(testTdf123645XLSX);
 CPPUNIT_TEST(testTdf125173XLSX);
@@ -1407,6 +1409,41 @@ void ScExportTest2::testTdf122191()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testTdf142881()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf142881.", FORMAT_XLSX);
+CPPUNIT_ASSERT_MESSAGE("Failed to load tdf142881.xlsx", xDocSh.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX);
+xmlDocUniquePtr pDrawing1
+= XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/drawings/drawing1.xml");
+CPPUNIT_ASSERT(pDrawing1);
+
+// Verify that the shapes are rotated and positioned in the expected way
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:from/xdr:col", "11");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:from/xdr:row", "0");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:to/xdr:col", "12");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:to/xdr:row", "19");
+
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:from/xdr:col", "2");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:from/xdr:row", "8");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:to/xdr:col", "7");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:to/xdr:row", "10");
+
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:from/xdr:col", "10");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:from/xdr:row", "9");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:to/xdr:col", "11");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:to/xdr:row", "26");
+
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:from/xdr:col", "2");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:from/xdr:row", "17");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:to/xdr:col", "8");
+assertXPathContent(pDrawing1, 
"/xdr:wsDr/xdr:twoCellAnchor[4]/xdr:to/xdr:row", "19");
+
+xDocSh->DoClose();
+}
+
 void ScExportTest2::testTdf112567b()
 {
 // Set the system locale to Hungarian (a language with different range 
separator)
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 3a05578f14e2..bdc3648d7584 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1120,7 +1120,7 @@ void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, 
const Reference< XShape >&
 // MSO changes the anchor positions at these angles and that does 
an extra 9

[Libreoffice-commits] core.git: sc/inc sc/qa sc/source sc/uiconfig sc/UIConfig_scalc.mk svx/source

2021-07-20 Thread Daniel Arato (NISZ) (via logerrit)
 sc/UIConfig_scalc.mk|4 
 sc/inc/scres.hrc|8 
 sc/qa/uitest/calc_tests9/tdf142763.py   |   69 +++
 sc/source/ui/attrdlg/scdlgfact.cxx  |   12 +
 sc/source/ui/inc/hfedtdlg.hxx   |   42 
 sc/source/ui/inc/scuitphfedit.hxx   |   14 +
 sc/source/ui/pagedlg/hfedtdlg.cxx   |   90 +-
 sc/source/ui/pagedlg/scuitphfedit.cxx   |   26 ++
 sc/source/ui/pagedlg/tphf.cxx   |   28 ++-
 sc/uiconfig/scalc/ui/footerdialog.ui|   46 +
 sc/uiconfig/scalc/ui/headerdialog.ui|   46 +
 sc/uiconfig/scalc/ui/sharedfirstfooterdialog.ui |  209 
 sc/uiconfig/scalc/ui/sharedfirstheaderdialog.ui |  209 
 sc/uiconfig/scalc/ui/sharedleftfooterdialog.ui  |  205 +++
 sc/uiconfig/scalc/ui/sharedleftheaderdialog.ui  |  205 +++
 svx/source/dialog/hdft.cxx  |   16 -
 16 files changed, 1202 insertions(+), 27 deletions(-)

New commits:
commit 6128e2d55f0d0c68d3c7f6fb69539ec800637947
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Jun 16 10:39:29 2021 +0200
Commit: László Németh 
CommitDate: Tue Jul 20 16:19:37 2021 +0200

tdf#142763 sc UI: add first page header/footer options

Add checkbox "Same content on first page" checkbox
(similar to the existing "Same content on left and right
pages) to the Page Style dialog window, on the Header
and Footer panes.

Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
(tdf#121715 XLSX: support custom first page header/footer)
and commit 52beb3907dd3c7e6ae112e263def1005272cecd8
(tdf#142764 sc: import "Same content on first/left page").

Note: to set different header or footer on the first page
of the spreadsheet, disable "Same content on first page"
on Format->Page Style...->Header (or Footer), and choose
the "Edit..." button.

Change-Id: I3348fde216424b8d2c662956eab27cbe5880fc1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117316
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index e19172e49bd3..c7ddfa38f88f 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -217,6 +217,10 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/selectsource \
sc/uiconfig/scalc/ui/sheetprintpage \
sc/uiconfig/scalc/ui/sharedocumentdlg \
+   sc/uiconfig/scalc/ui/sharedfirstfooterdialog \
+   sc/uiconfig/scalc/ui/sharedfirstheaderdialog \
+   sc/uiconfig/scalc/ui/sharedleftfooterdialog \
+   sc/uiconfig/scalc/ui/sharedleftheaderdialog \
sc/uiconfig/scalc/ui/sharedfooterdialog \
sc/uiconfig/scalc/ui/sharedheaderdialog \
sc/uiconfig/scalc/ui/sharedwarningdialog \
diff --git a/sc/inc/scres.hrc b/sc/inc/scres.hrc
index 57ac75843530..8089d41258f0 100644
--- a/sc/inc/scres.hrc
+++ b/sc/inc/scres.hrc
@@ -39,8 +39,12 @@
 #define RID_SCDLG_HFEDIT_RIGHTHEADER(SC_DIALOGS_START + 65)
 #define RID_SCDLG_HFEDIT_LEFTFOOTER (SC_DIALOGS_START + 66)
 #define RID_SCDLG_HFEDIT_RIGHTFOOTER(SC_DIALOGS_START + 67)
-#define RID_SCDLG_HFEDIT_HEADER (SC_DIALOGS_START + 68)
-#define RID_SCDLG_HFEDIT_FOOTER (SC_DIALOGS_START + 69)
+#define RID_SCDLG_HFEDIT_SHAREDFIRSTHEADER (SC_DIALOGS_START + 68)
+#define RID_SCDLG_HFEDIT_SHAREDLEFTHEADER  (SC_DIALOGS_START + 69)
+#define RID_SCDLG_HFEDIT_SHAREDFIRSTFOOTER (SC_DIALOGS_START + 70)
+#define RID_SCDLG_HFEDIT_SHAREDLEFTFOOTER  (SC_DIALOGS_START + 71)
+#define RID_SCDLG_HFEDIT_HEADER (SC_DIALOGS_START + 72)
+#define RID_SCDLG_HFEDIT_FOOTER (SC_DIALOGS_START + 73)
 
 #define WID_CONDFRMT_REF(SC_DIALOGS_START + 163)
 
diff --git a/sc/qa/uitest/calc_tests9/tdf142763.py 
b/sc/qa/uitest/calc_tests9/tdf142763.py
new file mode 100644
index ..5808dd1df624
--- /dev/null
+++ b/sc/qa/uitest/calc_tests9/tdf142763.py
@@ -0,0 +1,69 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, 
select_pos
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from libreoffice.calc.document import get_cell_by_position
+import time
+
+class Tdf142763(UITestCase):
+
+def test_tdf142763_header(self):
+with self.ui_test.create_doc_in_start_center("calc"):
+xCalcDoc = self.xUITest.getTopFocusWindow()
+gridwin = xCalcDoc.getChild("grid_window")
+  

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - 2 commits - cui/source sc/qa sc/source

2021-07-07 Thread Daniel Arato (NISZ) (via logerrit)
 cui/source/tabpages/numpages.cxx |8 ++--
 sc/qa/unit/data/ods/tdf142764.ods|binary
 sc/qa/unit/subsequent_export-test2.cxx   |   19 +++
 sc/source/filter/xml/XMLTableHeaderFooterContext.cxx |   12 +---
 4 files changed, 34 insertions(+), 5 deletions(-)

New commits:
commit 2de1b879b70535a6c1e7207b4be9271a54e2dfc9
Author: Daniel Arato (NISZ) 
AuthorDate: Thu Jun 24 15:01:54 2021 +0200
Commit: Xisco Fauli 
CommitDate: Wed Jul 7 21:58:25 2021 +0200

tdf#142764 sc: import "Same content on first/left page"

Different header of the first page was never imported
(related to the missing UI support), despite its working
ODF export.

This commit sets the values of those options at ODS file load
according to the "display" attribute used to hide or show
a particular header/footer.

Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
"tdf#121715 XLSX: support custom first page header/footer".

Change-Id: I3409ad94a4d3ff86fd7f6d8afede3e7603024515
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117788
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 52beb3907dd3c7e6ae112e263def1005272cecd8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118501
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/data/ods/tdf142764.ods 
b/sc/qa/unit/data/ods/tdf142764.ods
new file mode 100644
index ..bbc4355dab32
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf142764.ods differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index 1c088c813f21..47a50a3d8ee6 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -142,6 +142,7 @@ public:
 void testPivotCacheAfterExportXLSX();
 void testTdf114969XLSX();
 void testTdf115192XLSX();
+void testTdf142764();
 void testTdf91634XLSX();
 void testTdf115159();
 void testTdf112567();
@@ -237,6 +238,7 @@ public:
 CPPUNIT_TEST(testPivotCacheAfterExportXLSX);
 CPPUNIT_TEST(testTdf114969XLSX);
 CPPUNIT_TEST(testTdf115192XLSX);
+CPPUNIT_TEST(testTdf142764);
 CPPUNIT_TEST(testTdf91634XLSX);
 CPPUNIT_TEST(testTdf115159);
 CPPUNIT_TEST(testTdf112567);
@@ -1211,6 +1213,23 @@ void ScExportTest2::testTdf115192XLSX()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testTdf142764()
+{
+ScDocShellRef xShell = loadDoc(u"tdf142764.", FORMAT_ODS);
+CPPUNIT_ASSERT(xShell);
+
+auto pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
+
+xmlDocUniquePtr pSheet
+= XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/worksheets/sheet1.xml");
+CPPUNIT_ASSERT(pSheet);
+
+assertXPath(pSheet, "/x:worksheet/x:headerFooter", "differentOddEven", 
"true");
+assertXPath(pSheet, "/x:worksheet/x:headerFooter", "differentFirst", 
"true");
+
+xShell->DoClose();
+}
+
 void ScExportTest2::testTdf91634XLSX()
 {
 ScDocShellRef xDocSh = loadDoc(u"image_hyperlink.", FORMAT_XLSX);
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx 
b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
index a34015a999cf..c0b5c6eb6cc1 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
@@ -53,6 +53,7 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( 
SvXMLImport& rImport,
 OUString sContentLeft( bFooter ? OUString(SC_UNO_PAGE_LEFTFTRCONT) : 
OUString(SC_UNO_PAGE_LEFTHDRCONT) );
 OUString sContentFirst( bFooter ? OUString(SC_UNO_PAGE_FIRSTFTRCONT) : 
OUString(SC_UNO_PAGE_FIRSTHDRCONT) );
 OUString sShareContent( bFooter ? OUString(SC_UNO_PAGE_FTRSHARED) : 
OUString(SC_UNO_PAGE_HDRSHARED) );
+OUString sShareFirstContent( bFooter ? 
OUString(SC_UNO_PAGE_FIRSTFTRSHARED) : OUString(SC_UNO_PAGE_FIRSTHDRSHARED) );
 bool bDisplay( true );
 for( auto  : sax_fastparser::castToFastAttributeList( xAttrList ) )
 {
@@ -61,10 +62,9 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( 
SvXMLImport& rImport,
 else
 XMLOFF_WARN_UNKNOWN("sc", aIter);
 }
+bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn )));
 if( bLeft )
 {
-bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn )));
-
 if( bOn && bDisplay )
 {
 if( ::cppu::any2bool(xPropSet->getPropertyValue( sShareContent )) )
@@ -80,16 +80,22 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( 
SvXMLImport& rImport,
 }
 else
 {
-bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn )));
 if ( bOn != bDisplay )
 xPropSet->s

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

2021-07-07 Thread Daniel Arato (NISZ) (via logerrit)
 sc/qa/unit/data/ods/tdf142764.ods|binary
 sc/qa/unit/subsequent_export-test2.cxx   |   19 +++
 sc/source/filter/xml/XMLTableHeaderFooterContext.cxx |   12 +---
 3 files changed, 28 insertions(+), 3 deletions(-)

New commits:
commit 52beb3907dd3c7e6ae112e263def1005272cecd8
Author: Daniel Arato (NISZ) 
AuthorDate: Thu Jun 24 15:01:54 2021 +0200
Commit: László Németh 
CommitDate: Wed Jul 7 15:27:43 2021 +0200

tdf#142764 sc: import "Same content on first/left page"

Different header of the first page was never imported
(related to the missing UI support), despite its working
ODF export.

This commit sets the values of those options at ODS file load
according to the "display" attribute used to hide or show
a particular header/footer.

Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
"tdf#121715 XLSX: support custom first page header/footer".

Change-Id: I3409ad94a4d3ff86fd7f6d8afede3e7603024515
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117788
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sc/qa/unit/data/ods/tdf142764.ods 
b/sc/qa/unit/data/ods/tdf142764.ods
new file mode 100644
index ..bbc4355dab32
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf142764.ods differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index ad08aa2802d0..0a44090734ab 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -142,6 +142,7 @@ public:
 void testPivotCacheAfterExportXLSX();
 void testTdf114969XLSX();
 void testTdf115192XLSX();
+void testTdf142764();
 void testTdf91634XLSX();
 void testTdf115159();
 void testTdf112567();
@@ -240,6 +241,7 @@ public:
 CPPUNIT_TEST(testPivotCacheAfterExportXLSX);
 CPPUNIT_TEST(testTdf114969XLSX);
 CPPUNIT_TEST(testTdf115192XLSX);
+CPPUNIT_TEST(testTdf142764);
 CPPUNIT_TEST(testTdf91634XLSX);
 CPPUNIT_TEST(testTdf115159);
 CPPUNIT_TEST(testTdf112567);
@@ -1217,6 +1219,23 @@ void ScExportTest2::testTdf115192XLSX()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testTdf142764()
+{
+ScDocShellRef xShell = loadDoc(u"tdf142764.", FORMAT_ODS);
+CPPUNIT_ASSERT(xShell);
+
+auto pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
+
+xmlDocUniquePtr pSheet
+= XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/worksheets/sheet1.xml");
+CPPUNIT_ASSERT(pSheet);
+
+assertXPath(pSheet, "/x:worksheet/x:headerFooter", "differentOddEven", 
"true");
+assertXPath(pSheet, "/x:worksheet/x:headerFooter", "differentFirst", 
"true");
+
+xShell->DoClose();
+}
+
 void ScExportTest2::testTdf91634XLSX()
 {
 ScDocShellRef xDocSh = loadDoc(u"image_hyperlink.", FORMAT_XLSX);
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx 
b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
index a34015a999cf..c0b5c6eb6cc1 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
@@ -53,6 +53,7 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( 
SvXMLImport& rImport,
 OUString sContentLeft( bFooter ? OUString(SC_UNO_PAGE_LEFTFTRCONT) : 
OUString(SC_UNO_PAGE_LEFTHDRCONT) );
 OUString sContentFirst( bFooter ? OUString(SC_UNO_PAGE_FIRSTFTRCONT) : 
OUString(SC_UNO_PAGE_FIRSTHDRCONT) );
 OUString sShareContent( bFooter ? OUString(SC_UNO_PAGE_FTRSHARED) : 
OUString(SC_UNO_PAGE_HDRSHARED) );
+OUString sShareFirstContent( bFooter ? 
OUString(SC_UNO_PAGE_FIRSTFTRSHARED) : OUString(SC_UNO_PAGE_FIRSTHDRSHARED) );
 bool bDisplay( true );
 for( auto  : sax_fastparser::castToFastAttributeList( xAttrList ) )
 {
@@ -61,10 +62,9 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( 
SvXMLImport& rImport,
 else
 XMLOFF_WARN_UNKNOWN("sc", aIter);
 }
+bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn )));
 if( bLeft )
 {
-bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn )));
-
 if( bOn && bDisplay )
 {
 if( ::cppu::any2bool(xPropSet->getPropertyValue( sShareContent )) )
@@ -80,16 +80,22 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( 
SvXMLImport& rImport,
 }
 else
 {
-bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn )));
 if ( bOn != bDisplay )
 xPropSet->setPropertyValue( sOn, uno::makeAny(bDisplay) );
 }
 if (bLeft)
+{
 sCont = sContentLeft;
+}
 else if (bFirst)
+{
 sCont = sContentFirst;
+xPropSet->setProperty

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - oox/source reportdesign/source sc/inc sc/qa sc/source

2021-06-29 Thread Daniel Arato (NISZ) (via logerrit)
 oox/source/token/properties.txt  |4 +
 reportdesign/source/core/api/ReportDefinition.cxx|4 +
 sc/inc/scitems.hxx   |   55 ++-
 sc/inc/unonames.hxx  |4 +
 sc/qa/unit/data/xlsx/tdf121715.xlsx  |binary
 sc/qa/unit/subsequent_export-test2.cxx   |   21 +++
 sc/source/core/data/docpool.cxx  |9 ++-
 sc/source/filter/excel/xepage.cxx|   47 +---
 sc/source/filter/excel/xipage.cxx|2 
 sc/source/filter/excel/xlpage.cxx|2 
 sc/source/filter/inc/pagesettings.hxx|6 +-
 sc/source/filter/inc/xlpage.hxx  |9 ++-
 sc/source/filter/oox/pagesettings.cxx|   30 ++
 sc/source/filter/xml/XMLTableHeaderFooterContext.cxx |5 +
 sc/source/filter/xml/XMLTableHeaderFooterContext.hxx |2 
 sc/source/filter/xml/XMLTableMasterPageExport.cxx|   24 
 sc/source/filter/xml/xmlfonte.cxx|3 -
 sc/source/filter/xml/xmlstyli.cxx|4 -
 sc/source/ui/inc/printfun.hxx|2 
 sc/source/ui/pagedlg/tphf.cxx|4 +
 sc/source/ui/unoobj/styleuno.cxx |6 ++
 sc/source/ui/view/printfun.cxx   |   12 +++-
 22 files changed, 200 insertions(+), 55 deletions(-)

New commits:
commit b9993369b4011cd8f367e439f5248096827f1efc
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Jun 8 11:53:42 2021 +0200
Commit: László Németh 
CommitDate: Tue Jun 29 22:50:43 2021 +0200

tdf#121715 XLSX: support custom first page header/footer

Add XLSX import/export support for a different header or
footer (activated separately) on the first page.
Print preview is also extended to support this.

Note: only ODS export is supported, yet. Follow-up commits
are going to add ODS import and UI support.

Change-Id: Icd3a40131bdbcd5d5a42f98c86a71345a5745051
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116842
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 19fa853ce12136b5c14e0c5a0aa906c296b75388)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118067
Tested-by: Jenkins

diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 980c1bb8c0f2..68b5e2d14af5 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -184,6 +184,10 @@ Filter
 FilterCriteriaSource
 FilterOptions
 FirstLineOffset
+FirstPageFooterContent
+FirstPageHeaderContent
+FirstPageFooterIsShared
+FirstPageHeaderIsShared
 FirstPageNumber
 FocusOnClick
 FontCharset
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx 
b/reportdesign/source/core/api/ReportDefinition.cxx
index fd6bf1bb56c1..839ec947ca36 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -149,6 +149,7 @@
 #define SC_UNO_PAGE_HDRON   "HeaderIsOn"
 #define SC_UNO_PAGE_HDRDYNAMIC  "HeaderIsDynamicHeight"
 #define SC_UNO_PAGE_HDRSHARED   "HeaderIsShared"
+#define SC_UNO_PAGE_FIRSTHDRSHARED  "FirstPageHeaderIsShared"
 #define SC_UNO_PAGE_FTRBACKCOL  "FooterBackColor"
 #define SC_UNO_PAGE_FTRBACKTRAN "FooterBackTransparent"
 #define SC_UNO_PAGE_FTRGRFFILT  "FooterBackGraphicFilter"
@@ -171,6 +172,7 @@
 #define SC_UNO_PAGE_FTRON   "FooterIsOn"
 #define SC_UNO_PAGE_FTRDYNAMIC  "FooterIsDynamicHeight"
 #define SC_UNO_PAGE_FTRSHARED   "FooterIsShared"
+#define SC_UNO_PAGE_FIRSTFTRSHARED  "FirstPageFooterIsShared"
 
 namespace reportdesign
 {
@@ -309,6 +311,7 @@ OStyle::OStyle()
 registerPropertyNoMember(SC_UNO_PAGE_FTRDYNAMIC,  
++i,nBound,cppu::UnoType::get(), css::uno::Any(false));
 registerPropertyNoMember(SC_UNO_PAGE_FTRON,   
++i,nBound,cppu::UnoType::get(), css::uno::Any(false));
 registerPropertyNoMember(SC_UNO_PAGE_FTRSHARED,   
++i,nBound,cppu::UnoType::get(), css::uno::Any(false));
+registerPropertyNoMember(SC_UNO_PAGE_FIRSTFTRSHARED, 
++i,nBound,cppu::UnoType::get(), css::uno::Any(false));
 registerPropertyNoMember(SC_UNO_PAGE_FTRLEFTBOR,  ++i,nBound, 
cppu::UnoType::get(), css::uno::Any(table::BorderLine2()));
 registerPropertyNoMember(SC_UNO_PAGE_FTRLEFTBDIS, ++i,nBound, 
cppu::UnoType::get(), css::uno::makeAny(0));
 registerPropertyNoMember(SC_UNO_PAGE_FTRLEFTMAR,  ++i,nBound, 
cppu::UnoType::get(), css::uno::makeAny(0));
@@ -332,6 +335,7 @@ OStyle::OStyle()
 registerPropertyNoMember(SC_UNO_PAGE_HDRDYNAMIC,  
++i,nBound|nMayBeVoid,cppu::UnoType::get(), css::uno::Any(false));
 registerPropertyNoMember(SC_UNO_PAGE_HDRON,   
++i,nBound|nMayBeVoid,cppu::UnoTyp

[Libreoffice-commits] core.git: oox/source reportdesign/source sc/inc sc/qa sc/source

2021-06-29 Thread Daniel Arato (NISZ) (via logerrit)
 oox/source/token/properties.txt  |4 +
 reportdesign/source/core/api/ReportDefinition.cxx|4 +
 sc/inc/scitems.hxx   |   55 ++-
 sc/inc/unonames.hxx  |4 +
 sc/qa/unit/data/xlsx/tdf121715.xlsx  |binary
 sc/qa/unit/subsequent_export-test2.cxx   |   21 +++
 sc/source/core/data/docpool.cxx  |9 ++-
 sc/source/filter/excel/xepage.cxx|   47 +---
 sc/source/filter/excel/xipage.cxx|2 
 sc/source/filter/excel/xlpage.cxx|2 
 sc/source/filter/inc/pagesettings.hxx|6 +-
 sc/source/filter/inc/xlpage.hxx  |9 ++-
 sc/source/filter/oox/pagesettings.cxx|   30 ++
 sc/source/filter/xml/XMLTableHeaderFooterContext.cxx |5 +
 sc/source/filter/xml/XMLTableHeaderFooterContext.hxx |2 
 sc/source/filter/xml/XMLTableMasterPageExport.cxx|   24 
 sc/source/filter/xml/xmlfonte.cxx|3 -
 sc/source/filter/xml/xmlstyli.cxx|4 -
 sc/source/ui/inc/printfun.hxx|2 
 sc/source/ui/pagedlg/tphf.cxx|4 +
 sc/source/ui/unoobj/styleuno.cxx |6 ++
 sc/source/ui/view/printfun.cxx   |   12 +++-
 22 files changed, 200 insertions(+), 55 deletions(-)

New commits:
commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Jun 8 11:53:42 2021 +0200
Commit: László Németh 
CommitDate: Tue Jun 29 11:21:01 2021 +0200

tdf#121715 XLSX: support custom first page header/footer

Add XLSX import/export support for a different header or
footer (activated separately) on the first page.
Print preview is also extended to support this.

Note: only ODS export is supported, yet. Follow-up commits
are going to add ODS import and UI support.

Change-Id: Icd3a40131bdbcd5d5a42f98c86a71345a5745051
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116842
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 980c1bb8c0f2..68b5e2d14af5 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -184,6 +184,10 @@ Filter
 FilterCriteriaSource
 FilterOptions
 FirstLineOffset
+FirstPageFooterContent
+FirstPageHeaderContent
+FirstPageFooterIsShared
+FirstPageHeaderIsShared
 FirstPageNumber
 FocusOnClick
 FontCharset
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx 
b/reportdesign/source/core/api/ReportDefinition.cxx
index fd6bf1bb56c1..839ec947ca36 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -149,6 +149,7 @@
 #define SC_UNO_PAGE_HDRON   "HeaderIsOn"
 #define SC_UNO_PAGE_HDRDYNAMIC  "HeaderIsDynamicHeight"
 #define SC_UNO_PAGE_HDRSHARED   "HeaderIsShared"
+#define SC_UNO_PAGE_FIRSTHDRSHARED  "FirstPageHeaderIsShared"
 #define SC_UNO_PAGE_FTRBACKCOL  "FooterBackColor"
 #define SC_UNO_PAGE_FTRBACKTRAN "FooterBackTransparent"
 #define SC_UNO_PAGE_FTRGRFFILT  "FooterBackGraphicFilter"
@@ -171,6 +172,7 @@
 #define SC_UNO_PAGE_FTRON   "FooterIsOn"
 #define SC_UNO_PAGE_FTRDYNAMIC  "FooterIsDynamicHeight"
 #define SC_UNO_PAGE_FTRSHARED   "FooterIsShared"
+#define SC_UNO_PAGE_FIRSTFTRSHARED  "FirstPageFooterIsShared"
 
 namespace reportdesign
 {
@@ -309,6 +311,7 @@ OStyle::OStyle()
 registerPropertyNoMember(SC_UNO_PAGE_FTRDYNAMIC,  
++i,nBound,cppu::UnoType::get(), css::uno::Any(false));
 registerPropertyNoMember(SC_UNO_PAGE_FTRON,   
++i,nBound,cppu::UnoType::get(), css::uno::Any(false));
 registerPropertyNoMember(SC_UNO_PAGE_FTRSHARED,   
++i,nBound,cppu::UnoType::get(), css::uno::Any(false));
+registerPropertyNoMember(SC_UNO_PAGE_FIRSTFTRSHARED, 
++i,nBound,cppu::UnoType::get(), css::uno::Any(false));
 registerPropertyNoMember(SC_UNO_PAGE_FTRLEFTBOR,  ++i,nBound, 
cppu::UnoType::get(), css::uno::Any(table::BorderLine2()));
 registerPropertyNoMember(SC_UNO_PAGE_FTRLEFTBDIS, ++i,nBound, 
cppu::UnoType::get(), css::uno::makeAny(0));
 registerPropertyNoMember(SC_UNO_PAGE_FTRLEFTMAR,  ++i,nBound, 
cppu::UnoType::get(), css::uno::makeAny(0));
@@ -332,6 +335,7 @@ OStyle::OStyle()
 registerPropertyNoMember(SC_UNO_PAGE_HDRDYNAMIC,  
++i,nBound|nMayBeVoid,cppu::UnoType::get(), css::uno::Any(false));
 registerPropertyNoMember(SC_UNO_PAGE_HDRON,   
++i,nBound|nMayBeVoid,cppu::UnoType::get(), css::uno::Any(false));
 registerPropertyNoMember(SC_UNO_PAGE_HDRSHARED,   
++i,nBound|nMayBeVoid,cppu::UnoType::get(), css::uno::Any(false));
+

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

2021-05-21 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/layout/data/tdf104254.docx |binary
 sw/qa/extras/layout/layout2.cxx |   18 ++
 sw/source/core/text/txtfly.cxx  |8 +---
 3 files changed, 23 insertions(+), 3 deletions(-)

New commits:
commit 798b69087119c01a3b51e0bb3240ef35cfededeb
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Mar 24 20:18:16 2021 +0100
Commit: László Németh 
CommitDate: Fri May 21 08:00:33 2021 +0200

tdf#104254 sw DOCX import: fix text wrapping in headers

Text wrapping around shapes and images used to be
turned off in header and footer frames. This commit
simply reenables that feature for headers/footers
(to avoid also regressions related to the fix i13832).

Change-Id: I46ca112f36e0c0c86342fa34fdb7cb7502745731
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113098
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/qa/extras/layout/data/tdf104254.docx 
b/sw/qa/extras/layout/data/tdf104254.docx
new file mode 100644
index ..a074db337024
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf104254.docx differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 8846ff6a914e..7e962c9b5976 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -2472,6 +2472,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124770)
 assertXPath(pXmlDoc, "/root/page/body/txt[1]/LineBreak", 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTextWrappingInHeader)
+{
+SwDoc* pDoc = createDoc("tdf104254.docx");
+
+std::shared_ptr xMetaFile = 
pDoc->GetDocShell()->GetPreviewMetaFile();
+MetafileXmlDump dumper;
+xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+CPPUNIT_ASSERT(pXmlDoc);
+assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray", 2);
+
+// Make sure the header image does not block any of the header text.
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: > 3000
+// - Actual  : 2009
+OUString sTextArrayX = getXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[1]/textarray[1]", "x");
+CPPUNIT_ASSERT(sTextArrayX.toUInt32() > 3000);
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testContinuousEndnotesInsertPageAtStart)
 {
 // Create a new document with CONTINUOUS_ENDNOTES enabled.
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index a5fb1f6b6731..28ffea4116ab 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -843,7 +843,8 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList()
 const bool bAllowCompatWrap = m_pCurrFrame->IsInTab() && (bFooterHeader || 
m_pCurrFrame->IsInFootnote());
 const bool bWrapAllowed = ( 
pIDSA->get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING) ||
 bAllowCompatWrap ||
-(!m_pCurrFrame->IsInFootnote() && 
!bFooterHeader));
+(!m_pCurrFrame->IsInFootnote() && 
!bFooterHeader) ||
+bFooterHeader );
 
 m_bOn = false;
 
@@ -885,12 +886,14 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList()
 // #i20505# Do not consider oversized objects
 SwAnchoredObject* pAnchoredObj = (*pSorted)[ i ];
 assert(pAnchoredObj);
+const SwFormatSurround  = 
pAnchoredObj->GetFrameFormat().GetSurround();
 if ( !pAnchoredObj ||
  !rIDDMA.IsVisibleLayerId( 
pAnchoredObj->GetDrawObj()->GetLayer() ) ||
  !pAnchoredObj->ConsiderForTextWrap() ||
  ( mbIgnoreObjsInHeaderFooter && !bFooterHeader &&
pAnchoredObj->GetAnchorFrame()->FindFooterOrHeader() ) ||
- ( bAllowCompatWrap && 
!pAnchoredObj->GetFrameFormat().GetFollowTextFlow().GetValue() )
+ ( bAllowCompatWrap && 
!pAnchoredObj->GetFrameFormat().GetFollowTextFlow().GetValue() ) ||
+ ( !bAllowCompatWrap && bFooterHeader && 
com::sun::star::text::WrapTextMode_NONE == rFlyFormat.GetSurround() )
)
 {
 continue;
@@ -928,7 +931,6 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList()
 mpAnchoredObjList->insert( aInsPosIter, pAnchoredObj );
 }
 
-const SwFormatSurround  = 
pAnchoredObj->GetFrameFormat().GetSurround();
 // #i68520#
 if ( rFlyFormat.IsAnchorOnly() &&
  pAnchoredObj->GetAnchorFrame() == GetMaster() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-10 Thread Daniel Arato (NISZ) (via logerrit)
 sw/source/core/doc/docdesc.cxx |3 ---
 sw/source/uibase/shells/basesh.cxx |6 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 0cd000bb83719982c1fd2265ea040c82af5bf98e
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Apr 26 15:04:17 2021 +0200
Commit: László Németh 
CommitDate: Mon May 10 15:41:28 2021 +0200

tdf#141613 sw: avoid possible crash when undoing header creation

Move the ClearRedo() call to the very end of the undo process in order to 
avoid heap use after free.

We still need to call ClearRedo() because there's no mechanism in place to 
Redo a header/footer change.

Regression from commit 65e52cb61d74b0c71b45b63b2da131bc6b621104
"tdf#141613 sw: fix crash at header/footer undo".

Change-Id: Ibd4604379c9791e85aef3d4dc6c29c9e3ecd5a28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115275
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 4f38197f7ce9..fb7211dbae3b 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -503,9 +503,6 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc  
)
 lDelHFFormat(, 
rDescLeftFooterFormat.GetFooterFormat());
 else if (rDescFirstLeftFooterFormat.GetFooterFormat() && 
rDescFirstLeftFooterFormat != rChgedFirstLeftFooterFormat)
 lDelHFFormat(, 
rDescFirstLeftFooterFormat.GetFooterFormat());
-
-// FIXME: Disable redoing this change until we figure out how
-GetIDocumentUndoRedo().ClearRedo();
 }
 }
 ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 78e37c09c756..d8b4c3210547 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -559,6 +559,12 @@ void SwBaseShell::ExecUndo(SfxRequest )
 rWrtShell.Do( SwWrtShell::UNDO, nCnt );
 for (SwViewShell& rShell : rWrtShell.GetRingContainer())
 rShell.UnlockPaint();
+
+// tdf#141613 FIXME: Disable redoing header/footer changes for 
now.
+// The proper solution would be to write a SwUndoHeaderFooter 
class
+// to represent the addition of a header or footer to the 
current page.
+if (nUndoId == SwUndoId::HEADER_FOOTER)
+rUndoRedo.ClearRedo();
 }
 break;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-04 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf69635.docx   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx|2 
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx|   16 
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |   22 +++---
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |6 -
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx |2 
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx |   12 +--
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |2 
 sw/source/filter/ww8/docxexport.cxx   |9 +-
 sw/source/filter/ww8/docxexport.hxx   |3 
 sw/source/filter/ww8/rtfexport.cxx|   10 +-
 sw/source/filter/ww8/rtfexport.hxx|6 +
 sw/source/filter/ww8/wrtw8sty.cxx |   95 +++---
 sw/source/filter/ww8/wrtww8.hxx   |8 +-
 14 files changed, 145 insertions(+), 48 deletions(-)

New commits:
commit 88e6a1bfeac86e0c89d2ff08c908c2b5ae061177
Author: Daniel Arato (NISZ) 
AuthorDate: Fri Feb 5 12:07:48 2021 +0100
Commit: László Németh 
CommitDate: Tue May 4 19:14:22 2021 +0200

tdf#69635 DOCX: export hidden (shared) headers/footers

Exporting to .docx used to lose all header and footer
content that was not visible in the document at the
moment of saving. This commit forces the DocxExport
class to output all headers and footers even when
the "Same content on left and right pages" option
is turned on.

Change-Id: I6a52f216f1e1b386d887ec614198766670b5bce3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113158
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf69635.docx 
b/sw/qa/extras/ooxmlexport/data/tdf69635.docx
new file mode 100644
index ..94cced4d2ae4
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf69635.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 06c5a16e578a..24f51850e4ff 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -671,7 +671,7 @@ 
DECLARE_OOXMLEXPORT_TEST(testTdf130167_spilloverHeaderShape, "testTdf130167_spil
 xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY);
 // graphics from discarded headers were being added to the text body. 
Reduced from 5 to 2 shapes overall.
 // CPPUNIT_ASSERT(xNameAccess->getCount() <= 4); -> What about hidden 
headers?
-CPPUNIT_ASSERT_LESS(sal_Int32(6), xNameAccess->getCount());
+CPPUNIT_ASSERT_LESS(sal_Int32(9), xNameAccess->getCount());
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf124986, "tdf124986.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index d31a4ea06a8f..991bfb6817f1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -119,6 +119,22 @@ CPPUNIT_TEST_FIXTURE(Test, testGutterTop)
 assertXPath(pXmlSettings, "/w:settings/w:gutterAtTop", 1);
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf69635, "tdf69635.docx")
+{
+xmlDocUniquePtr pXmlHeader1 = parseExport("word/header1.xml");
+xmlDocUniquePtr pXmlSettings = parseExport("word/settings.xml");
+CPPUNIT_ASSERT(pXmlHeader1);
+CPPUNIT_ASSERT(pXmlSettings);
+
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: "left"
+// - Actual  : "right"
+assertXPathContent(pXmlHeader1, "/w:hdr/w:p/w:r/w:t", "left");
+
+// Make sure "left" appears as a hidden header
+assertXPath(pXmlSettings, "/w:settings/w:evenAndOddHeaders", 0);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf140668, "tdf140668.docx")
 {
 // Don't crash when document is opened
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 603b1010b59a..ac0930169253 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -398,10 +398,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChartInFooter, 
"chart-in-footer.docx")
 // fdo#73872: document contains chart in footer.
 // The problem was that  footer1.xml.rels files for footer1.xml
 // files were missing from docx file after roundtrip.
-xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/footer1.xml.rels");
+xmlDocUniquePtr pXmlDoc = parseExport("word/_rels/footer2.xml.rels");
 
-// Check footer1.xml.rels contains in doc after roundtrip.
-// Check Id = rId1 in footer1.xml.rels
+// Check footer2.xml.rels contains in doc after roundtrip.
+// Check Id = rId1 in footer2.xml.rels
 assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship","Id","rId1");
 assertXPath(pXmlDoc,
 "/rels:Relat

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

2021-05-04 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/uitest/writer_tests7/tdf46561.py |   13 +
 sw/source/core/doc/docdesc.cxx |   84 +
 2 files changed, 97 insertions(+)

New commits:
commit 65e52cb61d74b0c71b45b63b2da131bc6b621104
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Apr 26 15:04:17 2021 +0200
Commit: László Németh 
CommitDate: Tue May 4 15:38:21 2021 +0200

tdf#141613 sw: fix crash at header/footer undo

Undoing the creation of a header/footer used to leave their
corresponding document nodes intact, causing the node index
of a previous undo entry to point to the wrong node.

We now force the destruction of the header/footer nodes manually.
We also cut the redo chain which loses the redo history, but solves
another crash for now (when redoing the creation of the header).

The proper solution would be to create a new SwUndo* derived class
from scratch to represent the creation of a new header/footer section
in the document.

Regression from commit 8d8486f43c1a8a51157bfc3e0b87090b05a9229e
(tdf#46561 sw: fix lost undo stack setting header/footer)

Change-Id: I97188aa8ded802bc6b6fa88ddd83a95c40de8bc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114667
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/qa/uitest/writer_tests7/tdf46561.py 
b/sw/qa/uitest/writer_tests7/tdf46561.py
index 1c90dc3c404a..7d43ed8505eb 100644
--- a/sw/qa/uitest/writer_tests7/tdf46561.py
+++ b/sw/qa/uitest/writer_tests7/tdf46561.py
@@ -97,4 +97,17 @@ class tdf46561(UITestCase):
 
 self.ui_test.close_doc()
 
+# Check that former crash has been fixed
+def test_tdf141613(self):
+self.ui_test.create_doc_in_start_center("writer")
+
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+xArgs = mkPropertyValues({"Text": "something"})
+self.xUITest.executeCommandWithParameters(".uno:InsertText", xArgs)
+self.xUITest.executeCommand(".uno:InsertPageHeader")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:Undo")
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index ee08206bd7ef..4f38197f7ce9 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -424,6 +424,90 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc 
 )
 
 
GetIDocumentUndoRedo().AppendUndo(std::make_unique(rDesc, 
rChged, this));
 }
+else
+{
+SwUndoId nBeingUndone;
+GetIDocumentUndoRedo().GetFirstRedoInfo(nullptr, );
+if (SwUndoId::HEADER_FOOTER == nBeingUndone)
+{
+// The last format change is currently being undone. Remove 
header/footer and corresponding nodes.
+auto rDescMasterHeaderFormat = 
rDesc.GetMaster().GetFormatAttr(RES_HEADER);
+auto rDescLeftHeaderFormat = 
rDesc.GetLeft().GetFormatAttr(RES_HEADER);
+auto rDescFirstLeftHeaderFormat = 
rDesc.GetFirstLeft().GetFormatAttr(RES_HEADER);
+auto rDescMasterFooterFormat = 
rDesc.GetMaster().GetFormatAttr(RES_FOOTER);
+auto rDescLeftFooterFormat = 
rDesc.GetLeft().GetFormatAttr(RES_FOOTER);
+auto rDescFirstLeftFooterFormat = 
rDesc.GetFirstLeft().GetFormatAttr(RES_FOOTER);
+
+auto rChgedMasterHeaderFormat = 
rChged.GetMaster().GetFormatAttr(RES_HEADER);
+auto rChgedLeftHeaderFormat = 
rChged.GetLeft().GetFormatAttr(RES_HEADER);
+auto rChgedFirstLeftHeaderFormat = 
rChged.GetFirstLeft().GetFormatAttr(RES_HEADER);
+auto rChgedMasterFooterFormat = 
rChged.GetMaster().GetFormatAttr(RES_FOOTER);
+auto rChgedLeftFooterFormat = 
rChged.GetLeft().GetFormatAttr(RES_FOOTER);
+auto rChgedFirstLeftFooterFormat = 
rChged.GetFirstLeft().GetFormatAttr(RES_FOOTER);
+
+rDesc.GetMaster().ResetFormatAttr(RES_HEADER);
+rDesc.GetLeft().ResetFormatAttr(RES_HEADER);
+rDesc.GetFirstLeft().ResetFormatAttr(RES_HEADER);
+rDesc.GetMaster().ResetFormatAttr(RES_FOOTER);
+rDesc.GetLeft().ResetFormatAttr(RES_FOOTER);
+rDesc.GetFirstLeft().ResetFormatAttr(RES_FOOTER);
+
+auto lDelHFFormat = [this](SwClient* pToRemove, SwFrameFormat* 
pFormat)
+{
+// Code taken from lcl_DelHFFormat
+pFormat->Remove(pToRemove);
+SwFormatContent& rCnt = 
const_cast(pFormat->GetContent());
+if (rCnt.GetContentIdx())
+{
+SwNode* pNode = nullptr;
+{
+SwNodeIndex aIdx(*rCnt.GetContentIdx(), 0);
+pNode = ();
+   

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sw/source

2021-04-20 Thread Daniel Arato (NISZ) (via logerrit)
 sw/source/uibase/dochdl/swdtflvr.cxx |   18 ++
 1 file changed, 18 insertions(+)

New commits:
commit 515afc9d17003255910b403ac26705867332d9e1
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Sep 8 16:56:58 2020 +0200
Commit: Gabor Kelemen 
CommitDate: Tue Apr 20 13:35:26 2021 +0200

tdf#135669 sw: drag and drop other files as OLE

from file managers.

Native text, PDF and image file formats were supported,
but now spreadsheet and DOCX documents, too. The same
feature was already implemented in e.g. Impress.

Note: DOCX files inserted as OLE objects yet, and not
linked files in sections, as ODTs (but it's possible saving
and printing them via Save As option of the local menu
of the OLE object).

Change-Id: Ia2fafe4a0b79dc0c66eaec5ad073c994f98e1345
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102263
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit a354b7f7476513e5b1b4bbf1986b483cf122d47b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114283
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index cb1e8f51a262..5be9cc5533ee 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -2256,6 +2256,19 @@ bool SwTransferable::PasteOLE( TransferableDataHelper& 
rData, SwWrtShell& rSh,
 }
 }
 }
+else if (rData.HasFormat(SotClipboardFormatId::SIMPLE_FILE))
+{
+OUString sFile;
+if (rData.GetString(nFormat, sFile) && !sFile.isEmpty())
+{
+// Copied from sd::View::DropInsertFileHdl
+uno::Sequence< beans::PropertyValue > aMedium(1);
+aMedium[0].Name = "URL";
+aMedium[0].Value <<= sFile;
+SwDocShell* pDocSh = rSh.GetDoc()->GetDocShell();
+xObj = 
pDocSh->GetEmbeddedObjectContainer().InsertEmbeddedObject(aMedium, aName);
+}
+}
 }
 
 if ( xStrm.is() && !xObj.is() )
@@ -3033,6 +3046,11 @@ bool SwTransferable::PasteFileName( 
TransferableDataHelper& rData,
 rSh.StartInsertRegionDialog( aSect ); // starts dialog 
asynchronously
 bRet = true;
 }
+else if (SwPasteSdr::Insert == nAction && 
rData.HasFormat(SotClipboardFormatId::SIMPLE_FILE))
+{
+// insert file as OLE
+PasteOLE(rData, rSh, nFormat, nActionFlags, nullptr == 
pPt);
+}
 else if( SwPasteSdr::SetAttr == nAction ||
 ( bIsURLFile && SwPasteSdr::Insert == nAction ))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-26 Thread Daniel Arato (NISZ) (via logerrit)
 include/oox/export/drawingml.hxx |8 +++--
 include/oox/export/vmlexport.hxx |6 ++-
 oox/source/export/drawingml.cxx  |   31 ++-
 oox/source/export/vmlexport.cxx  |   10 +++---
 sw/qa/extras/ooxmlexport/data/tdf118535.odt  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx   |   13 
 sw/source/filter/ww8/docxattributeoutput.cxx |   42 ---
 sw/source/filter/ww8/docxattributeoutput.hxx |   11 +++
 sw/source/filter/ww8/docxexport.cxx  |4 --
 9 files changed, 88 insertions(+), 37 deletions(-)

New commits:
commit 797fef38612fb2fd62d1f6591619b9361e526bca
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Mar 9 14:11:11 2021 +0100
Commit: László Németh 
CommitDate: Fri Mar 26 13:07:57 2021 +0100

tdf#118535 DOCX export: save header image once

Writer used to dump the same image file as many times
as it was featured in different headers or footers in
the document, bloating the .docx file size.

This is countered by making all "relationships" in the
header*.xml.rels files point to the same image.

Change-Id: I44d72630289c721d58d8f7e208517df2f1fe621c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112656
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index 2cd17e6defb0..cfcad30fa257 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -125,8 +125,10 @@ public:
 virtual void WriteTextBox(css::uno::Reference 
xShape) = 0;
 /// Look up the RelId of a graphic based on its checksum.
 virtual OUString FindRelId(BitmapChecksum nChecksum) = 0;
-/// Store the RelId of a graphic based on its checksum.
-virtual void CacheRelId(BitmapChecksum nChecksum, const OUString& rRelId) 
= 0;
+/// Look up the filename of a graphic based on its checksum.
+virtual OUString FindFileName(BitmapChecksum nChecksum) = 0;
+/// Store the RelId and filename of a graphic based on its checksum.
+virtual void CacheRelId(BitmapChecksum nChecksum, const OUString& rRelId, 
const OUString& rFileName) = 0;
 ///  Get textbox which belongs to the shape.
 virtual css::uno::Reference GetUnoTextFrame(
 css::uno::Reference xShape) = 0;
@@ -192,7 +194,7 @@ public:
 
 void SetBackgroundDark(bool bIsDark) { mbIsBackgroundDark = bIsDark; }
 /// If bRelPathToMedia is true add "../" to image folder path while adding 
the image relationship
-OUString WriteImage( const Graphic  , bool bRelPathToMedia = 
false);
+OUString WriteImage( const Graphic  , bool bRelPathToMedia = 
false, OUString* pFileName = nullptr );
 
 void WriteColor( ::Color nColor, sal_Int32 nAlpha = MAX_PERCENT );
 void WriteColor( const OUString& sColorSchemeName, const 
css::uno::Sequence< css::beans::PropertyValue >& aTransformations, sal_Int32 
nAlpha = MAX_PERCENT );
diff --git a/include/oox/export/vmlexport.hxx b/include/oox/export/vmlexport.hxx
index dd5edc57c208..9a53a07652c8 100644
--- a/include/oox/export/vmlexport.hxx
+++ b/include/oox/export/vmlexport.hxx
@@ -67,8 +67,10 @@ public:
 virtual void WriteVMLTextBox(css::uno::Reference 
xShape) = 0;
 /// Look up the RelId of a graphic based on its checksum.
 virtual OUString FindRelId(BitmapChecksum nChecksum) = 0;
-/// Store the RelId of a graphic based on its checksum.
-virtual void CacheRelId(BitmapChecksum nChecksum, const OUString& rRelId) 
= 0;
+/// Look up the filename of a graphic based on its checksum.
+virtual OUString FindFileName(BitmapChecksum nChecksum) = 0;
+/// Store the RelId and filename of a graphic based on its checksum.
+virtual void CacheRelId(BitmapChecksum nChecksum, const OUString& rRelId, 
const OUString& rFileName) = 0;
 protected:
 VMLTextExport() {}
 virtual ~VMLTextExport() {}
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 67f26e71daea..32780296ce89 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1162,7 +1162,7 @@ const char* DrawingML::GetRelationCompPrefix() const
 return "unknown";
 }
 
-OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia 
)
+OUString DrawingML::WriteImage( const Graphic& rGraphic , bool 
bRelPathToMedia, OUString* pFileName )
 {
 GfxLink aLink = rGraphic.GetGfxLink ();
 OUString sMediaType;
@@ -1266,15 +1266,18 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic 
, bool bRelPathToMedia )
 sRelationCompPrefix = "../";
 else
 sRelationCompPrefix = GetRelationCompPrefix();
+OUString sPath = OUStringBuffer()
+ .appendAscii( sRelationCompPrefix.getStr() )
+ .appendAscii( sRelPathToMedia.getStr() )
+   

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

2021-03-17 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/uiwriter/uiwriter.cxx |4 -
 sw/qa/uitest/data/tdf46561.odt |binary
 sw/qa/uitest/writer_tests7/tdf46561.py |  105 +
 sw/source/core/doc/docdesc.cxx |   87 +--
 sw/source/core/layout/pagedesc.cxx |   27 +---
 5 files changed, 156 insertions(+), 67 deletions(-)

New commits:
commit 8d8486f43c1a8a51157bfc3e0b87090b05a9229e
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Feb 22 16:59:38 2021 +0100
Commit: Balazs Varga 
CommitDate: Wed Mar 17 13:10:27 2021 +0100

tdf#46561 sw: fix lost undo stack setting header/footer

Changing 'shared' setting of left vs right or
first vs non-first page headers or footers removed
the whole undo stack.

Note: style changes before a 'shared' change
can still not be undone.

Co-authored-by: Attila Bakos (NISZ)

Change-Id: I6875bd0581869ffeb853911347dbc9f8c666214b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111635
Reviewed-by: László Németh 
Reviewed-by: Balazs Varga 
Tested-by: Balazs Varga 

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index c39659fa9bab..dae657a35088 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -2225,7 +2225,9 @@ void SwUiWriterTest::testTextCursorInvalidation()
 // this does not actually delete the header:
xPageStyle->setPropertyValue("HeaderIsOn", uno::makeAny(false));
 pWrtShell->ChangeHeaderOrFooter(u"Default Page Style", true, false, false);
 // must be disposed after deleting header
-CPPUNIT_ASSERT_THROW(xCursor->goRight(1, false), uno::RuntimeException);
+// cursor ends up in body
+// UPDATE: this behaviour has been corrected as a side effect of the fix 
to tdf#46561:
+//CPPUNIT_ASSERT_THROW(xCursor->goRight(1, false), uno::RuntimeException);
 }
 
 void SwUiWriterTest::testTdf68183()
diff --git a/sw/qa/uitest/data/tdf46561.odt b/sw/qa/uitest/data/tdf46561.odt
new file mode 100644
index ..c9f9942521d0
Binary files /dev/null and b/sw/qa/uitest/data/tdf46561.odt differ
diff --git a/sw/qa/uitest/writer_tests7/tdf46561.py 
b/sw/qa/uitest/writer_tests7/tdf46561.py
new file mode 100644
index ..235136524903
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf46561.py
@@ -0,0 +1,105 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import type_text
+import importlib
+import org.libreoffice.unotest
+import pathlib
+
+def get_url_for_data_file(file_name):
+return 
pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
+class tdf46561(UITestCase):
+def check_header_texts(self, master="", first="", left="", right=""):
+# Get the current header style and its text contents
+xPageStyle = self.document.getStyleFamilies().getByIndex(2)
+xHeaderText = xPageStyle.getByIndex(0).HeaderText.String
+xHeaderTextFirst = xPageStyle.getByIndex(0).HeaderTextFirst.String
+xHeaderTextLeft = xPageStyle.getByIndex(0).HeaderTextLeft.String
+xHeaderTextRight = xPageStyle.getByIndex(0).HeaderTextRight.String
+
+# Check the current values
+self.assertEqual(master, xHeaderText)
+self.assertEqual(first, xHeaderTextFirst)
+self.assertEqual(left, xHeaderTextLeft)
+self.assertEqual(right, xHeaderTextRight)
+
+def test_tdf46561(self):
+self.ui_test.load_file(get_url_for_data_file("tdf46561.odt"))
+self.document = self.ui_test.get_component()
+self.check_header_texts(master="right", first="1st", left="left", 
right="right")
+
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "2"}))
+self.xUITest.executeCommand(".uno:JumpToHeader")
+
+# Switch "same left and right page headers" on and off a few times
+for _ in range(4):
+self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+PageDialog = self.xUITest.getTopFocusWindow();
+
+xTabs = PageDialog.getChild("tabcontrol")
+select_pos(xTabs, "4")
+
+Button = xTabs.getChild('checkSameLR')
+Button.executeAction("CLICK",tuple())
+ok = PageDi

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

2021-03-02 Thread Daniel Arato (NISZ) (via logerrit)
 sw/inc/pagedesc.hxx |   17 +
 sw/qa/uitest/data/tdf140117.fodt|   95 
 sw/qa/uitest/writer_tests7/tdf140117.py |   70 +++
 sw/source/core/doc/docdesc.cxx  |   70 ++-
 sw/source/core/layout/pagedesc.cxx  |   73 
 5 files changed, 311 insertions(+), 14 deletions(-)

New commits:
commit f5dc6b11d2218d94c9effe7a1ab418d0133da5e3
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Jan 26 13:11:42 2021 +0100
Commit: László Németh 
CommitDate: Tue Mar 2 11:10:29 2021 +0100

tdf#140117 sw UI: keep headers/footers when inactive

Custom left page and first headers (and footers) used to disappear
forever if hidden temporarily by checking the "Same content on left
and right pages" or "Same content on first page" options, respectively.
This commit stashes the endangered headers (footers) in SwPageDesc
and restores them on demand.

Change-Id: I1f6b605e2bd19af18726de1b825721487d29b4eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110398
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 7f2eaa9c9d53..0d29eb0ca6e3 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -148,6 +148,17 @@ class SW_DLLPUBLIC SwPageDesc
 // FIXME epicycles growing here - page margins need to be stored 
differently
 SwFrameFormatm_FirstMaster;
 SwFrameFormatm_FirstLeft;
+
+struct StashedPageDesc
+{
+std::shared_ptr m_pStashedFirst;
+std::shared_ptr m_pStashedLeft;
+std::shared_ptr m_pStashedFirstLeft;
+};
+
+mutable StashedPageDesc m_aStashedHeader;
+mutable StashedPageDesc m_aStashedFooter;
+
 sw::WriterMultiListener m_aDepends; ///< Because of grid alignment 
(Registerhaltigkeit).
 mutable const SwTextFormatColl* m_pTextFormatColl;
 SwPageDesc *m_pFollow;
@@ -206,6 +217,12 @@ public:
 bool IsHidden() const { return m_IsHidden; }
 void SetHidden(bool const bValue) { m_IsHidden = bValue; }
 
+/// Remember original header/footer formats even when they are hidden by 
"sharing".
+void StashFrameFormat(const SwFrameFormat& rFormat, bool bHeader, bool 
bLeft, bool bFirst);
+
+/// Used to restore hidden header/footer formats.
+const SwFrameFormat* GetStashedFrameFormat(bool bHeader, bool bLeft, bool 
bFirst) const;
+
 /// Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is 
not modified.
 inline void  SetUseOn( UseOnPage eNew );
 inline UseOnPage GetUseOn() const;
diff --git a/sw/qa/uitest/data/tdf140117.fodt b/sw/qa/uitest/data/tdf140117.fodt
new file mode 100644
index ..8487346d1d5c
--- /dev/null
+++ b/sw/qa/uitest/data/tdf140117.fodt
@@ -0,0 +1,95 @@
+
+http://www.w3.org/TR/css3-text/; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#; 
xmlns:xhtml="http://www.w3.org/1999/xhtml; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:xforms="http://www.w3.org/2002/xforms; 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:drawooo="http://openoffice.org/2010/draw; 
xmlns:math="http://www.w3.org/1998/Math/MathML; 
xmlns:tableooo="http://openoffice.org/2009/table; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:oooc="http://openoffice.org/2004/calc; 
xmlns:ooow="http://openoffice.org/200
 4/writer" 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:rpt="http://openoffice.org/2005/report; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office; 
xmlns:dr3d="urn:oasi

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

2021-03-01 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf140668.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx|6 ++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |3 +--
 3 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit bbafee3424fdc59d2f69204fefab8a318aeec0e1
Author: Daniel Arato (NISZ) 
AuthorDate: Fri Feb 26 09:28:51 2021 +0100
Commit: Xisco Fauli 
CommitDate: Mon Mar 1 20:00:15 2021 +0100

tdf#140668 Crashfix: disregard w:textDirection tag outside frame

DomainMapper_Impl::SetFrameDirection had a false assumption that
a w:textDirection tag will only be encountered when the OOXML
parser is already inside a frame. This is not always the case.

Regression from commit af4e5ee0f93c1ff442d08caed5c875f2b2c1fd43
(tdf#97128 DOCX import: fix frame direction).

Change-Id: I39845599b0c7f502870e2de497df8cbdd4475594
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111594
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: Xisco Fauli 
Reviewed-by: László Németh 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111754

diff --git a/sw/qa/extras/ooxmlexport/data/tdf140668.docx 
b/sw/qa/extras/ooxmlexport/data/tdf140668.docx
new file mode 100644
index ..d7072187bb57
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf140668.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 1a57488b67e7..e4b4ab0b0a83 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -39,6 +39,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, 
"tdf138892_noNumbering.docx"
 CPPUNIT_ASSERT_MESSAGE("Para3: ", 
getProperty(getParagraph(3), "NumberingStyleName").isEmpty());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf140668, "tdf140668.docx")
+{
+// Don't crash when document is opened
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134619_numberingProps, 
"tdf134619_numberingProps.doc")
 {
 // Get the third paragraph's numbering style's 1st level's bullet size
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index afd55fe28a26..cd318ab054fa 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -966,8 +966,7 @@ public:
 m_bFrameDirectionSet = false;
 }
 void SetFrameDirection(sal_Int16 nDirection) {
-if (!m_bFrameDirectionSet) {
-assert(!m_aFrameDirectionQueue.empty());
+if (!m_bFrameDirectionSet && !m_aFrameDirectionQueue.empty()) {
 m_aFrameDirectionQueue.back() = nDirection;
 m_bFrameDirectionSet = true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-01 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf140668.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx|6 ++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |3 +--
 3 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 027cc8c90badd4dd8a3436d859587c1b8732459f
Author: Daniel Arato (NISZ) 
AuthorDate: Fri Feb 26 09:28:51 2021 +0100
Commit: László Németh 
CommitDate: Mon Mar 1 15:32:49 2021 +0100

tdf#140668 Crashfix: disregard w:textDirection tag outside frame

DomainMapper_Impl::SetFrameDirection had a false assumption that
a w:textDirection tag will only be encountered when the OOXML
parser is already inside a frame. This is not always the case.

Regression from commit af4e5ee0f93c1ff442d08caed5c875f2b2c1fd43
(tdf#97128 DOCX import: fix frame direction).

Change-Id: I39845599b0c7f502870e2de497df8cbdd4475594
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111594
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: Xisco Fauli 
Reviewed-by: László Németh 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf140668.docx 
b/sw/qa/extras/ooxmlexport/data/tdf140668.docx
new file mode 100644
index ..d7072187bb57
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf140668.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 29798dcabdec..f53078d6a332 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -78,6 +78,12 @@ CPPUNIT_TEST_FIXTURE(Test, testGutterTop)
 assertXPath(pXmlSettings, "/w:settings/w:gutterAtTop", 1);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf140668, "tdf140668.docx")
+{
+// Don't crash when document is opened
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134619_numberingProps, 
"tdf134619_numberingProps.doc")
 {
 // Get the third paragraph's numbering style's 1st level's bullet size
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 581d2dba6692..4a654822fb90 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -986,8 +986,7 @@ public:
 m_bFrameDirectionSet = false;
 }
 void SetFrameDirection(sal_Int16 nDirection) {
-if (!m_bFrameDirectionSet) {
-assert(!m_aFrameDirectionQueue.empty());
+if (!m_bFrameDirectionSet && !m_aFrameDirectionQueue.empty()) {
 m_aFrameDirectionQueue.back() = nDirection;
 m_bFrameDirectionSet = true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sw/qa sw/source

2021-03-01 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/core/layout/data/textbox-phantom-change.docx |binary
 sw/qa/core/layout/layout.cxx   |   20 ++
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |2 -
 sw/source/core/draw/dcontact.cxx   |   29 -
 4 files changed, 49 insertions(+), 2 deletions(-)

New commits:
commit 800bdfd06fd41b1305852f01d5a2aaaf33da9431
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Nov 16 11:53:47 2020 +0100
Commit: Gabor Kelemen 
CommitDate: Mon Mar 1 13:51:33 2021 +0100

tdf#135198 tdf#138050 sw editing: fix text box position sync

Follow-up to commit c9eb53f200225f2ee6ca695e1326843a487aee51
(tdf#135198 sw editing: text box fell out of its shape)

Every time a shape is repositioned, make sure the text box
inside the shape follows the shape.

The previous solution to this bug, the one implemented in
SwObjectFormatterTextFrame::DoFormatObjs, was a little
more cumbersome. This one should produce fewer regressions,
I hope.

Change-Id: I3e88eb8616cd299cabb7b74b188ab7220746ec89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106421
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 59fec754a1523eede0f19a59e4eeeff593a4d688)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111704
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 

diff --git a/sw/qa/core/layout/data/textbox-phantom-change.docx 
b/sw/qa/core/layout/data/textbox-phantom-change.docx
new file mode 100644
index ..75ac039561f6
Binary files /dev/null and b/sw/qa/core/layout/data/textbox-phantom-change.docx 
differ
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index b4fc9f3a5176..57f7c49a8eae 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -10,6 +10,13 @@
 #include 
 
 #include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 
 #include 
@@ -149,6 +156,19 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testContinuousEndnotesMoveBackwards)
 assertXPath(pLayout, "/root/page[2]/ftncont", 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxNotModifiedOnOpen)
+{
+// tdf#138050: a freshly opened document containing a shape with a text box
+// should not appear to be modified
+load(DATA_DIRECTORY, "textbox-phantom-change.docx");
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+
+// Without the fix in place this test would have shown that the document
+// was modified due to a fix to tdf#135198
+CPPUNIT_ASSERT(!pDoc->getIDocumentState().IsModified());
+}
+
 CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxAutoGrowVertical)
 {
 load(DATA_DIRECTORY, "textbox-autogrow-vertical.docx");
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index f932e9739800..3ed3e2b6bc24 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1018,7 +1018,7 @@ DECLARE_OOXMLIMPORT_TEST(textboxWpsOnly, 
"textbox-wps-only.docx")
 if ( nsScreen.frame.size.width * scaleFactor > 4000 )
 return;
 #endif
-CPPUNIT_ASSERT_EQUAL(sal_Int32(2805), getProperty(xFrame, 
"VertOrientPosition"));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(5304), getProperty(xFrame, 
"VertOrientPosition"));
 }
 
 DECLARE_OOXMLIMPORT_TEST(testGroupshapeRelsize, "groupshape-relsize.docx")
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index ad672260a834..050c041b92c5 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -50,6 +50,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1261,7 +1263,6 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 const SwFormatVertOrient& rVert = GetFormat()->GetVertOrient();
 if ( nYPosDiff != 0 )
 {
-
 if ( rVert.GetRelationOrient() == 
text::RelOrientation::CHAR ||
  rVert.GetRelationOrient() == 
text::RelOrientation::TEXT_LINE )
 {
@@ -1314,6 +1315,32 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 // may affect the size of the underlying textbox.
 lcl_textBoxSizeNotify(GetFormat());
 }
+
+// tdf#135198: keep text box together with its shape
+SwRect aObjRect(rObj.GetSnapRect());
+const SwPageFrame* rPageFrame = pAnchoredDrawObj->GetPageFrame();
+if (rPageFrame && rPageFrame->isFrameAreaPositionValid())
+{
+SwDoc* const pDoc = GetFormat()->GetDoc();
+
+// avoid Undo creation
+

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - oox/qa oox/source

2021-02-24 Thread Daniel Arato (NISZ) (via logerrit)
 oox/qa/unit/data/camera-rotation-revolution.docx |binary
 oox/qa/unit/drawingml.cxx|   25 +
 oox/source/drawingml/shape.cxx   |7 +++--
 oox/source/export/drawingml.cxx  |   32 +--
 4 files changed, 60 insertions(+), 4 deletions(-)

New commits:
commit 2dc62fd2fb797db2bf9c1f4876f1cf1ff9bce329
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Sep 29 16:37:41 2020 +0200
Commit: Gabor Kelemen 
CommitDate: Wed Feb 24 10:54:51 2021 +0100

tdf#133037 OOXML shape import: camera rotation along Z

Instead of implementing proper OOXML 3D rotation (which would be
an entirely new feature if I understand correctly), I merely
interpret attribute "rev" of the rotation element a:camera/a:rot
as a directive to rotate the entire shape the usual 2D way. That
is already implemented and works well. This isn't the same thing
Word does, but it might be good enough for now. This is kind of a
mock solution, but it will be very easy to revert if it turns out
to cause problems.

Note: the export worked well previously, too (moreover, reloading
the first LO export fixed the import).

Change-Id: I2a99c119880bbed1c5b6430c4638cfbd10b7ac06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103627
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit a9c5c0d814a266096483572b84c72875ef8efd77)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111430
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 

diff --git a/oox/qa/unit/data/camera-rotation-revolution.docx 
b/oox/qa/unit/data/camera-rotation-revolution.docx
new file mode 100644
index ..74054aa82b3f
Binary files /dev/null and b/oox/qa/unit/data/camera-rotation-revolution.docx 
differ
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index 7fcee1756a6f..6a0415b257f2 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -265,6 +265,31 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, 
testShapeTextAdjustLeft)
 CPPUNIT_ASSERT_EQUAL(drawing::TextHorizontalAdjust_BLOCK, eAdjust);
 }
 
+CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testCameraRotationRevolution)
+{
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"camera-rotation-revolution.docx";
+load(aURL);
+
+uno::Reference 
xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xShape0(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xShape1(xDrawPage->getByIndex(1), 
uno::UNO_QUERY);
+uno::Reference xShapeProps0(xShape0, uno::UNO_QUERY);
+uno::Reference xShapeProps1(xShape1, uno::UNO_QUERY);
+sal_Int32 nRotateAngle0;
+sal_Int32 nRotateAngle1;
+xShapeProps0->getPropertyValue("RotateAngle") >>= nRotateAngle0;
+xShapeProps1->getPropertyValue("RotateAngle") >>= nRotateAngle1;
+
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 8000
+// - Actual  : 0
+// so the camera rotation would not have been factored into how the shape 
is displayed
+CPPUNIT_ASSERT_EQUAL(static_cast(8000), nRotateAngle0);
+CPPUNIT_ASSERT_EQUAL(static_cast(27000), nRotateAngle1);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 173095b37df2..c5c77e29038f 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1473,11 +1473,14 @@ Reference< XShape > const & Shape::createAndInsert(
 else if( getTextBody() )
 getTextBody()->getTextProperties().pushVertSimulation();
 
+// tdf#133037: a bit hackish: force Shape to rotate in the opposite 
direction the camera would rotate
+const sal_Int32 nCameraRotation = 
get3DProperties().maCameraRotation.mnRevolution.get(0);
+
 PropertySet aPropertySet(mxShape);
-if ( !bUseRotationTransform && mnRotation != 0 )
+if ( !bUseRotationTransform && (mnRotation != 0 || nCameraRotation != 
0) )
 {
 // use the same logic for rotation from VML exporter 
(SimpleShape::implConvertAndInsert at vmlshape.cxx)
-aPropertySet.setAnyProperty( PROP_RotateAngle, makeAny( sal_Int32( 
NormAngle36000( mnRotation / -600 ) ) ) );
+aPropertySet.setAnyProperty( PROP_RotateAngle, makeAny( sal_Int32( 
NormAngle36000( (mnRotation - nCameraRotation) / -600 ) ) ) );
 aPropertySet.setAnyProperty( PROP_HoriOrientPosition, makeAny( 
maPosition.X ) );
 aPropertySet.setAnyProperty( PROP_VertOrientPosition, makeAny( 
maPosition.Y ) );
 }
diff --git a

Re: Calc memory consumption

2021-01-22 Thread Daniel Armando Rodriguez

El 2021-01-22 08:18, Daniel Armando Rodriguez escribió:

El 2021-01-21 17:35, Michael Meeks escribió:

On 20/01/2021 10:29, Daniel A. Rodriguez wrote:
Hi, exists some kind of formula to estimate how much RAM a 
spreadsheet

could use? For instance 468K rows and columns from A to AG.


Well, trying to do something with such file using an i3 based PC with
4Gb freezes the software completely.


	Both Tor and Noel are right; but I collect the 'shape' of 
pathological

spreadsheets as a hobby =)

Can you tell me:

+ what data-type is in each column
+ whether the column is sparse (ie, are
  there 'holes' in the data)
+ what formulae are used - and what their shape is ?
+ hopefully formulae are normally
  non-confidential


Don't have access to the file so have asked


+ what file format you're using.


XLSX, it's exported from the software the company use



	But of course, this really doesn't belong on the dev list, but in a 
bug

if you have one ?


Nope, just acting as an intermediate in this case


In case nothing jumps out of the above data, possibly running a
sampling profiler under Linux like 'perf' might show what's being 
slow,
though I imagine it sounds like a memory issue (perhaps even a 
transient

memory use) problem.

Thanks ! =)

Michael.




About the file, it's just a log from month activity. No formulas 
involved.



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


Re: Calc memory consumption

2021-01-22 Thread Daniel Armando Rodriguez

El 2021-01-21 17:35, Michael Meeks escribió:

On 20/01/2021 10:29, Daniel A. Rodriguez wrote:
Hi, exists some kind of formula to estimate how much RAM a 
spreadsheet

could use? For instance 468K rows and columns from A to AG.


Well, trying to do something with such file using an i3 based PC with
4Gb freezes the software completely.


Both Tor and Noel are right; but I collect the 'shape' of pathological
spreadsheets as a hobby =)

Can you tell me:

+ what data-type is in each column
+ whether the column is sparse (ie, are
  there 'holes' in the data)
+ what formulae are used - and what their shape is ?
+ hopefully formulae are normally
  non-confidential


Don't have access to the file so have asked


+ what file format you're using.


XLSX, it's exported from the software the company use



	But of course, this really doesn't belong on the dev list, but in a 
bug

if you have one ?


Nope, just acting as an intermediate in this case


In case nothing jumps out of the above data, possibly running a
sampling profiler under Linux like 'perf' might show what's being slow,
though I imagine it sounds like a memory issue (perhaps even a 
transient

memory use) problem.

Thanks ! =)

Michael.


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


Re: Calc memory consumption

2021-01-20 Thread Daniel A. Rodriguez

20 ene. 2021 02:56:24 Tor Lillqvist :

>>
>> Hi, exists some kind of formula to estimate how much RAM a spreadsheet could 
>> use? For instance 468K rows and columns from A to AG.
>
> Why do you need to know? And why is the amount of RAM interesting and not the 
> amount of virtual memory required?
>
> --tml
>

Well, trying to do something with such file using an i3 based PC with 4Gb 
freezes the software completely. However, an i7 with 16Gb handles it well. The 
idea is to find a common ground in between to prevent with hardware.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Calc memory consumption

2021-01-20 Thread Daniel A. Rodriguez
 Well, trying to do something with such file using an i3 based PC with 4Gb
freezes the software completely. However, an i7 with 16Gb handles it well.
The idea is to find a common ground in between to prevent with hardware.

El mié., 20 de enero de 2021 02:56, Tor Lillqvist  escribió:

>
>> Hi, exists some kind of formula to estimate how much RAM a spreadsheet
>> could use? For instance 468K rows and columns from A to AG.
>>
>
> Why do you need to know? And why is the amount of RAM interesting and not
> the amount of virtual memory required?
>
> --tml
>
>
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Calc memory consumption

2021-01-19 Thread Daniel A. Rodriguez
Hi, exists some kind of formula to estimate how much RAM a spreadsheet
could use? For instance 468K rows and columns from A to AG.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2020-11-26 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/core/layout/data/textbox-phantom-change.docx |binary
 sw/qa/core/layout/layout.cxx   |   14 
 sw/source/core/draw/dcontact.cxx   |   29 +-
 sw/source/core/layout/objectformattertxtfrm.cxx|   33 -
 4 files changed, 42 insertions(+), 34 deletions(-)

New commits:
commit cc04f0b6ff5a5e35cfc9dea1a98ea27b0efe6d5d
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Nov 16 11:53:47 2020 +0100
Commit: Xisco Fauli 
CommitDate: Thu Nov 26 16:39:46 2020 +0100

tdf#135198 tdf#138050 sw editing: fix text box position sync

Follow-up to commit c9eb53f200225f2ee6ca695e1326843a487aee51
(tdf#135198 sw editing: text box fell out of its shape)

Every time a shape is repositioned, make sure the text box
inside the shape follows the shape.

The previous solution to this bug, the one implemented in
SwObjectFormatterTextFrame::DoFormatObjs, was a little
more cumbersome. This one should produce fewer regressions,
I hope.

Change-Id: I3e88eb8616cd299cabb7b74b188ab7220746ec89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106421
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 59fec754a1523eede0f19a59e4eeeff593a4d688)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106681
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/core/layout/data/textbox-phantom-change.docx 
b/sw/qa/core/layout/data/textbox-phantom-change.docx
new file mode 100644
index ..75ac039561f6
Binary files /dev/null and b/sw/qa/core/layout/data/textbox-phantom-change.docx 
differ
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 15f2c4edb846..2151b870da13 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 char const DATA_DIRECTORY[] = "/sw/qa/core/layout/data/";
@@ -180,6 +181,19 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testTextBoxStaysInsideShape)
 assertXPath(pXmlDoc, "//fly/infos/bounds", "bottom", "7184");
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxNotModifiedOnOpen)
+{
+// tdf#138050: a freshly opened document containing a shape with a text box
+// should not appear to be modified
+load(DATA_DIRECTORY, "textbox-phantom-change.docx");
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+
+// Without the fix in place this test would have shown that the document
+// was modified due to a fix to tdf#135198
+CPPUNIT_ASSERT(!pDoc->getIDocumentState().IsModified());
+}
+
 CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxAutoGrowVertical)
 {
 load(DATA_DIRECTORY, "textbox-autogrow-vertical.docx");
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 8707bcbaeb84..bece3f460079 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -50,6 +50,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1262,7 +1264,6 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 const SwFormatVertOrient& rVert = GetFormat()->GetVertOrient();
 if ( nYPosDiff != 0 )
 {
-
 if ( rVert.GetRelationOrient() == 
text::RelOrientation::CHAR ||
  rVert.GetRelationOrient() == 
text::RelOrientation::TEXT_LINE )
 {
@@ -1315,6 +1316,32 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 // may affect the size of the underlying textbox.
 lcl_textBoxSizeNotify(GetFormat());
 }
+
+// tdf#135198: keep text box together with its shape
+SwRect aObjRect(rObj.GetSnapRect());
+const SwPageFrame* rPageFrame = pAnchoredDrawObj->GetPageFrame();
+if (rPageFrame && rPageFrame->isFrameAreaPositionValid())
+{
+SwDoc* const pDoc = GetFormat()->GetDoc();
+
+// avoid Undo creation
+::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
+
+// hide any artificial "changes" made by synchronizing the 
textbox position
+const bool bEnableSetModified = 
pDoc->getIDocumentState().IsEnableSetModified();
+pDoc->getIDocumentState().SetEnableSetModified(false);
+
+SfxItemSet aSyncSet(pDoc->GetAttrPool(),
+svl::Items{});
+aSyncSet.Put(SwFormatVertOrient(aObjRect.Top() - 
rPageFrame->getFrameArea().Top(),
+text::VertOrientation::NONE,
+ 

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

2020-11-26 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/core/layout/data/textbox-phantom-change.docx |binary
 sw/qa/core/layout/layout.cxx   |   14 
 sw/source/core/draw/dcontact.cxx   |   29 +-
 sw/source/core/layout/objectformattertxtfrm.cxx|   33 -
 4 files changed, 42 insertions(+), 34 deletions(-)

New commits:
commit 59fec754a1523eede0f19a59e4eeeff593a4d688
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Nov 16 11:53:47 2020 +0100
Commit: László Németh 
CommitDate: Thu Nov 26 14:41:53 2020 +0100

tdf#135198 tdf#138050 sw editing: fix text box position sync

Follow-up to commit c9eb53f200225f2ee6ca695e1326843a487aee51
(tdf#135198 sw editing: text box fell out of its shape)

Every time a shape is repositioned, make sure the text box
inside the shape follows the shape.

The previous solution to this bug, the one implemented in
SwObjectFormatterTextFrame::DoFormatObjs, was a little
more cumbersome. This one should produce fewer regressions,
I hope.

Change-Id: I3e88eb8616cd299cabb7b74b188ab7220746ec89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106421
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/qa/core/layout/data/textbox-phantom-change.docx 
b/sw/qa/core/layout/data/textbox-phantom-change.docx
new file mode 100644
index ..75ac039561f6
Binary files /dev/null and b/sw/qa/core/layout/data/textbox-phantom-change.docx 
differ
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 15f2c4edb846..2151b870da13 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 char const DATA_DIRECTORY[] = "/sw/qa/core/layout/data/";
@@ -180,6 +181,19 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testTextBoxStaysInsideShape)
 assertXPath(pXmlDoc, "//fly/infos/bounds", "bottom", "7184");
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxNotModifiedOnOpen)
+{
+// tdf#138050: a freshly opened document containing a shape with a text box
+// should not appear to be modified
+load(DATA_DIRECTORY, "textbox-phantom-change.docx");
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+
+// Without the fix in place this test would have shown that the document
+// was modified due to a fix to tdf#135198
+CPPUNIT_ASSERT(!pDoc->getIDocumentState().IsModified());
+}
+
 CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxAutoGrowVertical)
 {
 load(DATA_DIRECTORY, "textbox-autogrow-vertical.docx");
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index eb406e418ac9..3ae40ccde5a2 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -49,6 +49,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1260,7 +1262,6 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 const SwFormatVertOrient& rVert = GetFormat()->GetVertOrient();
 if ( nYPosDiff != 0 )
 {
-
 if ( rVert.GetRelationOrient() == 
text::RelOrientation::CHAR ||
  rVert.GetRelationOrient() == 
text::RelOrientation::TEXT_LINE )
 {
@@ -1313,6 +1314,32 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
 // may affect the size of the underlying textbox.
 lcl_textBoxSizeNotify(GetFormat());
 }
+
+// tdf#135198: keep text box together with its shape
+SwRect aObjRect(rObj.GetSnapRect());
+const SwPageFrame* rPageFrame = pAnchoredDrawObj->GetPageFrame();
+if (rPageFrame && rPageFrame->isFrameAreaPositionValid())
+{
+SwDoc* const pDoc = GetFormat()->GetDoc();
+
+// avoid Undo creation
+::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
+
+// hide any artificial "changes" made by synchronizing the 
textbox position
+const bool bEnableSetModified = 
pDoc->getIDocumentState().IsEnableSetModified();
+pDoc->getIDocumentState().SetEnableSetModified(false);
+
+SfxItemSet aSyncSet(pDoc->GetAttrPool(),
+svl::Items{});
+aSyncSet.Put(SwFormatVertOrient(aObjRect.Top() - 
rPageFrame->getFrameArea().Top(),
+text::VertOrientation::NONE,
+
text::RelOrientation::PAGE_FRAME));
+aSyncSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_PAGE, 
pAnchoredDrawObj->GetPageFrame()->GetPhyPa

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

2020-11-12 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/uiwriter/data3/tdf137964.odt   |binary
 sw/qa/extras/uiwriter/uiwriter3.cxx |   34 
 sw/source/core/layout/objectformattertxtfrm.cxx |   25 +
 sw/source/uibase/docvw/edtwin.cxx   |5 +++
 4 files changed, 58 insertions(+), 6 deletions(-)

New commits:
commit 768cfcee178b284be6d96d384364e59e40ecb375
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Nov 3 14:09:46 2020 +0100
Commit: László Németh 
CommitDate: Thu Nov 12 16:20:27 2020 +0100

tdf#137960 tdf#137964 sw: fix Shift-ArrowKey text box movement

A text box and its including shape are now going to keep their
positions in sync along the horizontal (X) axis as well as the
vertical (Y) axis.

Moreover, Shift-UpArrow, Shift-DownArrow, Shift-LeftArrow and
Shift-RightArrow are all going to work the same as the plain
arrow keys, they are just going to move the text a larger
distance.

Change-Id: I49482a101d97927715f47efbf0f58808ea6a8547
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105328
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/qa/extras/uiwriter/data3/tdf137964.odt 
b/sw/qa/extras/uiwriter/data3/tdf137964.odt
new file mode 100644
index ..efbb27628ac7
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf137964.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 477652a6369e..09cad813f162 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -11,6 +11,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -29,6 +31,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 namespace
 {
@@ -1905,4 +1910,33 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133477)
 CPPUNIT_ASSERT_EQUAL(Color(0, 102, 204), aBitmap.GetPixelColor(0, 0));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf137964)
+{
+load(DATA_DIRECTORY, "tdf137964.odt");
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pTextDoc);
+
+CPPUNIT_ASSERT_EQUAL(1, getShapes());
+uno::Reference xShape(getShape(1), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3579), xShape->getPosition().X);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(4090), xShape->getPosition().Y);
+
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+SdrPage* pPage = 
pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+SdrObject* pObject = pPage->GetObj(1);
+SwContact* pTextBox = static_cast(pObject->GetUserCall());
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(RES_FLYFRMFMT), 
pTextBox->GetFormat()->Which());
+
+pWrtShell->SelectObj(Point(), 0, pObject);
+
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_SHIFT | KEY_UP);
+pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_SHIFT | KEY_LEFT);
+Scheduler::ProcessEventsToIdle();
+
+// Without the fix in place, the shape would have stayed where it was
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2579), xShape->getPosition().X);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3090), xShape->getPosition().Y);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx 
b/sw/source/core/layout/objectformattertxtfrm.cxx
index 6b0e910fb113..e3a9b4eb6711 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -370,12 +370,25 @@ bool SwObjectFormatterTextFrame::DoFormatObjs()
 svl::Items{});
 
 const SwRect& rPageFrameArea = 
pPageFrame->getFrameArea();
-
aSet.Put(SwFormatVertOrient(pObj->GetObjRect().Top() - rPageFrameArea.Top(),
-
text::VertOrientation::NONE,
-
text::RelOrientation::PAGE_FRAME));
-aSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_PAGE, 
pObj->GetPageFrame()->GetPhyPageNum()));
-
-SwTextBoxHelper::syncFlyFrameAttr(rFormat, aSet);
+if (rFormat.GetVertOrient().GetPos() != 
pOtherFormat->GetVertOrient().GetPos())
+{
+
aSet.Put(SwFormatVertOrient(pObj->GetObjRect().Top() - rPageFrameArea.Top(),
+
text::VertOrientation::NONE,
+
text::RelOrientation::PAGE_FRAME));
+}
+if (rFormat.GetHoriOrient().GetPos() != 
pOtherFormat->GetHoriOrient().GetPos())
+   

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

2020-11-09 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/core/layout/data/bottom-textbox-size.docx |binary
 sw/qa/core/layout/layout.cxx|   15 
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx|3 --
 sw/source/core/layout/objectformattertxtfrm.cxx |   29 ++--
 4 files changed, 33 insertions(+), 14 deletions(-)

New commits:
commit f2eef84ff03660cbb46a76c317e640e054ed0a56
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Nov 3 11:22:40 2020 +0100
Commit: László Németh 
CommitDate: Mon Nov 9 19:05:20 2020 +0100

tdf#137881 sw: fix text box size regression

from commit c9eb53f200225f2ee6ca695e1326843a487aee51
(tdf#135198 sw editing: text box fell out of its shape).

The height of the bottom text box frame from the tdf#117921 sample
file grew unreasonably large. This is countered by only activating
the previous fix if it is strictly needed, i.e. when a shape and
its text box drift apart from each other.

The test file is derived from the one used for tdf#117921.

Change-Id: Ied01c6089efe586b73de559f89f08b958f4b62d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105238
Tested-by: László Németh 
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/sw/qa/core/layout/data/bottom-textbox-size.docx 
b/sw/qa/core/layout/data/bottom-textbox-size.docx
new file mode 100644
index ..a1c700f28ae9
Binary files /dev/null and b/sw/qa/core/layout/data/bottom-textbox-size.docx 
differ
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index a992a32ae7d4..ff339322fe70 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -196,6 +196,21 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testTextBoxStaysInsideShape)
nTextBoxTopAfter < nTextBoxTopBefore);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxSizeAtBottomOfPage)
+{
+// tdf#137881: check whether text box at the bottom of the page stays the 
right size
+load(DATA_DIRECTORY, "bottom-textbox-size.docx");
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+SdrPage* pPage = 
pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+SdrObject* pTextBoxObj = pPage->GetObj(0);
+
+uno::Reference xShape(pTextBoxObj->getUnoShape(), 
uno::UNO_QUERY_THROW);
+const sal_Int32 nHeight = xShape->getSize().Height;
+CPPUNIT_ASSERT_EQUAL_MESSAGE("text box was not supposed to be resized on 
fileopen",
+ static_cast(2200), nHeight);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index ec680a69a6ad..5919d1a6f76d 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1065,8 +1065,7 @@ DECLARE_OOXMLIMPORT_TEST(textboxWpsOnly, 
"textbox-wps-only.docx")
 if ( nsScreen.frame.size.width * scaleFactor > 4000 )
 return;
 #endif
-// Vertically oriented to page due to tdf#135198
-CPPUNIT_ASSERT_EQUAL(sal_Int32(5304), getProperty(xFrame, 
"VertOrientPosition"));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2805), getProperty(xFrame, 
"VertOrientPosition"));
 }
 
 DECLARE_OOXMLIMPORT_TEST(testGroupshapeRelsize, "groupshape-relsize.docx")
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx 
b/sw/source/core/layout/objectformattertxtfrm.cxx
index 2109835ba841..6b0e910fb113 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -355,23 +355,28 @@ bool SwObjectFormatterTextFrame::DoFormatObjs()
 SwFrameFormat& rFormat = pObj->GetFrameFormat();
 if (SwTextBoxHelper::isTextBox(, RES_DRAWFRMFMT))
 {
-if (const SwPageFrame* pPageFrame = pObj->GetPageFrame())
+const SwFrameFormat* pOtherFormat = 
SwTextBoxHelper::getOtherTextBoxFormat(, RES_DRAWFRMFMT);
+if (rFormat.GetVertOrient().GetPos() != 
pOtherFormat->GetVertOrient().GetPos() ||
+rFormat.GetAnchor().GetAnchorId() != 
pOtherFormat->GetAnchor().GetAnchorId())
 {
-SwDoc* pDoc = rFormat.GetDoc();
+if (const SwPageFrame* pPageFrame = 
pObj->GetPageFrame())
+{
+SwDoc* pDoc = rFormat.GetDoc();
 
-// avoid Undo creation,
-::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
+// avoid Undo creation,
+::sw::UndoGuard const 
ug(pDoc->GetIDocumentUndoRedo());
 
-SfxItemSet aSet(pDoc->GetAttrPool(),
-  

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

2020-11-05 Thread Daniel Arato (NISZ) (via logerrit)
 oox/qa/unit/data/camera-rotation-revolution.docx |binary
 oox/qa/unit/drawingml.cxx|   25 +
 oox/source/drawingml/shape.cxx   |7 +++--
 oox/source/export/drawingml.cxx  |   32 +--
 4 files changed, 60 insertions(+), 4 deletions(-)

New commits:
commit a571afa4a1747fe3ab3078ade6e93093526c6807
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Sep 29 16:37:41 2020 +0200
Commit: Gülşah Köse 
CommitDate: Thu Nov 5 17:04:47 2020 +0100

tdf#133037 OOXML shape import: camera rotation along Z

Instead of implementing proper OOXML 3D rotation (which would be
an entirely new feature if I understand correctly), I merely
interpret attribute "rev" of the rotation element a:camera/a:rot
as a directive to rotate the entire shape the usual 2D way. That
is already implemented and works well. This isn't the same thing
Word does, but it might be good enough for now. This is kind of a
mock solution, but it will be very easy to revert if it turns out
to cause problems.

Note: the export worked well previously, too (moreover, reloading
the first LO export fixed the import).

Change-Id: I2a99c119880bbed1c5b6430c4638cfbd10b7ac06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103627
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit a9c5c0d814a266096483572b84c72875ef8efd77)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105352
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Gülşah Köse 

diff --git a/oox/qa/unit/data/camera-rotation-revolution.docx 
b/oox/qa/unit/data/camera-rotation-revolution.docx
new file mode 100644
index ..74054aa82b3f
Binary files /dev/null and b/oox/qa/unit/data/camera-rotation-revolution.docx 
differ
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index dea8461d543f..f17d1050fe85 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -274,6 +274,31 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, 
testShapeTextAdjustLeft)
 CPPUNIT_ASSERT_EQUAL(drawing::TextHorizontalAdjust_BLOCK, eAdjust);
 }
 
+CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testCameraRotationRevolution)
+{
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"camera-rotation-revolution.docx";
+load(aURL);
+
+uno::Reference 
xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xShape0(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xShape1(xDrawPage->getByIndex(1), 
uno::UNO_QUERY);
+uno::Reference xShapeProps0(xShape0, uno::UNO_QUERY);
+uno::Reference xShapeProps1(xShape1, uno::UNO_QUERY);
+sal_Int32 nRotateAngle0;
+sal_Int32 nRotateAngle1;
+xShapeProps0->getPropertyValue("RotateAngle") >>= nRotateAngle0;
+xShapeProps1->getPropertyValue("RotateAngle") >>= nRotateAngle1;
+
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 8000
+// - Actual  : 0
+// so the camera rotation would not have been factored into how the shape 
is displayed
+CPPUNIT_ASSERT_EQUAL(static_cast(8000), nRotateAngle0);
+CPPUNIT_ASSERT_EQUAL(static_cast(27000), nRotateAngle1);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 2ccc1e20917f..668c30a547b0 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1439,11 +1439,14 @@ Reference< XShape > const & Shape::createAndInsert(
 else if( getTextBody() )
 getTextBody()->getTextProperties().pushVertSimulation();
 
+// tdf#133037: a bit hackish: force Shape to rotate in the opposite 
direction the camera would rotate
+const sal_Int32 nCameraRotation = 
get3DProperties().maCameraRotation.mnRevolution.get(0);
+
 PropertySet aPropertySet(mxShape);
-if ( !bUseRotationTransform && mnRotation != 0 )
+if ( !bUseRotationTransform && (mnRotation != 0 || nCameraRotation != 
0) )
 {
 // use the same logic for rotation from VML exporter 
(SimpleShape::implConvertAndInsert at vmlshape.cxx)
-aPropertySet.setAnyProperty( PROP_RotateAngle, makeAny( sal_Int32( 
NormAngle36000( mnRotation / -600 ) ) ) );
+aPropertySet.setAnyProperty( PROP_RotateAngle, makeAny( sal_Int32( 
NormAngle36000( (mnRotation - nCameraRotation) / -600 ) ) ) );
 aPropertySet.setAnyProperty( PROP_HoriOrientPosition, makeAny( 
maPosition.X ) );
 aPropertySet.setAnyProperty( PROP_VertOrientPosition, makeAny( 
maPosition.Y ) );
 

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

2020-10-29 Thread Daniel Arato (NISZ) (via logerrit)
 sw/CppunitTest_sw_core_layout.mk   |1 +
 sw/qa/core/layout/layout.cxx   |   10 ++
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx |6 --
 3 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 3e2290c55c23c0785763f8de51eba749ab622900
Author: Daniel Arato (NISZ) 
AuthorDate: Thu Oct 29 13:41:06 2020 +0100
Commit: László Németh 
CommitDate: Thu Oct 29 19:02:59 2020 +0100

tdf#135198 fix unit test for HiDPI: pick object by index

Clean-up commit c9eb53f200225f2ee6ca695e1326843a487aee51
(tdf#135198 sw editing: text box fell out of its shape).

Also removed a few unnecessary lines that have been commented out.

Change-Id: I6ec8535f98ed6e7743b34c9e31b0c76c0cddf301
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105006
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/CppunitTest_sw_core_layout.mk b/sw/CppunitTest_sw_core_layout.mk
index 06f35d4bdc04..2cae001add53 100644
--- a/sw/CppunitTest_sw_core_layout.mk
+++ b/sw/CppunitTest_sw_core_layout.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_core_layout, \
 svt \
 tl \
 svl \
+svxcore \
 ))
 
 $(eval $(call gb_CppunitTest_use_externals,sw_core_layout,\
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 7c6ae7df3894..a992a32ae7d4 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -16,9 +16,11 @@
 #include 
 #include 
 #include 
-//#include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 char const DATA_DIRECTORY[] = "/sw/qa/core/layout/data/";
 
@@ -173,9 +175,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testTextBoxStaysInsideShape)
 // tdf#135198: check whether text box stays inside shape after moving it 
upwards
 load(DATA_DIRECTORY, "shape-textbox.odt");
 SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
-SwDocShell* pDocShell = pTextDoc->GetDocShell();
-SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
-SdrObject* pTextBoxObj = pWrtShell->GetObjAt({ 8000, 3000 });
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+SdrPage* pPage = 
pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+SdrObject* pTextBoxObj = pPage->GetObj(0);
 
 xmlDocUniquePtr pLayoutBefore = parseLayoutDump();
 CPPUNIT_ASSERT(pLayoutBefore);
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index dbfd1fa78ead..453b1718d5bf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -660,12 +660,6 @@ DECLARE_OOXMLEXPORT_TEST(testChartSize, "chart-size.docx")
 uno::Reference 
xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), 
uno::UNO_QUERY);
 // This was 10954.
 CPPUNIT_ASSERT_EQUAL(sal_Int32(6008), 
getProperty(xEmbeddedObjects->getByIndex(0), "Width"));
-
-// The following assert no longer applies due to tdf#135198
-
-// Layout modified the document when it had this chart.
-//uno::Reference xModifiable(mxComponent, 
uno::UNO_QUERY);
-//CPPUNIT_ASSERT_EQUAL(false, bool(xModifiable->isModified()));
 }
 
 DECLARE_OOXMLEXPORT_TEST(testInlineGroupshape, "inline-groupshape.docx")
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-27 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/core/layout/data/shape-textbox.odt|binary
 sw/qa/core/layout/layout.cxx|   31 
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx  |6 +++-
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx|3 +-
 sw/source/core/layout/objectformattertxtfrm.cxx |   30 +++
 5 files changed, 67 insertions(+), 3 deletions(-)

New commits:
commit c9eb53f200225f2ee6ca695e1326843a487aee51
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Oct 14 15:46:23 2020 +0200
Commit: László Németh 
CommitDate: Tue Oct 27 13:27:55 2020 +0100

tdf#135198 sw editing: text box fell out of its shape

Without this patch if a shape anchored to a paragraph and containing
a text box was moved upwards beyond the vertical position of its anchor,
the text box failed to keep its position in sync with the shape.

This is fixed by telling the text box the absolute vertical position of
the corresponding shape after the latter is moved.

Note: Other fix is associated to the shortcut keys
Shift-Arrow Up/Shift-Arrow Down for moving text frames with
bigger steps vertically. Now it's not possible to use these
keys, but that was bad with text boxes, because it moved only
the text content of the text box.

Note: this patch fixes the vertical position of the text box
of textbox-wps-only.docx of the unit test textboxWpsOnly.

Change-Id: Ib66b13cae455462c616fed6bbd088433c83e61a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104520
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/qa/core/layout/data/shape-textbox.odt 
b/sw/qa/core/layout/data/shape-textbox.odt
new file mode 100644
index ..26a9eb7f7011
Binary files /dev/null and b/sw/qa/core/layout/data/shape-textbox.odt differ
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 8decbdf8e98c..7c6ae7df3894 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -14,6 +14,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+//#include 
+#include 
+#include 
 
 char const DATA_DIRECTORY[] = "/sw/qa/core/layout/data/";
 
@@ -163,6 +168,32 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testAnchorPositionBasedOnParagraph)
 assertXPath(pXmlDoc, "(//SwAnchoredDrawObject)[3]/bounds", "bottom", 
"3844");
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTextBoxStaysInsideShape)
+{
+// tdf#135198: check whether text box stays inside shape after moving it 
upwards
+load(DATA_DIRECTORY, "shape-textbox.odt");
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+SwDocShell* pDocShell = pTextDoc->GetDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+SdrObject* pTextBoxObj = pWrtShell->GetObjAt({ 8000, 3000 });
+
+xmlDocUniquePtr pLayoutBefore = parseLayoutDump();
+CPPUNIT_ASSERT(pLayoutBefore);
+const int nTextBoxTopBefore = getXPath(pLayoutBefore, 
"//fly/infos/bounds", "top").toInt32();
+
+uno::Reference xShape(pTextBoxObj->getUnoShape(), 
uno::UNO_QUERY_THROW);
+auto aPosition = xShape->getPosition();
+aPosition.Y -= 500;
+xShape->setPosition(aPosition);
+
+discardDumpedLayout();
+xmlDocUniquePtr pLayoutAfter = parseLayoutDump();
+CPPUNIT_ASSERT(pLayoutAfter);
+const int nTextBoxTopAfter = getXPath(pLayoutAfter, "//fly/infos/bounds", 
"top").toInt32();
+CPPUNIT_ASSERT_MESSAGE("text box was supposed to stay inside its shape",
+   nTextBoxTopAfter < nTextBoxTopBefore);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 5b22f0ea274b..dbfd1fa78ead 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -661,9 +661,11 @@ DECLARE_OOXMLEXPORT_TEST(testChartSize, "chart-size.docx")
 // This was 10954.
 CPPUNIT_ASSERT_EQUAL(sal_Int32(6008), 
getProperty(xEmbeddedObjects->getByIndex(0), "Width"));
 
+// The following assert no longer applies due to tdf#135198
+
 // Layout modified the document when it had this chart.
-uno::Reference xModifiable(mxComponent, uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(false, bool(xModifiable->isModified()));
+//uno::Reference xModifiable(mxComponent, 
uno::UNO_QUERY);
+//CPPUNIT_ASSERT_EQUAL(false, bool(xModifiable->isModified()));
 }
 
 DECLARE_OOXMLEXPORT_TEST(testInlineGroupshape, "inline-groupshape.docx")
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index ee1b545821be..91029dae7a1d 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ 

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source

2020-10-14 Thread Daniel Arato (NISZ) (via logerrit)
 chart2/qa/extras/chart2export.cxx   |   14 ++
 chart2/qa/extras/data/odp/tdf121189.odp |binary
 oox/source/export/shapes.cxx|1 +
 3 files changed, 15 insertions(+)

New commits:
commit 9ca974ddb5ba89b09c1c2cfd7efced5895fbead5
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 24 17:29:08 2020 +0200
Commit: Gabor Kelemen 
CommitDate: Wed Oct 14 23:21:14 2020 +0200

tdf#121189 PPTX export: fix missing chart

Based on Regina Henschel's technical analysis and code pointer.

Change-Id: Ifdea48c09d23dce495fa6bc90a9e1648dbb5ccb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101283
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 0c5ac9d1cb39eac838a612092a8934a6ca12326f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104328
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 268e30d46d19..73f335574513 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -147,6 +147,7 @@ public:
 void testTdf119029();
 void testTdf108022();
 void testTdf121744();
+void testTdf121189();
 void testTdf122031();
 void testTdf115012();
 void testTdf134118();
@@ -267,6 +268,7 @@ public:
 CPPUNIT_TEST(testTdf119029);
 CPPUNIT_TEST(testTdf108022);
 CPPUNIT_TEST(testTdf121744);
+CPPUNIT_TEST(testTdf121189);
 CPPUNIT_TEST(testTdf122031);
 CPPUNIT_TEST(testTdf115012);
 CPPUNIT_TEST(testTdf134118);
@@ -2391,6 +2393,18 @@ void Chart2ExportTest::testTdf121744()
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[2]", "val", YValueId );
 }
 
+void Chart2ExportTest::testTdf121189()
+{
+load("/chart2/qa/extras/data/odp/", "tdf121189.odp");
+reload("Impress Office Open XML");
+
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
+uno::Reference 
xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xPage->getCount());
+uno::Reference xShape(xPage->getByIndex(0), 
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.OLE2Shape"), 
xShape->getShapeType());
+}
+
 void Chart2ExportTest::testTdf122031()
 {
 //Checks pie chart data label format.
diff --git a/chart2/qa/extras/data/odp/tdf121189.odp 
b/chart2/qa/extras/data/odp/tdf121189.odp
new file mode 100644
index ..6f99e0054936
Binary files /dev/null and b/chart2/qa/extras/data/odp/tdf121189.odp differ
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 9f69e316cbec..4aa4522bd596 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1550,6 +1550,7 @@ static const NameToConvertMapType& lcl_GetConverters()
 
 { "com.sun.star.presentation.GraphicObjectShape"   , 
::WriteGraphicObjectShape },
 { "com.sun.star.presentation.MediaShape"   , 
::WriteGraphicObjectShape },
+{ "com.sun.star.presentation.ChartShape"   , 
::WriteOLE2Shape },
 { "com.sun.star.presentation.OLE2Shape", 
::WriteOLE2Shape },
 { "com.sun.star.presentation.TableShape"   , 
::WriteTableShape },
 { "com.sun.star.presentation.TextShape", 
::WriteTextShape },
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-10 Thread Daniel (via logerrit)
 include/svx/compressgraphicdialog.hxx   |1 +
 include/svx/strings.hrc |1 +
 svx/source/dialog/compressgraphicdialog.cxx |9 ++---
 3 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 46772b2dbbc269c2e83f00af2cd864fb64ccf425
Author: Daniel 
AuthorDate: Sat Oct 10 10:38:51 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 10 14:26:36 2020 +0200

tdf#87963: Add percentage value to new calculated compressed image size

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

diff --git a/include/svx/compressgraphicdialog.hxx 
b/include/svx/compressgraphicdialog.hxx
index a29225263efb..9c11b8dc765f 100644
--- a/include/svx/compressgraphicdialog.hxx
+++ b/include/svx/compressgraphicdialog.hxx
@@ -59,6 +59,7 @@ private:
 SfxBindings&m_rBindings;
 
 double  m_dResolution;
+sal_Int32   m_aNativeSize;
 
 void Initialize();
 
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index 4b4ca6797e99..1e8b33826120 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1368,6 +1368,7 @@
 #define STR_IMAGE_ORIGINAL_SIZE 
NC_("STR_IMAGE_ORIGINAL_SIZE", "$(WIDTH) x $(HEIGHT) ($(WIDTH_IN_PX) x 
$(HEIGHT_IN_PX) px)")
 #define STR_IMAGE_VIEW_SIZE 
NC_("STR_IMAGE_VIEW_SIZE", "$(WIDTH) x $(HEIGHT) at $(DPI) DPI")
 #define STR_IMAGE_CAPACITY  
NC_("STR_IMAGE_CAPACITY", "$(CAPACITY) kiB")
+#define STR_IMAGE_CAPACITY_WITH_REDUCTION   
NC_("STR_IMAGE_CAPACITY_WITH_REDUCTION", "$(CAPACITY) kiB ($(REDUCTION) % 
Reduction)")
 #define STR_IMAGE_GIF   
NC_("STR_IMAGE_GIF", "Gif image")
 #define STR_IMAGE_JPEG  
NC_("STR_IMAGE_JPEG", "Jpeg image")
 #define STR_IMAGE_PNG   
NC_("STR_IMAGE_PNG", "PNG image")
diff --git a/svx/source/dialog/compressgraphicdialog.cxx 
b/svx/source/dialog/compressgraphicdialog.cxx
index 14b4c809f04a..d16202cd5c1c 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -192,10 +192,10 @@ void CompressGraphicsDialog::Update()
 SvMemoryStream aMemStream;
 aMemStream.SetVersion( SOFFICE_FILEFORMAT_CURRENT );
 m_aGraphic.ExportNative(aMemStream);
-sal_Int32 aNativeSize = aMemStream.TellEnd();
+m_aNativeSize = aMemStream.TellEnd();
 
 OUString aNativeSizeString = SvxResId(STR_IMAGE_CAPACITY);
-aNativeSizeString = aNativeSizeString.replaceAll("$(CAPACITY)",  
OUString::number(aNativeSize / 1024));
+aNativeSizeString = aNativeSizeString.replaceAll("$(CAPACITY)",  
OUString::number( m_aNativeSize  / 1024 ));
 m_xFixedText5->set_label(aNativeSizeString);
 
 m_xFixedText6->set_label("??");
@@ -360,8 +360,11 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, 
CalculateClickHdl, weld::Button&, void
 {
 OUString aSizeAsString = OUString::number(aSize / 1024);
 
-OUString aNewSizeString = SvxResId(STR_IMAGE_CAPACITY);
+OUString aReductionSizeAsString = OUString::number( m_aNativeSize > 0 
? (m_aNativeSize - aSize) * 100 / m_aNativeSize : 0 );
+
+OUString aNewSizeString = SvxResId(STR_IMAGE_CAPACITY_WITH_REDUCTION);
 aNewSizeString = aNewSizeString.replaceAll("$(CAPACITY)", 
aSizeAsString);
+aNewSizeString = aNewSizeString.replaceAll("$(REDUCTION)", 
aReductionSizeAsString);
 m_xFixedText6->set_label(aNewSizeString);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-09 Thread Daniel Arato (NISZ) (via logerrit)
 oox/qa/unit/data/camera-rotation-revolution.docx |binary
 oox/qa/unit/drawingml.cxx|   25 +
 oox/source/drawingml/shape.cxx   |7 +++--
 oox/source/export/drawingml.cxx  |   32 +--
 4 files changed, 60 insertions(+), 4 deletions(-)

New commits:
commit a9c5c0d814a266096483572b84c72875ef8efd77
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Sep 29 16:37:41 2020 +0200
Commit: László Németh 
CommitDate: Fri Oct 9 10:12:35 2020 +0200

tdf#133037 OOXML shape import: camera rotation along Z

Instead of implementing proper OOXML 3D rotation (which would be
an entirely new feature if I understand correctly), I merely
interpret attribute "rev" of the rotation element a:camera/a:rot
as a directive to rotate the entire shape the usual 2D way. That
is already implemented and works well. This isn't the same thing
Word does, but it might be good enough for now. This is kind of a
mock solution, but it will be very easy to revert if it turns out
to cause problems.

Note: the export worked well previously, too (moreover, reloading
the first LO export fixed the import).

Change-Id: I2a99c119880bbed1c5b6430c4638cfbd10b7ac06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103627
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/oox/qa/unit/data/camera-rotation-revolution.docx 
b/oox/qa/unit/data/camera-rotation-revolution.docx
new file mode 100644
index ..74054aa82b3f
Binary files /dev/null and b/oox/qa/unit/data/camera-rotation-revolution.docx 
differ
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index 7fcee1756a6f..6a0415b257f2 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -265,6 +265,31 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, 
testShapeTextAdjustLeft)
 CPPUNIT_ASSERT_EQUAL(drawing::TextHorizontalAdjust_BLOCK, eAdjust);
 }
 
+CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testCameraRotationRevolution)
+{
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"camera-rotation-revolution.docx";
+load(aURL);
+
+uno::Reference 
xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xShape0(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xShape1(xDrawPage->getByIndex(1), 
uno::UNO_QUERY);
+uno::Reference xShapeProps0(xShape0, uno::UNO_QUERY);
+uno::Reference xShapeProps1(xShape1, uno::UNO_QUERY);
+sal_Int32 nRotateAngle0;
+sal_Int32 nRotateAngle1;
+xShapeProps0->getPropertyValue("RotateAngle") >>= nRotateAngle0;
+xShapeProps1->getPropertyValue("RotateAngle") >>= nRotateAngle1;
+
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 8000
+// - Actual  : 0
+// so the camera rotation would not have been factored into how the shape 
is displayed
+CPPUNIT_ASSERT_EQUAL(static_cast(8000), nRotateAngle0);
+CPPUNIT_ASSERT_EQUAL(static_cast(27000), nRotateAngle1);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index c9ade16f7a1d..95b608eadcc6 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1461,11 +1461,14 @@ Reference< XShape > const & Shape::createAndInsert(
 else if( getTextBody() )
 getTextBody()->getTextProperties().pushVertSimulation();
 
+// tdf#133037: a bit hackish: force Shape to rotate in the opposite 
direction the camera would rotate
+const sal_Int32 nCameraRotation = 
get3DProperties().maCameraRotation.mnRevolution.get(0);
+
 PropertySet aPropertySet(mxShape);
-if ( !bUseRotationTransform && mnRotation != 0 )
+if ( !bUseRotationTransform && (mnRotation != 0 || nCameraRotation != 
0) )
 {
 // use the same logic for rotation from VML exporter 
(SimpleShape::implConvertAndInsert at vmlshape.cxx)
-aPropertySet.setAnyProperty( PROP_RotateAngle, makeAny( sal_Int32( 
NormAngle36000( mnRotation / -600 ) ) ) );
+aPropertySet.setAnyProperty( PROP_RotateAngle, makeAny( sal_Int32( 
NormAngle36000( (mnRotation - nCameraRotation) / -600 ) ) ) );
 aPropertySet.setAnyProperty( PROP_HoriOrientPosition, makeAny( 
maPosition.X ) );
 aPropertySet.setAnyProperty( PROP_VertOrientPosition, makeAny( 
maPosition.Y ) );
 }
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 4a9ac9f69014..c19b030ad642 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -

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

2020-10-06 Thread Daniel Arato (NISZ) (via logerrit)
 sw/source/core/unocore/unoframe.cxx|   17 +
 writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx |   21 +++
 writerfilter/qa/cppunittests/dmapper/data/frame-direction.docx |binary
 writerfilter/source/dmapper/DomainMapper.cxx   |   30 
++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx  |6 +-
 writerfilter/source/dmapper/DomainMapper_Impl.hxx  |   21 +++
 6 files changed, 94 insertions(+), 1 deletion(-)

New commits:
commit af4e5ee0f93c1ff442d08caed5c875f2b2c1fd43
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Sep 16 08:48:32 2020 +0200
Commit: László Németh 
CommitDate: Tue Oct 6 12:31:04 2020 +0200

tdf#97128 DOCX import: fix frame direction

Frames used to be imported with zero rotation even if a w:textDirection
tag explicitly called for a non-default orientation.

I found no other solution to pass the incoming frame direction property
on to the SwXFrame about to be created.

1. If you put the property into the GetSectionContext(), it gets
overwritten when the next w:pPr tag is parsed, so all three frames will
end up having the same direction.

2. If you put the property into the GetTopContextOfType(CONTEXT_PARAGRAPH)
that context gets popped off the stack before control even gets to
CheckUnregisteredFrameConversion().

3. If you use PushStyleSheetProperties (which is bad in and of itself),
the order will be messed up because the frames are not necessarily
created in the same order as they are described in the file, so each
frame gets a wrong frame direction in the end.

Follow-up of commit 5a5597655a4bf12e4ca07c9c2b6f6221e217f080
(tentative fix for fdo#30474# [DOCX rotated text import failure]).

Change-Id: I6e3d68fe60c6e2a5b6684c65a964dd86d0168181
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103553
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index e8461393ea6f..a73b8e74fa95 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1402,6 +1402,23 @@ void SwXFrame::setPropertyValue(const OUString& 
rPropertyName, const ::uno::Any&
 {
 SolarMutexGuard aGuard;
 SwFrameFormat* pFormat = GetFrameFormat();
+
+// Hack to support hidden property to transfer textDirection
+if(rPropertyName == "FRMDirection")
+{
+if (pFormat)
+{
+SvxFrameDirectionItem aItem(SvxFrameDirection::Environment, 
RES_FRAMEDIR);
+aItem.PutValue(_rValue, 0);
+GetFrameFormat()->SetFormatAttr(aItem);
+}
+else if(IsDescriptor())
+{
+m_pProps->SetProperty(static_cast(RES_FRAMEDIR), 0, 
_rValue);
+}
+return;
+}
+
 const ::SfxItemPropertySimpleEntry* pEntry = 
m_pPropSet->getPropertyMap().getByName(rPropertyName);
 
 if (!pEntry)
diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx
index 893db1607112..de63ec4084d9 100644
--- a/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx
@@ -14,6 +14,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -104,6 +106,25 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberingRestartStyleParent)
 xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(OUString("2."), 
xPara->getPropertyValue(aProp).get());
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testFrameDirection)
+{
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"frame-direction.docx";
+getComponent() = loadFromDesktop(aURL);
+
+uno::Reference 
xDrawPageSupplier(getComponent(), uno::UNO_QUERY);
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xFrame0(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xFrame1(xDrawPage->getByIndex(1), 
uno::UNO_QUERY);
+uno::Reference xFrame2(xDrawPage->getByIndex(2), 
uno::UNO_QUERY);
+// Without the accompanying fix in place, all of the following values 
would be text::WritingMode2::CONTEXT
+CPPUNIT_ASSERT_EQUAL(text::WritingMode2::CONTEXT,
+ 
xFrame0->getPropertyValue("WritingMode").get());
+CPPUNIT_ASSERT_EQUAL(text::WritingMode2::BT_LR,
+ 
xFrame1->getPropertyValue("WritingMode").get());
+CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL,
+ 
xFrame2->getPropertyValue("WritingMode").get());
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/qa/cppunittests/dmapper/data/frame-direction.docx 
b/writerfilter/qa/cppunitte

[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - include/oox oox/source sw/qa sw/source writerfilter/source

2020-09-18 Thread Daniel Arato (NISZ) (via logerrit)
 include/oox/ole/oleobjecthelper.hxx  |2 +-
 oox/source/ole/oleobjecthelper.cxx   |   10 +++---
 sw/qa/extras/ooxmlexport/data/tdf131537.odt  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx|9 -
 sw/source/filter/ww8/docxattributeoutput.cxx |   16 +++-
 writerfilter/source/dmapper/OLEHandler.cxx   |4 ++--
 6 files changed, 25 insertions(+), 16 deletions(-)

New commits:
commit 8d80c1ae18844e96a7ba0ac5fc1cc608dad1ef07
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 12:48:07 2020 +0200
Commit: Gabor Kelemen 
CommitDate: Fri Sep 18 09:33:30 2020 +0200

tdf#131537 DOCX export: fix OLE "Display as icon"

for example to avoid converting OLE icons of an ODF document
to an icon-size embedded spreadsheet.

When creating a new OLE object in Writer the user has an option called
"Display as icon" which causes the actual contents of the OLE to be
hidden when rendered in the document. This setting, referred to
internally as the DrawAspect of the object, was imported fine, but when
exported to a .docx it always had the value "Content" (corresponding to
"Display as icon" being unchecked). Now OLE objects with "Display as
icon" checked are saved with DrawAspect="Icon".

A grab bag entry was previously used to let the DrawAspect setting flow
through Writer from OOXML import to export. Now this workaround is no
longer needed and is removed by the present commit.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101711
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 07dcb0dab759d4ab535d99c0e6d326959906b87e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102652
Reviewed-by: Dániel Arató 
Reviewed-by: Xisco Fauli 
Tested-by: Jenkins
(cherry picked from commit 10184fcab1f314e0861ad152b320ed1ee31ccdd5)

Change-Id: I46ea4fc95a26bcd1f85e19a506c0965f73d4257a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102937
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 

diff --git a/include/oox/ole/oleobjecthelper.hxx 
b/include/oox/ole/oleobjecthelper.hxx
index 604785f305b6..0d76019318d8 100644
--- a/include/oox/ole/oleobjecthelper.hxx
+++ b/include/oox/ole/oleobjecthelper.hxx
@@ -77,7 +77,7 @@ private:
 OOX_DLLPUBLIC void SaveInteropProperties(
css::uno::Reference const& xModel,
OUString const& rObjectName, OUString const* pOldObjectName,
-   OUString const& rProgId, OUString const& rDrawAspect);
+   OUString const& rProgId);
 
 
 } // namespace ole
diff --git a/oox/source/ole/oleobjecthelper.cxx 
b/oox/source/ole/oleobjecthelper.cxx
index cb909592f9b2..9d909faa2307 100644
--- a/oox/source/ole/oleobjecthelper.cxx
+++ b/oox/source/ole/oleobjecthelper.cxx
@@ -87,7 +87,7 @@ OleObjectHelper::~OleObjectHelper()
 // just "application/vnd.sun.star.oleobject"
 void SaveInteropProperties(uno::Reference const& xModel,
OUString const& rObjectName, OUString const*const pOldObjectName,
-   OUString const& rProgId, OUString const& rDrawAspect)
+   OUString const& rProgId)
 {
 static const char sEmbeddingsPropName[] = "EmbeddedObjects";
 
@@ -100,11 +100,9 @@ void SaveInteropProperties(uno::Reference 
const& xModel,
 if (aGrabBag.find(sEmbeddingsPropName) != aGrabBag.end())
 objectsList << aGrabBag[sEmbeddingsPropName];
 
-uno::Sequence< beans::PropertyValue > aGrabBagAttribute(2);
+uno::Sequence< beans::PropertyValue > aGrabBagAttribute(1);
 aGrabBagAttribute[0].Name = "ProgID";
 aGrabBagAttribute[0].Value <<= rProgId;
-aGrabBagAttribute[1].Name = "DrawAspect";
-aGrabBagAttribute[1].Value <<= rDrawAspect;
 
 // If we got an "old name", erase that first.
 if (pOldObjectName)
@@ -148,9 +146,7 @@ bool OleObjectHelper::importOleObject( PropertyMap& 
rPropMap, const OleObjectInf
 xOutStrm->writeBytes( rOleObject.maEmbeddedData );
 xOutStrm->closeOutput();
 
-SaveInteropProperties(m_xModel, aObjectId, nullptr,
-rOleObject.maProgId,
-rOleObject.mbShowAsIcon ? OUString("Icon") : 
OUString("Content"));
+SaveInteropProperties(m_xModel, aObjectId, nullptr, 
rOleObject.maProgId);
 
 OUString aUrl = mxResolver->resolveEmbeddedObjectURL( aObjectId );
 OSL_ENSURE( aUrl.match( g_aEmbeddedObjScheme ), 
"OleObjectHelper::importOleObject - unexpected URL scheme" );
diff --git a/sw/qa/extras/ooxmlexport/data/tdf131537.odt 
b/sw/qa/extras/ooxmlexport/data/tdf131537.odt
new file mode 100644
index ..21f396368917
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf131537.odt differ
diff --git a/sw/qa

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

2020-09-16 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport12.cxx   |2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx   |3 +--
 sw/source/filter/ww8/docxattributeoutput.cxx |   11 +++
 3 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 17984bf6a57b2c445c2fb9a748e90a74981fcdc8
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Sep 9 13:37:03 2020 +0200
Commit: László Németh 
CommitDate: Wed Sep 16 15:16:53 2020 +0200

tdf#135663 DOCX export: fix OLE distance from text

Implements the export of the "mso-wrap-distance-*" properties of
VML icons of OLE objects to the "style" property of the "object" XML
tag. These properties are variously referred to as "wrap distance",
"margin" or "spacing" and they control the amount of blank space to
be left on each side of the object before text can appear.

Follow-up of commit 8ee88230c110ae90b439a52bc2906d6c5383967f
(tdf#135660 DOCX import: fix OLE icon wrap distance).

Change-Id: I576b876d2dca133b0ff593ff301519c17d2a348f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102323
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index 667695b96f70..682343c782af 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -945,7 +945,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf122563, 
"tdf122563.docx")
 assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 1);
 // Size of the embedded OLE spreadsheet was the bad 
"width:28.35pt;height:28.35pt"
 assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object/v:shape", 
"style",
-"width:255.75pt;height:63.75pt");
+"width:255.75pt;height:63.75pt;mso-wrap-distance-right:0pt");
 }
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf94628, "tdf94628.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 902d1c9df6a2..39a9b103308a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -691,8 +691,7 @@ DECLARE_OOXMLEXPORT_TEST(testImageSpaceSettings, 
"tdf135047_ImageSpaceSettings.f
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distR", "90170");
 }
 
-// TODO: change this to an export test once wrap distance export (TDF#135663) 
is implemented
-DECLARE_OOXMLIMPORT_TEST(testTdf13660, "tdf135660.docx")
+DECLARE_OOXMLEXPORT_TEST(testTdf135660, "tdf135660.docx")
 {
 CPPUNIT_ASSERT_EQUAL(1, getShapes());
 const uno::Reference xShape = getShape(1);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 54cae24fe730..caaaf440ddc3 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5825,6 +5825,17 @@ OString DocxAttributeOutput::GetOLEStyle(const 
SwFlyFrameFormat& rFormat, const
 "pt;height:" + OString::number( double( rSize.Height() 
) / 20 ) +
 "pt"; //from VMLExport::AddRectangleDimensions(), it 
does: value/20
 
+const SvxLRSpaceItem& rLRSpace = rFormat.GetLRSpace();
+if (rLRSpace.IsExplicitZeroMarginValLeft() || rLRSpace.GetLeft())
+sShapeStyle += ";mso-wrap-distance-left:" + 
OString::number(double(rLRSpace.GetLeft()) / 20) + "pt";
+if (rLRSpace.IsExplicitZeroMarginValRight() || rLRSpace.GetRight())
+sShapeStyle += ";mso-wrap-distance-right:" + 
OString::number(double(rLRSpace.GetRight()) / 20) + "pt";
+const SvxULSpaceItem& rULSpace = rFormat.GetULSpace();
+if (rULSpace.GetUpper())
+sShapeStyle += ";mso-wrap-distance-top:" + 
OString::number(double(rULSpace.GetUpper()) / 20) + "pt";
+if (rULSpace.GetLower())
+sShapeStyle += ";mso-wrap-distance-bottom:" + 
OString::number(double(rULSpace.GetLower()) / 20) + "pt";
+
 //Export anchor setting, if it exists
 if (!aPos.isEmpty() && !aAnch.isEmpty())
 sShapeStyle = aPos + sShapeStyle  + aAnch;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - include/oox oox/source sw/qa sw/source writerfilter/source

2020-09-16 Thread Daniel Arato (NISZ) (via logerrit)
 include/oox/ole/oleobjecthelper.hxx  |2 +-
 oox/source/ole/oleobjecthelper.cxx   |   10 +++---
 sw/qa/extras/ooxmlexport/data/tdf131537.odt  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx|7 +++
 sw/source/filter/ww8/docxattributeoutput.cxx |   16 +++-
 writerfilter/source/dmapper/OLEHandler.cxx   |4 ++--
 6 files changed, 24 insertions(+), 15 deletions(-)

New commits:
commit 10184fcab1f314e0861ad152b320ed1ee31ccdd5
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 12:48:07 2020 +0200
Commit: Xisco Fauli 
CommitDate: Wed Sep 16 13:55:19 2020 +0200

tdf#131537 DOCX export: fix OLE "Display as icon"

for example to avoid converting OLE icons of an ODF document
to an icon-size embedded spreadsheet.

When creating a new OLE object in Writer the user has an option called
"Display as icon" which causes the actual contents of the OLE to be
hidden when rendered in the document. This setting, referred to
internally as the DrawAspect of the object, was imported fine, but when
exported to a .docx it always had the value "Content" (corresponding to
"Display as icon" being unchecked). Now OLE objects with "Display as
icon" checked are saved with DrawAspect="Icon".

A grab bag entry was previously used to let the DrawAspect setting flow
through Writer from OOXML import to export. Now this workaround is no
longer needed and is removed by the present commit.

Change-Id: I46ea4fc95a26bcd1f85e19a506c0965f73d4257a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101711
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 07dcb0dab759d4ab535d99c0e6d326959906b87e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102652
Reviewed-by: Dániel Arató 
Reviewed-by: Xisco Fauli 
Tested-by: Jenkins

diff --git a/include/oox/ole/oleobjecthelper.hxx 
b/include/oox/ole/oleobjecthelper.hxx
index 1a5b1b67a044..0ce29c6b3bd9 100644
--- a/include/oox/ole/oleobjecthelper.hxx
+++ b/include/oox/ole/oleobjecthelper.hxx
@@ -77,7 +77,7 @@ private:
 OOX_DLLPUBLIC void SaveInteropProperties(
css::uno::Reference const& xModel,
OUString const& rObjectName, OUString const* pOldObjectName,
-   OUString const& rProgId, OUString const& rDrawAspect);
+   OUString const& rProgId);
 
 
 } // namespace ole
diff --git a/oox/source/ole/oleobjecthelper.cxx 
b/oox/source/ole/oleobjecthelper.cxx
index a77a784af629..4ec40af8073e 100644
--- a/oox/source/ole/oleobjecthelper.cxx
+++ b/oox/source/ole/oleobjecthelper.cxx
@@ -87,7 +87,7 @@ OleObjectHelper::~OleObjectHelper()
 // just "application/vnd.sun.star.oleobject"
 void SaveInteropProperties(uno::Reference const& xModel,
OUString const& rObjectName, OUString const*const pOldObjectName,
-   OUString const& rProgId, OUString const& rDrawAspect)
+   OUString const& rProgId)
 {
 static const char sEmbeddingsPropName[] = "EmbeddedObjects";
 
@@ -100,11 +100,9 @@ void SaveInteropProperties(uno::Reference 
const& xModel,
 if (aGrabBag.find(sEmbeddingsPropName) != aGrabBag.end())
 objectsList << aGrabBag[sEmbeddingsPropName];
 
-uno::Sequence< beans::PropertyValue > aGrabBagAttribute(2);
+uno::Sequence< beans::PropertyValue > aGrabBagAttribute(1);
 aGrabBagAttribute[0].Name = "ProgID";
 aGrabBagAttribute[0].Value <<= rProgId;
-aGrabBagAttribute[1].Name = "DrawAspect";
-aGrabBagAttribute[1].Value <<= rDrawAspect;
 
 // If we got an "old name", erase that first.
 if (pOldObjectName)
@@ -148,9 +146,7 @@ bool OleObjectHelper::importOleObject( PropertyMap& 
rPropMap, const OleObjectInf
 xOutStrm->writeBytes( rOleObject.maEmbeddedData );
 xOutStrm->closeOutput();
 
-SaveInteropProperties(m_xModel, aObjectId, nullptr,
-rOleObject.maProgId,
-rOleObject.mbShowAsIcon ? OUString("Icon") : 
OUString("Content"));
+SaveInteropProperties(m_xModel, aObjectId, nullptr, 
rOleObject.maProgId);
 
 OUString aUrl = mxResolver->resolveEmbeddedObjectURL( aObjectId );
 OSL_ENSURE( aUrl.match( g_aEmbeddedObjScheme ), 
"OleObjectHelper::importOleObject - unexpected URL scheme" );
diff --git a/sw/qa/extras/ooxmlexport/data/tdf131537.odt 
b/sw/qa/extras/ooxmlexport/data/tdf131537.odt
new file mode 100644
index ..21f396368917
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf131537.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 08d4831d1b12..43b404553741 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras

[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - oox/source sw/qa sw/source writerfilter/source

2020-09-15 Thread Daniel Arato (NISZ) (via logerrit)
 oox/source/token/properties.txt   |1 +
 oox/source/vml/vmlshape.cxx   |1 +
 sw/qa/extras/ooxmlexport/data/tdf135665.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx|   17 +++--
 sw/source/core/unocore/unoframe.cxx   |8 ++--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   17 +
 6 files changed, 32 insertions(+), 12 deletions(-)

New commits:
commit 2048a2c268125f17a440ec449df4030b91758172
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Sep 2 15:46:56 2020 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 15 12:55:59 2020 +0200

tdf#135665 DOCX: import tight wrap setting of VML shapes

The wrap setting that OOXML calls "tight" and LibreOffice calls
"contour" (== true) was not supported by the import code, only
the export.

Change-Id: I48739ffaad48e28df05fd87a9b51a14238dc47e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101932
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 4b7ee7bd61f78be60211cc72ba36da987191266e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102124
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 41e33ea67c26..5ae85fd245e1 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -508,6 +508,7 @@ SubViewSize
 Subtotals
 Suffix
 Surround
+SurroundContour
 SwapXAndYAxis
 Symbol
 SymbolColor
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index a1e5744db8da..d52e8e97fe1d 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -584,6 +584,7 @@ static void lcl_setSurround(PropertySet& rPropSet, const 
ShapeTypeModel& rTypeMo
 nSurround = css::text::WrapTextMode_NONE;
 
 rPropSet.setProperty(PROP_Surround, static_cast(nSurround));
+rPropSet.setProperty(PROP_SurroundContour, aWrapType == "tight");
 }
 
 static void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& 
rTypeModel, const GraphicHelper& rGraphicHelper)
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135665.docx 
b/sw/qa/extras/ooxmlexport/data/tdf135665.docx
new file mode 100644
index ..2400a1c1a46c
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf135665.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 792e919394b7..ab204e9c5e67 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -41,7 +41,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133370_columnBreak, 
"tdf133370_columnBreak.odt")
 CPPUNIT_ASSERT_EQUAL(1, getPages());
 }
 
-DECLARE_OOXMLIMPORT_TEST(testTdf131801, "tdf131801.docx")
+DECLARE_OOXMLEXPORT_TEST(testTdf131801, "tdf131801.docx")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
 
@@ -126,6 +126,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx")
 CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, 
"//page[1]/body/txt[1]/Text[3]", "nWidth").toInt32());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf135665, "tdf135665.docx")
+{
+uno::Reference xOLEProps1(getShape(1), 
uno::UNO_QUERY_THROW);
+uno::Reference xOLEProps2(getShape(2), 
uno::UNO_QUERY_THROW);
+bool bSurroundContour1 = false;
+bool bSurroundContour2 = false;
+xOLEProps1->getPropertyValue("SurroundContour") >>= bSurroundContour1;
+xOLEProps2->getPropertyValue("SurroundContour") >>= bSurroundContour2;
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE tight wrap setting not imported 
correctly", true, bSurroundContour1);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE tight wrap setting not imported 
correctly", false, bSurroundContour2);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testAtPageShapeRelOrientation, "rotated_shape.fodt")
 {
 // invalid combination of at-page anchor and horizontal-rel="paragraph"
@@ -179,7 +192,7 @@ 
DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginHasFooter,
 CPPUNIT_ASSERT_EQUAL(static_cast(1147), nAnchoredHeight);
 }
 
-DECLARE_OOXMLIMPORT_TEST(TestTdf132483, "tdf132483.docx")
+DECLARE_OOXMLEXPORT_TEST(TestTdf132483, "tdf132483.docx")
 {
 uno::Reference xOLEProps(getShape(1), 
uno::UNO_QUERY_THROW);
 sal_Int16 nVRelPos = -1;
diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index a04ac6908b92..c96dc6676dda 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -751,15 +751,19 @@ bool 
BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
 bRet &= aSh.PutValue(*pShTr, MID_SHADOW_TRANSPARENCE);
 rToSet.Put(aSh);
 

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

2020-09-14 Thread Daniel Arato (NISZ) (via logerrit)
 sw/source/uibase/dochdl/swdtflvr.cxx |   18 ++
 1 file changed, 18 insertions(+)

New commits:
commit a354b7f7476513e5b1b4bbf1986b483cf122d47b
Author: Daniel Arato (NISZ) 
AuthorDate: Tue Sep 8 16:56:58 2020 +0200
Commit: László Németh 
CommitDate: Mon Sep 14 12:51:21 2020 +0200

tdf#135669 sw: drag and drop other files as OLE

from file managers.

Native text, PDF and image file formats were supported,
but now spreadsheet and DOCX documents, too. The same
feature was already implemented in e.g. Impress.

Note: DOCX files inserted as OLE objects yet, and not
linked files in sections, as ODTs (but it's possible saving
and printing them via Save As option of the local menu
of the OLE object).

Change-Id: Ia2fafe4a0b79dc0c66eaec5ad073c994f98e1345
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102263
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 52c6b47d469f..745731327a09 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -2246,6 +2246,19 @@ bool SwTransferable::PasteOLE( TransferableDataHelper& 
rData, SwWrtShell& rSh,
 }
 }
 }
+else if (rData.HasFormat(SotClipboardFormatId::SIMPLE_FILE))
+{
+OUString sFile;
+if (rData.GetString(nFormat, sFile) && !sFile.isEmpty())
+{
+// Copied from sd::View::DropInsertFileHdl
+uno::Sequence< beans::PropertyValue > aMedium(1);
+aMedium[0].Name = "URL";
+aMedium[0].Value <<= sFile;
+SwDocShell* pDocSh = rSh.GetDoc()->GetDocShell();
+xObj = 
pDocSh->GetEmbeddedObjectContainer().InsertEmbeddedObject(aMedium, aName);
+}
+}
 }
 
 if ( xStrm.is() && !xObj.is() )
@@ -3023,6 +3036,11 @@ bool SwTransferable::PasteFileName( 
TransferableDataHelper& rData,
 rSh.StartInsertRegionDialog( aSect ); // starts dialog 
asynchronously
 bRet = true;
 }
+else if (SwPasteSdr::Insert == nAction && 
rData.HasFormat(SotClipboardFormatId::SIMPLE_FILE))
+{
+// insert file as OLE
+PasteOLE(rData, rSh, nFormat, nActionFlags, nullptr == 
pPt);
+}
 else if( SwPasteSdr::SetAttr == nAction ||
 ( bIsURLFile && SwPasteSdr::Insert == nAction ))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-11 Thread Daniel Arato (NISZ) (via logerrit)
 oox/source/vml/vmlshape.cxx   |9 +
 sw/qa/extras/ooxmlexport/data/tdf135660.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx|   20 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 
 4 files changed, 33 insertions(+)

New commits:
commit 8ee88230c110ae90b439a52bc2906d6c5383967f
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Sep 7 11:50:53 2020 +0200
Commit: László Németh 
CommitDate: Fri Sep 11 10:19:18 2020 +0200

tdf#135660 DOCX import: fix OLE icon wrap distance

The text wrap distance (also sometimes called "margin") of
OLE VML icons used to be thrown away when a .docx file is opened.

Change-Id: I79837421470dde5e68e916f87924b170ebf1d734
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102159
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index f8a4c9000e66..905548bafb9e 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -911,6 +911,15 @@ Reference< XShape > SimpleShape::createPictureObject(const 
Reference< XShapes >&
 const GraphicHelper& rGraphicHelper = 
mrDrawing.getFilter().getGraphicHelper();
 lcl_SetAnchorType(aPropSet, maTypeModel, rGraphicHelper);
 
+const sal_Int32 nWrapDistanceLeft = 
ConversionHelper::decodeMeasureToHmm(rGraphicHelper, 
maTypeModel.maWrapDistanceLeft, 0, true, true);
+const sal_Int32 nWrapDistanceRight = 
ConversionHelper::decodeMeasureToHmm(rGraphicHelper, 
maTypeModel.maWrapDistanceRight, 0, true, true);
+const sal_Int32 nWrapDistanceTop = 
ConversionHelper::decodeMeasureToHmm(rGraphicHelper, 
maTypeModel.maWrapDistanceTop, 0, false, true);
+const sal_Int32 nWrapDistanceBottom = 
ConversionHelper::decodeMeasureToHmm(rGraphicHelper, 
maTypeModel.maWrapDistanceBottom, 0, false, true);
+aPropSet.setProperty(PROP_LeftMargin, uno::makeAny(nWrapDistanceLeft));
+aPropSet.setProperty(PROP_RightMargin, 
uno::makeAny(nWrapDistanceRight));
+aPropSet.setProperty(PROP_TopMargin, uno::makeAny(nWrapDistanceTop));
+aPropSet.setProperty(PROP_BottomMargin, 
uno::makeAny(nWrapDistanceBottom));
+
 if (maTypeModel.moCropBottom.has() || maTypeModel.moCropLeft.has() || 
maTypeModel.moCropRight.has() || maTypeModel.moCropTop.has())
 {
 text::GraphicCrop aGraphicCrop;
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135660.docx 
b/sw/qa/extras/ooxmlexport/data/tdf135660.docx
new file mode 100644
index ..2309c9b0ac09
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf135660.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 104e867a33ba..5aad7cc44f0e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -674,6 +674,26 @@ DECLARE_OOXMLEXPORT_TEST(testImageSpaceSettings, 
"tdf135047_ImageSpaceSettings.f
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distR", "90170");
 }
 
+// TODO: change this to an export test once wrap distance export (TDF#135663) 
is implemented
+DECLARE_OOXMLIMPORT_TEST(testTdf13660, "tdf135660.docx")
+{
+CPPUNIT_ASSERT_EQUAL(1, getShapes());
+const uno::Reference xShape = getShape(1);
+const uno::Reference xOLEProps(xShape, 
uno::UNO_QUERY_THROW);
+sal_Int32 nWrapDistanceLeft = -1;
+sal_Int32 nWrapDistanceRight = -1;
+sal_Int32 nWrapDistanceTop = -1;
+sal_Int32 nWrapDistanceBottom = -1;
+xOLEProps->getPropertyValue("LeftMargin") >>= nWrapDistanceLeft;
+xOLEProps->getPropertyValue("RightMargin") >>= nWrapDistanceRight;
+xOLEProps->getPropertyValue("TopMargin") >>= nWrapDistanceTop;
+xOLEProps->getPropertyValue("BottomMargin") >>= nWrapDistanceBottom;
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Left wrap distance is wrong", 
static_cast(0), nWrapDistanceLeft);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Right wrap distance is wrong", 
static_cast(400), nWrapDistanceRight);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Top wrap distance is wrong", 
static_cast(300), nWrapDistanceTop);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Bottom wrap distance is wrong", 
static_cast(199), nWrapDistanceBottom);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 6387d22b12a3..fc9c13e9c562 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2271,6 +2271,10 @@ void DomainMapper_Impl::appendOLE( const OUString& 
rStreamName, const std::share

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

2020-09-07 Thread Daniel Arato (NISZ) (via logerrit)
 oox/source/token/properties.txt   |1 +
 oox/source/vml/vmlshape.cxx   |1 +
 sw/qa/extras/ooxmlexport/data/tdf135665.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx|   13 +
 sw/source/core/unocore/unoframe.cxx   |8 ++--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |1 +
 6 files changed, 22 insertions(+), 2 deletions(-)

New commits:
commit 4b7ee7bd61f78be60211cc72ba36da987191266e
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Sep 2 15:46:56 2020 +0200
Commit: László Németh 
CommitDate: Mon Sep 7 13:11:44 2020 +0200

tdf#135665 DOCX: import tight wrap setting of VML shapes

The wrap setting that OOXML calls "tight" and LibreOffice calls
"contour" (== true) was not supported by the import code, only
the export.

Change-Id: I48739ffaad48e28df05fd87a9b51a14238dc47e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101932
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 46200bf221ff..d50cd4bb124d 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -509,6 +509,7 @@ SubViewSize
 Subtotals
 Suffix
 Surround
+SurroundContour
 SwapXAndYAxis
 Symbol
 SymbolColor
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 85ad112bcfae..f8a4c9000e66 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -588,6 +588,7 @@ static void lcl_setSurround(PropertySet& rPropSet, const 
ShapeTypeModel& rTypeMo
 nSurround = css::text::WrapTextMode_NONE;
 
 rPropSet.setProperty(PROP_Surround, static_cast(nSurround));
+rPropSet.setProperty(PROP_SurroundContour, aWrapType == "tight");
 }
 
 static void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& 
rTypeModel, const GraphicHelper& rGraphicHelper)
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135665.docx 
b/sw/qa/extras/ooxmlexport/data/tdf135665.docx
new file mode 100644
index ..2400a1c1a46c
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf135665.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 4e39a5af0297..95770433a6ab 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -513,6 +513,19 @@ DECLARE_OOXMLIMPORT_TEST(TestTdf135653, "tdf135653.docx")
 CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE bg color does not match!", 
aExpectedColor, aFillColor);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf135665, "tdf135665.docx")
+{
+uno::Reference xOLEProps1(getShape(1), 
uno::UNO_QUERY_THROW);
+uno::Reference xOLEProps2(getShape(2), 
uno::UNO_QUERY_THROW);
+bool bSurroundContour1 = false;
+bool bSurroundContour2 = false;
+xOLEProps1->getPropertyValue("SurroundContour") >>= bSurroundContour1;
+xOLEProps2->getPropertyValue("SurroundContour") >>= bSurroundContour2;
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE tight wrap setting not imported 
correctly", true, bSurroundContour1);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE tight wrap setting not imported 
correctly", false, bSurroundContour2);
+}
+
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAtPageShapeRelOrientation, 
"rotated_shape.fodt")
 {
 // invalid combination of at-page anchor and horizontal-rel="paragraph"
diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index 2d122992d840..5d7b86fc37e0 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -752,15 +752,19 @@ bool 
BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
 bRet &= aSh.PutValue(*pShTr, MID_SHADOW_TRANSPARENCE);
 rToSet.Put(aSh);
 }
-const ::uno::Any* pSur  = nullptr;
+const ::uno::Any* pSur = nullptr;
 GetProperty(RES_SURROUND, MID_SURROUND_SURROUNDTYPE, pSur);
+const ::uno::Any* pSurCont = nullptr;
+GetProperty(RES_SURROUND, MID_SURROUND_CONTOUR, pSurCont);
 const ::uno::Any* pSurAnch = nullptr;
 GetProperty(RES_SURROUND, MID_SURROUND_ANCHORONLY, pSurAnch);
 if(pSur || pSurAnch)
 {
 SwFormatSurround aSrnd ( rFromSet.Get ( RES_SURROUND ) );
 if(pSur)
-bRet &= static_cast(aSrnd).PutValue(*pSur, 
MID_SURROUND_SURROUNDTYPE );
+bRet &= static_cast(aSrnd).PutValue(*pSur, 
MID_SURROUND_SURROUNDTYPE);
+if(pSurCont)
+bRet &= static_cast(aSrnd).PutValue(*pSurCont, 
MID_SURROUND_CONTOUR);
 if(pSurAnch)
 bRet &= static_cast(aSrnd).PutValue(*pSurAnch, 
MID_SURROUND_ANCHORONLY);
 rToSet.Put(aSrnd);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 

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

2020-09-03 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 0be6e21857f868d85049fca2c8e02fc5e8802120
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:30:26 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 19:35:50 2020 +0200

tdf#129423 sw: export-only tests, part 10

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index fa09ebbfbc27..120a8db1d3bb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -119,13 +119,10 @@ DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, 
"dml-textshape.docx")
 CPPUNIT_ASSERT_EQUAL(sal_Int32(-4727), xShape->getPosition().Y);
 }
 
-DECLARE_OOXMLEXPORT_TEST(testDmlTextshapeB, "dml-textshapeB.docx")
+// testDmlTextshapeB was only made export-only because as an import-export 
test it failed for an unknown reason
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDmlTextshapeB, "dml-textshapeB.docx")
 {
 uno::Reference xGroup(getShape(1), 
uno::UNO_QUERY);
-xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
-if (!pXmlDocument)
-return;
-
 uno::Reference xShape(xGroup->getByIndex(3), 
uno::UNO_QUERY);
 // Connector was incorrectly shifted towards the top left corner, X was 
192, Y was -5743.
 CPPUNIT_ASSERT_EQUAL(sal_Int32(3778), xShape->getPosition().X);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-03 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx |   13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

New commits:
commit 77829e5310350afe5d5e66f8abc3adbcc988ba39
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:24:20 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 19:35:12 2020 +0200

tdf#129423 sw: export-only tests, part 4

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index cc2a19c44cd2..fff8e17ec4f5 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -883,12 +883,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf125324, "tdf125324.docx")
 assertXPath(pXmlDoc, 
"/root/page/body/txt[2]/anchored/fly/tab/infos/bounds", "top", "4193");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf78657, "tdf78657_picture_hyperlink.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf78657, 
"tdf78657_picture_hyperlink.docx")
 {
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
 xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels");
-if (!pXmlDoc || !pXmlRels)
-return;
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:r/w:drawing/wp:inline/wp:docPr/a:hlinkClick", 1);
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:nvPicPr/pic:cNvPr/a:hlinkClick",
 1);
 assertXPath(pXmlRels, 
"/rels:Relationships/rels:Relationship[@Target='http://www.google.com']", 
"TargetMode", "External");
@@ -1107,8 +1105,6 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127362, 
"tdf127362.odt")
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
 
 xmlDocUniquePtr pXmlRels = parseExport("word/_rels/document.xml.rels");
-if (!pXmlRels)
-return;
 
 OUString bookmarkName = "#" + getXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:bookmarkStart", "name");
 OUString anchor = getXPath(pXmlRels, 
"/rels:Relationships/rels:Relationship[@Id='rId3']", "Target");
@@ -1175,8 +1171,6 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123628, 
"tdf123628.odt")
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
 
 xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
-if (!pXmlStyles)
-return;
 
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:hyperlink/w:r/w:rPr/w:rStyle", "val", 
"InternetLink");
 assertXPath(pXmlStyles, 
"/w:styles/w:style[@w:styleId='InternetLink']/w:name", "val", "Hyperlink");
@@ -1192,13 +1186,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127741, 
"tdf127741.docx")
 CPPUNIT_ASSERT(visitedStyleName.equalsIgnoreAsciiCase("Visited Internet 
Link"));
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf127925, "tdf127925.odt")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127925, "tdf127925.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
 xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
-if (!pXmlStyles)
-return;
-
 assertXPath(pXmlStyles, 
"/w:styles/w:style[@w:styleId='VisitedInternetLink']/w:name", "val", 
"FollowedHyperlink");
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-03 Thread Daniel Arato (NISZ) (via logerrit)
 include/oox/ole/oleobjecthelper.hxx  |2 +-
 oox/source/ole/oleobjecthelper.cxx   |   10 +++---
 sw/qa/extras/ooxmlexport/data/tdf131537.odt  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx|7 +++
 sw/source/filter/ww8/docxattributeoutput.cxx |   16 +++-
 writerfilter/source/dmapper/OLEHandler.cxx   |4 ++--
 6 files changed, 24 insertions(+), 15 deletions(-)

New commits:
commit 07dcb0dab759d4ab535d99c0e6d326959906b87e
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 12:48:07 2020 +0200
Commit: László Németh 
CommitDate: Thu Sep 3 18:34:55 2020 +0200

tdf#131537 DOCX export: fix OLE "Display as icon"

for example to avoid converting OLE icons of an ODF document
to an icon-size embedded spreadsheet.

When creating a new OLE object in Writer the user has an option called
"Display as icon" which causes the actual contents of the OLE to be
hidden when rendered in the document. This setting, referred to
internally as the DrawAspect of the object, was imported fine, but when
exported to a .docx it always had the value "Content" (corresponding to
"Display as icon" being unchecked). Now OLE objects with "Display as
icon" checked are saved with DrawAspect="Icon".

A grab bag entry was previously used to let the DrawAspect setting flow
through Writer from OOXML import to export. Now this workaround is no
longer needed and is removed by the present commit.

Change-Id: I46ea4fc95a26bcd1f85e19a506c0965f73d4257a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101711
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/include/oox/ole/oleobjecthelper.hxx 
b/include/oox/ole/oleobjecthelper.hxx
index a9d6bfec54bd..d2506f3d4949 100644
--- a/include/oox/ole/oleobjecthelper.hxx
+++ b/include/oox/ole/oleobjecthelper.hxx
@@ -76,7 +76,7 @@ private:
 OOX_DLLPUBLIC void SaveInteropProperties(
css::uno::Reference const& xModel,
OUString const& rObjectName, OUString const* pOldObjectName,
-   OUString const& rProgId, OUString const& rDrawAspect);
+   OUString const& rProgId);
 
 
 } // namespace oox::ole
diff --git a/oox/source/ole/oleobjecthelper.cxx 
b/oox/source/ole/oleobjecthelper.cxx
index b6c4edb4314e..6716ac1ebb29 100644
--- a/oox/source/ole/oleobjecthelper.cxx
+++ b/oox/source/ole/oleobjecthelper.cxx
@@ -87,7 +87,7 @@ OleObjectHelper::~OleObjectHelper()
 // just "application/vnd.sun.star.oleobject"
 void SaveInteropProperties(uno::Reference const& xModel,
OUString const& rObjectName, OUString const*const pOldObjectName,
-   OUString const& rProgId, OUString const& rDrawAspect)
+   OUString const& rProgId)
 {
 static const char sEmbeddingsPropName[] = "EmbeddedObjects";
 
@@ -100,11 +100,9 @@ void SaveInteropProperties(uno::Reference 
const& xModel,
 if (aGrabBag.find(sEmbeddingsPropName) != aGrabBag.end())
 objectsList << aGrabBag[sEmbeddingsPropName];
 
-uno::Sequence< beans::PropertyValue > aGrabBagAttribute(2);
+uno::Sequence< beans::PropertyValue > aGrabBagAttribute(1);
 aGrabBagAttribute[0].Name = "ProgID";
 aGrabBagAttribute[0].Value <<= rProgId;
-aGrabBagAttribute[1].Name = "DrawAspect";
-aGrabBagAttribute[1].Value <<= rDrawAspect;
 
 // If we got an "old name", erase that first.
 if (pOldObjectName)
@@ -148,9 +146,7 @@ bool OleObjectHelper::importOleObject( PropertyMap& 
rPropMap, const OleObjectInf
 xOutStrm->writeBytes( rOleObject.maEmbeddedData );
 xOutStrm->closeOutput();
 
-SaveInteropProperties(m_xModel, aObjectId, nullptr,
-rOleObject.maProgId,
-rOleObject.mbShowAsIcon ? OUString("Icon") : 
OUString("Content"));
+SaveInteropProperties(m_xModel, aObjectId, nullptr, 
rOleObject.maProgId);
 
 OUString aUrl = mxResolver->resolveEmbeddedObjectURL( aObjectId );
 OSL_ENSURE( aUrl.match( g_aEmbeddedObjScheme ), 
"OleObjectHelper::importOleObject - unexpected URL scheme" );
diff --git a/sw/qa/extras/ooxmlexport/data/tdf131537.odt 
b/sw/qa/extras/ooxmlexport/data/tdf131537.odt
new file mode 100644
index ..21f396368917
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf131537.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 6c07f4534ed4..af9cd5c86a56 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -909,6 +909,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80898, 
"fdo80898.docx")
 "Word.Document.8");
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOleIconDra

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

2020-09-03 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |   35 ++
 1 file changed, 12 insertions(+), 23 deletions(-)

New commits:
commit 4d57fd4557d818c6ec5aea12cdd797899b4fdcf7
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:28:43 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 10:23:41 2020 +0200

tdf#129423 sw: export-only tests, part 8

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 928e4557d8b0..f2ede8360d81 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -558,7 +558,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testOleObject, 
"test_ole_object.docx")
 
 }
 
-DECLARE_OOXMLEXPORT_TEST(testFdo74792, "fdo74792.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo74792, "fdo74792.docx")
 {
 /*
  * fdo#74792 : The images associated with smart-art data[i].xml
@@ -566,8 +566,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo74792, "fdo74792.docx")
  * Added support to grabbag the rels, with associated images.
  */
 xmlDocUniquePtr pXmlDoc = 
parseExport("word/diagrams/_rels/data1.xml.rels");
-if(!pXmlDoc)
-return;
 assertXPath(pXmlDoc,"/rels:Relationships/rels:Relationship", 4);
 uno::Reference xNameAccess = 
packages::zip::ZipFileAccess::createWithURL(
  comphelper::getComponentContext(m_xSFactory), 
maTempFile.GetURL());
@@ -577,19 +575,14 @@ DECLARE_OOXMLEXPORT_TEST(testFdo74792, "fdo74792.docx")
 CPPUNIT_ASSERT( xInputStream.is() );
 }
 
-DECLARE_OOXMLEXPORT_TEST(testFdo77718, "fdo77718.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo77718, "fdo77718.docx")
 {
 //in case of multiple smart arts the names for images were getting
 //repeated and thereby causing a data loss as the binary stream was
 //getting over written. This test case ensures that unique names are
 //given for images in different smart arts.
 xmlDocUniquePtr pXmlDataRels1 = 
parseExport("word/diagrams/_rels/data1.xml.rels");
-if( !pXmlDataRels1 )
-return;
-
 xmlDocUniquePtr pXmlDataRels2 = 
parseExport("word/diagrams/_rels/data2.xml.rels");
-if( !pXmlDataRels2 )
-return;
 
 //ensure that the rels file is present.
 assertXPath(pXmlDataRels1,"/rels:Relationships/rels:Relationship", 4);
@@ -806,7 +799,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCheckBoxControl, 
"checkbox-control.docx"
 // TODO: import control and add a check here
 }
 
-DECLARE_OOXMLEXPORT_TEST(testParagraphWithComments, 
"paragraphWithComments.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParagraphWithComments, 
"paragraphWithComments.docx")
 {
 /* Comment id's were getting overwritten for annotation mark(s),
which was causing a mismatch in the relationship for comment id's
@@ -814,8 +807,6 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphWithComments, 
"paragraphWithComments.docx"
 */
 xmlDocUniquePtr pXmlDoc  = parseExport("word/document.xml");
 xmlDocUniquePtr pXmlComm = parseExport("word/comments.xml");
-if(!pXmlDoc)
-return;
 
 sal_Int32 idInDocXml = 
getXPath(pXmlDoc,"/w:document/w:body/w:p[3]/w:commentRangeEnd[1]","id").toInt32();
 sal_Int32 idInCommentXml = 
getXPath(pXmlComm,"/w:comments/w:comment[1]","id").toInt32();
@@ -963,14 +954,12 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76108, 
"test76108.docx")
 assertXPath(pXmlDoc, 
"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:fldChar[1]", "fldCharType", "begin");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTCTagMisMatch, "TCTagMisMatch.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTCTagMisMatch, "TCTagMisMatch.docx")
 {
// TCTagMisMatch.docx : This document contains an empty table with borders.
// there was a TC tag mismatch which resulted into a crash.
 
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
-   if(!pXmlDoc)
-  return;

assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]",0);
assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]", 1);
 }
@@ -1042,12 +1031,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103001, 
"tdf103001.docx")
 CPPUNIT_ASSERT(xNameAccess->hasByName("word/_rels/header1.xml.rels&qu

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

2020-09-03 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 0e3e0b04395de673e0cc9709de360e5cf95c1cc7
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:25:43 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 09:22:38 2020 +0200

tdf#129423 sw: export-only tests, part 5

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 88f86f57da67..bcd96e2491cc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -1234,7 +1234,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf108505, 
"tdf108505.docx")
 getProperty(xText, "CharFontName"));
 }
 
-DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromTopMarginHasHeader,
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorHeightFromTopMarginHasHeader,
  
"tdf123324_testRelativeAnchorHeightFromTopMarginHasHeader.docx")
 {
 // tdf#123324 The height was set relative to page print area top,
@@ -1242,12 +1242,10 @@ 
DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromTopMarginHasHeader,
 // Note: page print area top = margin + header height.
 // In this case the header exists.
 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
-if (!pXmlDoc)
-return;
 assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height", "2551");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromTopMarginNoHeader,
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorHeightFromTopMarginNoHeader,
  
"tdf123324_testRelativeAnchorHeightFromTopMarginNoHeader.docx")
 {
 // tdf#123324 The height was set relative from top margin, but this was 
handled relative from page height.
@@ -1259,8 +1257,6 @@ 
DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromTopMarginNoHeader,
 // Note: page print area top = margin + header height.
 // In this case the header does not exist, so OpenDocument and OOXML 
margins are the same.
 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
-if (!pXmlDoc)
-return;
 assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height", "2551");
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-03 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |  102 +-
 1 file changed, 45 insertions(+), 57 deletions(-)

New commits:
commit f51aaf80002c74af78c8934a3dff4938e1f55acd
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:29:45 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 08:46:55 2020 +0200

tdf#129423 sw: export-only tests, part 9

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 7ef68c54404a..6c07f4534ed4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -109,11 +109,11 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo76589 , 
"fdo76589.docx")
 assertXPath ( pXmlDoc, 
"/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val","%1" );
 }
 
-DECLARE_OOXMLEXPORT_TEST(testDecimalNumberingNoLeveltext, 
"decimal-numbering-no-leveltext.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDecimalNumberingNoLeveltext, 
"decimal-numbering-no-leveltext.docx")
 {
 // This was "%1", not empty: we turned a kind-of-none numbering into a 
decimal one.
-if (xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"))
-assertXPath (pXmlDoc, 
"/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val", "");
+xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml");
+assertXPath(pXmlDoc, 
"/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val","");
 }
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNoDuplicateAttributeExport, 
"duplicate-east-asia.odt")
@@ -537,16 +537,12 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79540, 
"fdo79540.docx")
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing", 1);
 }
 
-DECLARE_OOXMLEXPORT_TEST(testFDO79062, "fdo79062.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO79062, "fdo79062.docx")
 {
 xmlDocUniquePtr pXmlFootNotes = parseExport("word/footnotes.xml");
-if (!pXmlFootNotes)
-return;
 assertXPath(pXmlFootNotes, "/w:footnotes", "Ignorable", "w14 wp14");
 
 xmlDocUniquePtr pXmlEndNotes = parseExport("word/endnotes.xml");
-if (!pXmlEndNotes)
-return;
 assertXPath(pXmlEndNotes, "/w:endnotes", "Ignorable", "w14 wp14");
 
 //tdf#93121 don't add fake tabs in front of extra footnote paragraphs
@@ -624,13 +620,11 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO79915, 
"fdo79915.docx")
 assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[9]/w:t", "How 
much buoyancy does the water provide?");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testfdo79817, "fdo79817.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo79817, "fdo79817.docx")
 {
-if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"))
-{
-assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID", 
"{9222E47B-A68B-4AEB-9855-21C912B9D3D2}");
-assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath", 
"/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]");
-}
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", 
"storeItemID", "{9222E47B-A68B-4AEB-9855-21C912B9D3D2}");
+assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", 
"xpath", 
"/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]");
 }
 
 
@@ -1028,17 +1022,15 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFD083057, 
"fdo83057.docx")
 assertXPath(pXmlDoc, "//mc:AlternateContent//w:sdt", 0);
 }
 
-DECLARE_OOXMLEXPORT_TEST(testHeaderBorder, "header-border.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testHeaderBorder, "header-border.docx")
 {
-if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"))
-{
-// This was 0, as header margin was lost during import.
-assertXPath(pXmlDoc, "//w:pgMar", "header", "720");
-// This was 33: 33 points -> 660 twips. We counted 900 - 240 (distance
-// 

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

2020-09-02 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |  132 +++---
 1 file changed, 57 insertions(+), 75 deletions(-)

New commits:
commit c41d937fdd97238fe7787f97a51b3e2a4c72d30a
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:33:38 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 07:30:17 2020 +0200

tdf#129423 sw: export-only tests, part 13

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index b4da04e47f11..eaf33fdda6b0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -371,9 +371,9 @@ 
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78599,"fdo78599.docx")
 assertXPath ( pXmlDoc, 
"/w:document/w:body/w:p[1]/w:hyperlink/w:r[6]/w:fldChar", "fldCharType", "end" 
);
 
 // Check for automatic hyphenation
-if (xmlDocUniquePtr pSettingsXml = parseExport("word/settings.xml"))
-// This failed as w:settings had no w:autoHyphenation child.
-assertXPath(pSettingsXml, "/w:settings/w:autoHyphenation");
+xmlDocUniquePtr pSettingsXml = parseExport("word/settings.xml");
+// This failed as w:settings had no w:autoHyphenation child.
+assertXPath(pSettingsXml, "/w:settings/w:autoHyphenation");
 }
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78886, "fdo78886.docx")
@@ -401,55 +401,45 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78590, 
"FDO78590.docx")
 assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "h", 
"1669" );
 }
 
-DECLARE_OOXMLEXPORT_TEST(testSdtCitationRun, "sdt-citation-run.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtCitationRun, 
"sdt-citation-run.docx")
 {
 // The problem was that the SDT was around the whole paragraph, not only 
around the citation field.
-if (xmlDocUniquePtr pXmlDoc = parseExport())
-{
-assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:t", 
"Before sdt.");
-assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:instrText", " CITATION BBC11 
\\l 1033 ");
-assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:t", 
"After sdt.");
-}
+xmlDocUniquePtr pXmlDoc = parseExport();
+assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/w:t", "Before 
sdt.");
+assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:instrText", " CITATION BBC11 
\\l 1033 ");
+assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:t", "After 
sdt.");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testParagraphSdt, "paragraph-sdt.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParagraphSdt, "paragraph-sdt.docx")
 {
 // The problem was that the SDT was around the run only, not the whole 
paragraph.
-if (xmlDocUniquePtr pXmlDoc = parseExport())
-{
-// The path to w:sdt contained a w:p.
-assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:sdt");
-}
+xmlDocUniquePtr pXmlDoc = parseExport();
+// The path to w:sdt contained a w:p.
+assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:sdt");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testSdt2Run, "sdt-2-para.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdt2Run, "sdt-2-para.docx")
 {
-if (xmlDocUniquePtr pXmlDoc = parseExport())
-{
-// The problem was that  was closed after "first", not after 
"second", so the second assert failed.
-assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r/w:t", "first");
-assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r/w:t", "second");
-// Make sure the third paragraph is still outside .
-assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r/w:t", "third");
-}
+xmlDocUniquePtr pXmlDoc = parseExport();
+// The problem was that  was closed after "first", not after 
"second", so the second assert failed.
+assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r/w:t", "first");
+assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:r/w:t", "second&q

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

2020-09-02 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |   58 ++
 1 file changed, 28 insertions(+), 30 deletions(-)

New commits:
commit a53e0459280a06a3794cd2a83fd7fbca90fb7ea5
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:32:05 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 07:28:46 2020 +0200

tdf#129423 sw: export-only tests, part 12

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index a62a3035bf03..e5fd69650911 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -75,42 +75,40 @@ DECLARE_OOXMLEXPORT_TEST(testFdo55381, "fdo55381.docx")
 //TODO: frames not located on the correct pages
 }
 
-DECLARE_OOXMLEXPORT_TEST(testDocm, "hello.docm")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDocm, "hello.docm")
 {
 // Make sure that we check the name of the export filter.
 // This was application/vnd.ms-word.document.macroEnabled.main+xml when the
 // name of the import filter was checked.
-if (xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"))
-assertXPath(pXmlDoc,
-
"/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']",
-"ContentType",
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");
+xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
+assertXPath(pXmlDoc,
+
"/ContentType:Types/ContentType:Override[@PartName='/word/document.xml']",
+"ContentType",
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testDefaultContentTypes, "fdo55381.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testDefaultContentTypes, "fdo55381.docx")
 {
-if (xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"))
-{
-assertXPath(pXmlDoc,
-"/ContentType:Types/ContentType:Default[@Extension='xml']",
-"ContentType",
-"application/xml");
+xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml");
+assertXPath(pXmlDoc,
+"/ContentType:Types/ContentType:Default[@Extension='xml']",
+"ContentType",
+"application/xml");
 
-assertXPath(pXmlDoc,
-
"/ContentType:Types/ContentType:Default[@Extension='rels']",
-"ContentType",
-
"application/vnd.openxmlformats-package.relationships+xml");
+assertXPath(pXmlDoc,
+"/ContentType:Types/ContentType:Default[@Extension='rels']",
+"ContentType",
+"application/vnd.openxmlformats-package.relationships+xml");
 
-assertXPath(pXmlDoc,
-"/ContentType:Types/ContentType:Default[@Extension='png']",
-"ContentType",
-"image/png");
+assertXPath(pXmlDoc,
+"/ContentType:Types/ContentType:Default[@Extension='png']",
+"ContentType",
+"image/png");
 
-assertXPath(pXmlDoc,
-
"/ContentType:Types/ContentType:Default[@Extension='jpeg']",
-"ContentType",
-"image/jpeg");
-}
+assertXPath(pXmlDoc,
+"/ContentType:Types/ContentType:Default[@Extension='jpeg']",
+"ContentType",
+"image/jpeg");
 }
 
 DECLARE_SW_ROUNDTRIP_TEST(testDocmSave, "hello.docm", nullptr, DocmTest)
@@ -1121,11 +1119,11 @@ 
DECLARE_OOXMLEXPORT_TEST(testTdf121670_columnsInSectionsOnly, "tdf121670_columns
 CPPUNIT_ASSERT_EQUAL_MESSAGE("# of columns", sal_Int16(0), 
xTextColumns->getColumnCount());
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf106492, "tdf106492.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf106492, "tdf106492.docx")
 {
-if (xmlDocUniquePtr pXmlDoc = parseExport())
-// This was 4: an additional sectPr was added to the document.
-assertXPath(pXmlDoc, "//w:sectPr", 3);
+xmlDocUniquePtr pXmlDoc = parseExport();
+// This was 4: an additional sectPr was added to the document.
+assertXPath(pXmlDoc, "//w:sectPr", 3);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf107104, "tdf107104.docx")
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-02 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx |   30 ++
 1 file changed, 10 insertions(+), 20 deletions(-)

New commits:
commit 4419b19715fdc65728b559d9fc6e36c9e66bc562
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:31:05 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 07:25:02 2020 +0200

tdf#129423 sw: export-only tests, part 11

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index 08f4826277c9..2e8c2c45aa42 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -465,12 +465,10 @@ 
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureEffectPreservation, "picture-effe
 "rad", 63500); // actually, it returns 63360
 }
 
-DECLARE_OOXMLEXPORT_TEST(testPictureArtisticEffectPreservation, 
"picture-artistic-effects-preservation.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureArtisticEffectPreservation, 
"picture-artistic-effects-preservation.docx")
 {
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
 xmlDocUniquePtr pRelsDoc = parseExport("word/_rels/document.xml.rels");
-if (!pXmlDoc || !pRelsDoc)
-   return;
 
 uno::Reference xNameAccess = 
packages::zip::ZipFileAccess::createWithURL(
 comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL());
@@ -581,10 +579,9 @@ 
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNestedAlternateContent, "nestedAlternate
 // Currently LibreOffice exports custom geometry for this hexagon, not preset 
shape.
 // When LibreOffice can export preset shapes with correct modifiers, then this 
test can be re-enabled.
 
-DECLARE_OOXMLEXPORT_TEST(test76317, "test76317.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(test76317, "test76317.docx")
 {
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
-if (!pXmlDoc) return;
 assertXPath(pXmlDoc, 
"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]",
 "prst", "hexagon");
 }
 
@@ -677,15 +674,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testLockedCanvas, 
"fdo78658.docx")
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/lc:lockedCanvas",
 1);
 }
 
-DECLARE_OOXMLEXPORT_TEST(fdo78474, "fdo78474.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(fdo78474, "fdo78474.docx")
 {
 xmlDocUniquePtr pXmlDoc1 = parseExport("word/document.xml");
-if (!pXmlDoc1) return;
 //docx file after RT is getting corrupted.
 assertXPath(pXmlDoc1, 
"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]",
 "embed", "rId2");
 
 xmlDocUniquePtr pXmlDoc2 = parseExport("word/_rels/document.xml.rels");
-if (!pXmlDoc2) return;
 
assertXPath(pXmlDoc2,"/rels:Relationships/rels:Relationship[2]","Id","rId2");
 }
 
@@ -764,13 +759,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo78663, 
"fdo78663.docx")
 
assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:pict",1);
 }
 
-DECLARE_OOXMLEXPORT_TEST(testFdo78957, "fdo78957.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo78957, "fdo78957.docx")
 {
 xmlDocUniquePtr pXmlHeader = parseExport("word/header2.xml");
 
-if(!pXmlHeader)
-return;
-
 const sal_Int64 IntMax = SAL_MAX_INT32;
 sal_Int64 cx = 0, cy = 0;
 cx = 
getXPath(pXmlHeader,"/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:extent[1]","cx").toInt64();
@@ -923,16 +915,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf118242, 
"tdf118242.odt")
 
 }
 
-DECLARE_OOXMLEXPORT_TEST(testWrapTightThrough, "wrap-tight-through.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testWrapTightThrough, 
"wrap-tight-through.docx")
 {
 // These were wrapSquare without a wrap polygon before.
-if (xmlDocUniquePtr pXmlDoc = parseExport(&qu

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

2020-09-02 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit bc01e76bab663826c7c0f125cbbfc790f7de4a98
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:28:06 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 07:22:56 2020 +0200

tdf#129423 sw: export-only tests, part 7

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 2596c8d5d5e4..76ccf318e8c9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -489,14 +489,12 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx")
 CPPUNIT_ASSERT_EQUAL(OUString("RenderedShapes"), nValue); // Rendered 
bitmap has the proper name
 }
 
-DECLARE_OOXMLEXPORT_TEST(testFontNameIsEmpty, "font-name-is-empty.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFontNameIsEmpty, 
"font-name-is-empty.docx")
 {
 // Check no empty font name is exported
 // This test does not fail, if the document contains a font with empty 
name.
 
 xmlDocUniquePtr pXmlFontTable = parseExport("word/fontTable.xml");
-if (!pXmlFontTable)
-return;
 xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlFontTable, "/w:fonts/w:font");
 xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
 sal_Int32 length = xmlXPathNodeSetGetLength(pXmlNodes);
@@ -1109,14 +1107,12 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testArrowMarker, 
"tdf123346_ArrowMarker.docx
 "/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:tailEnd", "type", 
"arrow");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testShapeLineWidth, "tdf92526_ShapeLineWidth.odt")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShapeLineWidth, 
"tdf92526_ShapeLineWidth.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getShapes());
 CPPUNIT_ASSERT_EQUAL(1, getPages());
 // tdf#92526: Make sure that line with stays 0.
 xmlDocUniquePtr pXml = parseExport("word/document.xml");
-if (!pXml)
-return;
 
 // "w" attribute was not exported.
 assertXPath(pXml, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-02 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx |   15 +++
 1 file changed, 3 insertions(+), 12 deletions(-)

New commits:
commit 78bc1c3c0c71eb67046db5596eb8d442ad564310
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:26:53 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 07:21:56 2020 +0200

tdf#129423 sw: export-only tests, part 6

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 1eff36be4eb6..48cf77e84f0b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -465,14 +465,12 @@ DECLARE_OOXMLIMPORT_TEST(TestTdf135653, "tdf135653.docx")
 CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE bg color does not match!", 
aExpectedColor, aFillColor);
 }
 
-DECLARE_OOXMLEXPORT_TEST(testAtPageShapeRelOrientation, "rotated_shape.fodt")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAtPageShapeRelOrientation, 
"rotated_shape.fodt")
 {
 // invalid combination of at-page anchor and horizontal-rel="paragraph"
 // caused relativeFrom="column" instead of relativeFrom="page"
 
 xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
-if (!pXmlDocument)
-return;
 
 assertXPathContent(pXmlDocument, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor"
 "/wp:positionH/wp:posOffset", "-480060");
@@ -502,7 +500,7 @@ DECLARE_OOXMLEXPORT_TEST(testAtPageShapeRelOrientation, 
"rotated_shape.fodt")
 CPPUNIT_ASSERT(style.indexOf("v-text-anchor:middle") != -1);
 }
 
-DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginHasFooter,
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorHeightFromBottomMarginHasFooter,
  
"tdf133070_testRelativeAnchorHeightFromBottomMarginHasFooter.docx")
 {
 // tdf#133070 The height was set relative to page print area bottom,
@@ -510,8 +508,6 @@ 
DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginHasFooter,
 // Note: page print area bottom = margin + footer height.
 // In this case the footer exists.
 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
-if (!pXmlDoc)
-return;
 assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height", "1147");
 }
 
@@ -543,7 +539,7 @@ DECLARE_OOXMLIMPORT_TEST(TestTdf132483, "tdf132483.docx")
 text::RelOrientation::PAGE_FRAME , nHRelPos);
 }
 
-DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginNoFooter,
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testRelativeAnchorHeightFromBottomMarginNoFooter,
  
"tdf133070_testRelativeAnchorHeightFromBottomMarginNoFooter.docx")
 {
 // tdf#133070 The height was set relative to page print area bottom,
@@ -551,17 +547,12 @@ 
DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginNoFooter,
 // Note: page print area bottom = margin + footer height.
 // In this case the footer does not exist, so OpenDocument and OOXML 
margins are the same.
 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
-if (!pXmlDoc)
-return;
 assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "height", "1147");
 }
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133702, "tdf133702.docx")
 {
 xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
-if (!pXmlDocument)
-return;
-
 assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr");
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-02 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |  185 +--
 1 file changed, 80 insertions(+), 105 deletions(-)

New commits:
commit 87c6b7a8dea4f59b09001d4d6364cb1835d10903
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:21:53 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 07:19:19 2020 +0200

tdf#129423 sw: export-only tests, part 3

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the tests fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 9260cc8f4f7f..26151ebcc0c9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -67,10 +67,10 @@ protected:
 }
 };
 
-DECLARE_OOXMLEXPORT_TEST(testfdo81381, "fdo81381.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo81381, "fdo81381.docx")
 {
-if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"))
-assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:r[1]/w:object[1]/o:OLEObject[1]", "DrawAspect", 
"Icon");
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:r[1]/w:object[1]/o:OLEObject[1]", "DrawAspect", 
"Icon");
 }
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtAlias, "sdt-alias.docx")
@@ -81,11 +81,11 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtAlias, 
"sdt-alias.docx")
 assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:alias", "val", 
"Subtitle");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testFooterBodyDistance, "footer-body-distance.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFooterBodyDistance, 
"footer-body-distance.docx")
 {
-if (xmlDocUniquePtr pXmlDoc = parseExport())
-// Page break was exported as section break, this was 0
-assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1);
+xmlDocUniquePtr pXmlDoc = parseExport();
+// Page break was exported as section break, this was 0
+assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1);
 }
 
 // Check for correct header/footer with special first page with TOC inside:
@@ -149,21 +149,21 @@ DECLARE_OOXMLEXPORT_TEST(testfdo81031, "fdo81031.docx")
 CPPUNIT_ASSERT_EQUAL( static_cast(148), 
xBitmap->getSize().Height );
 }
 
-DECLARE_OOXMLEXPORT_TEST(testPlausableBorder, "plausable-border.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPlausableBorder, 
"plausable-border.docx")
 {
 // sw::util::IsPlausableSingleWordSection() did not merge two page styles 
due to borders.
-if (xmlDocUniquePtr pXmlDoc = parseExport())
-// Page break was exported as section break, this was 0
-assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1);
+xmlDocUniquePtr pXmlDoc = parseExport();
+// Page break was exported as section break, this was 0
+assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1);
 
 CPPUNIT_ASSERT_EQUAL( 2, getPages() );
 }
 
-DECLARE_OOXMLEXPORT_TEST(testUnwantedSectionBreak, 
"unwanted-section-break.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testUnwantedSectionBreak, 
"unwanted-section-break.docx")
 {
-if (xmlDocUniquePtr pXmlDoc = parseExport())
-// This was 2: an additional sectPr was added to the document.
-assertXPath(pXmlDoc, "//w:sectPr", 1);
+xmlDocUniquePtr pXmlDoc = parseExport();
+// This was 2: an additional sectPr was added to the document.
+assertXPath(pXmlDoc, "//w:sectPr", 1);
 }
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80897 , "fdo80897.docx")
@@ -188,11 +188,11 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo80902, 
"fdo80902.docx")
 assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:docGrid", "type", 
"lines");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testParaShading, "para-shading.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testParaShading, "para-shading.docx")
 {
 // Make sure the themeColor attribute is not written when it would be 
empty.
-if (xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"))
-assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:shd", 
"themeColor");
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:shd", 
"themeColor");
 }
 
 DECLARE_OOXMLEXPORT_TEST(t

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

2020-09-02 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/odfexport/odfexport.cxx |   77 +++
 1 file changed, 34 insertions(+), 43 deletions(-)

New commits:
commit f83f06475996cdf072a230aa8c0abe6d85b278ec
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:12:52 2020 +0200
Commit: Mike Kaganski 
CommitDate: Thu Sep 3 07:14:50 2020 +0200

tdf#129423 sw: export-only tests, part 2

Convert some unit tests from "export" tests to "export only".
Remove nullptr checks on parseExport's return value to make
the test fail if parsing fails for any reason.

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

diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index cb131ece62de..20c8b25f0b48 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -262,25 +262,25 @@ DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt")
 CPPUNIT_ASSERT_EQUAL(sal_Int32( 408), rect.Height);
 }
 
-DECLARE_ODFEXPORT_TEST(testUserFieldDecl, "user-field-decl.odt")
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testUserFieldDecl, "user-field-decl.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
-if (xmlDocUniquePtr pXmlDoc = parseExport("styles.xml"))
-// Without the accompanying fix in place, this test would have failed 
with 'Expected: 2;
-// Actual: 1', i.e. the in-table field had no declaration (in the 
header), while the
-// outside-table one had the declaration.
-assertXPath(pXmlDoc, 
"//style:header/text:user-field-decls/text:user-field-decl", 2);
+xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+// Without the accompanying fix in place, this test would have failed with 
'Expected: 2;
+// Actual: 1', i.e. the in-table field had no declaration (in the header), 
while the
+// outside-table one had the declaration.
+assertXPath(pXmlDoc, 
"//style:header/text:user-field-decls/text:user-field-decl", 2);
 }
 
-DECLARE_ODFEXPORT_TEST(testUserFieldDeclFly, "user-field-decl-fly.odt")
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testUserFieldDeclFly, 
"user-field-decl-fly.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getShapes());
 CPPUNIT_ASSERT_EQUAL(1, getPages());
-if (xmlDocUniquePtr pXmlDoc = parseExport("styles.xml"))
-// Without the accompanying fix in place, this test would have failed 
with 'Expected: 2;
-// Actual: 1', i.e. the in-textframe field had no declaration (in the 
header), while the
-// outside-textframe one had the declaration.
-assertXPath(pXmlDoc, 
"//style:header/text:user-field-decls/text:user-field-decl", 2);
+xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
+// Without the accompanying fix in place, this test would have failed with 
'Expected: 2;
+// Actual: 1', i.e. the in-textframe field had no declaration (in the 
header), while the
+// outside-textframe one had the declaration.
+assertXPath(pXmlDoc, 
"//style:header/text:user-field-decls/text:user-field-decl", 2);
 }
 
 DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt")
@@ -2145,36 +2145,32 @@ DECLARE_ODFEXPORT_TEST(testTdf132642_keepWithNextTable, 
"tdf132642_keepWithNextT
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Row splits over 2 pages", 2, getPages());
 }
 
-DECLARE_ODFEXPORT_TEST(testImageMimetype, "image-mimetype.odt")
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testImageMimetype, "image-mimetype.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getShapes());
 CPPUNIT_ASSERT_EQUAL(1, getPages());
 // Test that the loext:mimetype attribute is written for exported images, 
tdf#109202
-if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml"))
-{
-// Original image (svg)
-assertXPath(pXmlDoc, 
"/office:document-content/office:body/office:text/text:p/draw:frame/draw:image[@draw:mime-type='image/svg+xml']");
-}
+xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+// Original image (svg)
+assertXPath(pXmlDoc, 
"/office:document-content/office:body/office:text/text:p/draw:frame/draw:image[@draw:mime-type='image/svg+xml']");
 }
 
-DECLARE_ODFEXPORT_TEST(testEmbeddedFontProps, "embedded-font-props.odt")
+DECLARE_ODFEXPORT_EXPORTONLY_TEST(testEmbeddedFontProps, 
"embedded-font-props.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
 #if !defined(MACOSX)
 // Test that font style/weight of embedded fonts is exposed.
 // Test file is a normal ODT, except EmbedFonts is set to true in 
settings.xml.
-if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml"))
-{
-// These failed, the attributes were missing.
-as

[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - chart2/qa oox/source

2020-09-01 Thread Daniel Arato (NISZ) (via logerrit)
 chart2/qa/extras/chart2export.cxx   |   14 ++
 chart2/qa/extras/data/odp/tdf121189.odp |binary
 oox/source/export/shapes.cxx|1 +
 3 files changed, 15 insertions(+)

New commits:
commit f366b87d71d774c3a6983224903933bb32b43ff0
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 24 17:29:08 2020 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 1 13:26:40 2020 +0200

tdf#121189 PPTX export: fix missing chart

Based on Regina Henschel's technical analysis and code pointer.

Change-Id: Ifdea48c09d23dce495fa6bc90a9e1648dbb5ccb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101283
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 0c5ac9d1cb39eac838a612092a8934a6ca12326f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101674
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 81b79439a9ff..2459a2b3089b 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -155,6 +155,7 @@ public:
 void testTdf119029();
 void testTdf108022();
 void testTdf121744();
+void testTdf121189();
 void testTdf122031();
 void testTdf115012();
 void testTdf123206_customLabelText();
@@ -289,6 +290,7 @@ public:
 CPPUNIT_TEST(testTdf119029);
 CPPUNIT_TEST(testTdf108022);
 CPPUNIT_TEST(testTdf121744);
+CPPUNIT_TEST(testTdf121189);
 CPPUNIT_TEST(testTdf122031);
 CPPUNIT_TEST(testTdf115012);
 CPPUNIT_TEST(testTdf123206_customLabelText);
@@ -2540,6 +2542,18 @@ void Chart2ExportTest::testTdf121744()
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[2]", "val", YValueId );
 }
 
+void Chart2ExportTest::testTdf121189()
+{
+load("/chart2/qa/extras/data/odp/", "tdf121189.odp");
+reload("Impress Office Open XML");
+
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
+uno::Reference 
xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xPage->getCount());
+uno::Reference xShape(xPage->getByIndex(0), 
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.OLE2Shape"), 
xShape->getShapeType());
+}
+
 void Chart2ExportTest::testTdf122031()
 {
 //Checks pie chart data label format.
diff --git a/chart2/qa/extras/data/odp/tdf121189.odp 
b/chart2/qa/extras/data/odp/tdf121189.odp
new file mode 100644
index ..6f99e0054936
Binary files /dev/null and b/chart2/qa/extras/data/odp/tdf121189.odp differ
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 9a6a72b08b0f..1b17f888c493 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1519,6 +1519,7 @@ static const NameToConvertMapType& lcl_GetConverters()
 
 { "com.sun.star.presentation.GraphicObjectShape"   , 
::WriteGraphicObjectShape },
 { "com.sun.star.presentation.MediaShape"   , 
::WriteGraphicObjectShape },
+{ "com.sun.star.presentation.ChartShape"   , 
::WriteOLE2Shape },
 { "com.sun.star.presentation.OLE2Shape", 
::WriteOLE2Shape },
 { "com.sun.star.presentation.TableShape"   , 
::WriteTableShape },
 { "com.sun.star.presentation.TextShape", 
::WriteTextShape },
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-01 Thread Daniel Arato (NISZ) (via logerrit)
 chart2/qa/extras/chart2export.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit ceae73dd294b5ca4073062afc1223efb1c206780
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 31 13:10:26 2020 +0200
Commit: Mike Kaganski 
CommitDate: Tue Sep 1 09:04:06 2020 +0200

tdf#129423 sw: Make yet more tests export-only

This commit continues an earlier, incomplete unit test refactor under
the same bug ticket number. Eliminates a few unwanted nullptr tests
in chart2/qa/.

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

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 7e17c2f1307c..3e1f5d86e897 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -655,8 +655,7 @@ void Chart2ExportTest::testStockChart()
 load("/chart2/qa/extras/data/docx/", "testStockChart.docx");
 
 xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open 
XML Text");
-if (!pXmlDoc)
-   return;
+CPPUNIT_ASSERT(pXmlDoc);
 
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:idx", "val", "1");
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:order", "val", "1");
@@ -670,8 +669,7 @@ void Chart2ExportTest::testBarChart()
 {
 load("/chart2/qa/extras/data/docx/", "testBarChart.docx");
 xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open 
XML Text");
-if (!pXmlDoc)
-   return;
+CPPUNIT_ASSERT(pXmlDoc);
 
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:barDir", "val", "col");
 }
@@ -727,8 +725,7 @@ void Chart2ExportTest::testScatterChartTextXValues()
 
 // Test the export.
 xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open 
XML Text");
-if (!pXmlDoc)
-   return;
+CPPUNIT_ASSERT(pXmlDoc);
 
 assertXPathContent(pXmlDoc, 
"//c:scatterChart/c:ser[1]/c:xVal[1]/c:numRef[1]/c:numCache[1]/c:pt[1]/c:v[1]", 
"1");
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-31 Thread Daniel Arato (NISZ) (via logerrit)
 chart2/qa/extras/chart2export.cxx   |   14 ++
 chart2/qa/extras/data/odp/tdf121189.odp |binary
 oox/source/export/shapes.cxx|1 +
 3 files changed, 15 insertions(+)

New commits:
commit 0c5ac9d1cb39eac838a612092a8934a6ca12326f
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 24 17:29:08 2020 +0200
Commit: László Németh 
CommitDate: Mon Aug 31 10:12:41 2020 +0200

tdf#121189 PPTX export: fix missing chart

Based on Regina Henschel's technical analysis and code pointer.

Change-Id: Ifdea48c09d23dce495fa6bc90a9e1648dbb5ccb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101283
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index fddfdc0c2e67..7e17c2f1307c 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -156,6 +156,7 @@ public:
 void testTdf119029();
 void testTdf108022();
 void testTdf121744();
+void testTdf121189();
 void testTdf122031();
 void testTdf115012();
 void testTdf134118();
@@ -295,6 +296,7 @@ public:
 CPPUNIT_TEST(testTdf119029);
 CPPUNIT_TEST(testTdf108022);
 CPPUNIT_TEST(testTdf121744);
+CPPUNIT_TEST(testTdf121189);
 CPPUNIT_TEST(testTdf122031);
 CPPUNIT_TEST(testTdf115012);
 CPPUNIT_TEST(testTdf134118);
@@ -2577,6 +2579,18 @@ void Chart2ExportTest::testTdf121744()
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[2]", "val", YValueId );
 }
 
+void Chart2ExportTest::testTdf121189()
+{
+load("/chart2/qa/extras/data/odp/", "tdf121189.odp");
+reload("Impress Office Open XML");
+
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
+uno::Reference 
xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xPage->getCount());
+uno::Reference xShape(xPage->getByIndex(0), 
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.OLE2Shape"), 
xShape->getShapeType());
+}
+
 void Chart2ExportTest::testTdf122031()
 {
 //Checks pie chart data label format.
diff --git a/chart2/qa/extras/data/odp/tdf121189.odp 
b/chart2/qa/extras/data/odp/tdf121189.odp
new file mode 100644
index ..6f99e0054936
Binary files /dev/null and b/chart2/qa/extras/data/odp/tdf121189.odp differ
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 3121aa745a16..e7997226f689 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1490,6 +1490,7 @@ static const NameToConvertMapType& lcl_GetConverters()
 
 { "com.sun.star.presentation.GraphicObjectShape"   , 
::WriteGraphicObjectShape },
 { "com.sun.star.presentation.MediaShape"   , 
::WriteGraphicObjectShape },
+{ "com.sun.star.presentation.ChartShape"   , 
::WriteOLE2Shape },
 { "com.sun.star.presentation.OLE2Shape", 
::WriteOLE2Shape },
 { "com.sun.star.presentation.TableShape"   , 
::WriteTableShape },
 { "com.sun.star.presentation.TextShape", 
::WriteTextShape },
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-28 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/layout/data/tdf69647_images.odt |binary
 sw/qa/extras/layout/data/tdf69647_text.docx  |binary
 sw/qa/extras/layout/layout.cxx   |   19 +++-
 sw/source/core/text/itrform2.cxx |   23 +++-
 sw/source/core/text/porlay.cxx   |   31 +--
 sw/source/core/text/porlay.hxx   |7 ++
 sw/source/core/text/possiz.hxx   |6 +++--
 7 files changed, 62 insertions(+), 24 deletions(-)

New commits:
commit d336e6c26012255015d3fc0caf8e7fafe14bd8f2
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 24 11:05:17 2020 +0200
Commit: László Németh 
CommitDate: Fri Aug 28 13:13:58 2020 +0200

tdf#69647 sw layout: fix line spacing with inline pictures

Line height is now based on (the biggest) font size in the
line rather than on the size of the tallest object there,
according to ODF and like MSO does.

Note: handling of first paragraph line is still different.

Co-authored-by: Attila Bánhegyi (NISZ)

Change-Id: I6cebea7dbdedd21ea173a0a867434525e7b86337
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101272
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/qa/extras/layout/data/tdf69647_images.odt 
b/sw/qa/extras/layout/data/tdf69647_images.odt
new file mode 100644
index ..e4f7fbe8039a
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf69647_images.odt differ
diff --git a/sw/qa/extras/layout/data/tdf69647_text.docx 
b/sw/qa/extras/layout/data/tdf69647_text.docx
new file mode 100644
index ..587089ff29cf
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf69647_text.docx differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 438a60bc633a..5e8f2d89eed4 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2076,6 +2076,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections)
 CheckRedlineSectionsHidden();
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TDF69647_images)
+{
+createDoc("tdf69647_images.odt");
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pTextDoc);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of pages does not match!", 2, 
getPages());
+}
+
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TDF69647_text)
+{
+createDoc("tdf69647_text.docx");
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pTextDoc);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of pages does not match!", 2, 
getPages());
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables)
 {
 createDoc("redline_table.fodt");
@@ -3756,7 +3772,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123651)
 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
 // Without the accompanying fix in place, this test would have failed with 
'Expected: 7639;
 // Actual: 12926'. The shape was below the second "Lorem ipsum" text, not 
above it.
-assertXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds", "top", "7639");
+const sal_Int32 nTopValue = getXPath(pXmlDoc, 
"//SwAnchoredDrawObject/bounds", "top").toInt32();
+CPPUNIT_ASSERT_DOUBLES_EQUAL(7639, nTopValue, 10);
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116501)
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 577b4d8ecbbc..a78d4f730e7f 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -324,7 +324,7 @@ void SwTextFormatter::InsertPortion( SwTextFormatInfo ,
 
 // Adjust maxima
 if( m_pCurr->Height() < pPor->Height() )
-m_pCurr->Height( pPor->Height() );
+m_pCurr->Height( pPor->Height(), pPor->IsTextPortion() );
 if( m_pCurr->GetAscent() < pPor->GetAscent() )
 m_pCurr->SetAscent( pPor->GetAscent() );
 
@@ -776,7 +776,7 @@ void SwTextFormatter::CalcAscent( SwTextFormatInfo , 
SwLinePortion *pPor )
 // height (example: n758883.docx)
 SwLinePortion const*const pLast = rInf.GetLast();
 assert(pLast);
-pPor->Height( pLast->Height() );
+pPor->Height( pLast->Height(), false );
 pPor->SetAscent( pLast->GetAscent() );
 }
 else
@@ -1523,7 +1523,7 @@ SwLinePortion *SwTextFormatter::NewPortion( 
SwTextFormatInfo  )
 if( !m_pCurr->Height() )
 {
 OSL_ENSURE( m_pCurr->Height(), "SwTextFormatter::NewPortion: limbo 
dance" );
-m_pCurr->Height( pPor->Height() );
+m_pCurr->Height( pPor->Height(), false );
 m_pCurr->SetAscent( pPor->GetAscent() );
 }
 
@@ -1613,7 +1613,7 @@ TextFrameIndex SwTextFormatter::FormatLine(TextFrameIndex 
const nStartPos)
 if( GetInfo().IsStop() )
 {

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

2020-08-24 Thread Daniel Arato (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit d9e1775941ff2314d4c1c3d2ace273796d809ca4
Author: Daniel Arato (NISZ) 
AuthorDate: Mon Aug 24 13:24:02 2020 +0200
Commit: László Németh 
CommitDate: Mon Aug 24 15:32:17 2020 +0200

tdf#129423 sw: remove last two bad nullptr checks

Clean-up of commit 5ac88d12b377f64ff36551bfb3cf95a4a23a167d
(tdf#129423 sw: Convert more tests to export-only).

After a bulk refactor of OOXML export-only tests some unnecessary,
in fact harmful, checks whether parseExport returned a valid pointer
remained in the codebase (spotted by Mike Kaganski).

These checks have been deleted.

Change-Id: I0374596c2f1b01be8092461168177f8c13ee1ca4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101274
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index 61d914ced235..08f4826277c9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -86,8 +86,6 @@ 
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAnchorIdForWP14AndW14, "AnchorId.docx")
 
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Choice/w:drawing/wp:inline",
 "anchorId", "78735EFD");
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:r[3]/mc:AlternateContent/mc:Fallback/w:pict/v:rect",
 "anchorId", "78735EFD");
-
-
 }
 
 DECLARE_OOXMLEXPORT_TEST(testDkVert, "dkvert.docx")
@@ -105,8 +103,6 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTextWatermark, 
"textWatermark.docx")
 //and Word uses the object ID to identify if it is a watermark.
 //It has to have the 'PowerPlusWaterMarkObject' string in it
 xmlDocUniquePtr pXmlHeader1 = parseExport("word/header1.xml");
-if (!pXmlHeader1)
-return;
 
 assertXPath(pXmlHeader1, 
"/w:hdr[1]/w:p[1]/w:r[1]/w:pict[1]/v:shape[1]","id","PowerPlusWaterMarkObject93701316");
 
@@ -122,8 +118,6 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPictureWatermark, 
"pictureWatermark.docx
 //It has to have the 'WordPictureWaterMarkObject' string in it
 
 xmlDocUniquePtr pXmlHeader1 = parseExport("word/header1.xml");
-if (!pXmlHeader1)
-return;
 
 // Check the watermark ID
 assertXPath(pXmlHeader1, 
"/w:hdr[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:shape[1]","id","WordPictureWatermark11962361");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 31 commits - basctl/inc basctl/source i18nutil/source include/i18nutil include/vcl sc/inc sc/source sd/inc sd/source sd/uiconfig sfx2

2019-09-26 Thread Daniel (via logerrit)
 basctl/inc/strings.hrc   |8 
 basctl/source/basicide/basicrenderable.cxx   |   47 
 basctl/source/basicide/basicrenderable.hxx   |8 
 i18nutil/source/utility/paper.cxx|   11 
 include/i18nutil/paper.hxx   |6 
 include/vcl/print.hxx|6 
 sc/inc/docuno.hxx|5 
 sc/inc/strings.hrc   |   17 
 sc/source/ui/unoobj/docuno.cxx   |  120 -
 sd/inc/DocumentRenderer.hrc  |   16 
 sd/inc/strings.hrc   |8 
 sd/source/ui/view/DocumentRenderer.cxx   |  125 -
 sd/uiconfig/simpress/ui/impressprinteroptions.ui |  120 +
 sfx2/source/view/viewprn.cxx |   13 
 sw/inc/strings.hrc   |   11 
 sw/source/core/doc/doc.cxx   |   14 
 sw/source/core/view/printdata.cxx|   90 
 sw/source/uibase/uno/unotxdoc.cxx|   31 
 sw/uiconfig/swriter/ui/printeroptions.ui |   40 
 vcl/UIConfig_vcl.mk  |1 
 vcl/inc/print.hrc|   51 
 vcl/inc/printdlg.hxx |  243 +-
 vcl/inc/strings.hrc  |1 
 vcl/source/gdi/print.cxx |   31 
 vcl/source/gdi/print3.cxx|   37 
 vcl/source/window/printdlg.cxx   | 1798 ++
 vcl/uiconfig/ui/moreoptionsdialog.ui |   88 
 vcl/uiconfig/ui/printdialog.ui   | 2256 +--
 28 files changed, 2763 insertions(+), 2439 deletions(-)

New commits:
commit 53b660c952f17f92634e8028656f6eaf3fc8f5e3
Author: Daniel 
AuthorDate: Wed Jan 16 18:51:47 2019 -0200
Commit: Aron Budea 
CommitDate: Thu Sep 26 18:56:46 2019 +0200

tdf#122079 - Document orientation is no longer changed in print dialog

Change-Id: I9d13cfd136f9b70674b3e43268525f8a6e1c0954
Reviewed-on: https://gerrit.libreoffice.org/66483
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-by: Michael Weghorn 
(cherry picked from commit eaec995a96b41963ae9e5156b6c5c7ac022f9a55)

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index aede9f7d4da4..bcecd3d0b05f 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2386,25 +2386,6 @@ static bool lcl_GetBoolProperty(
 return bRes;
 }
 
-static sal_Int32 lcl_GetIntProperty(
-const uno::Sequence< beans::PropertyValue >& rOptions,
-const sal_Char *pPropName,
-sal_Int32 nDefault )
-{
-sal_Int32 nRes = nDefault;
-const sal_Int32 nLen = rOptions.getLength();
-const beans::PropertyValue *pProps = rOptions.getConstArray();
-for ( sal_Int32 i = 0;  i < nLen;  ++i )
-{
-if ( pProps[i].Name.equalsAscii( pPropName ) )
-{
-pProps[i].Value >>= nRes;
-break;
-}
-}
-return nRes;
-}
-
 SfxViewShell * SwXTextDocument::GetRenderView(
 bool ,
 const uno::Sequence< beans::PropertyValue >& rOptions,
@@ -2598,13 +2579,6 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
 if (!pViewShell || !pViewShell->GetLayout())
 return 0;
 
-// make sure document orientation matches printer paper orientation
-sal_Int32 nLandscape = lcl_GetIntProperty( rxOptions, "IsLandscape", 
-1 );
-if ( nLandscape == 1 )
-pViewShell->ChgAllPageOrientation( Orientation::Landscape );
-else if ( nLandscape == 0 )
-pViewShell->ChgAllPageOrientation( Orientation::Portrait );
-
 if (bFormat)
 {
 // #i38289
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index d8cb58c67769..0e3500f9e65d 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1010,21 +1010,14 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool 
i_bMayUseCache )
 
 void PrintDialog::updateOrientationBox( const bool bAutomatic )
 {
-Orientation eOrientation = maPController->getPrinter()->GetOrientation();
 if ( !bAutomatic )
 {
+Orientation eOrientation = 
maPController->getPrinter()->GetOrientation();
 mpOrientationBox->SelectEntryPos( static_cast(eOrientation) 
+ 1 );
-
-maPController->setValue( "IsLandscape",
- makeAny( static_cast(eOrientation) 
) );
 }
 else if ( hasOrientationChanged() )
 {
 mpOrientationBox->SelectEntryPos( ORIENTATION_AUTOMATIC );
-
-// used to make sure document orientation matches printer paper 
orientation
-maPController->setValue( "IsLandscape",
- makeAny( static_cast(eOrientation) 
) );
 }

[Libreoffice-qa] Bug LibreOffice Versión: 6.3.1.2 (x64)

2019-09-23 Thread Daniel Gallardo Venegas

Buenos días,
he detectado un bug en LibreOffice Versión: 6.3.1.2 (x64) Español, 
cuando se crea un documento utilizando el botón contextual, Nuevo 
Documento (Texto, Hoja de cálculo...) por defecto los crea en idioma de 
texto Inglés (EE.UU), solo ocurre cuando lo creas desde el menú 
contextual. Esto supone un problema al redactar ya que hay que modificar 
todos los documentos manualmente.

Muchas gracias

--
*Agencia Andaluza de Instituciones Culturales
CONSEJERÍA DE CULTURA Y PATRIMONIO HISTÓRICO
Daniel Gallardo Venegas *
UNIDAD DE TECNOLOGÍAS Y SISTEMAS
tfn. 955 929 006 (corp. 368006)
daniel.galla...@juntadeandalucia.es 
<mailto:daniel.galla...@juntadeandalucia.es> | www.aaiicc.es 
<http://www.aaiicc.es>



___
List Name: Libreoffice-qa mailing list
Mail address: Libreoffice-qa@lists.freedesktop.org
Change settings: https://lists.freedesktop.org/mailman/listinfo/libreoffice-qa
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://lists.freedesktop.org/archives/libreoffice-qa/

Bug LibreOffice Versión: 6.3.1.2 (x64)

2019-09-23 Thread Daniel Gallardo Venegas

Buenos días,
he detectado un bug en LibreOffice Versión: 6.3.1.2 (x64) Español, 
cuando se crea un documento utilizando el botón contextual, Nuevo 
Documento (Texto, Hoja de cálculo...) por defecto los crea en idioma de 
texto Inglés (EE.UU), solo ocurre cuando lo creas desde el menú 
contextual. Esto supone un problema al redactar ya que hay que modificar 
todos los documentos manualmente.

Muchas gracias

--
*Agencia Andaluza de Instituciones Culturales
CONSEJERÍA DE CULTURA Y PATRIMONIO HISTÓRICO
Daniel Gallardo Venegas *
UNIDAD DE TECNOLOGÍAS Y SISTEMAS
tfn. 955 929 006 (corp. 368006)
daniel.galla...@juntadeandalucia.es 
<mailto:daniel.galla...@juntadeandalucia.es> | www.aaiicc.es 
<http://www.aaiicc.es>



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

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

2019-07-31 Thread Daniel Silva (via logerrit)
 filter/source/pdf/impdialog.cxx   |   12 +---
 sw/source/core/view/printdata.cxx |3 ++-
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit f50363c7008c239d302944144beb256de6a55f38
Author: Daniel Silva 
AuthorDate: Sat Dec 8 10:15:26 2018 -0200
Commit: Michael Stahl 
CommitDate: Wed Jul 31 18:11:35 2019 +0200

tdf#54908 Make selection active if there's a selection (Writer)

If the user make a selection in Writer and then opens print dialog or PDF
export dialog, Print Selection is the default option.

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

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index f0b5663eeb10..f6f084fd2fb0 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -504,8 +504,9 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 mxRbAll->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleAllHdl ) 
);
 TogglePagesHdl();
 
-mxRbSelection->set_sensitive( pParent->mbSelectionPresent );
-if ( pParent->mbSelectionPresent )
+const bool bSelectionPresent = pParent->mbSelectionPresent;
+mxRbSelection->set_sensitive( bSelectionPresent );
+if ( bSelectionPresent )
 mxRbSelection->connect_toggled( LINK( this, ImpPDFTabGeneralPage, 
ToggleSelectionHdl ) );
 mbIsPresentation = pParent->mbIsPresentation;
 mbIsWriter = pParent->mbIsWriter;
@@ -612,7 +613,12 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 }
 
 mxCbExportPlaceholders->set_visible(mbIsWriter);
-if( !mbIsWriter )
+if( mbIsWriter )
+{
+// tdf#54908 Make selection active if there is a selection in Writer's 
version
+mxRbSelection->set_active( bSelectionPresent );
+}
+else
 {
 mxCbExportPlaceholders->set_active(false);
 }
diff --git a/sw/source/core/view/printdata.cxx 
b/sw/source/core/view/printdata.cxx
index a92f3661c990..a2da5005cc38 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -301,7 +301,8 @@ SwPrintUIOptions::SwPrintUIOptions(
 aWidgetIds[4] = "rbRangeSelection";
 m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, 
OUString(),
 aHelpIds, 
aPrintRangeName,
-aChoices, 0 /* always 
default to 'All pages' */,
+aChoices,
+bHasSelection ? 4 : 0,
 aChoicesDisabled);
 
 // show an Edit dependent on "Pages" selected
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'feature/print_revamp' - vcl/uiconfig

2018-07-06 Thread Daniel Silva
 vcl/uiconfig/ui/printdialog.ui |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit aaa50a06155b366b797c932a4d30e070f11df1cb
Author: Daniel Silva 
Date:   Thu Jul 5 16:02:41 2018 -0300

Minor UI fixes in print dialog

Change-Id: I7a6ee82dd88911372854b3f44102417579e83ffe
Reviewed-on: https://gerrit.libreoffice.org/57020
Tested-by: Jenkins
Reviewed-by: Daniel Silva 

diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui
index 4775d131fab5..0251d367f106 100644
--- a/vcl/uiconfig/ui/printdialog.ui
+++ b/vcl/uiconfig/ui/printdialog.ui
@@ -89,6 +89,7 @@
   
   
 False
+6
 dialog
 
   
@@ -121,7 +122,7 @@
 True
 True
 50
-50
+135
   
   
 True
@@ -215,6 +216,7 @@
 False
 center
 True
+True
 True
   
   
@@ -428,6 +430,7 @@
   
 True
 False
+6
 12
 
   
@@ -538,6 +541,7 @@
   
 True
 False
+6
 12
 
   
@@ -594,6 +598,7 @@
 True
 True
 False
+True
 True
   
   
@@ -727,6 +732,7 @@
 True
 False
 start
+True
 True
   
   
@@ -774,6 +780,7 @@
   
 True
 False
+6
 12
 
   
@@ -941,6 +948,7 @@
 False
 start
 True
+True
 True
 pagespersheetbtn
   
@@ -986,6 +994,7 @@
 True
 False
 start
+True
 True
   
   
@@ -1006,6 +1015,7 @@
 True
 False
 True
+True
 True
 brochure
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/print_revamp' - vcl/inc vcl/source vcl/uiconfig

2018-06-27 Thread Daniel Silva
 vcl/inc/printdlg.hxx   |1 
 vcl/source/window/printdlg.cxx |   31 +-
 vcl/uiconfig/ui/printdialog.ui |  182 +
 3 files changed, 159 insertions(+), 55 deletions(-)

New commits:
commit 18acebfc14fac1e2645218ee929b9c63c7320e35
Author: Daniel Silva 
Date:   Mon Jun 18 14:52:16 2018 -0300

Sets pages per sheet and brochure in print dialog

Change-Id: Iee6fea72cee02d9ffd00b81511382992aad72e61
Reviewed-on: https://gerrit.libreoffice.org/56057
Tested-by: Jenkins
Reviewed-by: Daniel Silva 

diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index 2baa21dc53d3..5264fa506034 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -164,6 +164,7 @@ namespace vcl
 VclPtr mpNupOrientationBox;
 
 // page order ("left to right, then down")
+VclPtr   mpNupOrderTxt;
 VclPtr mpNupOrderBox;
 VclPtr  mpNupOrderWin;
 /// border around each page
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 967b88335b09..97c3bca84689 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -518,6 +518,7 @@ PrintDialog::PrintDialog(vcl::Window* i_pWindow, const 
std::shared_ptrSetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) );
 mpNupColEdt->SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) );
 mpNupRowsEdt->SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) );
+mpPageMarginEdt->SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) );
+mpSheetMarginEdt->SetModifyHdl( LINK( this, PrintDialog, ModifyHdl ) );
 
 preparePreview( true, true );
 }
@@ -690,6 +693,7 @@ void PrintDialog::dispose()
 mpNupOrientationBox.clear();
 mpNupOrderBox.clear();
 mpNupOrderWin.clear();
+mpNupOrderTxt.clear();
 mpBorderCB.clear();
 ModalDialog::dispose();
 }
@@ -1024,10 +1028,28 @@ void PrintDialog::updateNupFromPages()
 mpSheetMarginEdt->SetValue( mpSheetMarginEdt->Normalize( nSheetMargin ), 
FUNIT_100TH_MM );
 
 showAdvancedControls( bCustom );
-
 updateNup();
 }
 
+void PrintDialog::enableNupControls( bool bEnable )
+{
+mpNupPagesBox->Enable( bEnable );
+mpNupNumPagesTxt->Enable( bEnable );
+mpNupColEdt->Enable( bEnable );
+mpNupTimesTxt->Enable( bEnable );
+mpNupRowsEdt->Enable( bEnable );
+mpPageMarginTxt1->Enable( bEnable );
+mpPageMarginEdt->Enable( bEnable );
+mpPageMarginTxt2->Enable( bEnable );
+mpSheetMarginTxt1->Enable( bEnable );
+mpSheetMarginEdt->Enable( bEnable );
+mpSheetMarginTxt2->Enable( bEnable );
+mpNupOrderTxt->Enable( bEnable );
+mpNupOrderBox->Enable( bEnable );
+mpNupOrderWin->Enable( bEnable );
+mpBorderCB->Enable( bEnable );
+}
+
 void PrintDialog::showAdvancedControls( bool i_bShow )
 {
 mpNupNumPagesTxt->Show( i_bShow );
@@ -1232,8 +1254,7 @@ void PrintDialog::setupOptionalUI()
 else if( aCtrlType == "Bool" && aGroupingHint == "LayoutPage" && 
aPropertyName == "PrintProspect" )
 {
 mpBrochureBtn->SetText( aText );
-// FIXME: Brochure button is still not working, so it is hidden 
for now
-// mpBrochureBtn->Show();
+mpBrochureBtn->Show();
 
 bool bVal = false;
 PropertyValue* pVal = maPController->getValue( aPropertyName );
@@ -1582,12 +1603,12 @@ IMPL_LINK ( PrintDialog, ClickHdl, Button*, pButton, 
void )
 mpNupPagesBox->SelectEntryPos( 0 );
 updateNupFromPages();
 showAdvancedControls( false );
-//enableNupControls( false );
+enableNupControls( false );
 }
 }
 else if( pButton == mpPagesBtn )
 {
-//enableNupControls( true );
+enableNupControls( true );
 updateNupFromPages();
 }
 else if( pButton == mpCollateBox )
diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui
index f7b7de2db876..4775d131fab5 100644
--- a/vcl/uiconfig/ui/printdialog.ui
+++ b/vcl/uiconfig/ui/printdialog.ui
@@ -1,5 +1,5 @@
 
-
+
 
   
   
@@ -29,6 +29,64 @@
 gtk-media-next
 1
   
+  
+
+  
+  
+  
+  
+
+
+  
+1
+1
+  
+  
+2
+2
+  
+  
+4
+4
+  
+  
+6
+6
+  
+  
+9
+9
+  
+  
+16
+16
+  
+  
+Custom
+65535
+  
+
+  
+  
+
+  
+  
+
+
+  
+left 
to right, then down
+  
+  
+top to 
bottom, then right
+  
+  
+top to 
bottom, then left
+  
+  
+right 
t

[Libreoffice-commits] core.git: Branch 'feature/print_revamp' - basctl/inc basctl/source sc/inc sc/source sd/inc sd/source sw/inc sw/source vcl/uiconfig

2018-06-25 Thread Daniel
 basctl/inc/strings.hrc |6 +--
 basctl/source/basicide/basicrenderable.cxx |   15 +++
 sc/inc/strings.hrc |   15 +++
 sc/source/ui/unoobj/docuno.cxx |   26 -
 sd/inc/DocumentRenderer.hrc|   12 +++---
 sd/inc/strings.hrc |3 +
 sd/source/ui/view/DocumentRenderer.cxx |   30 +--
 sw/inc/strings.hrc |9 ++--
 sw/source/core/view/printdata.cxx  |   56 +
 vcl/uiconfig/ui/printdialog.ui |   40 
 10 files changed, 103 insertions(+), 109 deletions(-)

New commits:
commit c75876410c6617f65c63b1d8d65ffb2cdf6fca51
Author: Daniel 
Date:   Thu Jun 14 23:29:34 2018 -0300

Configures page range in print dialog

Change-Id: I62bd9affc9e065d7afcc60296a72eae4612b0ddd
Reviewed-on: https://gerrit.libreoffice.org/55840
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 

diff --git a/basctl/inc/strings.hrc b/basctl/inc/strings.hrc
index aa9ebb37f7c5..88d1f0a669e9 100644
--- a/basctl/inc/strings.hrc
+++ b/basctl/inc/strings.hrc
@@ -97,9 +97,9 @@
 #define RID_STR_DLGIMP_MISMATCH_OMIT
NC_("RID_STR_DLGIMP_MISMATCH_OMIT", "Omit")
 #define RID_STR_DLGIMP_MISMATCH_TITLE   
NC_("RID_STR_DLGIMP_MISMATCH_TITLE", "Dialog Import - Language Mismatch")
 #define RID_STR_DLGIMP_MISMATCH_TEXT
NC_("RID_STR_DLGIMP_MISMATCH_TEXT", "The dialog to be imported supports other 
languages than the target library.\n\nAdd these languages to the library to 
keep additional language resources provided by the dialog or omit them to stay 
with the current library languages.\n\nNote: For languages not supported by the 
dialog the resources of the dialog's default language will be used.\n ")
-#define RID_STR_PRINTDLG_RANGE  NC_("RID_STR_PRINTDLG_RANGE", 
"Print range")
-#define RID_STR_PRINTDLG_ALLPAGES   NC_("RID_STR_PRINTDLG_ALLPAGES", 
"All ~Pages")
-#define RID_STR_PRINTDLG_PAGES  NC_("RID_STR_PRINTDLG_PAGES", 
"Pa~ges")
+#define RID_STR_PRINTDLG_PAGES  NC_("RID_STR_PRINTDLG_PAGES", 
"Pages:")
+#define RID_STR_PRINTDLG_PRINTALLPAGES  
NC_("RID_STR_PRINTDLG_PRINTALLPAGES", "Print all pages")
+#define RID_STR_PRINTDLG_PRINTPAGES NC_("RID_STR_PRINTDLG_PRINTPAGES", 
"Print pages")
 #define RID_STR_BTNDEL  NC_("RID_STR_BTNDEL", "~Delete")
 #define RID_STR_BTNNEW  NC_("RID_STR_BTNNEW", "~New")
 #define RID_STR_CHOOSE  NC_("RID_STR_CHOOSE", "Choose")
diff --git a/basctl/source/basicide/basicrenderable.cxx 
b/basctl/source/basicide/basicrenderable.cxx
index e7e510d12b37..e89adb755686 100644
--- a/basctl/source/basicide/basicrenderable.cxx
+++ b/basctl/source/basicide/basicrenderable.cxx
@@ -43,19 +43,16 @@ Renderable::Renderable (BaseWindow* pWin)
 aPrintRangeOpt.maGroupHint = "PrintRange" ;
 aPrintRangeOpt.mbInternalOnly = true;
 m_aUIProperties[0].Value = setSubgroupControlOpt("printrange",
-IDEResId( RID_STR_PRINTDLG_RANGE ), OUString(), aPrintRangeOpt);
+IDEResId( RID_STR_PRINTDLG_PAGES ), OUString(), aPrintRangeOpt);
 
 // create a choice for the range to print
 OUString aPrintContentName( "PrintContent" );
-const Sequence aChoices{IDEResId(RID_STR_PRINTDLG_ALLPAGES),
-  IDEResId(RID_STR_PRINTDLG_PAGES)};
-const Sequence 
aHelpIds{".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0",
-  
".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1"};
-const Sequence aWidgetIds{"printallpages",
-"printpages"};
-m_aUIProperties[1].Value = setChoiceRadiosControlOpt(aWidgetIds, 
OUString(),
+const Sequence aChoices{IDEResId(RID_STR_PRINTDLG_PRINTALLPAGES),
+  IDEResId(RID_STR_PRINTDLG_PRINTPAGES)};
+const Sequence 
aHelpIds{".HelpID:vcl:PrintDialog:PrintContent:ListBox"};
+m_aUIProperties[1].Value = setChoiceListControlOpt( "printpagesbox", 
OUString(),
aHelpIds, aPrintContentName,
-   aChoices, 0);
+   aChoices, 0 );
 
 // create a an Edit dependent on "Pages" selected
 vcl::PrinterOptionsHelper::UIControlOptions 
aPageRangeOpt(aPrintContentName, 1, true);
diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index ed0fc8df5663..4966fad11343 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/st

[Libreoffice-commits] core.git: Branch 'feature/print_revamp' - vcl/inc vcl/source vcl/uiconfig

2018-06-14 Thread Daniel
 vcl/inc/printdlg.hxx   |   23 +
 vcl/source/window/printdlg.cxx |  616 -
 vcl/uiconfig/ui/printdialog.ui |   15 
 3 files changed, 641 insertions(+), 13 deletions(-)

New commits:
commit e0c9aaf19bed5a38ecb2748008d02b5c88a7ff26
Author: Daniel 
Date:   Fri Jun 8 00:26:21 2018 -0300

Reinserts optional UI options into print dialog

Change-Id: I9ee0e250ea476aa546b842cbd45fff8ea208cfe5
Reviewed-on: https://gerrit.libreoffice.org/55450
Tested-by: Jenkins
Reviewed-by: Daniel Silva 

diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index 03e01b840003..2baa21dc53d3 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -104,9 +105,12 @@ namespace vcl
 
 private:
 
+std::unique_ptr mpCustomOptionsUIBuilder;
+
 std::shared_ptr  maPController;
 
 VclPtr  mpTabCtrl;
+VclPtrmpPageLayoutFrame;
 VclPtr mpPrinters;
 VclPtr   mpStatusTxt;
 VclPtr  mpSetupButton;
@@ -165,30 +169,47 @@ namespace vcl
 /// border around each page
 VclPtrmpBorderCB;
 
-std::map< VclPtr, OUString >  maControlToPropertyMap;
+std::map< VclPtr, OUString >
+maControlToPropertyMap;
+std::map< OUString, std::vector< VclPtr > >
+maPropertyToWindowMap;
+std::map< VclPtr, sal_Int32 >
+maControlToNumValMap;
+std::set< OUString >maReverseDependencySet;
 
 SizemaNupPortraitSize;
 SizemaNupLandscapeSize;
 /// internal, used for automatic Nup-Portrait/landscape
 SizemaFirstPageSize;
 
+boolmbShowLayoutFrame;
+
 DECL_LINK( ClickHdl, Button*, void );
 DECL_LINK( SelectHdl, ListBox&, void );
 DECL_LINK( ModifyHdl, Edit&, void );
 DECL_LINK( ToggleHdl, CheckBox&, void );
 DECL_LINK( ToggleRadioHdl, RadioButton&, void );
 
+DECL_LINK( UIOption_CheckHdl, CheckBox&, void );
+DECL_LINK( UIOption_RadioHdl, RadioButton&, void );
+DECL_LINK( UIOption_SelectHdl, ListBox&, void );
+DECL_LINK( UIOption_ModifyHdl, Edit&, void );
+
 css::beans::PropertyValue* getValueForWindow( vcl::Window* ) const;
 
 void preparePreview( bool i_bPrintChanged = true, bool i_bMayUseCache 
= false );
 void setPreviewText();
 void updatePrinterText();
 void checkControlDependencies();
+void checkOptionalControlDependencies();
+void makeEnabled( vcl::Window* );
+void updateWindowFromProperty( const OUString& );
 void initFromMultiPageSetup( const 
vcl::PrinterController::MultiPageSetup& );
 void showAdvancedControls( bool );
 void updateNup();
 void updateNupFromPages();
 void enableNupControls( bool bEnable );
+void setupOptionalUI();
 Size const & getJobPageSize();
 
 };
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 06f3ed8470f0..967b88335b09 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -482,8 +482,8 @@ Size const & PrintDialog::getJobPageSize()
 }
 
 PrintDialog::PrintDialog(vcl::Window* i_pWindow, const 
std::shared_ptr& i_rController)
-
 : ModalDialog(i_pWindow, "PrintDialog", "vcl/ui/printdialog.ui")
+, mpCustomOptionsUIBuilder(nullptr)
 , maPController( i_rController )
 , maPrintToFileText( VclResId( SV_PRINT_TOFILE_TXT ) )
 , maDefPrtText( VclResId( SV_PRINT_DEFPRT_TXT ) )
@@ -494,11 +494,14 @@ PrintDialog::PrintDialog(vcl::Window* i_pWindow, const 
std::shared_ptrgetMultipage() );
 
+// setup optional UI options set by application
+setupOptionalUI();
+
+// hide layout frame if unwanted
+mpPageLayoutFrame->Show( mbShowLayoutFrame );
+
 // setup click hdl
 mpOKButton->SetClickHdl(LINK(this, PrintDialog, ClickHdl));
 mpCancelButton->SetClickHdl(LINK(this, PrintDialog, ClickHdl));
@@ -618,7 +627,6 @@ PrintDialog::PrintDialog(vcl::Window* i_pWindow, const 
std::shared_ptrSetToggleHdl( LINK( this, PrintDialog, ToggleHdl ) );
 mpCollateBox->SetToggleHdl( LINK( this, PrintDialog, ToggleHdl ) );
 mpPagesBtn->SetToggleHdl( LINK( this, PrintDialog, ToggleRadioHdl ) );
-mpBrochureBtn->SetToggleHdl( LINK( this, PrintDialog, ToggleRadioHdl ) );
 
 // setup select hdl
 mpPrint

[Libreoffice-commits] core.git: Branch 'feature/print_revamp' - vcl/inc vcl/source vcl/uiconfig

2018-06-07 Thread Daniel
 vcl/inc/printdlg.hxx   |  208 +---
 vcl/source/gdi/print3.cxx  |   11 
 vcl/source/window/printdlg.cxx | 1562 +++---
 vcl/uiconfig/ui/printdialog.ui | 2069 +++--
 4 files changed, 1225 insertions(+), 2625 deletions(-)

New commits:
commit 1d5edc87667625d8b97c7cc9f59cbd2c8c96fe36
Author: Daniel 
Date:   Sat Jun 2 19:40:52 2018 -0300

New Print Dialog Design

Change-Id: Ib92a16ccfab70b84ffea07970a694800ecc16d07
Reviewed-on: https://gerrit.libreoffice.org/55237
Tested-by: Jenkins 
Reviewed-by: Daniel Silva 

diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index 0a5b09fd366a..03e01b840003 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_PRINTDLG_HXX
-#define INCLUDED_VCL_INC_PRINTDLG_HXX
+#ifndef VCL_INC_NEWPRINTDLG_HXX
+#define VCL_INC_NEWPRINTDLG_HXX
 
 #include 
 
@@ -91,168 +91,106 @@ namespace vcl
 }
 };
 
-private:
-
-class NUpTabPage
-{
-public:
-VclPtr mpPagesBtn;
-VclPtr mpBrochureBtn;
-VclPtr   mpPagesBoxTitleTxt;
-VclPtr mpNupPagesBox;
-
-// controls for "Custom" page mode
-VclPtr   mpNupNumPagesTxt;
-VclPtrmpNupColEdt;
-VclPtr   mpNupTimesTxt;
-VclPtrmpNupRowsEdt;
-VclPtr   mpPageMarginTxt1;
-VclPtr mpPageMarginEdt;
-VclPtr   mpPageMarginTxt2;
-VclPtr   mpSheetMarginTxt1;
-VclPtr mpSheetMarginEdt;
-VclPtr   mpSheetMarginTxt2;
-VclPtr   mpNupOrientationTxt;
-VclPtr mpNupOrientationBox;
-
-// page order ("left to right, then down")
-VclPtr   mpNupOrderTxt;
-VclPtr mpNupOrderBox;
-VclPtr  mpNupOrderWin;
-/// border around each page
-VclPtrmpBorderCB;
-
-NUpTabPage( VclBuilder* );
-
-void initFromMultiPageSetup( const 
vcl::PrinterController::MultiPageSetup& );
-void enableNupControls( bool bEnable );
-
-void showAdvancedControls( bool );
-};
-
-class JobTabPage
-{
-public:
-VclPtr mpPrinters;
-VclPtr   mpStatusTxt;
-VclPtr   mpLocationTxt;
-VclPtr   mpCommentTxt;
-
-VclPtr  mpSetupButton;
-
-VclPtrmpCopyCountField;
-VclPtrmpCollateBox;
-VclPtr  mpCollateImage;
-VclPtrmpReverseOrderBox;
-
-BitmapExmaCollateBmp;
-BitmapExmaNoCollateBmp;
-
-longmnCollateUIMode;
-
-JobTabPage( VclBuilder* );
-
-void readFromSettings();
-void storeToSettings();
-};
-
-class OutputOptPage
-{
-public:
-VclPtrmpCollateSingleJobsBox;
-VclPtrmpPapersizeFromSetup;
+PrintDialog( vcl::Window*, const std::shared_ptr< PrinterController >& 
);
+virtual ~PrintDialog() override;
+virtual void dispose() override;
 
-OutputOptPage( VclBuilder* );
+bool isPrintToFile();
+bool isCollate();
+bool hasPreview();
 
-void readFromSettings();
-void storeToSettings();
-};
+void previewForward();
+void previewBackward();
 
-std::unique_ptr mpCustomOptionsUIBuilder;
+private:
 
 std::shared_ptr  maPController;
-VclPtr  mpTabCtrl;
-NUpTabPage  maNUpPage;
-JobTabPage  maJobPage;
-OutputOptPage   maOptionsPage;
-VclPtr  mpPreviewWindow;
-VclPtrmpPageEdit;
 
-VclPtr   mpNumPagesText;
-VclPtr  mpBackwardBtn;
-VclPtr  mpForwardBtn;
-VclPtrmpPreviewBox;
+VclPtr  

[Libreoffice-commits] core.git: Branch 'feature/print_revamp' - vcl/inc vcl/source vcl/uiconfig

2018-05-29 Thread Daniel
 vcl/inc/printdlg.hxx   |3 +
 vcl/inc/strings.hrc|1 
 vcl/source/window/printdlg.cxx |   62 +
 vcl/uiconfig/ui/printdialog.ui |   16 ++
 4 files changed, 71 insertions(+), 11 deletions(-)

New commits:
commit b9c297021d2b95b67fa2ab2842f0f4b344338129
Author: Daniel 
Date:   Tue May 15 22:58:38 2018 -0300

tdf#67905 adds an option to disable print preview in print dialog

Change-Id: Id6dd1724a1b8f61d94f0685f63d28b3cff19988f

diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index b16d91cad1f6..0a5b09fd366a 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -181,6 +181,7 @@ namespace vcl
 VclPtr   mpNumPagesText;
 VclPtr  mpBackwardBtn;
 VclPtr  mpForwardBtn;
+VclPtrmpPreviewBox;
 
 VclPtrmpOKButton;
 VclPtrmpCancelButton;
@@ -188,6 +189,7 @@ namespace vcl
 
 OUStringmaPageStr;
 OUStringmaNoPageStr;
+OUStringmaNoPreviewStr;
 sal_Int32   mnCurPage;
 sal_Int32   mnCachedPages;
 
@@ -247,6 +249,7 @@ namespace vcl
 bool isPrintToFile();
 bool isCollate();
 bool isSingleJobs();
+bool hasPreview();
 
 void previewForward();
 void previewBackward();
diff --git a/vcl/inc/strings.hrc b/vcl/inc/strings.hrc
index 1475e2a65ceb..1e5eb9d14743 100644
--- a/vcl/inc/strings.hrc
+++ b/vcl/inc/strings.hrc
@@ -113,6 +113,7 @@
 #define SV_ACCESSERROR_NO_FONTS  
NC_("SV_ACCESSERROR_NO_FONTS", "No fonts could be found on the system.")
 
 #define SV_PRINT_NOPAGES NC_("SV_PRINT_NOPAGES", 
"No pages")
+#define SV_PRINT_NOPREVIEW   NC_("SV_PRINT_NOPREVIEW", 
"Preview is disabled")
 #define SV_PRINT_TOFILE_TXT  
NC_("SV_PRINT_TOFILE_TXT", "Print to File...")
 #define SV_PRINT_DEFPRT_TXT  
NC_("SV_PRINT_DEFPRT_TXT", "Default printer")
 #define SV_PRINT_PRINTPREVIEW_TXT
NC_("SV_PRINT_PRINTPREVIEW_TXT", "Print preview")
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 084763fa934b..e59694ca8c0f 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -650,6 +650,7 @@ PrintDialog::PrintDialog( vcl::Window* i_pParent, const 
std::shared_ptrGetText();
@@ -715,9 +717,6 @@ PrintDialog::PrintDialog( vcl::Window* i_pParent, const 
std::shared_ptrresetPrinterOptions( false );
 
-// get the first page
-preparePreview( true, true );
-
 // update the text fields for the printer
 updatePrinterText();
 
@@ -747,6 +746,7 @@ PrintDialog::PrintDialog( vcl::Window* i_pParent, const 
std::shared_ptrSetClickHdl( LINK( this, PrintDialog, ClickHdl ) );
 mpForwardBtn->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) );
 mpBackwardBtn->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) );
+mpPreviewBox->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) );
 
 maJobPage.mpCollateBox->SetToggleHdl( LINK( this, PrintDialog, ToggleHdl ) 
);
 maJobPage.mpSetupButton->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) 
);
@@ -805,6 +805,7 @@ void PrintDialog::dispose()
 mpNumPagesText.clear();
 mpBackwardBtn.clear();
 mpForwardBtn.clear();
+mpPreviewBox.clear();
 mpOKButton.clear();
 mpCancelButton.clear();
 mpHelpButton.clear();
@@ -834,6 +835,16 @@ void PrintDialog::readFromSettings()
 }
 }
 
+aValue = pItem->getValue( "PrintDialog", "HasPreview" );
+if ( aValue.equalsIgnoreAsciiCase("true") )
+{
+mpPreviewBox->Check();
+}
+else
+{
+mpPreviewBox->Check( false );
+}
+
 // persistent window state
 OUString aWinState( pItem->getValue( "PrintDialog",
   "WindowState" ) );
@@ -864,6 +875,9 @@ void PrintDialog::storeToSettings()
  "WindowState",
  OStringToOUString( GetWindowState(), 
RTL_TEXTENCODING_UTF8 )
  );
+pItem->setValue( "PrintDialog",
+ "HasPreview",
+ hasPreview() ? OUString("true") : OUString("false") );
 pItem->Commit();
 }
 
@@ -882,6 +896,11 @@ bool PrintDialog::isSingleJobs()
 return maOptionsPage.mpCollateSingleJobsBox->IsChecked();
 }
 
+bool PrintDialog::hasPreview()
+{
+return mpPreviewBox->IsChe

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

2018-05-21 Thread Daniel
 include/svx/sdr/table/tablecontroller.hxx |1 +
 svx/source/table/tablecontroller.cxx  |   12 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 7c5f1caa775e6a3d178c7dae7171d3fca2874635
Author: Daniel <danielfaleirosi...@gmail.com>
Date:   Thu May 17 10:23:24 2018 -0300

tdf#117581 impress: fix selection overlay after moving table

Change-Id: Ie5afa4fbddf86c6692a7ed68af9ef990c2f9f487
Reviewed-on: https://gerrit.libreoffice.org/54493
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/include/svx/sdr/table/tablecontroller.hxx 
b/include/svx/sdr/table/tablecontroller.hxx
index 3a8ec322aaeb..130d57a6da3e 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -177,6 +177,7 @@ private:
 CellPos maCursorFirstPos;
 CellPos maCursorLastPos;
 bool mbCellSelectionMode;
+bool mbHasJustMerged;
 CellPos maMouseDownPos;
 bool mbLeftButtonDown;
 std::unique_ptr  mpSelectionOverlay;
diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 3568fa743fd7..3241f2c7d304 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -172,6 +172,7 @@ SvxTableController::SvxTableController(
 SdrView& rView,
 const SdrTableObj& rObj)
 :   mbCellSelectionMode(false)
+,mbHasJustMerged(false)
 ,mbLeftButtonDown(false)
 ,mpSelectionOverlay(nullptr)
 ,mrView(rView)
@@ -1820,6 +1821,8 @@ void SvxTableController::MergeRange( sal_Int32 nFirstCol, 
sal_Int32 nFirstRow, s
 }
 
 xRange->merge();
+mbHasJustMerged = true;
+setSelectedCells( maCursorFirstPos, maCursorFirstPos );
 
 if( bUndo )
 rModel.EndUndo();
@@ -2144,6 +2147,11 @@ void SvxTableController::onTableModified()
 
 void SvxTableController::updateSelectionOverlay()
 {
+// There is no need to update selection overlay after merging cells
+// since the selection overlay should remain the same
+if ( mbHasJustMerged )
+return;
+
 destroySelectionOverlay();
 if( mbCellSelectionMode )
 {
@@ -2792,9 +2800,11 @@ IMPL_LINK_NOARG(SvxTableController, UpdateHdl, void*, 
void)
 if( aStart != maCursorFirstPos || aEnd != maCursorLastPos )
 {
 setSelectedCells( aStart, aEnd );
-updateSelectionOverlay();
 }
 }
+
+updateSelectionOverlay();
+mbHasJustMerged = false;
 }
 
 namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-06 Thread Daniel
 sw/inc/viewsh.hxx |5 +++--
 sw/source/core/view/vprint.cxx|   13 +++--
 sw/source/uibase/uno/unotxdoc.cxx |2 +-
 3 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 08441d466dd70c203a519a133aaf1a5997adbbd3
Author: Daniel <danielfaleirosi...@gmail.com>
Date:   Tue May 1 16:22:33 2018 -0300

tdf#113866 print text in black print option doest not affect PDF export

Change-Id: Ie328e3a8246e1c2c818af1b9cc4d59e2e711a041
Reviewed-on: https://gerrit.libreoffice.org/53716
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Heiko Tietze <tietze.he...@gmail.com>
Tested-by: Heiko Tietze <tietze.he...@gmail.com>
Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index afe420ac43be..1996cce7f40e 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -162,7 +162,7 @@ class SW_DLLPUBLIC SwViewShell : public 
sw::Ring
 SAL_DLLPRIVATE bool CheckInvalidForPaint( const SwRect & );  // Direct 
Paint or rather
 // trigger 
an action.
 
-SAL_DLLPRIVATE void PrepareForPrint( const SwPrintData  );
+SAL_DLLPRIVATE void PrepareForPrint( const SwPrintData , bool 
bIsPDFExport = false );
 
 SAL_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption  );
 
@@ -346,7 +346,8 @@ public:
 // bIsPDFExport == true is: do PDF Export (no printing!)
 bool PrintOrPDFExport( OutputDevice *pOutDev,
 SwPrintData const& rPrintData,
-sal_Int32 nRenderer /* offset in vector of pages to print */ );
+sal_Int32 nRenderer, /* offset in vector of pages to print */
+bool bIsPDFExport );
 
 // Printing of one brochure page.
 void PrintProspect( OutputDevice *pOutDev, const SwPrintData ,
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 42afa4f016b8..96f94a03a4a8 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -445,7 +445,8 @@ sw_getPage(SwRootFrame const& rLayout, sal_Int32 const 
nPage)
 bool SwViewShell::PrintOrPDFExport(
 OutputDevice *pOutDev,
 SwPrintData const& rPrintData,
-sal_Int32 nRenderer /* the index in the vector of pages to be printed 
*/ )
+sal_Int32 nRenderer, /* the index in the vector of pages to be printed 
*/
+bool bIsPDFExport )
 {
 // CAUTION: Do also always update the printing routines in viewpg.cxx 
(PrintProspect)!
 
@@ -510,8 +511,7 @@ bool SwViewShell::PrintOrPDFExport(
 
 // save options at draw view:
 SwDrawViewSave aDrawViewSave( pShell->GetDrawView() );
-
-pShell->PrepareForPrint( rPrintData );
+pShell->PrepareForPrint( rPrintData, bIsPDFExport );
 
 const sal_Int32 nPage = rPrintData.GetRenderData().GetPagesToPrint()[ 
nRenderer ];
 OSL_ENSURE( nPage < 0 ||
@@ -683,14 +683,15 @@ SwDrawViewSave::~SwDrawViewSave()
 }
 
 // OD 09.01.2003 #i6467# - method also called for page preview
-void SwViewShell::PrepareForPrint( const SwPrintData  )
+void SwViewShell::PrepareForPrint( const SwPrintData , bool 
bIsPDFExport )
  {
 mpOpt->SetGraphic  ( rOptions.m_bPrintGraphic );
 mpOpt->SetTable( rOptions.m_bPrintTable );
-mpOpt->SetDraw ( rOptions.m_bPrintDraw  );
+mpOpt->SetDraw ( rOptions.m_bPrintDraw );
 mpOpt->SetControl  ( rOptions.m_bPrintControl );
 mpOpt->SetPageBack ( rOptions.m_bPrintPageBackground );
-mpOpt->SetBlackFont( rOptions.m_bPrintBlackFont );
+// Font should not be balck if it's a PDF Export
+mpOpt->SetBlackFont( rOptions.m_bPrintBlackFont && !bIsPDFExport );
 
 if ( HasDrawView() )
 {
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index ee6165166310..0a22921c96e6 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3058,7 +3058,7 @@ void SAL_CALL SwXTextDocument::render(
 if (bPrintProspect)
 pVwSh->PrintProspect( pOut, rSwPrtOptions, nRenderer );
 else// normal printing and PDF export
-pVwSh->PrintOrPDFExport( pOut, rSwPrtOptions, 
nRenderer );
+pVwSh->PrintOrPDFExport( pOut, rSwPrtOptions, 
nRenderer, bIsPDFExport );
 
 // #i35176#
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-06 Thread Daniel
 sd/source/core/sdpage.cxx |   68 ++
 1 file changed, 51 insertions(+), 17 deletions(-)

New commits:
commit 6a8ae73b4c23ec80f97bcafd8b9a5e8f14b2abc7
Author: Daniel <danielfaleirosi...@gmail.com>
Date:   Sun Apr 29 14:51:08 2018 -0300

tdf#99301 fix handouts selected order

Change-Id: I757d41a4ec2ce832b16243e9d9c6fbd5fba6add6
Reviewed-on: https://gerrit.libreoffice.org/53628
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index aadb6a91e905..96835106736d 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2936,21 +2936,67 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& 
rModel, AutoLayout eLayout,
 {
 SdPage& rHandoutMaster = *rModel.GetMasterSdPage( 0, PageKind::Handout );
 
+static const sal_uInt16 aOffsets[5][9] =
+{
+{ 0, 1, 2, 3, 4, 5, 6, 7, 8 }, // AUTOLAYOUT_HANDOUT9, Portrait, 
Horizontal order
+{ 0, 2, 4, 1, 3, 5, 0, 0, 0 }, // AUTOLAYOUT_HANDOUT3, Landscape, 
Vertical
+{ 0, 2, 1, 3, 0, 0, 0, 0, 0 }, // AUTOLAYOUT_HANDOUT4, Landscape, 
Vertical
+{ 0, 3, 1, 4, 2, 5, 0, 0, 0 }, // AUTOLAYOUT_HANDOUT4, Portrait, 
Vertical
+{ 0, 3, 6, 1, 4, 7, 2, 5, 8 }, // AUTOLAYOUT_HANDOUT9, Landscape, 
Vertical
+};
+
+const sal_uInt16* pOffsets = aOffsets[0];
+
+Size aArea = rHandoutMaster.GetSize();
+const bool bLandscape = aArea.Width() > aArea.Height();
+
 if( eLayout == AUTOLAYOUT_NONE )
 {
 // use layout from handout master
 SdrObjListIter aShapeIter (rHandoutMaster);
-while (aShapeIter.IsMore())
+
+std::vector< ::tools::Rectangle > vSlidesAreas;
+while ( aShapeIter.IsMore() )
 {
-SdrPageObj* pPageObj = 
dynamic_cast<SdrPageObj*>(aShapeIter.Next());
+SdrPageObj* pPageObj = dynamic_cast<SdrPageObj*>( 
aShapeIter.Next() );
+// get slide rectangles
 if (pPageObj)
-rAreas.push_back( pPageObj->GetCurrentBoundRect() );
+vSlidesAreas.push_back( pPageObj->GetCurrentBoundRect() );
+}
+
+if ( !bHorizontal || vSlidesAreas.size() < 4 )
+{ // top to bottom, then right
+rAreas.swap( vSlidesAreas );
+}
+else
+{ // left to right, then down
+switch ( vSlidesAreas.size() )
+{
+case 4:
+pOffsets = aOffsets[2];
+break;
+
+default:
+SAL_FALLTHROUGH;
+case 6:
+pOffsets = aOffsets[ bLandscape ? 3 : 1 ];
+break;
+
+case 9:
+pOffsets = aOffsets[4];
+break;
+}
+
+rAreas.resize( static_cast(vSlidesAreas.size()) );
+
+for( const tools::Rectangle& rRect : vSlidesAreas )
+{
+rAreas[*pOffsets++] = rRect;
+}
 }
 }
 else
 {
-SizeaArea = rHandoutMaster.GetSize();
-
 const long nGapW = 1000; // gap is 1cm
 const long nGapH = 1000;
 
@@ -2970,18 +3016,6 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& 
rModel, AutoLayout eLayout,
 aArea.AdjustWidth( -(nGapW * 2 + nLeftBorder + nRightBorder) );
 aArea.AdjustHeight( -(nGapH * 2 + nTopBorder + nBottomBorder) );
 
-const bool bLandscape = aArea.Width() > aArea.Height();
-
-static const sal_uInt16 aOffsets[5][9] =
-{
-{ 0, 1, 2, 3, 4, 5, 6, 7, 8 }, // AUTOLAYOUT_HANDOUT9, Portrait, 
Horizontal order
-{ 0, 2, 4, 1, 3, 5, 0, 0, 0 }, // AUTOLAYOUT_HANDOUT3, Landscape, 
Vertical
-{ 0, 2, 1, 3, 0, 0, 0, 0, 0 }, // AUTOLAYOUT_HANDOUT4, Landscape, 
Vertical
-{ 0, 3, 1, 4, 2, 5, 0, 0, 0 }, // AUTOLAYOUT_HANDOUT4, Portrait, 
Vertical
-{ 0, 3, 6, 1, 4, 7, 2, 5, 8 }, // AUTOLAYOUT_HANDOUT9, Landscape, 
Vertical
-};
-
-const sal_uInt16* pOffsets = aOffsets[0];
 sal_uInt16  nColCnt = 0, nRowCnt = 0;
 switch ( eLayout )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


GSoC 2018 Introduction

2018-05-06 Thread Daniel Silva
Dear LibreOffice Devs,

I would like to introduce myself: I am Daniel Silva, one of the students
selected for GSoC 2018. My project is to Revamp Print Dialog.

So far, I've been studying how current print dialog works and I am trying
to solve some bugs related to the print dialog.

Thanks for the opportunity and I look forward to a great summer!

Regards,
Daniel Silva
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2018-03-28 Thread Daniel
 include/svx/tbcontrl.hxx |1 +
 svx/source/tbxctrls/tbcontrl.cxx |9 -
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit bdd7abf56676732f8ce4fd04bea5c72758f1ec3b
Author: Daniel <danielfaleirosi...@gmail.com>
Date:   Sat Mar 24 00:13:26 2018 -0300

tdf#63438 Toggle highlight color to no fill if the same value is active

Change-Id: I7553bc7bffeb0a8d1275aadc44bf2813564087b5
Reviewed-on: https://gerrit.libreoffice.org/51794
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx
index 57d1dcba5f22..1f5079f69a22 100644
--- a/include/svx/tbcontrl.hxx
+++ b/include/svx/tbcontrl.hxx
@@ -212,6 +212,7 @@ class SVX_DLLPUBLIC SvxColorToolBoxControl : public 
cppu::ImplInheritanceHelper<
 std::shared_ptr m_xPaletteManager;
 BorderColorStatus m_aBorderColorStatus;
 bool m_bSplitButton;
+bool m_bIsNoFill;
 sal_uInt16 m_nSlotId;
 ColorSelectFunction m_aColorSelectFunction;
 DECL_LINK(SelectedHdl, const NamedColor&, void);
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 6ec04a941513..c817027dedad 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2753,6 +2753,7 @@ 
com_sun_star_comp_svx_FontNameToolBoxControl_get_implementation(
 SvxColorToolBoxControl::SvxColorToolBoxControl( const 
css::uno::Reference& rContext ) :
 ImplInheritanceHelper( rContext, nullptr, OUString() ),
 m_bSplitButton(true),
+m_bIsNoFill(false),
 m_nSlotId(0),
 m_aColorSelectFunction(PaletteManager::DispatchColorCommand)
 {
@@ -2876,6 +2877,9 @@ VclPtr 
SvxColorToolBoxControl::createPopupWindow( vcl::Window* pPar
 
 IMPL_LINK(SvxColorToolBoxControl, SelectedHdl, const NamedColor&, rColor, void)
 {
+if (m_xBtnUpdater->GetCurrentColor() != rColor.first)
+m_bIsNoFill = false;
+
 m_xBtnUpdater->Update(rColor.first);
 if (m_xPaletteManager)
 m_xPaletteManager->SetLastColor(rColor.first);
@@ -2938,8 +2942,11 @@ void SvxColorToolBoxControl::execute(sal_Int16 
/*nSelectModifier*/)
 Color aColor = m_xPaletteManager->GetLastColor();
 
 auto aArgs( comphelper::InitPropertySequence( {
-{ m_aCommandURL.copy(5), css::uno::makeAny( 
m_xPaletteManager->GetLastColor() ) }
+{ m_aCommandURL.copy(5), css::uno::makeAny( COL_TRANSPARENT ) }
 } ) );
+if (!m_bIsNoFill)
+aArgs[0].Value <<= sal_Int32( m_xPaletteManager->GetLastColor() );
+m_bIsNoFill = !m_bIsNoFill;
 dispatchCommand( aCommand, aArgs );
 
 OUString sColorName = ("#" + aColor.AsRGBHexString().toAsciiUpperCase());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - sc/source

2017-12-04 Thread Daniel
 sc/source/core/data/table4.cxx |   67 -
 1 file changed, 47 insertions(+), 20 deletions(-)

New commits:
commit 87efbdb1ae5a73d081667e10f1571f1e523c1b9c
Author: Daniel <danielfaleirosi...@gmail.com>
Date:   Sat Nov 25 01:48:18 2017 -0200

tdf#105268 - Auto Fill: Fix The Next Value for 001-001-001

Change-Id: If1d1a23afb6209c35092d7cd95235ea1699fe7fb
Reviewed-on: https://gerrit.libreoffice.org/45262
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Eike Rathke <er...@redhat.com>
Tested-by: Eike Rathke <er...@redhat.com>
(cherry picked from commit 76c1e7287e29a2a2739fce895fbded3c04764bca)
Reviewed-on: https://gerrit.libreoffice.org/45742

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index f7bab382a76c..bd1d18d0443d 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -78,10 +78,10 @@ short lcl_DecompValueString( OUString& rValue, sal_Int32& 
nVal, sal_uInt16* pMin
 return 0;
 }
 const sal_Unicode* p = rValue.getStr();
-sal_Int32 nNeg = 0;
+sal_Int32 nSign = 0;
 sal_Int32 nNum = 0;
-if ( p[nNum] == '-' )
-nNum = nNeg = 1;
+if ( p[nNum] == '-' || p[nNum] == '+' )
+nNum = nSign = 1;
 while ( p[nNum] && CharClass::isAsciiNumeric( OUString(p[nNum]) ) )
 nNum++;
 
@@ -91,34 +91,37 @@ short lcl_DecompValueString( OUString& rValue, sal_Int32& 
nVal, sal_uInt16* pMin
 // #i5550# If there are numbers at the beginning and the end,
 // prefer the one at the beginning only if it's followed by a space.
 // Otherwise, use the number at the end, to enable things like IP 
addresses.
-if ( nNum > nNeg && ( cNext == 0 || cNext == ' ' || 
!CharClass::isAsciiNumeric(OUString(cLast)) ) )
+if ( nNum > nSign && ( cNext == 0 || cNext == ' ' || 
!CharClass::isAsciiNumeric(OUString(cLast)) ) )
 {   // number at the beginning
 nVal = rValue.copy( 0, nNum ).toInt32();
 //  any number with a leading zero sets the minimum number of digits
-if ( p[nNeg] == '0' && pMinDigits && ( nNum - nNeg > *pMinDigits ) )
-*pMinDigits = nNum - nNeg;
+if ( p[nSign] == '0' && pMinDigits && ( nNum - nSign > *pMinDigits ) )
+*pMinDigits = nNum - nSign;
 rValue = rValue.copy(nNum);
 return -1;
 }
 else
 {
-nNeg = 0;
+nSign = 0;
 sal_Int32 nEnd = nNum = rValue.getLength() - 1;
 while ( nNum && CharClass::isAsciiNumeric( OUString(p[nNum]) ) )
 nNum--;
-if ( p[nNum] == '-' )
+if ( p[nNum] == '-' || p[nNum] == '+' )
 {
 nNum--;
-nNeg = 1;
+nSign = 1;
 }
-if ( nNum < nEnd - nNeg )
+if ( nNum < nEnd - nSign )
 {   // number at the end
 nVal = rValue.copy( nNum + 1 ).toInt32();
 //  any number with a leading zero sets the minimum number of 
digits
-if ( p[nNum+1+nNeg] == '0' && pMinDigits && ( nEnd - nNum - nNeg > 
*pMinDigits ) )
-*pMinDigits = nEnd - nNum - nNeg;
+if ( p[nNum+1+nSign] == '0' && pMinDigits && ( nEnd - nNum - nSign 
> *pMinDigits ) )
+*pMinDigits = nEnd - nNum - nSign;
 rValue = rValue.copy(0, nNum + 1);
-return 1;
+if (nSign) // use the return value = 2 to put back the '+'
+return 2;
+else
+return 1;
 }
 }
 nVal = 0;
@@ -938,11 +941,19 @@ OUString ScTable::GetAutoFillPreview( const ScRange& 
rSource, SCCOL nEndX, SCROW
 {
 if (aValue == ScGlobal::GetOrdinalSuffix( 
nVal))
 aValue = ScGlobal::GetOrdinalSuffix( nVal 
+ nDelta);
-
 aValue = lcl_ValueString( nVal + nDelta, 
nCellDigits ) + aValue;
 }
 else if ( nFlag > 0 )
-aValue += lcl_ValueString( nVal + nDelta, 
nCellDigits );
+{
+sal_Int32 nNextValue;
+if ( nVal < 0 )
+nNextValue = nVal - nDelta;
+else
+nNextValue = nVal + nDelta;
+if ( nFlag == 2 && nNextValue >= 0 ) // Put 
back the '+'
+aValue += "+";
+aValue += lcl_ValueString( nNextValue, 
nCellDigits );
+}
 }
 }
 break;
@@ -10

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

2017-12-03 Thread Daniel
 sc/source/core/data/table4.cxx |   67 -
 1 file changed, 47 insertions(+), 20 deletions(-)

New commits:
commit 76c1e7287e29a2a2739fce895fbded3c04764bca
Author: Daniel <danielfaleirosi...@gmail.com>
Date:   Sat Nov 25 01:48:18 2017 -0200

tdf#105268 - Auto Fill: Fix The Next Value for 001-001-001

Change-Id: If1d1a23afb6209c35092d7cd95235ea1699fe7fb
Reviewed-on: https://gerrit.libreoffice.org/45262
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Eike Rathke <er...@redhat.com>
Tested-by: Eike Rathke <er...@redhat.com>

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index f7bab382a76c..bd1d18d0443d 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -78,10 +78,10 @@ short lcl_DecompValueString( OUString& rValue, sal_Int32& 
nVal, sal_uInt16* pMin
 return 0;
 }
 const sal_Unicode* p = rValue.getStr();
-sal_Int32 nNeg = 0;
+sal_Int32 nSign = 0;
 sal_Int32 nNum = 0;
-if ( p[nNum] == '-' )
-nNum = nNeg = 1;
+if ( p[nNum] == '-' || p[nNum] == '+' )
+nNum = nSign = 1;
 while ( p[nNum] && CharClass::isAsciiNumeric( OUString(p[nNum]) ) )
 nNum++;
 
@@ -91,34 +91,37 @@ short lcl_DecompValueString( OUString& rValue, sal_Int32& 
nVal, sal_uInt16* pMin
 // #i5550# If there are numbers at the beginning and the end,
 // prefer the one at the beginning only if it's followed by a space.
 // Otherwise, use the number at the end, to enable things like IP 
addresses.
-if ( nNum > nNeg && ( cNext == 0 || cNext == ' ' || 
!CharClass::isAsciiNumeric(OUString(cLast)) ) )
+if ( nNum > nSign && ( cNext == 0 || cNext == ' ' || 
!CharClass::isAsciiNumeric(OUString(cLast)) ) )
 {   // number at the beginning
 nVal = rValue.copy( 0, nNum ).toInt32();
 //  any number with a leading zero sets the minimum number of digits
-if ( p[nNeg] == '0' && pMinDigits && ( nNum - nNeg > *pMinDigits ) )
-*pMinDigits = nNum - nNeg;
+if ( p[nSign] == '0' && pMinDigits && ( nNum - nSign > *pMinDigits ) )
+*pMinDigits = nNum - nSign;
 rValue = rValue.copy(nNum);
 return -1;
 }
 else
 {
-nNeg = 0;
+nSign = 0;
 sal_Int32 nEnd = nNum = rValue.getLength() - 1;
 while ( nNum && CharClass::isAsciiNumeric( OUString(p[nNum]) ) )
 nNum--;
-if ( p[nNum] == '-' )
+if ( p[nNum] == '-' || p[nNum] == '+' )
 {
 nNum--;
-nNeg = 1;
+nSign = 1;
 }
-if ( nNum < nEnd - nNeg )
+if ( nNum < nEnd - nSign )
 {   // number at the end
 nVal = rValue.copy( nNum + 1 ).toInt32();
 //  any number with a leading zero sets the minimum number of 
digits
-if ( p[nNum+1+nNeg] == '0' && pMinDigits && ( nEnd - nNum - nNeg > 
*pMinDigits ) )
-*pMinDigits = nEnd - nNum - nNeg;
+if ( p[nNum+1+nSign] == '0' && pMinDigits && ( nEnd - nNum - nSign 
> *pMinDigits ) )
+*pMinDigits = nEnd - nNum - nSign;
 rValue = rValue.copy(0, nNum + 1);
-return 1;
+if (nSign) // use the return value = 2 to put back the '+'
+return 2;
+else
+return 1;
 }
 }
 nVal = 0;
@@ -938,11 +941,19 @@ OUString ScTable::GetAutoFillPreview( const ScRange& 
rSource, SCCOL nEndX, SCROW
 {
 if (aValue == ScGlobal::GetOrdinalSuffix( 
nVal))
 aValue = ScGlobal::GetOrdinalSuffix( nVal 
+ nDelta);
-
 aValue = lcl_ValueString( nVal + nDelta, 
nCellDigits ) + aValue;
 }
 else if ( nFlag > 0 )
-aValue += lcl_ValueString( nVal + nDelta, 
nCellDigits );
+{
+sal_Int32 nNextValue;
+if ( nVal < 0 )
+nNextValue = nVal - nDelta;
+else
+nNextValue = nVal + nDelta;
+if ( nFlag == 2 && nNextValue >= 0 ) // Put 
back the '+'
+aValue += "+";
+aValue += lcl_ValueString( nNextValue, 
nCellDigits );
+}
 }
 }
 break;
@@ -1044,7 +1055,11 @@ OUString ScTable::GetAutoFillPreview( const ScRange& 
rSource, SCCOL nEndX, SCROW
 aValue = 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - svx/source

2017-11-30 Thread Daniel
 svx/source/table/tablecontroller.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit cf715c7c60bd37d69f6fd6cbcb55e320503d9e36
Author: Daniel <danielfaleirosi...@gmail.com>
Date:   Wed Nov 29 00:26:43 2017 -0200

tdf#111773 tdf#111780 Fix selection after merge cells in an Impress table

Change-Id: I800c4fb8c37c07fb771f4310b207e459119a8e60
Reviewed-on: https://gerrit.libreoffice.org/45579
Reviewed-by: Caolán McNamara <caol...@redhat.com>
Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 521ace14a873..6649ba4df9b4 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -2757,12 +2757,12 @@ IMPL_LINK_NOARG(SvxTableController, UpdateHdl, void*, 
void)
 CellPos aEnd( maCursorLastPos );
 checkCell(aStart);
 checkCell(aEnd);
-if( aStart != maCursorFirstPos  || aEnd != maCursorLastPos )
+if( aStart != maCursorFirstPos || aEnd != maCursorLastPos )
 {
 setSelectedCells( aStart, aEnd );
+updateSelectionOverlay();
 }
 }
-updateSelectionOverlay();
 }
 
 namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-30 Thread Daniel
 svx/source/table/tablecontroller.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9b5062a3eeed6b94a2020b97f6dab9316af5d357
Author: Daniel <danielfaleirosi...@gmail.com>
Date:   Wed Nov 29 00:26:43 2017 -0200

tdf#111773 tdf#111780 Fix selection after merge cells in an Impress table

Change-Id: I800c4fb8c37c07fb771f4310b207e459119a8e60
Reviewed-on: https://gerrit.libreoffice.org/45451
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Caolán McNamara <caol...@redhat.com>
Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 521ace14a873..6649ba4df9b4 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -2757,12 +2757,12 @@ IMPL_LINK_NOARG(SvxTableController, UpdateHdl, void*, 
void)
 CellPos aEnd( maCursorLastPos );
 checkCell(aStart);
 checkCell(aEnd);
-if( aStart != maCursorFirstPos  || aEnd != maCursorLastPos )
+if( aStart != maCursorFirstPos || aEnd != maCursorLastPos )
 {
 setSelectedCells( aStart, aEnd );
+updateSelectionOverlay();
 }
 }
-updateSelectionOverlay();
 }
 
 namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cui/source cui/uiconfig

2017-09-25 Thread Daniel
 cui/source/dialogs/cuicharmap.cxx|   24 +++-
 cui/source/inc/cuicharmap.hxx|3 ++-
 cui/source/tabpages/numpages.cxx |2 +-
 cui/uiconfig/ui/specialcharacters.ui |   20 ++--
 4 files changed, 36 insertions(+), 13 deletions(-)

New commits:
commit 4020945651b4f3c636980e2103db440b5c55459c
Author: Daniel <danielfaleirosi...@gmail.com>
Date:   Sun Sep 24 17:55:19 2017 -0300

tdf#111739 fix Selecting a custom character as a bullet symbol insertion

Change-Id: I638ef2467f27bd6214cde092be5a3055fd539ebc
Reviewed-on: https://gerrit.libreoffice.org/42727
Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com>
Tested-by: Tamás Zolnai <tamas.zol...@collabora.com>

diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index 770cd82a1ce7..5234d75ef287 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -54,17 +54,19 @@ using namespace css;
 
 // class SvxCharacterMap =
 
-SvxCharacterMap::SvxCharacterMap( vcl::Window* pParent, const SfxItemSet* pSet 
)
+SvxCharacterMap::SvxCharacterMap( vcl::Window* pParent, const SfxItemSet* 
pSet, bool bInsert )
 : SfxModalDialog(pParent, "SpecialCharactersDialog", 
"cui/ui/specialcharacters.ui")
 , pSubsetMap( nullptr )
 , isSearchMode(true)
+, m_bHasInsert(bInsert)
 , mxContext(comphelper::getProcessComponentContext())
 {
 get(m_pShowSet, "showcharset");
 get(m_pSearchSet, "searchcharset");
 get(m_pShowChar, "showchar");
 m_pShowChar->SetCentered(true);
-get(m_pOKBtn, "ok");
+if (m_bHasInsert) get(m_pOKBtn, "insert");
+else get(m_pOKBtn, "ok");
 get(m_pFontText, "fontft");
 get(m_pFontLB, "fontlb");
 m_pFontLB->SetStyle(m_pFontLB->GetStyle() | WB_SORT);
@@ -475,6 +477,8 @@ void SvxCharacterMap::init()
 m_pFontLB->SetSelectHdl( LINK( this, SvxCharacterMap, FontSelectHdl ) );
 m_pSubsetLB->SetSelectHdl( LINK( this, SvxCharacterMap, SubsetSelectHdl ) 
);
 m_pOKBtn->SetClickHdl( LINK( this, SvxCharacterMap, InsertClickHdl ) );
+m_pOKBtn->Show();
+
 
 m_pShowSet->SetDoubleClickHdl( LINK( this, SvxCharacterMap, 
CharDoubleClickHdl ) );
 m_pShowSet->SetSelectHdl( LINK( this, SvxCharacterMap, CharSelectHdl ) );
@@ -619,15 +623,17 @@ void SvxCharacterMap::insertCharToDoc(const OUString& 
sGlyph)
 if(sGlyph.isEmpty())
 return;
 
-uno::Reference< uno::XComponentContext > xContext( 
comphelper::getProcessComponentContext() );
+if (m_bHasInsert) {
+  uno::Reference< uno::XComponentContext > xContext( 
comphelper::getProcessComponentContext() );
 
-uno::Sequence aArgs(2);
-aArgs[0].Name = "Symbols";
-aArgs[0].Value <<= sGlyph;
+  uno::Sequence aArgs(2);
+  aArgs[0].Name = "Symbols";
+  aArgs[0].Value <<= sGlyph;
 
-aArgs[1].Name = "FontName";
-aArgs[1].Value <<= aFont.GetFamilyName();
-comphelper::dispatchCommand(".uno:InsertSymbol", aArgs);
+  aArgs[1].Name = "FontName";
+  aArgs[1].Value <<= aFont.GetFamilyName();
+  comphelper::dispatchCommand(".uno:InsertSymbol", aArgs);
+}
 
 updateRecentCharacterList(sGlyph, aFont.GetFamilyName());
 }
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index 2ba12e34f212..b1a06b4540e3 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -89,6 +89,7 @@ private:
 vcl::Font   aFont;
 const SubsetMap*pSubsetMap;
 boolisSearchMode;
+boolm_bHasInsert;
 
 std::deque maRecentCharList;
 std::deque maRecentCharFontList;
@@ -128,7 +129,7 @@ private:
 void selectCharByCode(Radix radix);
 
 public:
-SvxCharacterMap( vcl::Window* pParent, const SfxItemSet* 
pSet=nullptr );
+SvxCharacterMap( vcl::Window* pParent, const SfxItemSet* 
pSet=nullptr, const bool bInsert=true);
 virtual ~SvxCharacterMap() override;
 virtual short Execute() override;
 virtual voiddispose() override;
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index fd4a5368e4b9..4327294ba998 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2074,7 +2074,7 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, 
PopupActivateHdl_Impl, MenuButton *, void)
 
 IMPL_LINK_NOARG(SvxNumOptionsTabPage, BulletHdl_Impl, Button*, void)
 {
-VclPtrInstance< SvxCharacterMap > pMap( this );
+VclPtrInstance< SvxCharacterMap > pMap( this, nullptr, false );
 
 sal_uInt16 nMask = 1;
 const vcl::Font* pFmtFont = nullptr;
diff --git a/cui/uiconfig/

  1   2   3   4   >