core.git: Changes to 'private/quwex/notespaneflat'

2024-04-30 Thread Sarper Akdemir (via logerrit)
New branch 'private/quwex/notespaneflat' available with the following commits:
commit 347a4c77314b09e254d5632a82cc96446dee7b61
Author: Sarper Akdemir 
Date:   Fri Apr 19 00:40:28 2024 +0200

related tdf#33603: sd: do not assume there's always a viewshell

Change-Id: I171639150a84372e7e25b5246d4882c467edd58b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166271
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

commit bcdc39128642d6d5bfd63dec13a632e23c98fa63
Author: Sarper Akdemir 
Date:   Tue Apr 16 17:09:28 2024 +0200

tdf#33603: make the notes pane handle placeholder text on focus

Change-Id: Id2bca2b8a8bafa9da44a5f97a8e763b512078ef7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166152
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

commit dfee653b274b536ecdbe4c353a2f5a7c15bf479d
Author: Samuel Mehrbrodt 
Date:   Thu Apr 11 11:24:22 2024 +0200

tdf#33603 Typo: 'Notes Panel' -> 'Notes Pane'

Similiar to 'Slide Pane'

Change-Id: If96afc4c054bbbff7c9bf8c5f4309e8eeb419d77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166005
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Sarper Akdemir 

commit 1405ccd249a0cc3aef013eb216acfcd5f83bad10
Author: Samuel Mehrbrodt 
Date:   Thu Apr 11 10:55:31 2024 +0200

tdf#33603 Allow adding Notes Panel to toolbar/menubar/keyboard shortcuts

Change-Id: Ic3e8f6b5a0cc8697c62e8f10f69ff53859f33d3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166004
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

commit c3f7f711e52497a49540d896a3a5295505bb1c9a
Author: Samuel Mehrbrodt 
Date:   Thu Apr 11 10:55:01 2024 +0200

tdf#33603 Make notes panel available in readonly mode

Change-Id: I2dd10802f3798b2e87833d3cd8ebd21366e0f546
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166003
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

commit 5d19c742adf596c77c97ad3752ffdd4f584386b4
Author: Samuel Mehrbrodt 
Date:   Thu Apr 11 10:19:40 2024 +0200

tdf#33603 Fix Close button not working in Notes Pane

Remove duplicate command and now unused NotesChildWindow

Change-Id: Idef94086ca91dd1474070c426c37ef921ad4fa03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166002
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

commit 3a7ab12873113dff90039e0a3cc6e7aba37000dd
Author: Sarper Akdemir 
Date:   Fri Apr 5 09:39:24 2024 +0300

related tdf#33603: sd: fix notespanel crash on drag and drop

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

commit 76c91efcad81ad0808e8d66f51a7894cf7f7b32b
Author: Sarper Akdemir 
Date:   Fri Apr 5 09:23:55 2024 +0300

related tdf#33603: sd: force invalidate notespanel

This is likely not the correct thing to do here, but is a working
solution that fixes the view lagging behind the resize for now.

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

commit 1bc2ebaf410c22c41ebaadbfdc648a4da6093a1a
Author: Sarper Akdemir 
Date:   Thu Apr 4 18:41:33 2024 +0300

related tdf#33603: fix notespanel missing outliner on mode change

When MainViewShell changed editing mode, two EventMultipexerEvents
arrive in succession - if while processing the first one links are
reset, second one was ignored.

Do not remove EventMultiplexer listener on FillOutliner()

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

commit 72095cf1cb060f4a8ca3c398f95e78d72907cec2
Author: Sarper Akdemir 
Date:   Thu Apr 4 07:18:38 2024 +0300

tdf#33603: sd: rework notes panel

To be able to support various dispatch commands, sidebar, proper
user configuration, and more - reworked the previous notes panel
implementation as a sd::View/sd::ViewShell pair that plays nice
with Impress framework.

To be able to support TextObjectBar(Shell) functionality, without
having TextObjectBar as a SubShell (In the current sd::framework
implementation AFAICS, SubShells are only possible for the
MainViewShell - this doesn't work for notes panel which is never
used as the MainViewShell.).

A workaround is implemented where NotesPanel inherits dispatching
slots from TextObjectBar, and for these inherited slots forwards
the calls to TextObjectBar's implementation.

This workaround could be removed if/when, SubShell support
outside of MainViewShell is implemented.

Known issues/TODO:
- Drag & Drop crashes / doesn't work.

- Some notes placeholder syncing problems on page change, edit mode
  

core.git: Changes to 'private/quwex/notespanesquashed'

2024-04-30 Thread Sarper Akdemir (via logerrit)
New branch 'private/quwex/notespanesquashed' available with the following 
commits:
commit a5e08f0631b7cd3976c9fc1afe8317ecc3b406a2
Author: Sarper Akdemir 
Date:   Fri Apr 19 00:40:28 2024 +0200

related tdf#33603: sd: do not assume there's always a viewshell

Change-Id: I171639150a84372e7e25b5246d4882c467edd58b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166271
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

commit 6b2c57f772fe16329d6c218237b1e087e5a0cbbe
Author: Sarper Akdemir 
Date:   Tue Apr 16 17:09:28 2024 +0200

tdf#33603: make the notes pane handle placeholder text on focus

Change-Id: Id2bca2b8a8bafa9da44a5f97a8e763b512078ef7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166152
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

commit f8bf22e68bd8e19a41360f8d49c9e70206e9d493
Author: Samuel Mehrbrodt 
Date:   Thu Apr 11 11:24:22 2024 +0200

tdf#33603 Typo: 'Notes Panel' -> 'Notes Pane'

Similiar to 'Slide Pane'

Change-Id: If96afc4c054bbbff7c9bf8c5f4309e8eeb419d77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166005
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Sarper Akdemir 

commit eb4eabb5cbd91816020eeaf7f0a9f864d68b7f4f
Author: Samuel Mehrbrodt 
Date:   Thu Apr 11 10:55:31 2024 +0200

tdf#33603 Allow adding Notes Panel to toolbar/menubar/keyboard shortcuts

Change-Id: Ic3e8f6b5a0cc8697c62e8f10f69ff53859f33d3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166004
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

commit e348b294334ae678a8e69703431ecd912105d3c5
Author: Samuel Mehrbrodt 
Date:   Thu Apr 11 10:55:01 2024 +0200

tdf#33603 Make notes panel available in readonly mode

Change-Id: I2dd10802f3798b2e87833d3cd8ebd21366e0f546
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166003
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

commit b00684769335f3ec7e37e1ccd577da52db1e39ad
Author: Sarper Akdemir 
Date:   Fri Apr 5 09:39:24 2024 +0300

related tdf#33603: sd: fix notespanel crash on drag and drop

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

commit e312b3322e7bce998ddfb90b336559fafdc3f800
Author: Sarper Akdemir 
Date:   Fri Apr 5 09:23:55 2024 +0300

related tdf#33603: sd: force invalidate notespanel

This is likely not the correct thing to do here, but is a working
solution that fixes the view lagging behind the resize for now.

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

commit e3a1e1e6d652e9b1b24ae480cc6315badb6b4b2a
Author: Sarper Akdemir 
Date:   Thu Apr 4 18:41:33 2024 +0300

related tdf#33603: fix notespanel missing outliner on mode change

When MainViewShell changed editing mode, two EventMultipexerEvents
arrive in succession - if while processing the first one links are
reset, second one was ignored.

Do not remove EventMultiplexer listener on FillOutliner()

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

commit 7ccb329214fcf12edf1b4c0422625cbafe4adfbb
Author: Sarper Akdemir 
Date:   Thu Nov 9 20:18:44 2023 +0300

tdf#33603: introduce reworked notes panel

this commit is the squash of the four commits below

instead of introducing the initial NotesPanel implementation
and then deleting the left-over implementation
(at commit ede2f1e6eefbc6471f0163c21430c2f747bb0e67 on
master)

provides all the relevant notes panel new implementation
patches into one.

=
tdf#33603: sd: add notes panel for normal view

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159288
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

related tdf#33603: do not register NotesChildWindow for Draw

Draw doesn't need the notes panel introduced in
c4c1ca58bb587a56a30c7f4817c346054ce37f2a, so don't register
that for it's shell (GraphicViewShell).

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163775
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

tdf#33603: sd: rework notes panel

To be able to support various dispatch commands, sidebar, proper
user configuration, and more - reworked the previous notes panel
implementation as a sd::View/sd::ViewShell pair that plays nice
with Impress framework.

To be able to support TextObjectBar(Shell) functionality, without
having TextObjectBar as a SubShell (In the current sd::framework
implementation AFAICS, SubShells are only possible for the
MainViewShell - this 

core.git: sd/source

2024-04-24 Thread Sarper Akdemir (via logerrit)
 sd/source/ui/inc/ViewShell.hxx |1 
 sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx |1 
 sd/source/ui/view/drawview.cxx |1 
 sd/source/ui/view/sdwindow.cxx |   12 -
 sd/source/ui/view/viewshe2.cxx |   97 
--
 sd/source/ui/view/viewshel.cxx |7 
 6 files changed, 95 insertions(+), 24 deletions(-)

New commits:
commit dfb412699b96e12b2758be0e422c3e775f183d17
Author: Sarper Akdemir 
AuthorDate: Tue Apr 23 16:00:32 2024 +0200
Commit: Sarper Akdemir 
CommitDate: Wed Apr 24 11:28:00 2024 +0200

tdf#38164: sd: allow panning across pages when zoomed in

Change-Id: I513b2b8cbdc91733e551da71a1e6782fecc981a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166542
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index 6ee126db9027..9e5e8e068160 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -382,6 +382,7 @@ public:
 */
 virtual void ShowUIControls (bool bVisible);
 bool IsPageFlipMode() const;
+bool CanPanAcrossPages() const;
 
 /** Set the given window as new parent window.  This is not possible for
 all views, so the return value tells the caller if the relocation
diff --git a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx 
b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
index 9203c06e8f9f..e8fc847a4a7b 100644
--- a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
@@ -176,6 +176,7 @@ void CurrentSlideManager::SetCurrentSlideAtViewShellBase 
(const SharedPageDescri
 pDrawViewShell->SwitchPage(nPageNumber);
 TabControl& rPageTabControl = pDrawViewShell->GetPageTabControl();
 
rPageTabControl.SetCurPageId(rPageTabControl.GetPageId(nPageNumber));
+pDrawViewShell->UpdateScrollBars();
 }
 }
 }
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 6792250fd8e7..99c166002cbd 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -407,6 +407,7 @@ void DrawView::Notify(SfxBroadcaster& rBC, const SfxHint& 
rHint)
 if ( mnPOCHSmph == 0 && eHintKind == SdrHintKind::PageOrderChange )
 {
 mpDrawViewShell->ResetActualPage();
+mpDrawViewShell->UpdateScrollBars();
 }
 else if ( eHintKind == SdrHintKind::LayerChange || eHintKind == 
SdrHintKind::LayerOrderChange )
 {
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index ab8a7bbd8889..8f71c17db957 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -667,8 +667,6 @@ void Window::SetVisibleXY(double fX, double fY)
 double Window::GetVisibleWidth() const
 {
 Size aWinSize = PixelToLogic(GetOutputSizePixel());
-if ( aWinSize.Width() > maViewSize.Width() )
-aWinSize.setWidth( maViewSize.Width() );
 return
 maViewSize.Width() == 0 ? 0 : (static_cast(aWinSize.Width()) / 
maViewSize.Width());
 }
@@ -680,8 +678,6 @@ double Window::GetVisibleWidth() const
 double Window::GetVisibleHeight() const
 {
 Size aWinSize = PixelToLogic(GetOutputSizePixel());
-if ( aWinSize.Height() > maViewSize.Height() )
-aWinSize.setHeight( maViewSize.Height() );
 return maViewSize.Height() == 0
 ? 0 : (static_cast(aWinSize.Height()) / maViewSize.Height());
 }
@@ -705,7 +701,7 @@ Point Window::GetVisibleCenter()
  */
 double Window::GetScrlLineWidth() const
 {
-return (GetVisibleWidth() * SCROLL_LINE_FACT);
+return std::min(1.0, GetVisibleWidth()) * SCROLL_LINE_FACT;
 }
 
 /**
@@ -714,7 +710,7 @@ double Window::GetScrlLineWidth() const
  */
 double Window::GetScrlLineHeight() const
 {
-return (GetVisibleHeight() * SCROLL_LINE_FACT);
+return std::min(1.0, GetVisibleHeight()) * SCROLL_LINE_FACT;
 }
 
 /**
@@ -723,7 +719,7 @@ double Window::GetScrlLineHeight() const
  */
 double Window::GetScrlPageWidth() const
 {
-return (GetVisibleWidth() * SCROLL_PAGE_FACT);
+return std::min(1.0, GetVisibleWidth()) * SCROLL_PAGE_FACT;
 }
 
 /**
@@ -732,7 +728,7 @@ double Window::GetScrlPageWidth() const
  */
 double Window::GetScrlPageHeight() const
 {
-return (GetVisibleHeight() * SCROLL_PAGE_FACT);
+return std::min(1.0, GetVisibleHeight()) * SCROLL_PAGE_FACT;
 }
 
 /**
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index b7ae44f2c3e1..18658fc8c929 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -63,6 +63,19 @@
 
 using namespace com::sun::star;
 
+namespace
+{
+inline double getViewToScrollScalarForPanAcrossPages(sal_uInt16 nTotalPages, 
double 

core.git: sd/source

2024-04-20 Thread Sarper Akdemir (via logerrit)
 sd/source/ui/view/sdwindow.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 20e2b922da0d4d49a5e1a88fddea77ade92cbdf3
Author: Sarper Akdemir 
AuthorDate: Fri Apr 19 00:40:28 2024 +0200
Commit: Sarper Akdemir 
CommitDate: Sat Apr 20 13:17:05 2024 +0200

related tdf#33603: sd: do not assume there's always a viewshell

Change-Id: I171639150a84372e7e25b5246d4882c467edd58b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166271
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index d409aeec1304..ab8a7bbd8889 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -742,7 +742,8 @@ void Window::LoseFocus()
 {
 mnTicks = 0;
 vcl::Window::LoseFocus ();
-GetViewShell()->onLoseFocus();
+if (mpViewShell)
+mpViewShell->onLoseFocus();
 }
 
 /**
@@ -752,7 +753,8 @@ void Window::GrabFocus()
 {
 mnTicks  = 0;
 vcl::Window::GrabFocus ();
-GetViewShell()->onGrabFocus();
+if (mpViewShell)
+mpViewShell->onGrabFocus();
 }
 
 void Window::DataChanged( const DataChangedEvent& rDCEvt )


core.git: sd/source

2024-04-18 Thread Sarper Akdemir (via logerrit)
 sd/source/ui/inc/NotesPanelView.hxx   |3 ++
 sd/source/ui/inc/NotesPanelViewShell.hxx  |2 +
 sd/source/ui/inc/ViewShell.hxx|   14 
 sd/source/ui/view/NotesPanelView.cxx  |   34 ++
 sd/source/ui/view/NotesPanelViewShell.cxx |4 +++
 sd/source/ui/view/sdwindow.cxx|2 +
 6 files changed, 59 insertions(+)

New commits:
commit efef507cfd480cc6f1efc964ac2f9e033e18ad87
Author: Sarper Akdemir 
AuthorDate: Tue Apr 16 17:09:28 2024 +0200
Commit: Sarper Akdemir 
CommitDate: Thu Apr 18 13:48:28 2024 +0200

tdf#33603: make the notes pane handle placeholder text on focus

Change-Id: Id2bca2b8a8bafa9da44a5f97a8e763b512078ef7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166152
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/sd/source/ui/inc/NotesPanelView.hxx 
b/sd/source/ui/inc/NotesPanelView.hxx
index 810cddd6af71..9f2b71523c09 100644
--- a/sd/source/ui/inc/NotesPanelView.hxx
+++ b/sd/source/ui/inc/NotesPanelView.hxx
@@ -39,6 +39,7 @@ class NotesPanelView final : public ::sd::SimpleOutlinerView
 
 SdrTextObj* mpTextObj = nullptr;
 bool mbIgnoreNotifications = false;
+bool mbInFocus = false;
 
 /** stores the last used document color.
 this is changed in onUpdateStyleSettings()
@@ -61,6 +62,8 @@ public:
 
 void Paint(const ::tools::Rectangle& rRect, ::sd::Window const* pWin);
 void onResize();
+void onGrabFocus();
+void onLoseFocus();
 
 OutlinerView* GetOutlinerView();
 OutlinerView* GetViewByWindow(vcl::Window const* pWin) const override;
diff --git a/sd/source/ui/inc/NotesPanelViewShell.hxx 
b/sd/source/ui/inc/NotesPanelViewShell.hxx
index e79ac899fe30..39901d6e4faa 100644
--- a/sd/source/ui/inc/NotesPanelViewShell.hxx
+++ b/sd/source/ui/inc/NotesPanelViewShell.hxx
@@ -49,6 +49,8 @@ public:
 virtual void Activate(bool IsMDIActivate) override;
 /** this method is called when the visible area of the view from this 
viewshell is changed */
 virtual void VisAreaChanged(const ::tools::Rectangle& rRect) override;
+virtual void onGrabFocus() override;
+virtual void onLoseFocus() override;
 
 virtual void ArrangeGUIElements() override;
 virtual SdPage* GetActualPage() override;
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index 85bc43e86c09..6ee126db9027 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -412,6 +412,20 @@ public:
 SdPage* pPage,
 const sal_Int32 nInsertPosition = -1);
 
+/** Called by sd::Window::LoseFocus to enable sd::ViewShell to take action
+when focus is lost.
+
+e.g. overriden by NotesPanelViewShell
+ */
+virtual void onLoseFocus(){};
+
+/** Called by sd::Window::GrabFocus to enable sd::ViewShell to take action
+when focus is grabbed.
+
+e.g. overriden by NotesPanelViewShell
+ */
+virtual void onGrabFocus(){};
+
 /// Allows adjusting the point or mark of the selection to a document 
coordinate.
 void SetCursorMm100Position(const Point& rPosition, bool bPoint, bool 
bClearMark);
 /// Gets the current selection
diff --git a/sd/source/ui/view/NotesPanelView.cxx 
b/sd/source/ui/view/NotesPanelView.cxx
index 2822a8df4c02..a2ae58e48331 100644
--- a/sd/source/ui/view/NotesPanelView.cxx
+++ b/sd/source/ui/view/NotesPanelView.cxx
@@ -224,6 +224,40 @@ void NotesPanelView::onResize()
 }
 }
 
+void NotesPanelView::onGrabFocus()
+{
+if (mbInFocus)
+return;
+mbInFocus = true;
+
+if (mpTextObj && mpTextObj->IsEmptyPresObj())
+{
+// clear the "Click to add Notes" text on entering the window.
+maOutliner.SetToEmptyText();
+}
+}
+
+void NotesPanelView::onLoseFocus()
+{
+if (!mbInFocus)
+return;
+mbInFocus = false;
+
+aModifyIdle.Stop();
+if (mpTextObj)
+{
+if (maOutliner.GetEditEngine().GetText().getLength() == 0)
+{
+// if the notes are empty restore the placeholder text and state.
+SdPage* pPage = 
dynamic_cast(mpTextObj->getSdrPageFromSdrObject());
+if (pPage)
+pPage->RestoreDefaultText(mpTextObj);
+}
+else
+setNotesToDoc();
+}
+}
+
 /**
  * Handler for StatusEvents
  */
diff --git a/sd/source/ui/view/NotesPanelViewShell.cxx 
b/sd/source/ui/view/NotesPanelViewShell.cxx
index d4dd078dfc4d..82f3133dad75 100644
--- a/sd/source/ui/view/NotesPanelViewShell.cxx
+++ b/sd/source/ui/view/NotesPanelViewShell.cxx
@@ -233,6 +233,10 @@ void NotesPanelViewShell::VisAreaChanged(const 
::tools::Rectangle& rRect)
 GetViewShellBase().GetDrawController()->FireVisAreaChanged(rRect);
 }
 
+void NotesPanelViewShell::onGrabFocus() { mpNotesPanelView->onGrabFocus(); }
+
+void NotesPanelViewShell::onLoseFocus() { mpNotesPanelView->onLoseFocus(); }
+
 void NotesPanelViewShell::ArrangeGUIElements()
 {
 

core.git: Branch 'feature/cib_contract49' - sd/source

2024-04-16 Thread Sarper Akdemir (via logerrit)
 sd/source/ui/dlg/NotesChildWindow.cxx |   66 ++
 sd/source/ui/inc/NotesChildWindow.hxx |4 ++
 2 files changed, 70 insertions(+)

New commits:
commit 9c131e19183fe3ae596b5f9947fc23311b4f66d5
Author: Sarper Akdemir 
AuthorDate: Tue Apr 16 10:59:50 2024 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Apr 16 12:03:01 2024 +0200

related tdf#33603: improve clipboard/paste handling for noteseditwindow

Similar to sd::View behavior, BeginPasteOrDropHdl &
EndPasteOrDropHdl are used to format the pasted content.

Specifically for the notes edit window, EndPasteOrDropHdl
enforces the default Notes placeholder font size for pasted text.

In general for better handling of key inputs - including paste,
now NotesEditWindow uses the OutlinerView implementation of
PostKeyEvent instead of EditView. Getting it behave more like
sd::View.

Change-Id: If0591db9c63e43bf702911fcca3e1981d851fd10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166144
Tested-by: allotropia jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/sd/source/ui/dlg/NotesChildWindow.cxx 
b/sd/source/ui/dlg/NotesChildWindow.cxx
index 0ab856da55ef..436c4c5ff1bf 100644
--- a/sd/source/ui/dlg/NotesChildWindow.cxx
+++ b/sd/source/ui/dlg/NotesChildWindow.cxx
@@ -69,6 +69,9 @@ NotesChildDockingWindow::NotesChildDockingWindow(SfxBindings* 
_pBindings,
 mpOutliner = 
std::make_unique(>GetDocShell()->GetPool(),
 OutlinerMode::TextObject);
 
+mpOutliner->SetStyleSheetPool(
+
static_cast(mpViewShellBase->GetDocShell()->GetStyleSheetPool()));
+
 mpOutlinerView = std::make_unique(mpOutliner.get(), nullptr);
 mpOutliner->InsertView(mpOutlinerView.get());
 
@@ -132,6 +135,51 @@ IMPL_LINK(NotesEditWindow, EventMultiplexerListener, 
tools::EventMultiplexerEven
 }
 }
 
+IMPL_LINK(NotesEditWindow, EndPasteOrDropHdl, PasteOrDropInfos*, pInfo, void)
+{
+/* Style Sheet handling */
+if (!mrParentWindow.GetOutliner() || !mpTextObj)
+return;
+
+SdPage* pPage = static_cast(mpTextObj->getSdrPageFromSdrObject());
+if (!pPage)
+return;
+
+SfxStyleSheet* pStyleSheet = 
pPage->GetStyleSheetForPresObj(PresObjKind::Notes);
+if (!pStyleSheet)
+return;
+
+for (sal_Int32 nPara = pInfo->nStartPara; nPara <= pInfo->nEndPara; 
nPara++)
+{
+SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
+mrParentWindow.GetOutliner()->SetStyleSheet(nPara, pStyleSheet);
+
+// force the pasted paragraph font height to the notes placeholder 
default.
+SfxItemSet aFontHeightSet(*rItemSet.GetPool(),
+  WhichRangesContainer(EE_CHAR_START, 
EE_CHAR_END));
+
+for (auto& rWhich : { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, 
EE_CHAR_FONTHEIGHT_CTL })
+{
+if (auto pFontHeightItem = rItemSet.GetItemIfSet(rWhich))
+aFontHeightSet.Put(*pFontHeightItem);
+}
+
+mrParentWindow.GetOutliner()->SetCharAttribs(nPara, aFontHeightSet);
+}
+}
+
+IMPL_LINK(NotesEditWindow, BeginPasteOrDropHdl, PasteOrDropInfos*, pInfo, void)
+{
+if (!mrParentWindow.GetOutliner() || !mpTextObj || 
!mpTextObj->getSdrPageFromSdrObject())
+return;
+
+// Turn character attributes of the paragraph of the insert position into
+// character-level attributes, so they are not lost when OnEndPasteOrDrop()
+// sets the paragraph stylesheet.
+SfxItemSet 
aSet(mrParentWindow.GetOutliner()->GetParaAttribs(pInfo->nStartPara));
+mrParentWindow.GetOutliner()->SetCharAttribs(pInfo->nStartPara, aSet);
+}
+
 void NotesEditWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea)
 {
 Size aSize(pDrawingArea->get_size_request());
@@ -185,6 +233,11 @@ void NotesEditWindow::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 
 provideNoteText();
 
+mrParentWindow.GetOutliner()->SetEndPasteOrDropHdl(
+LINK(this, NotesEditWindow, EndPasteOrDropHdl));
+mrParentWindow.GetOutliner()->SetBeginPasteOrDropHdl(
+LINK(this, NotesEditWindow, BeginPasteOrDropHdl));
+
 GetEditEngine()->SetStatusEventHdl(LINK(this, NotesEditWindow, 
EditStatusHdl));
 }
 
@@ -599,6 +652,19 @@ void NotesEditWindow::Notify(SfxBroadcaster&, const 
SfxHint& rHint)
 }
 }
 
+bool NotesEditWindow::KeyInput(const KeyEvent& rKEvt)
+{
+bool bDone = false;
+
+if (::OutlinerView* pOutlinerView = mrParentWindow.GetOutlinerView())
+bDone = pOutlinerView->PostKeyEvent(rKEvt);
+
+if (!bDone)
+bDone = WeldEditView::KeyInput(rKEvt);
+
+return bDone;
+}
+
 IMPL_LINK_NOARG(NotesEditWindow, EditStatusHdl, EditStatus&, void) { Resize(); 
}
 
 IMPL_LINK_NOARG(NotesEditWindow, EditModifiedHdl, LinkParamNone*, void)
diff --git a/sd/source/ui/inc/NotesChildWindow.hxx 
b/sd/source/ui/inc/NotesChildWindow.hxx
index 5242595bcb24..c94e35c20a2e 100644
--- 

core.git: 2 commits - sd/source

2024-04-11 Thread Sarper Akdemir (via logerrit)
 sd/source/ui/inc/NotesPanelView.hxx  |6 +-
 sd/source/ui/view/NotesPanelView.cxx |   24 +---
 2 files changed, 18 insertions(+), 12 deletions(-)

New commits:
commit fd7afc0a660992cb99650e3ea26cafd226899093
Author: Sarper Akdemir 
AuthorDate: Fri Apr 5 09:39:24 2024 +0300
Commit: Samuel Mehrbrodt 
CommitDate: Thu Apr 11 11:02:24 2024 +0200

related tdf#33603: sd: fix notespanel crash on drag and drop

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

diff --git a/sd/source/ui/inc/NotesPanelView.hxx 
b/sd/source/ui/inc/NotesPanelView.hxx
index 82b3631f3f50..810cddd6af71 100644
--- a/sd/source/ui/inc/NotesPanelView.hxx
+++ b/sd/source/ui/inc/NotesPanelView.hxx
@@ -85,6 +85,11 @@ public:
 virtual const OutlinerView* GetTextEditOutlinerView() const override { 
return  }
 virtual OutlinerView* GetTextEditOutlinerView() override { return 
 }
 
+virtual sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt, DropTargetHelper& 
rTargetHelper,
+SdrLayerID nLayer) override;
+virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt, ::sd::Window* 
pTargetWindow,
+ sal_uInt16 nPage, SdrLayerID nLayer) override;
+
 DECL_LINK(StatusEventHdl, EditStatus&, void);
 DECL_LINK(EditModifiedHdl, LinkParamNone*, void);
 DECL_LINK(ModifyTimerHdl, Timer*, void);
diff --git a/sd/source/ui/view/NotesPanelView.cxx 
b/sd/source/ui/view/NotesPanelView.cxx
index 7aa10d0c1f31..2822a8df4c02 100644
--- a/sd/source/ui/view/NotesPanelView.cxx
+++ b/sd/source/ui/view/NotesPanelView.cxx
@@ -305,6 +305,16 @@ SvtScriptType NotesPanelView::GetScriptType() const
 return nScriptType;
 }
 
+sal_Int8 NotesPanelView::AcceptDrop(const AcceptDropEvent&, DropTargetHelper&, 
SdrLayerID)
+{
+return DND_ACTION_NONE;
+}
+
+sal_Int8 NotesPanelView::ExecuteDrop(const ExecuteDropEvent&, ::sd::Window*, 
sal_uInt16, SdrLayerID)
+{
+return DND_ACTION_NONE;
+}
+
 } // end of namespace sd
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
commit 7a495eb899585c8443b2141534f166b77916b68e
Author: Sarper Akdemir 
AuthorDate: Fri Apr 5 09:23:55 2024 +0300
Commit: Samuel Mehrbrodt 
CommitDate: Thu Apr 11 11:02:18 2024 +0200

related tdf#33603: sd: force invalidate notespanel

This is likely not the correct thing to do here, but is a working
solution that fixes the view lagging behind the resize for now.

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

diff --git a/sd/source/ui/inc/NotesPanelView.hxx 
b/sd/source/ui/inc/NotesPanelView.hxx
index 4bb94590acbb..82b3631f3f50 100644
--- a/sd/source/ui/inc/NotesPanelView.hxx
+++ b/sd/source/ui/inc/NotesPanelView.hxx
@@ -38,7 +38,6 @@ class NotesPanelView final : public ::sd::SimpleOutlinerView
 Idle aModifyIdle;
 
 SdrTextObj* mpTextObj = nullptr;
-bool mbFirstPaint = true;
 bool mbIgnoreNotifications = false;
 
 /** stores the last used document color.
diff --git a/sd/source/ui/view/NotesPanelView.cxx 
b/sd/source/ui/view/NotesPanelView.cxx
index 49fa38a05d88..7aa10d0c1f31 100644
--- a/sd/source/ui/view/NotesPanelView.cxx
+++ b/sd/source/ui/view/NotesPanelView.cxx
@@ -149,16 +149,7 @@ void NotesPanelView::setNotesToDoc()
 
 void NotesPanelView::Paint(const ::tools::Rectangle& rRect, ::sd::Window 
const* /*pWin*/)
 {
-OutlinerView* pOlView = GetOutlinerView();
-
-if (pOlView)
-{
-pOlView->HideCursor();
-pOlView->Paint(rRect);
-
-pOlView->ShowCursor(mbFirstPaint);
-mbFirstPaint = false;
-}
+maOutlinerView.Paint(rRect);
 }
 
 void NotesPanelView::Notify(SfxBroadcaster&, const SfxHint& rHint)
@@ -227,7 +218,8 @@ void NotesPanelView::onResize()
 
 if (!aVisArea.IsEmpty()) // not when opening
 {
-mrNotesPanelViewShell.InitWindows(Point(0, 0), aVisArea.GetSize(), 
aVisArea.TopLeft());
+mrNotesPanelViewShell.InitWindows(Point(0, 0), aVisArea.GetSize(), 
aVisArea.TopLeft(),
+  true);
 mrNotesPanelViewShell.UpdateScrollBars();
 }
 }


core.git: 2 commits - include/svx sd/inc sd/Library_sd.mk sd/sdi sd/source

2024-04-11 Thread Sarper Akdemir (via logerrit)
 include/svx/svdedxv.hxx   |8 
 sd/Library_sd.mk  |2 
 sd/inc/app.hrc|2 
 sd/inc/glob.hxx   |2 
 sd/sdi/NotesPanelView.sdi |  514 ++
 sd/sdi/sdslots.sdi|1 
 sd/source/ui/app/sddll.cxx|1 
 sd/source/ui/dlg/PaneChildWindows.cxx |   28 
 sd/source/ui/dlg/PaneShells.cxx   |   17 
 sd/source/ui/framework/factories/BasicPaneFactory.cxx |   12 
 sd/source/ui/framework/factories/BasicViewFactory.cxx |7 
 sd/source/ui/framework/tools/FrameworkHelper.cxx  |4 
 sd/source/ui/func/fuoltext.cxx|  141 +
 sd/source/ui/inc/NotesPanelView.hxx   |   96 +
 sd/source/ui/inc/NotesPanelViewShell.hxx  |  101 +
 sd/source/ui/inc/OutlineView.hxx  |   18 
 sd/source/ui/inc/PaneChildWindows.hxx |   13 
 sd/source/ui/inc/PaneShells.hxx   |   17 
 sd/source/ui/inc/TextObjectBar.hxx|3 
 sd/source/ui/inc/ViewShell.hxx|3 
 sd/source/ui/inc/framework/FrameworkHelper.hxx|2 
 sd/source/ui/inc/fuoltext.hxx |   51 
 sd/source/ui/view/NotesPanelView.cxx  |  318 +++
 sd/source/ui/view/NotesPanelViewShell.cxx | 1448 ++
 sd/source/ui/view/ToolBarManager.cxx  |1 
 sd/source/ui/view/ViewShellBase.cxx   |   25 
 sd/source/ui/view/ViewShellImplementation.cxx |1 
 sd/source/ui/view/drtxtob.cxx |   34 
 sd/source/ui/view/drtxtob1.cxx|   48 
 sd/source/ui/view/outlview.cxx|2 
 30 files changed, 2789 insertions(+), 131 deletions(-)

New commits:
commit c3bc5c09e093967ad77cb1ee3330b80d16bfae95
Author: Sarper Akdemir 
AuthorDate: Thu Apr 4 18:41:33 2024 +0300
Commit: Samuel Mehrbrodt 
CommitDate: Thu Apr 11 11:02:09 2024 +0200

related tdf#33603: fix notespanel missing outliner on mode change

When MainViewShell changed editing mode, two EventMultipexerEvents
arrive in succession - if while processing the first one links are
reset, second one was ignored.

Do not remove EventMultiplexer listener on FillOutliner()

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

diff --git a/sd/source/ui/view/NotesPanelView.cxx 
b/sd/source/ui/view/NotesPanelView.cxx
index 0cbc7149e8ae..49fa38a05d88 100644
--- a/sd/source/ui/view/NotesPanelView.cxx
+++ b/sd/source/ui/view/NotesPanelView.cxx
@@ -52,6 +52,9 @@ NotesPanelView::NotesPanelView(DrawDocShell& rDocSh, 
vcl::Window* pWindow,
 // fill Outliner with contents
 FillOutliner();
 
+
mrNotesPanelViewShell.GetViewShellBase().GetEventMultiplexer()->AddEventListener(
+LINK(this, NotesPanelView, EventMultiplexerListener));
+
 // TODO: UNDO
 // sd::UndoManager* pDocUndoMgr = 
dynamic_cast(mpDocSh->GetUndoManager());
 // if (pDocUndoMgr != nullptr)
@@ -60,8 +63,10 @@ NotesPanelView::NotesPanelView(DrawDocShell& rDocSh, 
vcl::Window* pWindow,
 
 NotesPanelView::~NotesPanelView()
 {
-ResetLinks();
+
mrNotesPanelViewShell.GetViewShellBase().GetEventMultiplexer()->RemoveEventListener(
+LINK(this, NotesPanelView, EventMultiplexerListener));
 
+ResetLinks();
 // DisconnectFromApplication();
 // mpProgress.reset();
 }
@@ -93,16 +98,9 @@ void NotesPanelView::FillOutliner()
 void NotesPanelView::SetLinks()
 {
 maOutliner.SetStatusEventHdl(LINK(this, NotesPanelView, StatusEventHdl));
-
mrNotesPanelViewShell.GetViewShellBase().GetEventMultiplexer()->AddEventListener(
-LINK(this, NotesPanelView, EventMultiplexerListener));
 }
 
-void NotesPanelView::ResetLinks()
-{
-maOutliner.SetStatusEventHdl(Link());
-
mrNotesPanelViewShell.GetViewShellBase().GetEventMultiplexer()->RemoveEventListener(
-LINK(this, NotesPanelView, EventMultiplexerListener));
-}
+void NotesPanelView::ResetLinks() { 
maOutliner.SetStatusEventHdl(Link()); }
 
 void NotesPanelView::removeListener()
 {
commit 291919476294f62d7af9b8b7060d138728897ee7
Author: Sarper Akdemir 
AuthorDate: Thu Apr 4 07:18:38 2024 +0300
Commit: Samuel Mehrbrodt 
CommitDate: Thu Apr 11 11:02:01 2024 +0200

tdf#33603: sd: rework notes panel

To be able to support various dispatch commands, sidebar, proper
user configuration, and more - reworked the previous notes panel
implementation as a sd::View/sd::ViewShell pair that plays nice
with Impress framework.

To be able to support TextObjectBar(Shell) functionality, without
having 

core.git: Branch 'feature/cib_contract49' - 4 commits - include/svx sd/inc sd/Library_sd.mk sd/sdi sd/source

2024-04-05 Thread Sarper Akdemir (via logerrit)
 include/svx/svdedxv.hxx   |8 
 sd/Library_sd.mk  |2 
 sd/inc/app.hrc|2 
 sd/inc/glob.hxx   |2 
 sd/sdi/NotesPanelView.sdi |  514 ++
 sd/sdi/sdslots.sdi|1 
 sd/source/ui/app/sddll.cxx|1 
 sd/source/ui/dlg/PaneChildWindows.cxx |   28 
 sd/source/ui/dlg/PaneShells.cxx   |   17 
 sd/source/ui/framework/factories/BasicPaneFactory.cxx |   12 
 sd/source/ui/framework/factories/BasicViewFactory.cxx |7 
 sd/source/ui/framework/tools/FrameworkHelper.cxx  |4 
 sd/source/ui/func/fuoltext.cxx|  141 +
 sd/source/ui/inc/NotesPanelView.hxx   |  100 +
 sd/source/ui/inc/NotesPanelViewShell.hxx  |  101 +
 sd/source/ui/inc/OutlineView.hxx  |   18 
 sd/source/ui/inc/PaneChildWindows.hxx |   13 
 sd/source/ui/inc/PaneShells.hxx   |   17 
 sd/source/ui/inc/TextObjectBar.hxx|3 
 sd/source/ui/inc/ViewShell.hxx|3 
 sd/source/ui/inc/framework/FrameworkHelper.hxx|2 
 sd/source/ui/inc/fuoltext.hxx |   51 
 sd/source/ui/view/NotesPanelView.cxx  |  320 +++
 sd/source/ui/view/NotesPanelViewShell.cxx | 1447 ++
 sd/source/ui/view/ToolBarManager.cxx  |1 
 sd/source/ui/view/ViewShellBase.cxx   |   25 
 sd/source/ui/view/ViewShellImplementation.cxx |1 
 sd/source/ui/view/drtxtob.cxx |   34 
 sd/source/ui/view/drtxtob1.cxx|   48 
 sd/source/ui/view/outlview.cxx|2 
 30 files changed, 2794 insertions(+), 131 deletions(-)

New commits:
commit d6ae523008ca601b134bf86fcb51753bac13b149
Author: Sarper Akdemir 
AuthorDate: Fri Apr 5 09:39:24 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Apr 5 11:58:35 2024 +0300

related tdf#33603: sd: fix notespanel crash on drag and drop

Change-Id: I067fd3f3eccd8e0fa0d13795f660fe43410b0aa3

diff --git a/sd/source/ui/inc/NotesPanelView.hxx 
b/sd/source/ui/inc/NotesPanelView.hxx
index 82b3631f3f50..810cddd6af71 100644
--- a/sd/source/ui/inc/NotesPanelView.hxx
+++ b/sd/source/ui/inc/NotesPanelView.hxx
@@ -85,6 +85,11 @@ public:
 virtual const OutlinerView* GetTextEditOutlinerView() const override { 
return  }
 virtual OutlinerView* GetTextEditOutlinerView() override { return 
 }
 
+virtual sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt, DropTargetHelper& 
rTargetHelper,
+SdrLayerID nLayer) override;
+virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt, ::sd::Window* 
pTargetWindow,
+ sal_uInt16 nPage, SdrLayerID nLayer) override;
+
 DECL_LINK(StatusEventHdl, EditStatus&, void);
 DECL_LINK(EditModifiedHdl, LinkParamNone*, void);
 DECL_LINK(ModifyTimerHdl, Timer*, void);
diff --git a/sd/source/ui/view/NotesPanelView.cxx 
b/sd/source/ui/view/NotesPanelView.cxx
index 7aa10d0c1f31..2822a8df4c02 100644
--- a/sd/source/ui/view/NotesPanelView.cxx
+++ b/sd/source/ui/view/NotesPanelView.cxx
@@ -305,6 +305,16 @@ SvtScriptType NotesPanelView::GetScriptType() const
 return nScriptType;
 }
 
+sal_Int8 NotesPanelView::AcceptDrop(const AcceptDropEvent&, DropTargetHelper&, 
SdrLayerID)
+{
+return DND_ACTION_NONE;
+}
+
+sal_Int8 NotesPanelView::ExecuteDrop(const ExecuteDropEvent&, ::sd::Window*, 
sal_uInt16, SdrLayerID)
+{
+return DND_ACTION_NONE;
+}
+
 } // end of namespace sd
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
commit 4151d0bb02a679eab7266e9b0e64de22403ee40a
Author: Sarper Akdemir 
AuthorDate: Fri Apr 5 09:23:55 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Apr 5 11:58:35 2024 +0300

related tdf#33603: sd: force invalidate notespanel

This is likely not the correct thing to do here, but is a working
solution that fixes the view lagging behind the resize for now.

Change-Id: I662e59cfd0f1259eeb10a49b6e9c5fd616afa7a0

diff --git a/sd/source/ui/inc/NotesPanelView.hxx 
b/sd/source/ui/inc/NotesPanelView.hxx
index 4bb94590acbb..82b3631f3f50 100644
--- a/sd/source/ui/inc/NotesPanelView.hxx
+++ b/sd/source/ui/inc/NotesPanelView.hxx
@@ -38,7 +38,6 @@ class NotesPanelView final : public ::sd::SimpleOutlinerView
 Idle aModifyIdle;
 
 SdrTextObj* mpTextObj = nullptr;
-bool mbFirstPaint = true;
 bool mbIgnoreNotifications = false;
 
 /** stores the last used document color.
diff --git a/sd/source/ui/view/NotesPanelView.cxx 
b/sd/source/ui/view/NotesPanelView.cxx
index 49fa38a05d88..7aa10d0c1f31 100644
--- 

core.git: Branch 'libreoffice-24-2-2' - include/svx sd/qa sd/source

2024-03-19 Thread Sarper Akdemir (via logerrit)
 include/svx/sdrmasterpagedescriptor.hxx  |3 +-
 include/svx/sdrpageuser.hxx  |3 +-
 include/svx/svdpage.hxx  |1 
 sd/qa/unit/export-tests-ooxml4.cxx   |   45 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   38 ++
 5 files changed, 82 insertions(+), 8 deletions(-)

New commits:
commit aa371949ae72e84379ae811e469d9ec34bab6ec5
Author: Sarper Akdemir 
AuthorDate: Wed Mar 6 13:48:14 2024 +0300
Commit: Xisco Fauli 
CommitDate: Tue Mar 19 18:50:59 2024 +0100

tdf#159931: pptx export: export each used slide layout for a master

attempts to fix the slideLayout reference related regression
from Idb6b88ebe87a83818d8eb27a1fa087652a002c0c.

To correctly export the all used slideLayout instances for a
given master, iterate through sdr::PageUsers of that master
and figure out all used layouts.

Change-Id: I0f58befac1ba4d5ec01aeedbb5f611c83683dcf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164468
Tested-by: Jenkins
Reviewed-by: Balazs Varga 
Reviewed-by: Sarper Akdemir 
(cherry picked from commit a35831becee3781daf8628c48944660d31d84d8b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164495
(cherry picked from commit ebd9530b458cbc37a7b2b1da077435f2b33081ba)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164629
Reviewed-by: Michael Stahl 
Reviewed-by: Michael Weghorn 
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/include/svx/sdrmasterpagedescriptor.hxx 
b/include/svx/sdrmasterpagedescriptor.hxx
index d7eac22a1b5c..9be1e663bcff 100644
--- a/include/svx/sdrmasterpagedescriptor.hxx
+++ b/include/svx/sdrmasterpagedescriptor.hxx
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 class SdrPageProperties;
@@ -30,7 +31,7 @@ namespace sdr::contact { class ViewContact; }
 
 namespace sdr
 {
-class MasterPageDescriptor final : public sdr::PageUser
+class SVXCORE_DLLPUBLIC MasterPageDescriptor final : public sdr::PageUser
 {
 private:
 SdrPage&maOwnerPage;
diff --git a/include/svx/sdrpageuser.hxx b/include/svx/sdrpageuser.hxx
index 8c31a2936c7e..5557b2729777 100644
--- a/include/svx/sdrpageuser.hxx
+++ b/include/svx/sdrpageuser.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SVX_SDRPAGEUSER_HXX
 
 #include 
+#include 
 
 class SdrPage;
 
@@ -30,7 +31,7 @@ class SdrPage;
 
 namespace sdr
 {
-class PageUser
+class SVXCORE_DLLPUBLIC PageUser
 {
 public:
 // this method is called from the destructor of the referenced page.
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index c70a2f1f4a2d..cb1e7f9f0b20 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -405,6 +405,7 @@ private:
 public:
 void AddPageUser(sdr::PageUser& rNewUser);
 void RemovePageUser(sdr::PageUser& rOldUser);
+const sdr::PageUserVector& GetPageUsers() const { return maPageUsers; };
 
 // SdrModel access on SdrPage level
 SdrModel& getSdrModelFromSdrPage() const { return mrSdrModelFromSdrPage; }
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx 
b/sd/qa/unit/export-tests-ooxml4.cxx
index c4c061c50d2d..06cc2805d64d 100644
--- a/sd/qa/unit/export-tests-ooxml4.cxx
+++ b/sd/qa/unit/export-tests-ooxml4.cxx
@@ -1095,6 +1095,51 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, 
testTdf157740_slideMasters)
 assertXPath(pXmlDocContent, 
"/p:sldMaster/p:sldLayoutIdLst/p:sldLayoutId"_ostr, 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf159931_slideLayouts)
+{
+createSdImpressDoc("odp/repeatBitmapMode.odp");
+save("Impress Office Open XML");
+
+xmlDocUniquePtr pXmlDocRels1 = 
parseExport("ppt/slides/_rels/slide1.xml.rels");
+xmlDocUniquePtr pXmlDocRels2 = 
parseExport("ppt/slides/_rels/slide2.xml.rels");
+
+assertXPath(
+pXmlDocRels1,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])"_ostr);
+
+// the relative target e.g. "../slideLayouts/slideLayout2.xml"
+OUString sRelativeLayoutPath1 = getXPathContent(
+pXmlDocRels1,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])/@Target"_ostr);
+
+assertXPath(
+pXmlDocRels2,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])"_ostr);
+
+// the relative target e.g. "../slideLayouts/slideLayout1.xml"
+OUString sRelativeLayoutPath2 = getXPathContent(
+pXmlDocRels2,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])/@Target"_ostr);
+
+uno::Reference xNameAccess
+= 

core.git: Branch 'libreoffice-7-6-6' - include/svx sd/qa sd/source

2024-03-19 Thread Sarper Akdemir (via logerrit)
 include/svx/sdrmasterpagedescriptor.hxx  |3 +
 include/svx/sdrpageuser.hxx  |3 +
 include/svx/svdpage.hxx  |1 
 sd/qa/unit/export-tests-ooxml3.cxx   |   47 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   38 +
 5 files changed, 84 insertions(+), 8 deletions(-)

New commits:
commit a20c366364bdfea41bd9063bd8801d5bb59c0092
Author: Sarper Akdemir 
AuthorDate: Wed Mar 6 13:48:14 2024 +0300
Commit: Christian Lohmaier 
CommitDate: Tue Mar 19 18:03:07 2024 +0100

tdf#159931: pptx export: export each used slide layout for a master

attempts to fix the slideLayout reference related regression
from Idb6b88ebe87a83818d8eb27a1fa087652a002c0c.

To correctly export the all used slideLayout instances for a
given master, iterate through sdr::PageUsers of that master
and figure out all used layouts.

Change-Id: I0f58befac1ba4d5ec01aeedbb5f611c83683dcf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164468
Tested-by: Jenkins
Reviewed-by: Balazs Varga 
Reviewed-by: Sarper Akdemir 
(cherry picked from commit a35831becee3781daf8628c48944660d31d84d8b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164542
(cherry picked from commit a8f058e8ab02643ac2c8d6b6d8fcb3ab45fcf79f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164670
Reviewed-by: Michael Stahl 
Reviewed-by: Xisco Fauli 
Reviewed-by: Michael Weghorn 
Tested-by: Christian Lohmaier 
Reviewed-by: Christian Lohmaier 

diff --git a/include/svx/sdrmasterpagedescriptor.hxx 
b/include/svx/sdrmasterpagedescriptor.hxx
index d7eac22a1b5c..9be1e663bcff 100644
--- a/include/svx/sdrmasterpagedescriptor.hxx
+++ b/include/svx/sdrmasterpagedescriptor.hxx
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 class SdrPageProperties;
@@ -30,7 +31,7 @@ namespace sdr::contact { class ViewContact; }
 
 namespace sdr
 {
-class MasterPageDescriptor final : public sdr::PageUser
+class SVXCORE_DLLPUBLIC MasterPageDescriptor final : public sdr::PageUser
 {
 private:
 SdrPage&maOwnerPage;
diff --git a/include/svx/sdrpageuser.hxx b/include/svx/sdrpageuser.hxx
index 8c31a2936c7e..5557b2729777 100644
--- a/include/svx/sdrpageuser.hxx
+++ b/include/svx/sdrpageuser.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SVX_SDRPAGEUSER_HXX
 
 #include 
+#include 
 
 class SdrPage;
 
@@ -30,7 +31,7 @@ class SdrPage;
 
 namespace sdr
 {
-class PageUser
+class SVXCORE_DLLPUBLIC PageUser
 {
 public:
 // this method is called from the destructor of the referenced page.
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 6a65712719f1..76ab049055ca 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -398,6 +398,7 @@ private:
 public:
 void AddPageUser(sdr::PageUser& rNewUser);
 void RemovePageUser(sdr::PageUser& rOldUser);
+const sdr::PageUserVector& GetPageUsers() const { return maPageUsers; };
 
 // SdrModel access on SdrPage level
 SdrModel& getSdrModelFromSdrPage() const { return mrSdrModelFromSdrPage; }
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 6a66e59af884..a0f36fe0688a 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -2011,6 +2011,53 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, 
testTableCellVerticalPropertyRoundtrip)
 assertXPath(pXml, "(//a:tcPr)[3]", "vert", "wordArtVert");
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf159931_slideLayouts)
+{
+createSdImpressDoc("odp/repeatBitmapMode.odp");
+save("Impress Office Open XML");
+
+xmlDocUniquePtr pXmlDocRels1 = 
parseExport("ppt/slides/_rels/slide1.xml.rels");
+xmlDocUniquePtr pXmlDocRels2 = 
parseExport("ppt/slides/_rels/slide2.xml.rels");
+
+assertXPath(pXmlDocRels1, 
"(/rels:Relationships/rels:Relationship[@Type='http://;
+  
"schemas.openxmlformats.org/officeDocument/2006/relationships/"
+  "slideLayout'])");
+
+// the relative target e.g. "../slideLayouts/slideLayout2.xml"
+OUString sRelativeLayoutPath1
+= getXPathContent(pXmlDocRels1, 
"(/rels:Relationships/rels:Relationship[@Type='http://;
+
"schemas.openxmlformats.org/officeDocument/2006/"
+
"relationships/slideLayout'])/@Target");
+
+assertXPath(pXmlDocRels2, 
"(/rels:Relationships/rels:Relationship[@Type='http://;
+  
"schemas.openxmlformats.org/officeDocument/2006/relationships/"
+  "slideLayout'])");
+
+// the relative target e.g. "../slideLayouts/slideLayout1.xml"
+OUString sRelativeLayoutPath2
+= getXPathContent(pXmlDocRels2, 
"(/rels:Relationships/rels:Relationship[@Type='http://;
+ 

core.git: Branch 'distro/collabora/co-23.05' - include/svx sd/qa sd/source

2024-03-10 Thread Sarper Akdemir (via logerrit)
 include/svx/sdrmasterpagedescriptor.hxx  |3 +
 include/svx/sdrpageuser.hxx  |3 +
 include/svx/svdpage.hxx  |1 
 sd/qa/unit/export-tests-ooxml3.cxx   |   49 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   38 
 5 files changed, 86 insertions(+), 8 deletions(-)

New commits:
commit 2f73ddc64cbc429813a9b88a5f42c38420e20019
Author: Sarper Akdemir 
AuthorDate: Wed Mar 6 13:48:14 2024 +0300
Commit: Aron Budea 
CommitDate: Mon Mar 11 04:21:46 2024 +0100

tdf#159931: pptx export: export each used slide layout for a master

attempts to fix the slideLayout reference related regression
from Idb6b88ebe87a83818d8eb27a1fa087652a002c0c.

To correctly export the all used slideLayout instances for a
given master, iterate through sdr::PageUsers of that master
and figure out all used layouts.

Change-Id: I0f58befac1ba4d5ec01aeedbb5f611c83683dcf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164468
Tested-by: Jenkins
Reviewed-by: Balazs Varga 
Reviewed-by: Sarper Akdemir 
(cherry picked from commit a35831becee3781daf8628c48944660d31d84d8b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164542
(cherry picked from commit a8f058e8ab02643ac2c8d6b6d8fcb3ab45fcf79f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164640
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/include/svx/sdrmasterpagedescriptor.hxx 
b/include/svx/sdrmasterpagedescriptor.hxx
index d7eac22a1b5c..9be1e663bcff 100644
--- a/include/svx/sdrmasterpagedescriptor.hxx
+++ b/include/svx/sdrmasterpagedescriptor.hxx
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 class SdrPageProperties;
@@ -30,7 +31,7 @@ namespace sdr::contact { class ViewContact; }
 
 namespace sdr
 {
-class MasterPageDescriptor final : public sdr::PageUser
+class SVXCORE_DLLPUBLIC MasterPageDescriptor final : public sdr::PageUser
 {
 private:
 SdrPage&maOwnerPage;
diff --git a/include/svx/sdrpageuser.hxx b/include/svx/sdrpageuser.hxx
index 8c31a2936c7e..5557b2729777 100644
--- a/include/svx/sdrpageuser.hxx
+++ b/include/svx/sdrpageuser.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SVX_SDRPAGEUSER_HXX
 
 #include 
+#include 
 
 class SdrPage;
 
@@ -30,7 +31,7 @@ class SdrPage;
 
 namespace sdr
 {
-class PageUser
+class SVXCORE_DLLPUBLIC PageUser
 {
 public:
 // this method is called from the destructor of the referenced page.
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 5b9ccd9e8f7a..58f8797393b7 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -397,6 +397,7 @@ private:
 public:
 void AddPageUser(sdr::PageUser& rNewUser);
 void RemovePageUser(sdr::PageUser& rOldUser);
+const sdr::PageUserVector& GetPageUsers() const { return maPageUsers; };
 
 // SdrModel access on SdrPage level
 SdrModel& getSdrModelFromSdrPage() const { return mrSdrModelFromSdrPage; }
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index dd0945bd4c40..a573ce27af33 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -135,6 +135,7 @@ public:
 void testLinkedOLE();
 void testTdf102261_testParaTabStopDefaultDistance();
 void testTableCellVerticalPropertyRoundtrip();
+void testTdf159931_slideLayouts();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest3);
 
@@ -231,6 +232,7 @@ public:
 CPPUNIT_TEST(testLinkedOLE);
 CPPUNIT_TEST(testTdf102261_testParaTabStopDefaultDistance);
 CPPUNIT_TEST(testTableCellVerticalPropertyRoundtrip);
+CPPUNIT_TEST(testTdf159931_slideLayouts);
 CPPUNIT_TEST_SUITE_END();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -2204,6 +2206,53 @@ void 
SdOOXMLExportTest3::testTableCellVerticalPropertyRoundtrip()
 assertXPath(pXml, "(//a:tcPr)[3]", "vert", "wordArtVert");
 }
 
+void SdOOXMLExportTest3::testTdf159931_slideLayouts()
+{
+createSdImpressDoc("odp/repeatBitmapMode.odp");
+save("Impress Office Open XML");
+
+xmlDocUniquePtr pXmlDocRels1 = 
parseExport("ppt/slides/_rels/slide1.xml.rels");
+xmlDocUniquePtr pXmlDocRels2 = 
parseExport("ppt/slides/_rels/slide2.xml.rels");
+
+assertXPath(pXmlDocRels1, 
"(/rels:Relationships/rels:Relationship[@Type='http://;
+  
"schemas.openxmlformats.org/officeDocument/2006/relationships/"
+  "slideLayout'])");
+
+// the relative target e.g. "../slideLayouts/slideLayout2.xml"
+OUString sRelativeLayoutPath1
+= getXPathContent(pXmlDocRels1, 
"(/rels:Relationships/rels:Relationship[@Type='http://;
+
"schemas.openxmlformats.org/officeDocument/2006/"
+

core.git: Branch 'libreoffice-24-2' - include/svx sd/qa sd/source

2024-03-10 Thread Sarper Akdemir (via logerrit)
 include/svx/sdrmasterpagedescriptor.hxx  |3 +-
 include/svx/sdrpageuser.hxx  |3 +-
 include/svx/svdpage.hxx  |1 
 sd/qa/unit/export-tests-ooxml4.cxx   |   45 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   38 ++
 5 files changed, 82 insertions(+), 8 deletions(-)

New commits:
commit ebd9530b458cbc37a7b2b1da077435f2b33081ba
Author: Sarper Akdemir 
AuthorDate: Wed Mar 6 13:48:14 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Sun Mar 10 13:57:50 2024 +0100

tdf#159931: pptx export: export each used slide layout for a master

attempts to fix the slideLayout reference related regression
from Idb6b88ebe87a83818d8eb27a1fa087652a002c0c.

To correctly export the all used slideLayout instances for a
given master, iterate through sdr::PageUsers of that master
and figure out all used layouts.

Change-Id: I0f58befac1ba4d5ec01aeedbb5f611c83683dcf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164468
Tested-by: Jenkins
Reviewed-by: Balazs Varga 
Reviewed-by: Sarper Akdemir 
(cherry picked from commit a35831becee3781daf8628c48944660d31d84d8b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164495

diff --git a/include/svx/sdrmasterpagedescriptor.hxx 
b/include/svx/sdrmasterpagedescriptor.hxx
index d7eac22a1b5c..9be1e663bcff 100644
--- a/include/svx/sdrmasterpagedescriptor.hxx
+++ b/include/svx/sdrmasterpagedescriptor.hxx
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 class SdrPageProperties;
@@ -30,7 +31,7 @@ namespace sdr::contact { class ViewContact; }
 
 namespace sdr
 {
-class MasterPageDescriptor final : public sdr::PageUser
+class SVXCORE_DLLPUBLIC MasterPageDescriptor final : public sdr::PageUser
 {
 private:
 SdrPage&maOwnerPage;
diff --git a/include/svx/sdrpageuser.hxx b/include/svx/sdrpageuser.hxx
index 8c31a2936c7e..5557b2729777 100644
--- a/include/svx/sdrpageuser.hxx
+++ b/include/svx/sdrpageuser.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SVX_SDRPAGEUSER_HXX
 
 #include 
+#include 
 
 class SdrPage;
 
@@ -30,7 +31,7 @@ class SdrPage;
 
 namespace sdr
 {
-class PageUser
+class SVXCORE_DLLPUBLIC PageUser
 {
 public:
 // this method is called from the destructor of the referenced page.
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index c70a2f1f4a2d..cb1e7f9f0b20 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -405,6 +405,7 @@ private:
 public:
 void AddPageUser(sdr::PageUser& rNewUser);
 void RemovePageUser(sdr::PageUser& rOldUser);
+const sdr::PageUserVector& GetPageUsers() const { return maPageUsers; };
 
 // SdrModel access on SdrPage level
 SdrModel& getSdrModelFromSdrPage() const { return mrSdrModelFromSdrPage; }
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx 
b/sd/qa/unit/export-tests-ooxml4.cxx
index c4c061c50d2d..06cc2805d64d 100644
--- a/sd/qa/unit/export-tests-ooxml4.cxx
+++ b/sd/qa/unit/export-tests-ooxml4.cxx
@@ -1095,6 +1095,51 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, 
testTdf157740_slideMasters)
 assertXPath(pXmlDocContent, 
"/p:sldMaster/p:sldLayoutIdLst/p:sldLayoutId"_ostr, 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf159931_slideLayouts)
+{
+createSdImpressDoc("odp/repeatBitmapMode.odp");
+save("Impress Office Open XML");
+
+xmlDocUniquePtr pXmlDocRels1 = 
parseExport("ppt/slides/_rels/slide1.xml.rels");
+xmlDocUniquePtr pXmlDocRels2 = 
parseExport("ppt/slides/_rels/slide2.xml.rels");
+
+assertXPath(
+pXmlDocRels1,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])"_ostr);
+
+// the relative target e.g. "../slideLayouts/slideLayout2.xml"
+OUString sRelativeLayoutPath1 = getXPathContent(
+pXmlDocRels1,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])/@Target"_ostr);
+
+assertXPath(
+pXmlDocRels2,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])"_ostr);
+
+// the relative target e.g. "../slideLayouts/slideLayout1.xml"
+OUString sRelativeLayoutPath2 = getXPathContent(
+pXmlDocRels2,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])/@Target"_ostr);
+
+uno::Reference xNameAccess
+= 
packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory),
+  maTempFile.GetURL());
+
+// Check that the referenced slideLayout files exist
+// Without the accompanying fix in place, this test would have failed with:
+// equality 

core.git: Branch 'libreoffice-7-6' - include/svx sd/qa sd/source

2024-03-10 Thread Sarper Akdemir (via logerrit)
 include/svx/sdrmasterpagedescriptor.hxx  |3 +
 include/svx/sdrpageuser.hxx  |3 +
 include/svx/svdpage.hxx  |1 
 sd/qa/unit/export-tests-ooxml3.cxx   |   47 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   38 +
 5 files changed, 84 insertions(+), 8 deletions(-)

New commits:
commit a8f058e8ab02643ac2c8d6b6d8fcb3ab45fcf79f
Author: Sarper Akdemir 
AuthorDate: Wed Mar 6 13:48:14 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Sun Mar 10 13:57:34 2024 +0100

tdf#159931: pptx export: export each used slide layout for a master

attempts to fix the slideLayout reference related regression
from Idb6b88ebe87a83818d8eb27a1fa087652a002c0c.

To correctly export the all used slideLayout instances for a
given master, iterate through sdr::PageUsers of that master
and figure out all used layouts.

Change-Id: I0f58befac1ba4d5ec01aeedbb5f611c83683dcf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164468
Tested-by: Jenkins
Reviewed-by: Balazs Varga 
Reviewed-by: Sarper Akdemir 
(cherry picked from commit a35831becee3781daf8628c48944660d31d84d8b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164542

diff --git a/include/svx/sdrmasterpagedescriptor.hxx 
b/include/svx/sdrmasterpagedescriptor.hxx
index d7eac22a1b5c..9be1e663bcff 100644
--- a/include/svx/sdrmasterpagedescriptor.hxx
+++ b/include/svx/sdrmasterpagedescriptor.hxx
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 class SdrPageProperties;
@@ -30,7 +31,7 @@ namespace sdr::contact { class ViewContact; }
 
 namespace sdr
 {
-class MasterPageDescriptor final : public sdr::PageUser
+class SVXCORE_DLLPUBLIC MasterPageDescriptor final : public sdr::PageUser
 {
 private:
 SdrPage&maOwnerPage;
diff --git a/include/svx/sdrpageuser.hxx b/include/svx/sdrpageuser.hxx
index 8c31a2936c7e..5557b2729777 100644
--- a/include/svx/sdrpageuser.hxx
+++ b/include/svx/sdrpageuser.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SVX_SDRPAGEUSER_HXX
 
 #include 
+#include 
 
 class SdrPage;
 
@@ -30,7 +31,7 @@ class SdrPage;
 
 namespace sdr
 {
-class PageUser
+class SVXCORE_DLLPUBLIC PageUser
 {
 public:
 // this method is called from the destructor of the referenced page.
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 6a65712719f1..76ab049055ca 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -398,6 +398,7 @@ private:
 public:
 void AddPageUser(sdr::PageUser& rNewUser);
 void RemovePageUser(sdr::PageUser& rOldUser);
+const sdr::PageUserVector& GetPageUsers() const { return maPageUsers; };
 
 // SdrModel access on SdrPage level
 SdrModel& getSdrModelFromSdrPage() const { return mrSdrModelFromSdrPage; }
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 6a66e59af884..a0f36fe0688a 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -2011,6 +2011,53 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, 
testTableCellVerticalPropertyRoundtrip)
 assertXPath(pXml, "(//a:tcPr)[3]", "vert", "wordArtVert");
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf159931_slideLayouts)
+{
+createSdImpressDoc("odp/repeatBitmapMode.odp");
+save("Impress Office Open XML");
+
+xmlDocUniquePtr pXmlDocRels1 = 
parseExport("ppt/slides/_rels/slide1.xml.rels");
+xmlDocUniquePtr pXmlDocRels2 = 
parseExport("ppt/slides/_rels/slide2.xml.rels");
+
+assertXPath(pXmlDocRels1, 
"(/rels:Relationships/rels:Relationship[@Type='http://;
+  
"schemas.openxmlformats.org/officeDocument/2006/relationships/"
+  "slideLayout'])");
+
+// the relative target e.g. "../slideLayouts/slideLayout2.xml"
+OUString sRelativeLayoutPath1
+= getXPathContent(pXmlDocRels1, 
"(/rels:Relationships/rels:Relationship[@Type='http://;
+
"schemas.openxmlformats.org/officeDocument/2006/"
+
"relationships/slideLayout'])/@Target");
+
+assertXPath(pXmlDocRels2, 
"(/rels:Relationships/rels:Relationship[@Type='http://;
+  
"schemas.openxmlformats.org/officeDocument/2006/relationships/"
+  "slideLayout'])");
+
+// the relative target e.g. "../slideLayouts/slideLayout1.xml"
+OUString sRelativeLayoutPath2
+= getXPathContent(pXmlDocRels2, 
"(/rels:Relationships/rels:Relationship[@Type='http://;
+
"schemas.openxmlformats.org/officeDocument/2006/"
+
"relationships/slideLayout'])/@Target");
+
+uno::Reference xNameAccess
+= 
packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory),
+   

core.git: include/svx sd/qa sd/source

2024-03-07 Thread Sarper Akdemir (via logerrit)
 include/svx/sdrmasterpagedescriptor.hxx  |3 +-
 include/svx/sdrpageuser.hxx  |3 +-
 include/svx/svdpage.hxx  |1 
 sd/qa/unit/export-tests-ooxml4.cxx   |   45 +++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   38 ++
 5 files changed, 82 insertions(+), 8 deletions(-)

New commits:
commit 6c25216e461b624f556a1b2830ab0911d5df7daf
Author: Sarper Akdemir 
AuthorDate: Wed Mar 6 13:48:14 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Thu Mar 7 15:07:27 2024 +0100

tdf#159931: pptx export: export each used slide layout for a master

attempts to fix the slideLayout reference related regression
from Idb6b88ebe87a83818d8eb27a1fa087652a002c0c.

To correctly export the all used slideLayout instances for a
given master, iterate through sdr::PageUsers of that master
and figure out all used layouts.

Change-Id: I0f58befac1ba4d5ec01aeedbb5f611c83683dcf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164468
Tested-by: Jenkins
Reviewed-by: Balazs Varga 
Reviewed-by: Sarper Akdemir 

diff --git a/include/svx/sdrmasterpagedescriptor.hxx 
b/include/svx/sdrmasterpagedescriptor.hxx
index d7eac22a1b5c..9be1e663bcff 100644
--- a/include/svx/sdrmasterpagedescriptor.hxx
+++ b/include/svx/sdrmasterpagedescriptor.hxx
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 class SdrPageProperties;
@@ -30,7 +31,7 @@ namespace sdr::contact { class ViewContact; }
 
 namespace sdr
 {
-class MasterPageDescriptor final : public sdr::PageUser
+class SVXCORE_DLLPUBLIC MasterPageDescriptor final : public sdr::PageUser
 {
 private:
 SdrPage&maOwnerPage;
diff --git a/include/svx/sdrpageuser.hxx b/include/svx/sdrpageuser.hxx
index 8c31a2936c7e..5557b2729777 100644
--- a/include/svx/sdrpageuser.hxx
+++ b/include/svx/sdrpageuser.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SVX_SDRPAGEUSER_HXX
 
 #include 
+#include 
 
 class SdrPage;
 
@@ -30,7 +31,7 @@ class SdrPage;
 
 namespace sdr
 {
-class PageUser
+class SVXCORE_DLLPUBLIC PageUser
 {
 public:
 // this method is called from the destructor of the referenced page.
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index c70a2f1f4a2d..cb1e7f9f0b20 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -405,6 +405,7 @@ private:
 public:
 void AddPageUser(sdr::PageUser& rNewUser);
 void RemovePageUser(sdr::PageUser& rOldUser);
+const sdr::PageUserVector& GetPageUsers() const { return maPageUsers; };
 
 // SdrModel access on SdrPage level
 SdrModel& getSdrModelFromSdrPage() const { return mrSdrModelFromSdrPage; }
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx 
b/sd/qa/unit/export-tests-ooxml4.cxx
index 9ebb88208cc1..4c1e2ad1bccd 100644
--- a/sd/qa/unit/export-tests-ooxml4.cxx
+++ b/sd/qa/unit/export-tests-ooxml4.cxx
@@ -1095,6 +1095,51 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, 
testTdf157740_slideMasters)
 assertXPath(pXmlDocContent, 
"/p:sldMaster/p:sldLayoutIdLst/p:sldLayoutId"_ostr, 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf159931_slideLayouts)
+{
+createSdImpressDoc("odp/repeatBitmapMode.odp");
+save("Impress Office Open XML");
+
+xmlDocUniquePtr pXmlDocRels1 = 
parseExport("ppt/slides/_rels/slide1.xml.rels");
+xmlDocUniquePtr pXmlDocRels2 = 
parseExport("ppt/slides/_rels/slide2.xml.rels");
+
+assertXPath(
+pXmlDocRels1,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])"_ostr);
+
+// the relative target e.g. "../slideLayouts/slideLayout2.xml"
+OUString sRelativeLayoutPath1 = getXPathContent(
+pXmlDocRels1,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])/@Target"_ostr);
+
+assertXPath(
+pXmlDocRels2,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])"_ostr);
+
+// the relative target e.g. "../slideLayouts/slideLayout1.xml"
+OUString sRelativeLayoutPath2 = getXPathContent(
+pXmlDocRels2,
+
"(/rels:Relationships/rels:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout'])/@Target"_ostr);
+
+uno::Reference xNameAccess
+= 
packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory),
+  maTempFile.GetURL());
+
+// Check that the referenced slideLayout files exist
+// Without the accompanying fix in place, this test would have failed with:
+// equality assertion failed
+// - Expected: 1
+// - Actual  : 0
+// i.e. the referenced slideLayout file was missing on export.
+

core.git: 2 commits - sw/qa

2024-03-07 Thread Sarper Akdemir (via logerrit)
 sw/qa/extras/uiwriter/data/tdf158375_dde_reference.fodt  |  304 +++
 sw/qa/extras/uiwriter/uiwriter9.cxx  |  116 
 sw/qa/uitest/writer_tests8/save_with_password_test_policy.py |   63 ++
 3 files changed, 483 insertions(+)

New commits:
commit 10e12d0e6316ac20388f589f062e784e8d9aa630
Author: Sarper Akdemir 
AuthorDate: Fri Mar 1 03:33:20 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Thu Mar 7 12:30:43 2024 +0100

tdf#157518: add uitest for password policy

Change-Id: If246779c944fe250c0070094450545d688712ea4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164390
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/sw/qa/uitest/writer_tests8/save_with_password_test_policy.py 
b/sw/qa/uitest/writer_tests8/save_with_password_test_policy.py
new file mode 100644
index ..08e9a58cef8b
--- /dev/null
+++ b/sw/qa/uitest/writer_tests8/save_with_password_test_policy.py
@@ -0,0 +1,63 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 get_state_as_dict
+from tempfile import TemporaryDirectory
+import os.path
+
+class PasswordPolicy(UITestCase):
+   def test_save_with_password_policy(self):
+   # with a Password Policy configuration that enforces one lowercase, one 
uppercase and one number and at least 8 chars.
+   with 
self.ui_test.set_config('/org.openoffice.Office.Common/Security/Scripting/PasswordPolicy',
 r"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$"):
+   with TemporaryDirectory() as tempdir:
+   xFilePath = os.path.join(tempdir, 
"password_save_with_policy_test.odt")
+
+   with self.ui_test.create_doc_in_start_center("writer"):
+   # Save the document
+   with 
self.ui_test.execute_dialog_through_command(".uno:Save", close_button="") as 
xSaveDialog:
+   xFileName = xSaveDialog.getChild("file_name")
+   xFileName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+   xFileName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+   xFileName.executeAction("TYPE", 
mkPropertyValues({"TEXT": xFilePath}))
+   xPasswordCheckButton = xSaveDialog.getChild("password")
+   xPasswordCheckButton.executeAction("CLICK", tuple())
+   xOpen = xSaveDialog.getChild("open")
+
+   hasExitedEarly = True
+   with self.ui_test.execute_dialog_through_action(xOpen, 
"CLICK") as xPasswordDialog:
+   xNewPassword = 
xPasswordDialog.getChild("newpassEntry")
+   xNewPassword.executeAction("TYPE", 
mkPropertyValues({"TEXT": "password"}))
+   xConfirmPassword = 
xPasswordDialog.getChild("confirmpassEntry")
+   xConfirmPassword.executeAction("TYPE", 
mkPropertyValues({"TEXT": "password"}))
+
+   # check if the current state of the password entry 
reflects the rejection of the password.
+   xIndicator = 
xPasswordDialog.getChild("newpassIndicator")
+   IndicatorIsVisible = 
get_state_as_dict(xIndicator)["Visible"] == "true"
+   self.assertTrue(IndicatorIsVisible)
+
+   # the dialog shouldn't exit on this OK click.
+   xOk = xPasswordDialog.getChild("ok")
+   xOk.executeAction("CLICK", tuple())
+
+   # enter a password that will fit the password policy
+   xNewPassword.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+   xNewPassword.executeAction("TYPE", 
mkPropertyValues({"TEXT": "Zxcvbnm123"}))
+   xConfirmPassword.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+   xConfirmPassword.executeAction("TYPE", 
mkPropertyValues({"TEXT": "Zxcvbnm123"}))
+
+   # check the state is as expected now
+   IndicatorIsVisible = 
get_state_as_dict(xIndicator)["Visible"] == "true"
+   self.assertFalse(IndicatorIsVisible)
+   hasExitedEarly = False
+
+   # test if the dialog accepted the password that didn't 
fit the policy
+   self.assertFalse(hasExitedEarly)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
commit 

core.git: 2 commits - embeddedobj/source sfx2/source

2024-03-07 Thread Sarper Akdemir (via logerrit)
 embeddedobj/source/commonembedding/embedobj.cxx  |4 +
 embeddedobj/source/commonembedding/specialobject.cxx |5 ++
 embeddedobj/source/msole/oleembed.cxx|5 +-
 sfx2/source/appl/appserv.cxx |   42 +++
 sfx2/source/appl/linkmgr2.cxx|3 -
 5 files changed, 57 insertions(+), 2 deletions(-)

New commits:
commit a321084efea4d3ecb8dc2f5a120266ec53647a63
Author: Sarper Akdemir 
AuthorDate: Thu Feb 29 13:38:00 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Thu Mar 7 12:30:23 2024 +0100

do not assume there are no extra seperators at the end for dde links

Change-Id: Idee81b9a8a38aed2375092d2394010063c131fe2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164368
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index a20501a1bad6..01a88afd355f 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -259,13 +259,14 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * 
pLink,
 sal_Int32 nTmp = 0;
 OUString sServer( sLNm.getToken( 0, cTokenSeparator, nTmp 
) );
 OUString sTopic( sLNm.getToken( 0, cTokenSeparator, nTmp ) 
);
+OUString sLinkStr( sLNm.getToken(0, cTokenSeparator, nTmp) 
);
 
 if( pType )
 *pType = sServer;
 if( pFile )
 *pFile = sTopic;
 if( pLinkStr )
-*pLinkStr = nTmp != -1 ? sLNm.copy(nTmp) : OUString();
+*pLinkStr = sLinkStr;
 bRet = true;
 }
 break;
commit cb685f603e15d73fc518b8d4e896f96f21bab4ea
Author: Sarper Akdemir 
AuthorDate: Mon Jan 29 18:40:26 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Thu Mar 7 12:30:15 2024 +0100

tdf#158375: make it possible to hot disable embedded objects

Do not require a reload of the current document for the
embedded objects to be disabled.

Also make sure the existing active embedded objects are
disabled when DisableActiveContent is enabled via options
dialog.

Change-Id: I5a8f302af0cac64575c3e5ec6dbe71ec50a15442
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164367
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/embeddedobj/source/commonembedding/embedobj.cxx 
b/embeddedobj/source/commonembedding/embedobj.cxx
index 0b3843852e58..61e5d1f39ef4 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -475,6 +476,9 @@ uno::Sequence< sal_Int32 > const & 
OCommonEmbeddedObject::GetIntermediateStatesS
 
 void SAL_CALL OCommonEmbeddedObject::changeState( sal_Int32 nNewState )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get()
+&& nNewState != embed::EmbedStates::LOADED )
+throw embed::UnreachableStateException();
 ::osl::ResettableMutexGuard aGuard( m_aMutex );
 if ( m_bDisposed )
 throw lang::DisposedException(); // TODO
diff --git a/embeddedobj/source/commonembedding/specialobject.cxx 
b/embeddedobj/source/commonembedding/specialobject.cxx
index 3dc1eb7e47ef..a2f282ed1aae 100644
--- a/embeddedobj/source/commonembedding/specialobject.cxx
+++ b/embeddedobj/source/commonembedding/specialobject.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -137,6 +138,10 @@ sal_Int32 SAL_CALL OSpecialEmbeddedObject::getMapUnit( 
sal_Int64 nAspect )
 
 void SAL_CALL OSpecialEmbeddedObject::changeState( sal_Int32 nNewState )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get()
+ && nNewState != embed::EmbedStates::LOADED )
+throw embed::UnreachableStateException();
+
 if ( nNewState == embed::EmbedStates::UI_ACTIVE )
 nNewState = embed::EmbedStates::INPLACE_ACTIVE;
 OCommonEmbeddedObject::changeState( nNewState );
diff --git a/embeddedobj/source/msole/oleembed.cxx 
b/embeddedobj/source/msole/oleembed.cxx
index 8379a78693f1..69b3ca8d239e 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -52,7 +52,7 @@
 #include 
 #include 
 #include 
-
+#include 
 
 #include 
 
@@ -438,6 +438,9 @@ bool OleEmbeddedObject::TryToConvertToOOo( const 
uno::Reference< io::XStream >&
 
 void SAL_CALL OleEmbeddedObject::changeState( sal_Int32 nNewState )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get()
+ && nNewState != embed::EmbedStates::LOADED )
+throw embed::UnreachableStateException();
 // begin wrapping related part 
 uno::Reference< embed::XEmbeddedObject > xWrappedObject 

core.git: Branch 'libreoffice-7-6' - canvas/source

2024-02-27 Thread Sarper Akdemir (via logerrit)
 canvas/source/cairo/cairo_canvashelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a2c0ab909195c803401cc710985f19723680e0eb
Author: Sarper Akdemir 
AuthorDate: Mon Jan 15 07:01:01 2024 +0300
Commit: Xisco Fauli 
CommitDate: Tue Feb 27 19:31:44 2024 +0100

tdf#156830: fix faulty transformation order in cairo canvas for patterns

Change-Id: Ib58e845c23dd14bbc3b96e5549a722b650d593a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162069
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit 84055d875ead6d7862cd8ddc5697a280240411fe)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162008
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 3add4092d29b9b03c00dfa24caa917a3fc84540b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163972
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/canvas/source/cairo/cairo_canvashelper.cxx 
b/canvas/source/cairo/cairo_canvashelper.cxx
index 14113e89361f..2bfca55f317c 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -488,7 +488,7 @@ constexpr OUStringLiteral 
PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas::
 geometry::IntegerSize2D aSize = 
aTexture.Bitmap->getSize();
 
 cairo_matrix_init_scale( , 
1.0/aSize.Width, 1.0/aSize.Height );
-cairo_matrix_multiply( , 
,  );
+cairo_matrix_multiply( , 
,  );
 cairo_matrix_invert(  );
 
 // we don't care about repeat mode yet, so the 
workaround is disabled for now


core.git: Branch 'feature/cib_contract49' - sd/source

2024-02-27 Thread Sarper Akdemir (via logerrit)
 sd/source/ui/view/drvwshrg.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit c56c426a369cd94ccf0de68d5036c666dc1a2e95
Author: Sarper Akdemir 
AuthorDate: Thu Feb 22 17:45:54 2024 +0300
Commit: Thorsten Behrens 
CommitDate: Tue Feb 27 13:35:02 2024 +0100

related tdf#33603: do not register NotesChildWindow for Draw

Draw doesn't need the notes panel introduced in
c4c1ca58bb587a56a30c7f4817c346054ce37f2a, so don't register
that for it's shell (GraphicViewShell).

Change-Id: I062a54e806058f352721b89d7c10cece8612
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163775
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sd/source/ui/view/drvwshrg.cxx b/sd/source/ui/view/drvwshrg.cxx
index 9871db2e2de7..2b1c3459a9fd 100644
--- a/sd/source/ui/view/drvwshrg.cxx
+++ b/sd/source/ui/view/drvwshrg.cxx
@@ -105,7 +105,6 @@ void GraphicViewShell::InitInterface_Impl()
 GetStaticInterface()->RegisterChildWindow(
 sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
 
GetStaticInterface()->RegisterChildWindow(DevelopmentToolChildWindow::GetChildWindowId());
-
GetStaticInterface()->RegisterChildWindow(::sd::NotesChildWindow::GetChildWindowId());
 }
 
 } // end of namespace sd


core.git: sd/source

2024-02-27 Thread Sarper Akdemir (via logerrit)
 sd/source/ui/view/drvwshrg.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 75da0c3c576253c61092e762ead974c3600b15b4
Author: Sarper Akdemir 
AuthorDate: Thu Feb 22 17:45:54 2024 +0300
Commit: Thorsten Behrens 
CommitDate: Tue Feb 27 13:34:26 2024 +0100

related tdf#33603: do not register NotesChildWindow for Draw

Draw doesn't need the notes panel introduced in
c4c1ca58bb587a56a30c7f4817c346054ce37f2a, so don't register
that for it's shell (GraphicViewShell).

Change-Id: I062a54e806058f352721b89d7c10cece8612
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163775
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sd/source/ui/view/drvwshrg.cxx b/sd/source/ui/view/drvwshrg.cxx
index 9871db2e2de7..2b1c3459a9fd 100644
--- a/sd/source/ui/view/drvwshrg.cxx
+++ b/sd/source/ui/view/drvwshrg.cxx
@@ -105,7 +105,6 @@ void GraphicViewShell::InitInterface_Impl()
 GetStaticInterface()->RegisterChildWindow(
 sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
 
GetStaticInterface()->RegisterChildWindow(DevelopmentToolChildWindow::GetChildWindowId());
-
GetStaticInterface()->RegisterChildWindow(::sd::NotesChildWindow::GetChildWindowId());
 }
 
 } // end of namespace sd


core.git: Changes to 'refs/tags/cib_contract49-7.6.5.2.M1'

2024-02-22 Thread Sarper Akdemir (via logerrit)
Tag 'cib_contract49-7.6.5.2.M1' created by Thorsten Behrens 
 at 2024-02-22 22:36 +

cib_contract49-7.6.5.2.M1
-BEGIN PGP SIGNATURE-

iNUEABYKAH0WIQRV78SO268/dhkw1IIeB5amgXyR5gUCZdfMi18UgAAuAChp
c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0NTVF
RkM0OEVEQkFGM0Y3NjE5MzBENDgyMUUwNzk2QTY4MTdDOTFFNgAKCRAeB5amgXyR
5vxyAQDbvlOalt9FFAfq0Oa1A4NN/78i0DpRW84+8KEKKXG8aQEA2Ox4CCfLtfCy
Ez9SW8YaWK6LCxPob2nNAKReqxr6UQI=
=y7eB
-END PGP SIGNATURE-

Changes since libreoffice-7.6.5.2-hotfix1-115:
---
 0 files changed
---


core.git: Branch 'feature/cib_contract49' - officecfg/registry sd/inc sd/Library_sd.mk sd/source sd/uiconfig sd/UIConfig_simpress.mk

2024-02-22 Thread Sarper Akdemir (via logerrit)
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |
8 
 sd/Library_sd.mk |
1 
 sd/UIConfig_simpress.mk  |
2 
 sd/inc/strings.hrc   |
1 
 sd/source/ui/app/sddll.cxx   |
2 
 sd/source/ui/dlg/NotesChildWindow.cxx|  
632 ++
 sd/source/ui/inc/NotesChildWindow.hxx|  
108 +
 sd/source/ui/view/ViewShellBase.cxx  |   
24 
 sd/source/ui/view/drvwshrg.cxx   |
3 
 sd/uiconfig/simpress/menubar/menubar.xml |
1 
 sd/uiconfig/simpress/ui/noteschildwindow.ui  |   
41 
 sd/uiconfig/simpress/ui/notespanelcontextmenu.ui |
9 
 12 files changed, 832 insertions(+)

New commits:
commit 71a7fdfae4d350c950fec5a8b59ad45168945a28
Author: Sarper Akdemir 
AuthorDate: Thu Nov 9 20:18:44 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Thu Feb 22 13:51:47 2024 +0100

tdf#33603: sd: add notes panel for normal view

Change-Id: Ibc6e8a3f126c443453c5ecab52ba988a4f4f56e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159288
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index cca1b2ec38ae..618dbfa0d837 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -24,6 +24,14 @@
   S~lide
 
   
+  
+
+  Notes Panel
+
+
+  1
+
+  
   
 
   ~Page
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 926dd86ee755..d7483cb77c25 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -232,6 +232,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/dlg/AnimationChildWindow \
sd/source/ui/dlg/LayerTabBar \
sd/source/ui/dlg/NavigatorChildWindow \
+   sd/source/ui/dlg/NotesChildWindow \
sd/source/ui/dlg/PaneChildWindows \
sd/source/ui/dlg/PaneShells \
sd/source/ui/dlg/SpellDialogChildWindow \
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index ab6b2875e7bc..f0395c7646f2 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -147,6 +147,8 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/notebookbar_groupedbar_full \
sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact \
sd/uiconfig/simpress/ui/notebookbar_online \
+   sd/uiconfig/simpress/ui/noteschildwindow \
+   sd/uiconfig/simpress/ui/notespanelcontextmenu \
sd/uiconfig/simpress/ui/optimpressgeneralpage \
sd/uiconfig/simpress/ui/pagesfieldbox \
sd/uiconfig/simpress/ui/photoalbum \
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 3e1ddd1542e7..adf9f6538129 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -315,6 +315,7 @@
 #define STR_PRESOBJ_OUTLINE 
NC_("STR_PRESOBJ_OUTLINE", "Click to add Text" )
 #define STR_PRESOBJ_TEXT
NC_("STR_PRESOBJ_TEXT", "Click to add Text" )
 #define STR_PRESOBJ_NOTESTEXT   
NC_("STR_PRESOBJ_NOTESTEXT", "Click to add Notes" )
+#define STR_PRESOBJ_NOTESTEXT_MISSING   
NC_("STR_PRESOBJ_NOTESTEXT_MISSING", "Notes placeholder object is missing for 
the current slide." )
 #define STR_PRESOBJ_TITLE_MOBILE
NC_("STR_PRESOBJ_TITLE_MOBILE", "Double-tap to add Title" )
 #define STR_PRESOBJ_OUTLINE_MOBILE  
NC_("STR_PRESOBJ_OUTLINE_MOBILE", "Double-tap to add Text" )
 #define STR_PRESOBJ_TEXT_MOBILE 
NC_("STR_PRESOBJ_TEXT_MOBILE", "Double-tap to add Text" )
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index b4734310a39b..331c32afe5a7 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -178,6 +179,7 @@ void SdDLL::RegisterControllers(SdModule* pMod)
 ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod);
 ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod);
 ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
+::sd::NotesChildWindow::RegisterChildWindow(false, pMod);
 DevelopmentToolChildWindow::RegisterChildWindow(false, pMod);
 
 ::sd::SdNavigatorWrapper::RegisterChildWindow(false, pMod, 

core.git: Branch 'feature/cib_contract49' - 6 commits - editeng/source include/editeng sd/source svx/source sw/source

2024-02-22 Thread Sarper Akdemir (via logerrit)
 editeng/source/editeng/editview.cxx |   10 +++
 editeng/source/editeng/impedit.cxx  |   23 +
 editeng/source/editeng/impedit.hxx  |2 +
 editeng/source/misc/svxacorr.cxx|2 -
 include/editeng/editview.hxx|2 +
 sd/source/ui/func/fuformatpaintbrush.cxx|   36 +++-
 svx/source/svdraw/svdedxv.cxx   |   18 +-
 sw/source/uibase/docvw/edtwin.cxx   |7 +++--
 sw/source/uibase/uiview/formatclipboard.cxx |   15 +++
 9 files changed, 94 insertions(+), 21 deletions(-)

New commits:
commit 170860775de552f255a48a1f1b37c9b3460c033d
Author: Sarper Akdemir 
AuthorDate: Mon Jul 31 17:11:04 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Thu Feb 22 13:13:28 2024 +0100

tdf#103706: tdf#142857: sd: context aware paste for clone format

Introduces selection aware pasting for Impress/Draw's Clone
Format where paragraph properties are applied when the selection
contains a whole paragraph or there's no selection at all (i.e.
clone format applied with just a left click - without drag).

Change-Id: I37e7197580c2b8da333ada1a60408f40f85d7ef5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155108
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 0e3985c49459..72bdd4d18f1c 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -316,6 +316,16 @@ bool EditView::HasSelection() const
 return pImpEditView->HasSelection();
 }
 
+bool EditView::IsSelectionFullPara() const
+{
+return pImpEditView->IsSelectionFullPara();
+}
+
+bool EditView::IsSelectionWithinSinglePara() const
+{
+return pImpEditView->IsSelectionInSinglePara();
+}
+
 bool EditView::IsSelectionAtPoint(const Point& rPointPixel)
 {
 return pImpEditView->IsSelectionAtPoint(rPointPixel);
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 92af0e24b848..d03a2185a929 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -2047,6 +2047,29 @@ bool ImpEditView::IsInSelection( const EditPaM& rPaM )
 return false;
 }
 
+bool ImpEditView::IsSelectionFullPara() const
+{
+if (!IsSelectionInSinglePara())
+return false;
+
+sal_Int32 nSelectionStartPos = GetEditSelection().Min().GetIndex();
+sal_Int32 nSelectionEndPos = GetEditSelection().Max().GetIndex();
+
+if (nSelectionStartPos > nSelectionEndPos)
+std::swap(nSelectionStartPos, nSelectionEndPos);
+
+if (nSelectionStartPos != 0)
+return false;
+
+const ContentNode* pNode = GetEditSelection().Min().GetNode();
+return pNode->Len() == nSelectionEndPos;
+}
+
+bool ImpEditView::IsSelectionInSinglePara() const
+{
+return GetEditSelection().Min().GetNode() == 
GetEditSelection().Max().GetNode();
+}
+
 void ImpEditView::CreateAnchor()
 {
 pEditEngine->SetInSelectionMode(true);
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 5ff09c67257a..503e79bde400 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -416,6 +416,8 @@ public:
 boolIsSelectionAtPoint( const Point& rPosPixel );
 boolIsInSelection( const EditPaM& rPaM );
 
+boolIsSelectionFullPara() const;
+boolIsSelectionInSinglePara() const;
 
 voidSetAnchorMode( EEAnchorMode eMode );
 EEAnchorModeGetAnchorMode() const   { return eAnchorMode; }
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index f014e3abfeb9..ce0407c36530 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -210,6 +210,8 @@ public:
 voidSelectCurrentWord( sal_Int16 nWordType = 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES );
 /// Returns the rectangles of the current selection in TWIPs.
 void GetSelectionRectangles(std::vector& rLogicRects) 
const;
+bool IsSelectionFullPara() const;
+bool IsSelectionWithinSinglePara() const;
 
 boolIsInsertMode() const;
 voidSetInsertMode( bool bInsert );
diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx 
b/sd/source/ui/func/fuformatpaintbrush.cxx
index ae8f2f79ab74..9bbd30939d53 100644
--- a/sd/source/ui/func/fuformatpaintbrush.cxx
+++ b/sd/source/ui/func/fuformatpaintbrush.cxx
@@ -37,6 +37,25 @@
 
 #include 
 
+namespace
+{
+// Paragraph properties are pasted if the selection contains a whole paragraph
+// or there was no selection at all (i.e. just a left click)
+bool ShouldPasteParaFormatPerSelection(const OutlinerView* pOLV)
+{
+if(!pOLV)
+return true;
+
+if(!pOLV->GetEditView().HasSelection())
+return true;
+
+if(!pOLV->GetEditView().IsSelectionWithinSinglePara())
+return 

core.git: officecfg/registry sd/inc sd/Library_sd.mk sd/source sd/uiconfig sd/UIConfig_simpress.mk

2024-02-22 Thread Sarper Akdemir (via logerrit)
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |
8 
 sd/Library_sd.mk |
1 
 sd/UIConfig_simpress.mk  |
2 
 sd/inc/strings.hrc   |
1 
 sd/source/ui/app/sddll.cxx   |
2 
 sd/source/ui/dlg/NotesChildWindow.cxx|  
632 ++
 sd/source/ui/inc/NotesChildWindow.hxx|  
108 +
 sd/source/ui/view/ViewShellBase.cxx  |   
24 
 sd/source/ui/view/drvwshrg.cxx   |
3 
 sd/uiconfig/simpress/menubar/menubar.xml |
1 
 sd/uiconfig/simpress/ui/noteschildwindow.ui  |   
41 
 sd/uiconfig/simpress/ui/notespanelcontextmenu.ui |
9 
 12 files changed, 832 insertions(+)

New commits:
commit c4c1ca58bb587a56a30c7f4817c346054ce37f2a
Author: Sarper Akdemir 
AuthorDate: Thu Nov 9 20:18:44 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Thu Feb 22 09:47:34 2024 +0100

tdf#33603: sd: add notes panel for normal view

Change-Id: Ibc6e8a3f126c443453c5ecab52ba988a4f4f56e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159288
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index e9355220de4a..b46b7b34fac7 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -24,6 +24,14 @@
   S~lide
 
   
+  
+
+  Notes Panel
+
+
+  1
+
+  
   
 
   ~Page
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 01c546ad3dca..bdf7b146da91 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -231,6 +231,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/dlg/AnimationChildWindow \
sd/source/ui/dlg/LayerTabBar \
sd/source/ui/dlg/NavigatorChildWindow \
+   sd/source/ui/dlg/NotesChildWindow \
sd/source/ui/dlg/PaneChildWindows \
sd/source/ui/dlg/PaneShells \
sd/source/ui/dlg/SpellDialogChildWindow \
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index 9d98d611de82..ee778eaeb91a 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -148,6 +148,8 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/notebookbar_groupedbar_full \
sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact \
sd/uiconfig/simpress/ui/notebookbar_online \
+   sd/uiconfig/simpress/ui/noteschildwindow \
+   sd/uiconfig/simpress/ui/notespanelcontextmenu \
sd/uiconfig/simpress/ui/optimpressgeneralpage \
sd/uiconfig/simpress/ui/pagesfieldbox \
sd/uiconfig/simpress/ui/photoalbum \
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 08a5bb7cc8ce..5056a8030966 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -289,6 +289,7 @@
 #define STR_PRESOBJ_OUTLINE 
NC_("STR_PRESOBJ_OUTLINE", "Click to add Text" )
 #define STR_PRESOBJ_TEXT
NC_("STR_PRESOBJ_TEXT", "Click to add Text" )
 #define STR_PRESOBJ_NOTESTEXT   
NC_("STR_PRESOBJ_NOTESTEXT", "Click to add Notes" )
+#define STR_PRESOBJ_NOTESTEXT_MISSING   
NC_("STR_PRESOBJ_NOTESTEXT_MISSING", "Notes placeholder object is missing for 
the current slide." )
 #define STR_PRESOBJ_TITLE_MOBILE
NC_("STR_PRESOBJ_TITLE_MOBILE", "Double-tap to add Title" )
 #define STR_PRESOBJ_OUTLINE_MOBILE  
NC_("STR_PRESOBJ_OUTLINE_MOBILE", "Double-tap to add Text" )
 #define STR_PRESOBJ_TEXT_MOBILE 
NC_("STR_PRESOBJ_TEXT_MOBILE", "Double-tap to add Text" )
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index aded023da375..b21ce1c549e1 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -178,6 +179,7 @@ void SdDLL::RegisterControllers(SdModule* pMod)
 ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod);
 ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod);
 ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
+::sd::NotesChildWindow::RegisterChildWindow(false, pMod);
 DevelopmentToolChildWindow::RegisterChildWindow(false, pMod);
 
 ::sd::SdNavigatorWrapper::RegisterChildWindow(false, pMod, 

core.git: Branch 'libreoffice-24-2' - canvas/source

2024-01-23 Thread Sarper Akdemir (via logerrit)
 canvas/source/cairo/cairo_canvashelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3add4092d29b9b03c00dfa24caa917a3fc84540b
Author: Sarper Akdemir 
AuthorDate: Mon Jan 15 07:01:01 2024 +0300
Commit: Thorsten Behrens 
CommitDate: Tue Jan 23 15:47:26 2024 +0100

tdf#156830: fix faulty transformation order in cairo canvas for patterns

Change-Id: Ib58e845c23dd14bbc3b96e5549a722b650d593a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162069
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit 84055d875ead6d7862cd8ddc5697a280240411fe)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162008
Reviewed-by: Thorsten Behrens 

diff --git a/canvas/source/cairo/cairo_canvashelper.cxx 
b/canvas/source/cairo/cairo_canvashelper.cxx
index 2eb13678ca72..f09ce8c480bf 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -488,7 +488,7 @@ constexpr OUStringLiteral 
PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas::
 geometry::IntegerSize2D aSize = 
aTexture.Bitmap->getSize();
 
 cairo_matrix_init_scale( , 
1.0/aSize.Width, 1.0/aSize.Height );
-cairo_matrix_multiply( , 
,  );
+cairo_matrix_multiply( , 
,  );
 cairo_matrix_invert(  );
 
 // we don't care about repeat mode yet, so the 
workaround is disabled for now


core.git: vcl/source

2024-01-23 Thread Sarper Akdemir (via logerrit)
 vcl/source/pdf/XmpMetadata.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 3a20c691ab1d6a16ad0fc144926b22c098552be4
Author: Sarper Akdemir 
AuthorDate: Mon Jan 22 18:24:41 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Jan 23 13:45:27 2024 +0100

tdf#138792: PDF export: export metadata dc:date

Dublin Core attribute dc:date wasn't exported so far in the
current implementation. Looking at the information pointed
by http://purl.org/dc/elements/1.1/date, dc:date is a
vaguely defined field.

Now creation date is exported there, as I've came across
the note of "Typically, Date will be associated with the
creation or availability of the resource" in the resource
linked below.

https://www.dublincore.org/specifications/dublin-core/dcmi-terms/2005-06-13/#:~:text=Typically%2C%20Date%20will%20be%20associated%20with%20the%20creation%20or%20availability%20of%20the%20resource

Change-Id: I0b5f37058f64e3d6d08cb46045a27ccde54ee434
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162404
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx
index ddd638551bd5..47d76f187d02 100644
--- a/vcl/source/pdf/XmpMetadata.cxx
+++ b/vcl/source/pdf/XmpMetadata.cxx
@@ -83,6 +83,14 @@ void XmpMetadata::write()
 aXmlWriter.content("application/pdf"_ostr);
 aXmlWriter.endElement();
 
+aXmlWriter.startElement("dc:date");
+aXmlWriter.startElement("rdf:Seq");
+aXmlWriter.startElement("rdf:li");
+aXmlWriter.content(m_sCreateDate);
+aXmlWriter.endElement();
+aXmlWriter.endElement();
+aXmlWriter.endElement();
+
 if (!msTitle.isEmpty())
 {
 // this is according to PDF/A-1, technical corrigendum 1 
(2007-04-01)


core.git: canvas/source

2024-01-15 Thread Sarper Akdemir (via logerrit)
 canvas/source/cairo/cairo_canvashelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 84055d875ead6d7862cd8ddc5697a280240411fe
Author: Sarper Akdemir 
AuthorDate: Mon Jan 15 07:01:01 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Jan 15 09:21:05 2024 +0100

tdf#156830: fix faulty transformation order in cairo canvas for patterns

Change-Id: Ib58e845c23dd14bbc3b96e5549a722b650d593a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162069
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/canvas/source/cairo/cairo_canvashelper.cxx 
b/canvas/source/cairo/cairo_canvashelper.cxx
index 2eb13678ca72..f09ce8c480bf 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -488,7 +488,7 @@ constexpr OUStringLiteral 
PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas::
 geometry::IntegerSize2D aSize = 
aTexture.Bitmap->getSize();
 
 cairo_matrix_init_scale( , 
1.0/aSize.Width, 1.0/aSize.Height );
-cairo_matrix_multiply( , 
,  );
+cairo_matrix_multiply( , 
,  );
 cairo_matrix_invert(  );
 
 // we don't care about repeat mode yet, so the 
workaround is disabled for now


core.git: cui/source cui/uiconfig include/unotools unotools/source

2024-01-08 Thread Sarper Akdemir (via logerrit)
 cui/source/options/optinet2.cxx|1 
 cui/source/options/securityoptions.cxx |4 +++
 cui/source/options/securityoptions.hxx |3 ++
 cui/uiconfig/ui/securityoptionsdialog.ui   |   34 -
 include/unotools/securityoptions.hxx   |3 +-
 unotools/source/config/securityoptions.cxx |   12 ++
 6 files changed, 55 insertions(+), 2 deletions(-)

New commits:
commit a2ccc25ccb2e94f5990d6d413541dbcdd3a72338
Author: Sarper Akdemir 
AuthorDate: Tue Jan 9 02:29:42 2024 +0300
Commit: Thorsten Behrens 
CommitDate: Tue Jan 9 02:21:02 2024 +0100

tdf#158375: add UI option to disable active content

Adds a checkbox to disable active contents and OLE Automation at
Options - LibreOffice - Security - Security Options and Warnings

Change-Id: Idfac86e31c97f186eb6b6b2a7a7236b84aedbe83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161808
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 083c3e40f784..de34b031e8ce 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -906,6 +906,7 @@ bool SvxSecurityTabPage::FillItemSet( SfxItemSet* )
 CheckAndSave( SvtSecurityOptions::EOption::DocWarnRecommendPassword, 
m_xSecOptDlg->IsRecommPasswdChecked(), bModified );
 CheckAndSave( SvtSecurityOptions::EOption::CtrlClickHyperlink, 
m_xSecOptDlg->IsCtrlHyperlinkChecked(), bModified );
 CheckAndSave( SvtSecurityOptions::EOption::BlockUntrustedRefererLinks, 
m_xSecOptDlg->IsBlockUntrustedRefererLinksChecked(), bModified );
+CheckAndSave( SvtSecurityOptions::EOption::DisableActiveContent, 
m_xSecOptDlg->IsDisableActiveContentChecked(), bModified );
 }
 
 std::shared_ptr pBatch(
diff --git a/cui/source/options/securityoptions.cxx 
b/cui/source/options/securityoptions.cxx
index d583f626183e..8f970331d9a3 100644
--- a/cui/source/options/securityoptions.cxx
+++ b/cui/source/options/securityoptions.cxx
@@ -54,6 +54,8 @@ SecurityOptionsDialog::SecurityOptionsDialog(weld::Window* 
pParent)
 , m_xCtrlHyperlinkImg(m_xBuilder->weld_widget("lockctrlclick"))
 , 
m_xBlockUntrustedRefererLinksCB(m_xBuilder->weld_check_button("blockuntrusted"))
 , 
m_xBlockUntrustedRefererLinksImg(m_xBuilder->weld_widget("lockblockuntrusted"))
+, 
m_xDisableActiveContentCB(m_xBuilder->weld_check_button("disableactivecontent"))
+, 
m_xDisableActiveContentImg(m_xBuilder->weld_widget("lockdisableactivecontent"))
 , m_xRedlineinfoCB(m_xBuilder->weld_check_button("redlineinfo"))
 , m_xRedlineinfoImg(m_xBuilder->weld_widget("lockredlineinfo"))
 , m_xDocPropertiesCB(m_xBuilder->weld_check_button("docproperties"))
@@ -98,6 +100,8 @@ void SecurityOptionsDialog::init()
 *m_xCtrlHyperlinkImg);
 enableAndSet(SvtSecurityOptions::EOption::BlockUntrustedRefererLinks, 
*m_xBlockUntrustedRefererLinksCB,
 *m_xBlockUntrustedRefererLinksImg);
+enableAndSet(SvtSecurityOptions::EOption::DisableActiveContent,
+ *m_xDisableActiveContentCB, *m_xDisableActiveContentImg);
 
 if 
(!SvtSecurityOptions::IsReadOnly(SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo))
 changeKeepSecurityInfosEnabled();
diff --git a/cui/source/options/securityoptions.hxx 
b/cui/source/options/securityoptions.hxx
index 7884ccfbd30e..10534d4426a7 100644
--- a/cui/source/options/securityoptions.hxx
+++ b/cui/source/options/securityoptions.hxx
@@ -42,6 +42,8 @@ namespace svx
 std::unique_ptr m_xCtrlHyperlinkImg;
 std::unique_ptr m_xBlockUntrustedRefererLinksCB;
 std::unique_ptr m_xBlockUntrustedRefererLinksImg;
+std::unique_ptr m_xDisableActiveContentCB;
+std::unique_ptr m_xDisableActiveContentImg;
 
 std::unique_ptr m_xRedlineinfoCB;
 std::unique_ptr m_xRedlineinfoImg;
@@ -69,6 +71,7 @@ namespace svx
 bool IsRecommPasswdChecked() const { return 
m_xRecommPasswdCB->get_active(); }
 bool IsCtrlHyperlinkChecked() const { return 
m_xCtrlHyperlinkCB->get_active(); }
 bool IsBlockUntrustedRefererLinksChecked() const { return 
m_xBlockUntrustedRefererLinksCB->get_active(); }
+bool IsDisableActiveContentChecked() const { return 
m_xDisableActiveContentCB->get_active(); }
 
 DECL_LINK(ShowPersonalInfosToggle, weld::Toggleable&, void);
 
diff --git a/cui/uiconfig/ui/securityoptionsdialog.ui 
b/cui/uiconfig/ui/securityoptionsdialog.ui
index 17f253fd2365..309b964915e8 100644
--- a/cui/uiconfig/ui/securityoptionsdialog.ui
+++ b/cui/uiconfig/ui/securityoptionsdialog.ui
@@ -275,7 +275,7 @@
 0
 none
 
-  
+  
   
 True
 False
@@ -532,6 +532,38 @@
 4
   
 
+
+  

core.git: extensions/Library_oleautobridge.mk extensions/source officecfg/registry

2024-01-08 Thread Sarper Akdemir (via logerrit)
 extensions/Library_oleautobridge.mk|4 
 extensions/source/ole/servprov.cxx |7 ++-
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |7 +++
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 8f4ff4c601c7480479c97b274e577cf074a9a2ef
Author: Sarper Akdemir 
AuthorDate: Tue Dec 19 23:48:20 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Tue Jan 9 00:50:10 2024 +0100

tdf#158375: add expert option DisableOLEAutomation

Add a disable option for OLE Automation interface that is used
only on Windows.

Change-Id: I86f212977bb604fbae6ac2603bee037b32b5036c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161035
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/extensions/Library_oleautobridge.mk 
b/extensions/Library_oleautobridge.mk
index aa6c6d0cf2a6..38bd19eb8f06 100644
--- a/extensions/Library_oleautobridge.mk
+++ b/extensions/Library_oleautobridge.mk
@@ -11,6 +11,10 @@
 
 $(eval $(call gb_Library_Library,oleautobridge))
 
+$(eval $(call gb_Library_use_custom_headers,oleautobridge,\
+   officecfg/registry \
+))
+
 $(eval $(call 
gb_Library_set_componentfile,oleautobridge,extensions/source/ole/oleautobridge,services))
 
 $(eval $(call gb_Library_use_api,oleautobridge,\
diff --git a/extensions/source/ole/servprov.cxx 
b/extensions/source/ole/servprov.cxx
index f5a9323d361d..0c3920ccca11 100644
--- a/extensions/source/ole/servprov.cxx
+++ b/extensions/source/ole/servprov.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -144,8 +145,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
OneInstanceOleWrapper::CreateInstance(IUnknown
 
 SAL_INFO("extensions.olebridge", "OneInstanceOleWrapper::CreateInstance(" 
<< riid << ")");
 
-HRESULT ret = ResultFromScode(E_UNEXPECTED);
+if 
(officecfg::Office::Common::Security::Scripting::DisableOLEAutomation::get())
+{
+return ResultFromScode(E_NOINTERFACE);
+}
 
+HRESULT ret = ResultFromScode(E_UNEXPECTED);
 const Reference& xInst = m_xInstFunction();
 if (xInst.is())
 {
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index ecd6a05b927b..73de7af3a267 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2524,6 +2524,13 @@
   
   false
 
+
+  
+Specifies whether or not to disable OLE Automation interface.
+
+  
+  false
+
 
   
 Warn on load when a document binds an event to a macro


core.git: officecfg/registry pyuno/Library_pythonloader.mk pyuno/source

2024-01-08 Thread Sarper Akdemir (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |8 
 pyuno/Library_pythonloader.mk  |5 +
 pyuno/source/loader/pyuno_loader.cxx   |5 +
 3 files changed, 18 insertions(+)

New commits:
commit 5372538648dd865f36f53f2cee4490203385cd50
Author: Sarper Akdemir 
AuthorDate: Tue Dec 19 10:59:34 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Tue Jan 9 00:48:18 2024 +0100

tdf#158375: add expert option DisablePythonRuntime

When DisablePythonRuntime is set, anything that utilizes pyuno
bindings won't work (e.g. python macros and extensions).

Change-Id: Id42d01647eebee42b120b399470a1f944e4ba00f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160968
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 1ea33be5ba77..ecd6a05b927b 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2516,6 +2516,14 @@
   
   false
 
+
+  
+Specifies whether or not to disable Python Runtime 
Environment.
+Extensions and macros that utilize Python will not function when 
disabled.
+
+  
+  false
+
 
   
 Warn on load when a document binds an event to a macro
diff --git a/pyuno/Library_pythonloader.mk b/pyuno/Library_pythonloader.mk
index 4e3776b84897..2f1e69cfaef8 100644
--- a/pyuno/Library_pythonloader.mk
+++ b/pyuno/Library_pythonloader.mk
@@ -9,6 +9,10 @@
 
 $(eval $(call gb_Library_Library,pythonloader))
 
+$(eval $(call gb_Library_use_custom_headers,pythonloader,\
+   officecfg/registry \
+))
+
 $(eval $(call 
gb_Library_set_componentfile,pythonloader,pyuno/source/loader/pythonloader,pyuno))
 
 $(eval $(call gb_Library_set_include,pythonloader,\
@@ -22,6 +26,7 @@ $(eval $(call gb_Library_use_api,pythonloader,\
 ))
 
 $(eval $(call gb_Library_use_libraries,pythonloader,\
+   comphelper \
 cppu \
 cppuhelper \
 pyuno \
diff --git a/pyuno/source/loader/pyuno_loader.cxx 
b/pyuno/source/loader/pyuno_loader.cxx
index 05a03fe72c4d..afdb016aa764 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -36,6 +36,8 @@
 
 #include 
 
+#include 
+
 // apparently PATH_MAX is not standard and not defined by MSVC
 #ifndef PATH_MAX
 #ifdef _MAX_PATH
@@ -242,6 +244,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 pyuno_Loader_get_implementation(
 css::uno::XComponentContext* ctx , css::uno::Sequence 
const&)
 {
+if 
(officecfg::Office::Common::Security::Scripting::DisablePythonRuntime::get())
+return nullptr;
+
 // tdf#114815 init python only once, via single-instace="true" in 
pythonloader.component
 pythonInit();
 


core.git: Branch 'libreoffice-24-2' - 2 commits - comphelper/source include/comphelper include/svtools officecfg/registry sc/inc sc/source sd/source sfx2/source svl/source sw/source

2023-12-21 Thread Sarper Akdemir (via logerrit)
 comphelper/source/container/embeddedobjectcontainer.cxx|4 +++
 include/comphelper/embeddedobjectcontainer.hxx |3 ++
 include/svtools/strings.hrc|1 
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |2 -
 sc/inc/strings.hrc |1 
 sc/source/ui/docshell/docsh4.cxx   |   11 
 sc/source/ui/view/tabvwshb.cxx |   10 +++
 sd/source/ui/func/fulink.cxx   |   13 +
 sfx2/source/appl/linkmgr2.cxx  |   10 +++
 sfx2/source/appl/lnkbase2.cxx  |4 +++
 svl/source/svdde/ddecli.cxx|   17 -
 svl/source/svdde/ddesvr.cxx|   17 -
 sw/source/uibase/app/docsh2.cxx|2 +
 sw/source/uibase/shells/textfld.cxx|   13 +
 sw/source/uibase/uiview/view2.cxx  |   11 
 15 files changed, 106 insertions(+), 13 deletions(-)

New commits:
commit ec21a5935062175598d36c21d4484b777c915bff
Author: Sarper Akdemir 
AuthorDate: Mon Dec 18 17:28:20 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Thu Dec 21 11:06:44 2023 +0100

tdf#158375: adapt UI when DDE is disabled via DisableActiveContent

When DisableActiveContent is set, provide now non-functional areas
meaningful error messages / popup dialogs.

Change-Id: I34bffee10fb0ba5c0194193f3d3d81b93d7dbd26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160923
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins
(cherry picked from commit b693fba185df86fba6389ed564a12c0afeb33778)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161095
Reviewed-by: Sarper Akdemir 

diff --git a/include/svtools/strings.hrc b/include/svtools/strings.hrc
index 53cefc48d8ff..ab18119242b3 100644
--- a/include/svtools/strings.hrc
+++ b/include/svtools/strings.hrc
@@ -264,6 +264,7 @@
 #define STR_FIELD_INVITENC_("STR_FIELD_INVITE", 
"Invite")
 
 #define STR_WARNING_ACTIVE_CONTENT_DISABLED 
NC_("STR_WARNING_ACTIVE_CONTENT_DISABLED", "Active content is disabled.")
+#define STR_WARNING_EXTERNAL_LINK_EDIT_DISABLED 
NC_("STR_ERROR_EXTERNAL_LINK_EDIT_DISABLED", "It is not possible to edit 
external links. Active content is disabled in the security settings.")
 #define STR_SVT_DEFAULT_SERVICE_LABEL   
NC_("STR_SVT_DEFAULT_SERVICE_LABEL", "$user$'s $service$")
 
 #define STR_WARNING_JAVANOTFOUND
NC_("STR_WARNING_JAVANOTFOUND", "%PRODUCTNAME requires a Java runtime 
environment (JRE) to perform this task. Please install a JRE and restart 
%PRODUCTNAME. %FAQLINK")
diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index d58777176e52..266cb4cc6c5b 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/strings.hrc
@@ -371,6 +371,7 @@
 #define STR_ENABLE_CONTENT  NC_("STR_ENABLE_CONTENT", 
"Allow updating")
 /*tooltip for the "Allow updating" infobar button*/
 #define STR_ENABLE_CONTENT_TOOLTIP  
NC_("STR_ENABLE_CONTENT_TOOLTIP", "Only allow updating if you trust this 
document.")
+#define STR_ENABLE_CONTENT_TOOLTIP_DISABLED 
NC_("STR_ENABLE_CONTENT_TOOLTIP_DISABLED", "Active content is disabled in the 
security settings. It is not possible to allow updating.")
 /*Insert image dialog*/
 #define STR_ANCHOR_TO_CELL  NC_("STR_ANCHOR_TO_CELL", 
"To cell")
 #define STR_ANCHOR_TO_CELL_RESIZE   
NC_("STR_ANCHOR_TO_CELL_RESIZE", "To cell (resize with cell)")
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 964515743c27..4de5b1950183 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -566,6 +566,13 @@ void ScDocShell::Execute( SfxRequest& rReq )
 rBtn.set_label(ScResId(STR_ENABLE_CONTENT));
 
rBtn.set_tooltip_text(ScResId(STR_ENABLE_CONTENT_TOOLTIP));
 rBtn.connect_clicked(LINK(this, ScDocShell, 
ReloadAllLinksHdl));
+
+// when active content is disabled the "Allow 
updating" button has no functionality.
+if 
(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+{
+
rBtn.set_tooltip_text(ScResId(STR_ENABLE_CONTENT_TOOLTIP_DISABLED));
+rBtn.set_sensitive(false);
+}
 }
 }
 rReq.Done();
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index f0415d03d9aa..ad0e757ce0aa 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -64,6 +64,7 @@
 

core.git: Branch 'libreoffice-24-2' - 2 commits - embeddedobj/Library_emboleobj.mk embeddedobj/source include/svtools sc/source sd/source sw/source

2023-12-21 Thread Sarper Akdemir (via logerrit)
 embeddedobj/Library_emboleobj.mk|4 
 embeddedobj/source/commonembedding/xfactory.cxx |   16 
 embeddedobj/source/msole/xolefactory.cxx|   13 +
 include/svtools/strings.hrc |1 +
 sc/source/ui/drawfunc/fuins2.cxx|   11 +++
 sd/source/ui/func/fuinsert.cxx  |   11 +++
 sw/source/uibase/wrtsh/wrtsh1.cxx   |   12 
 7 files changed, 68 insertions(+)

New commits:
commit 417f140effaea10674d280370223181cb0dc3e55
Author: Sarper Akdemir 
AuthorDate: Wed Dec 20 12:46:54 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Thu Dec 21 10:14:22 2023 +0100

tdf#158375: adapt UI when embedded content is disabled via option

When DisableActiveContent is set, embedded active content is
disabled (e.g. OLE). Therefore the existing ui insertion bits don't
function either. Disable them with a warning pop-up hinting "Active
content is disabled."

Change-Id: I14984684f22df6aff81af79d5a15589b5cae75fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161055
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit 7bb50fd2398220c3b162e7242c1cc8d6c4c31463)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161028
Reviewed-by: Sarper Akdemir 

diff --git a/include/svtools/strings.hrc b/include/svtools/strings.hrc
index 3aa1e9770d66..53cefc48d8ff 100644
--- a/include/svtools/strings.hrc
+++ b/include/svtools/strings.hrc
@@ -263,6 +263,7 @@
 #define STR_FIELD_CALENDAR  NC_("STR_FIELD_CALENDAR", 
"Calendar")
 #define STR_FIELD_INVITENC_("STR_FIELD_INVITE", 
"Invite")
 
+#define STR_WARNING_ACTIVE_CONTENT_DISABLED 
NC_("STR_WARNING_ACTIVE_CONTENT_DISABLED", "Active content is disabled.")
 #define STR_SVT_DEFAULT_SERVICE_LABEL   
NC_("STR_SVT_DEFAULT_SERVICE_LABEL", "$user$'s $service$")
 
 #define STR_WARNING_JAVANOTFOUND
NC_("STR_WARNING_JAVANOTFOUND", "%PRODUCTNAME requires a Java runtime 
environment (JRE) to perform this task. Please install a JRE and restart 
%PRODUCTNAME. %FAQLINK")
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 07d076fe26d6..959424b40b87 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -32,6 +32,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -57,6 +59,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -252,6 +255,14 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, 
vcl::Window* pWin, ScDrawView*
 switch ( nSlot )
 {
 case SID_INSERT_OBJECT :
+if 
(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+{
+std::unique_ptr 
xError(Application::CreateMessageDialog(
+nullptr, VclMessageType::Warning, VclButtonsType::Ok,
+SvtResId(STR_WARNING_ACTIVE_CONTENT_DISABLED)));
+xError->run();
+break;
+}
 aServerLst.FillInsertObjects();
 aServerLst.Remove( ScDocShell::Factory().GetClassId() );   // 
Do not show Starcalc
 //TODO/LATER: currently no inserting of ClassId into 
SfxRequest!
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 5f80abc89ebd..31b286c822e3 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -42,6 +42,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -453,6 +455,15 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
 {
 case SID_INSERT_OBJECT :
 {
+if 
(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+{
+std::unique_ptr xError(
+Application::CreateMessageDialog(
+nullptr, VclMessageType::Warning, 
VclButtonsType::Ok,
+
SvtResId(STR_WARNING_ACTIVE_CONTENT_DISABLED)));
+xError->run();
+break;
+}
 aServerLst.FillInsertObjects();
 if (mpDoc->GetDocumentType() == DocumentType::Draw)
 {
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 912283dd20fc..4b2402fc93c8 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -89,6 +89,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -100,6 +101,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -433,6 +436,15 @@ void SwWrtShell::InsertObject( const 

core.git: include/svtools sc/inc sc/source sd/source sw/source

2023-12-20 Thread Sarper Akdemir (via logerrit)
 include/svtools/strings.hrc |1 +
 sc/inc/strings.hrc  |1 +
 sc/source/ui/docshell/docsh4.cxx|7 +++
 sc/source/ui/view/tabvwshb.cxx  |   10 ++
 sd/source/ui/func/fulink.cxx|   13 +
 sw/source/uibase/shells/textfld.cxx |   13 +
 sw/source/uibase/uiview/view2.cxx   |   11 +++
 7 files changed, 56 insertions(+)

New commits:
commit 09b13f3f85b3ef6ffe4d46e2ca5170ad81045ff4
Author: Sarper Akdemir 
AuthorDate: Mon Dec 18 17:28:20 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Thu Dec 21 07:49:16 2023 +0100

tdf#158375: adapt UI when DDE is disabled via DisableActiveContent

When DisableActiveContent is set, provide now non-functional areas
meaningful error messages / popup dialogs.

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

diff --git a/include/svtools/strings.hrc b/include/svtools/strings.hrc
index 53cefc48d8ff..ab18119242b3 100644
--- a/include/svtools/strings.hrc
+++ b/include/svtools/strings.hrc
@@ -264,6 +264,7 @@
 #define STR_FIELD_INVITENC_("STR_FIELD_INVITE", 
"Invite")
 
 #define STR_WARNING_ACTIVE_CONTENT_DISABLED 
NC_("STR_WARNING_ACTIVE_CONTENT_DISABLED", "Active content is disabled.")
+#define STR_WARNING_EXTERNAL_LINK_EDIT_DISABLED 
NC_("STR_ERROR_EXTERNAL_LINK_EDIT_DISABLED", "It is not possible to edit 
external links. Active content is disabled in the security settings.")
 #define STR_SVT_DEFAULT_SERVICE_LABEL   
NC_("STR_SVT_DEFAULT_SERVICE_LABEL", "$user$'s $service$")
 
 #define STR_WARNING_JAVANOTFOUND
NC_("STR_WARNING_JAVANOTFOUND", "%PRODUCTNAME requires a Java runtime 
environment (JRE) to perform this task. Please install a JRE and restart 
%PRODUCTNAME. %FAQLINK")
diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index d58777176e52..266cb4cc6c5b 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/strings.hrc
@@ -371,6 +371,7 @@
 #define STR_ENABLE_CONTENT  NC_("STR_ENABLE_CONTENT", 
"Allow updating")
 /*tooltip for the "Allow updating" infobar button*/
 #define STR_ENABLE_CONTENT_TOOLTIP  
NC_("STR_ENABLE_CONTENT_TOOLTIP", "Only allow updating if you trust this 
document.")
+#define STR_ENABLE_CONTENT_TOOLTIP_DISABLED 
NC_("STR_ENABLE_CONTENT_TOOLTIP_DISABLED", "Active content is disabled in the 
security settings. It is not possible to allow updating.")
 /*Insert image dialog*/
 #define STR_ANCHOR_TO_CELL  NC_("STR_ANCHOR_TO_CELL", 
"To cell")
 #define STR_ANCHOR_TO_CELL_RESIZE   
NC_("STR_ANCHOR_TO_CELL_RESIZE", "To cell (resize with cell)")
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 964515743c27..4de5b1950183 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -566,6 +566,13 @@ void ScDocShell::Execute( SfxRequest& rReq )
 rBtn.set_label(ScResId(STR_ENABLE_CONTENT));
 
rBtn.set_tooltip_text(ScResId(STR_ENABLE_CONTENT_TOOLTIP));
 rBtn.connect_clicked(LINK(this, ScDocShell, 
ReloadAllLinksHdl));
+
+// when active content is disabled the "Allow 
updating" button has no functionality.
+if 
(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+{
+
rBtn.set_tooltip_text(ScResId(STR_ENABLE_CONTENT_TOOLTIP_DISABLED));
+rBtn.set_sensitive(false);
+}
 }
 }
 rReq.Done();
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index f0415d03d9aa..ad0e757ce0aa 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -64,6 +64,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -485,6 +486,15 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
 case SID_LINKS:
 {
 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
+if 
(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+{
+std::unique_ptr 
xError(Application::CreateMessageDialog(
+nullptr, VclMessageType::Warning, VclButtonsType::Ok,
+SvtResId(STR_WARNING_EXTERNAL_LINK_EDIT_DISABLED)));
+xError->run();
+break;
+}
+
 ScopedVclPtr 
pDlg(pFact->CreateLinksDialog(pWin->GetFrameWeld(), rDoc.GetLinkManager()));
 pDlg->Execute();
 rBindings.Invalidate( nSlot );
diff --git 

core.git: 2 commits - comphelper/source include/comphelper include/svtools officecfg/registry sc/source sd/source sfx2/source svl/source sw/source

2023-12-20 Thread Sarper Akdemir (via logerrit)
 comphelper/source/container/embeddedobjectcontainer.cxx|4 +++
 include/comphelper/embeddedobjectcontainer.hxx |3 ++
 include/svtools/strings.hrc|1 
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |2 -
 sc/source/ui/docshell/docsh4.cxx   |4 +++
 sc/source/ui/drawfunc/fuins2.cxx   |   11 
 sd/source/ui/func/fuinsert.cxx |   11 
 sfx2/source/appl/linkmgr2.cxx  |   10 +++
 sfx2/source/appl/lnkbase2.cxx  |4 +++
 svl/source/svdde/ddecli.cxx|   17 -
 svl/source/svdde/ddesvr.cxx|   17 -
 sw/source/uibase/app/docsh2.cxx|2 +
 sw/source/uibase/wrtsh/wrtsh1.cxx  |   12 +
 13 files changed, 85 insertions(+), 13 deletions(-)

New commits:
commit 9157d8de8d8a7a2707179f371f4e4771f41777be
Author: Sarper Akdemir 
AuthorDate: Mon Dec 18 16:37:16 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Dec 20 20:15:29 2023 +0100

tdf#158375: disable DDE when DisableActiveContent is set

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

diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx 
b/comphelper/source/container/embeddedobjectcontainer.cxx
index 9a971b41b3f6..23915d3e13ab 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -46,6 +46,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -1492,6 +1494,8 @@ bool EmbeddedObjectContainer::SetPersistentEntries(const 
uno::Reference< embed::
 
 bool EmbeddedObjectContainer::getUserAllowsLinkUpdate() const
 {
+if 
(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+return false;
 return pImpl->mbUserAllowsLinkUpdate;
 }
 
diff --git a/include/comphelper/embeddedobjectcontainer.hxx 
b/include/comphelper/embeddedobjectcontainer.hxx
index cc040da152c3..8c75718dce35 100644
--- a/include/comphelper/embeddedobjectcontainer.hxx
+++ b/include/comphelper/embeddedobjectcontainer.hxx
@@ -182,7 +182,10 @@ public:
 */
 bool SetPersistentEntries(const css::uno::Reference< 
css::embed::XStorage >& _xStorage,bool _bClearModifiedFlag = true);
 
+// if DisableActiveContent configuration option is set, this always 
returns false
 bool getUserAllowsLinkUpdate() const;
+
+// if DisableActiveContent configuration option is set, this has no effect
 void setUserAllowsLinkUpdate(bool bNew);
 };
 
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 537220b79be2..1ea33be5ba77 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2512,7 +2512,7 @@
 
   
 Specifies whether or not to disable active content. Right now
-only disables active embedded content (OLE).
+only disables active embedded content (OLE) and DDE.
   
   false
 
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index f8a33f91d1e8..964515743c27 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -109,6 +109,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -2501,6 +2502,9 @@ bool ScDocShell::DdeSetData( const OUString& rItem,
 
 ::sfx2::SvLinkSource* ScDocShell::DdeCreateLinkSource( const OUString& rItem )
 {
+if 
(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+return nullptr;
+
 //  only check for valid item string - range is parsed again in 
ScServerObject ctor
 
 //  named range?
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index f529fb11d468..a20501a1bad6 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -281,6 +282,11 @@ void LinkManager::UpdateAllLinks(
 bool bUpdateGrfLinks,
 weld::Window* pParentWin )
 {
+// when active content is disabled don't bother updating all links
+// also (when bAskUpdate == true) don't show the pop up.
+
if(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+return;
+
 // First make a copy of the array in order to update links
 // links in ... no contact between them!
 std::vector aTmpArr;
@@ -354,8 +360,12 @@ SvLinkSourceRef LinkManager::CreateObj( SvBaseLink const * 
pLink )
 case 

core.git: embeddedobj/Library_emboleobj.mk embeddedobj/source

2023-12-20 Thread Sarper Akdemir (via logerrit)
 embeddedobj/Library_emboleobj.mk|4 
 embeddedobj/source/commonembedding/xfactory.cxx |   16 
 embeddedobj/source/msole/xolefactory.cxx|   13 +
 3 files changed, 33 insertions(+)

New commits:
commit 75df80e34efcd2d39a49ec91654480e156bcec1f
Author: Sarper Akdemir 
AuthorDate: Mon Dec 18 16:23:27 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Dec 20 20:15:02 2023 +0100

tdf#158375: further disable embedded objects

there was the possibility of constructing an OOoEmbeddedObjectFactory
or OleEmbeddedObjectFactory directly instead of
UNOEmbeddedObjectCreator.

So disable all createInstance calls for them too. Securing there won't
be active embedded objects.

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

diff --git a/embeddedobj/Library_emboleobj.mk b/embeddedobj/Library_emboleobj.mk
index b7fde953c466..d92f86f2c7d3 100644
--- a/embeddedobj/Library_emboleobj.mk
+++ b/embeddedobj/Library_emboleobj.mk
@@ -10,6 +10,10 @@
 
 $(eval $(call gb_Library_Library,emboleobj))
 
+$(eval $(call gb_Library_use_custom_headers,emboleobj,\
+   officecfg/registry \
+))
+
 $(eval $(call 
gb_Library_set_componentfile,emboleobj,embeddedobj/source/msole/emboleobj$(if 
$(filter WNT,$(OS)),.windows),services))
 
 $(eval $(call gb_Library_set_include,emboleobj,\
diff --git a/embeddedobj/source/commonembedding/xfactory.cxx 
b/embeddedobj/source/commonembedding/xfactory.cxx
index c6f57aa9c643..1460b31fd54b 100644
--- a/embeddedobj/source/commonembedding/xfactory.cxx
+++ b/embeddedobj/source/commonembedding/xfactory.cxx
@@ -23,9 +23,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 #include "xfactory.hxx"
 #include 
@@ -41,6 +43,8 @@ uno::Reference< uno::XInterface > SAL_CALL 
OOoEmbeddedObjectFactory::createInsta
 const 
uno::Sequence< beans::PropertyValue >& aMediaDescr,
 const 
uno::Sequence< beans::PropertyValue >& lObjArgs )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+throw lang::NoSupportException("Active embedded content is disabled!");
 if ( !xStorage.is() )
 throw lang::IllegalArgumentException( "No parent storage is provided!",
 static_cast< ::cppu::OWeakObject* 
>(this),
@@ -118,6 +122,8 @@ uno::Reference< uno::XInterface > SAL_CALL 
OOoEmbeddedObjectFactory::createInsta
 const uno::Sequence< beans::PropertyValue >& aMediaDescr,
 const uno::Sequence< beans::PropertyValue >& lObjArgs )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+throw lang::NoSupportException("Active embedded content is disabled!");
 if ( !xStorage.is() )
 throw lang::IllegalArgumentException( "No parent storage is provided!",
 static_cast< ::cppu::OWeakObject* 
>(this),
@@ -169,6 +175,8 @@ uno::Reference< uno::XInterface > SAL_CALL 
OOoEmbeddedObjectFactory::createInsta
 const OUString& sEntName,
 const uno::Sequence< 
beans::PropertyValue >& lObjArgs )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+throw lang::NoSupportException("Active embedded content is disabled!");
 uno::Reference< uno::XInterface > xResult;
 
 if ( !xStorage.is() )
@@ -212,6 +220,8 @@ uno::Reference< uno::XInterface > SAL_CALL 
OOoEmbeddedObjectFactory::createInsta
 const uno::Sequence< beans::PropertyValue >& lObjArgs )
 {
 // the initialization is completely controlled by user
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+throw lang::NoSupportException("Active embedded content is disabled!");
 if ( !xStorage.is() )
 throw lang::IllegalArgumentException( "No parent storage is provided!",
 uno::Reference< uno::XInterface >( 
static_cast< ::cppu::OWeakObject* >(this) ),
@@ -257,6 +267,8 @@ uno::Reference< uno::XInterface > SAL_CALL 
OOoEmbeddedObjectFactory::createInsta
 const uno::Sequence< 
beans::PropertyValue >& aMediaDescr,
 const uno::Sequence< 
beans::PropertyValue >& lObjArgs )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+throw lang::NoSupportException("Active embedded content is disabled!");
 uno::Reference< uno::XInterface > xResult;
 
 uno::Sequence< beans::PropertyValue > aTempMedDescr( aMediaDescr );

core.git: svl/source

2023-12-10 Thread Sarper Akdemir (via logerrit)
 svl/source/misc/PasswordHelper.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 9bc8918cf00b99f6c4a8f1e3f082e5583a4cd02c
Author: Sarper Akdemir 
AuthorDate: Tue Dec 5 18:50:29 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Sun Dec 10 10:13:31 2023 +0100

add explainer for the reasoning of fMaxPassStrengthEntropyBits

also fixes the typo in the fMaxPassStrengthEntropyBits variable name.

Change-Id: I7c9cfcea7253a3e07428c83008b0c072033f33c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160425
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/svl/source/misc/PasswordHelper.cxx 
b/svl/source/misc/PasswordHelper.cxx
index cfae72f64937..c98a26eff4af 100644
--- a/svl/source/misc/PasswordHelper.cxx
+++ b/svl/source/misc/PasswordHelper.cxx
@@ -136,10 +136,13 @@ bool SvPasswordHelper::CompareHashPassword(const 
uno::Sequence& rOldPa
 
 double SvPasswordHelper::GetPasswordStrengthPercentage(const char* pPassword)
 {
-// Entropy bits corresponding to 100% password strength
-static constexpr double fMaxPassStrengthEntorpyBits = 112.0;
+// Entropy bits ≥ 112 are mapped to 100% password strength.
+// 112 was picked since according to the linked below KeePass help page, it
+// corresponds to a strong password:
+// 

+static constexpr double fMaxPassStrengthEntropyBits = 112.0;
 return std::min(100.0,
-ZxcvbnMatch(pPassword, nullptr, nullptr) * 100.0 / 
fMaxPassStrengthEntorpyBits);
+ZxcvbnMatch(pPassword, nullptr, nullptr) * 100.0 / 
fMaxPassStrengthEntropyBits);
 }
 
 double SvPasswordHelper::GetPasswordStrengthPercentage(const OUString& 
aPassword)


core.git: embeddedobj/source officecfg/registry

2023-12-07 Thread Sarper Akdemir (via logerrit)
 embeddedobj/source/general/xcreator.cxx|   15 -
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |7 ++
 2 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 8d3ac3968e31d8d804d72d39a9387f225d30d087
Author: Sarper Akdemir 
AuthorDate: Wed Dec 6 21:40:37 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Thu Dec 7 13:07:17 2023 +0100

tdf#158375: add expert option to disable active content

adds new expert option DisableActiveContent

Right now only disables active embedded content / OLE.

If OLE content is being imported via
UNOEmbeddedObjectCreator::createInstanceInitFromEntry with the
expert option DisableActiveContent set, the imported OLE object is
now forced to be ODummyEmbeddedObject.

ODummyEmbeddedObject doesn't implement any other state then
embed::EmbedStates::LOADED (i.e. doesn't implement RUNNING,
ACTIVE etc.) which makes it possible to prevent the imported OLE
object becoming active.

The functions that now throw lang::NoSuchElementException are
usually called on new creation of embedded content via UI. But
since the call sites expect the possibility of embedded content
failing to initialize, that is handled by showing a popup stating
some form of `unable to insert`.

A follow-up improvement of disabling insertion of OLE content via
dialogs could be implemented.

Change-Id: Ib558a2a129b491798f5036a7bb269116545be75d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160402
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/embeddedobj/source/general/xcreator.cxx 
b/embeddedobj/source/general/xcreator.cxx
index c4a8635e465d..c9151827a65f 100644
--- a/embeddedobj/source/general/xcreator.cxx
+++ b/embeddedobj/source/general/xcreator.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -45,6 +46,8 @@ uno::Reference< uno::XInterface > SAL_CALL 
UNOEmbeddedObjectCreator::createInsta
 const OUString& sEntName,
 const uno::Sequence< 
beans::PropertyValue >& lObjArgs )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+throw lang::NoSupportException("Active OLE content is disabled!");
 if ( !xStorage.is() )
 throw lang::IllegalArgumentException( "No parent storage is provided!",
 static_cast< ::cppu::OWeakObject* 
>(this),
@@ -164,7 +167,10 @@ uno::Reference< uno::XInterface > SAL_CALL 
UNOEmbeddedObjectCreator::createInsta
 aEmbedFactory = 
m_aConfigHelper.GetFactoryNameByMediaType(MIMETYPE_VND_SUN_XML_BASE_ASCII);
 }
 
-if ( !aEmbedFactory.isEmpty() )
+if ( !aEmbedFactory.isEmpty()
+ // when active OLE content is disabled, ignore aEmbedFactory and force
+ // the embedded object to be an ODummyEmbeddedObject
+ && 
!officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
 {
 uno::Reference< uno::XInterface > xFact = 
m_xContext->getServiceManager()->createInstanceWithContext(aEmbedFactory, 
m_xContext);
 
@@ -238,6 +244,8 @@ uno::Reference< uno::XInterface > SAL_CALL 
UNOEmbeddedObjectCreator::createInsta
 const uno::Sequence< beans::PropertyValue >& aMediaDescr,
 const uno::Sequence< beans::PropertyValue >& lObjArgs )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+throw lang::NoSupportException("Active OLE content is disabled!");
 // TODO: use lObjArgs
 
 if ( !xStorage.is() )
@@ -299,6 +307,8 @@ uno::Reference< uno::XInterface > SAL_CALL 
UNOEmbeddedObjectCreator::createInsta
 const uno::Sequence< beans::PropertyValue >& aArgs,
 const uno::Sequence< beans::PropertyValue >& aObjectArgs )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+throw lang::NoSupportException("Active OLE content is disabled!");
 if ( !xStorage.is() )
 throw lang::IllegalArgumentException( "No parent storage is provided!",
 static_cast< ::cppu::OWeakObject* 
>(this),
@@ -330,6 +340,9 @@ uno::Reference< uno::XInterface > SAL_CALL 
UNOEmbeddedObjectCreator::createInsta
 const uno::Sequence< 
beans::PropertyValue >& aMediaDescr,
 const uno::Sequence< 
beans::PropertyValue >& lObjArgs )
 {
+if ( 
officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+throw lang::NoSupportException("Active OLE content is disabled!");
+
 uno::Reference< uno::XInterface > xResult;
 
 uno::Sequence< beans::PropertyValue > aTempMedDescr( aMediaDescr );
diff --git 

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sfx2/uiconfig solenv/sanitizers

2023-11-15 Thread Sarper Akdemir (via logerrit)
 include/sfx2/passwd.hxx|3 ++
 sfx2/source/dialog/passwd.cxx  |   45 
 sfx2/uiconfig/ui/password.ui   |   56 -
 solenv/sanitizers/ui/sfx.suppr |4 ++
 4 files changed, 96 insertions(+), 12 deletions(-)

New commits:
commit ed72c6fbfa02cf98cb0d0f761ef5a7b9ffb894bc
Author: Sarper Akdemir 
AuthorDate: Wed Nov 15 14:54:42 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Nov 15 23:05:49 2023 +0100

tdf#157518: enforce password policy on sfx2/ui/password.ui

Change-Id: I115b5b05ed82f2f900bcd70ec4f52c7f749544e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159443
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/include/sfx2/passwd.hxx b/include/sfx2/passwd.hxx
index bc5e478bbf03..3ddffed196d0 100644
--- a/include/sfx2/passwd.hxx
+++ b/include/sfx2/passwd.hxx
@@ -51,6 +51,7 @@ private:
 std::unique_ptr m_xPassword1FT;
 std::unique_ptr m_xPassword1ED;
 std::unique_ptr m_xPassword1StrengthBar;
+std::unique_ptr m_xPassword1PolicyLabel;
 std::unique_ptr m_xConfirm1FT;
 std::unique_ptr m_xConfirm1ED;
 
@@ -58,6 +59,7 @@ private:
 std::unique_ptr m_xPassword2FT;
 std::unique_ptr m_xPassword2ED;
 std::unique_ptr m_xPassword2StrengthBar;
+std::unique_ptr m_xPassword2PolicyLabel;
 std::unique_ptr m_xConfirm2FT;
 std::unique_ptr m_xConfirm2ED;
 
@@ -74,6 +76,7 @@ private:
 OUStringmaMainPwdStr;
 sal_uInt16  mnMinLen;
 SfxShowExtras  mnExtras;
+std::optional moPasswordPolicy;
 
 boolmbAsciiOnly;
 DECL_DLLPRIVATE_LINK(OKHdl, weld::Button&, void);
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index a69d0aef352a..b78546722cb9 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -38,15 +39,35 @@ void SfxPasswordDialog::ModifyHdl()
 bEnable = (bEnable && (m_xPassword2ED->get_text().getLength() >= 
mnMinLen));
 m_xOKBtn->set_sensitive(bEnable);
 
+// if there's a confirm entry, the dialog is being used for setting a 
password
 if (m_xConfirm1ED->get_visible())
 {
 m_xPassword1StrengthBar->set_percentage(
 SvPasswordHelper::GetPasswordStrengthPercentage(aPassword1Text));
+bool bPasswordMeetsPolicy = SvPasswordHelper::PasswordMeetsPolicy(
+aPassword1Text, moPasswordPolicy);
+m_xPassword1ED->set_message_type(bPasswordMeetsPolicy ? 
weld::EntryMessageType::Normal
+  : 
weld::EntryMessageType::Error);
+m_xPassword1PolicyLabel->set_visible(!bPasswordMeetsPolicy);
 }
+
+// if there's a confirm entry, the dialog is being used for setting a 
password
 if (m_xConfirm2ED->get_visible())
 {
+OUString aPassword2Text = m_xPassword2ED->get_text();
+
 m_xPassword2StrengthBar->set_percentage(
 
SvPasswordHelper::GetPasswordStrengthPercentage(m_xPassword2ED->get_text()));
+
+// second password is optional, ignore policy if it is empty
+bool bPasswordMeetsPolicy
+= aPassword2Text.isEmpty()
+  ? true
+  : SvPasswordHelper::PasswordMeetsPolicy(
+  aPassword2Text, moPasswordPolicy);
+m_xPassword2ED->set_message_type(bPasswordMeetsPolicy ? 
weld::EntryMessageType::Normal
+  : 
weld::EntryMessageType::Error);
+m_xPassword2PolicyLabel->set_visible(!bPasswordMeetsPolicy);
 }
 }
 
@@ -81,6 +102,19 @@ IMPL_LINK(SfxPasswordDialog, InsertTextHdl, OUString&, 
rTest, bool)
 
 IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl, weld::Button&, void)
 {
+if (m_xConfirm1ED->get_visible()
+&& !SvPasswordHelper::PasswordMeetsPolicy(GetPassword(), 
moPasswordPolicy))
+{
+m_xPassword1ED->grab_focus();
+return;
+}
+if (m_xConfirm2ED->get_visible() && !GetPassword2().isEmpty()
+&& !SvPasswordHelper::PasswordMeetsPolicy(GetPassword2(), 
moPasswordPolicy))
+{
+m_xPassword2ED->grab_focus();
+return;
+}
+
 bool bConfirmFailed = bool( mnExtras & SfxShowExtras::CONFIRM ) &&
   ( GetConfirm() != GetPassword() );
 if( ( mnExtras & SfxShowExtras::CONFIRM2 ) && ( m_xConfirm2ED->get_text() 
!= GetPassword2() ) )
@@ -114,12 +148,14 @@ SfxPasswordDialog::SfxPasswordDialog(weld::Widget* 
pParent, const OUString* pGro
 , m_xPassword1FT(m_xBuilder->weld_label("pass1ft"))
 , m_xPassword1ED(m_xBuilder->weld_entry("pass1ed"))
 , m_xPassword1StrengthBar(m_xBuilder->weld_level_bar("pass1bar"))
+, m_xPassword1PolicyLabel(m_xBuilder->weld_label("pass1policylabel"))
 , m_xConfirm1FT(m_xBuilder->weld_label("confirm1ft"))

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

2023-11-15 Thread Sarper Akdemir (via logerrit)
 uui/source/masterpasscrtdlg.cxx |   25 ++
 uui/source/masterpasscrtdlg.hxx |2 +
 uui/uiconfig/ui/setmasterpassworddlg.ui |   44 ++--
 3 files changed, 64 insertions(+), 7 deletions(-)

New commits:
commit fed7b3068dcea2ebf65314c4f212350720631706
Author: Sarper Akdemir 
AuthorDate: Mon Nov 13 17:19:01 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Nov 15 22:02:16 2023 +0100

tdf#157518: enforce password policy on setmasterpassworddlg

Change-Id: I7e7adde8f0d55808d16dc9247954a7645a1d3601
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159384
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index 2216ea5a1d48..f0c456365646 100644
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -33,10 +34,27 @@ IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl, 
weld::Entry&, void)
 m_xOKBtn->set_sensitive(aPasswordText.getLength() >= 1);
 m_xPasswdStrengthBar->set_percentage(
 SvPasswordHelper::GetPasswordStrengthPercentage(aPasswordText));
+
+if(m_oPasswordPolicy)
+{
+bool bPasswordMeetsPolicy
+= SvPasswordHelper::PasswordMeetsPolicy(aPasswordText, 
m_oPasswordPolicy);
+m_xEDMasterPasswordCrt->set_message_type(bPasswordMeetsPolicy ? 
weld::EntryMessageType::Normal
+ : 
weld::EntryMessageType::Error);
+m_xPasswordPolicyLabel->set_visible(!bPasswordMeetsPolicy);
+}
 }
 
 IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl, weld::Button&, void)
 {
+if (m_oPasswordPolicy
+&& 
!SvPasswordHelper::PasswordMeetsPolicy(m_xEDMasterPasswordCrt->get_text(),
+  m_oPasswordPolicy))
+{
+m_xEDMasterPasswordCrt->grab_focus();
+return;
+}
+
 // compare both passwords and show message box if there are not equal!!
 if (m_xEDMasterPasswordCrt->get_text() == 
m_xEDMasterPasswordRepeat->get_text())
 m_xDialog->response(RET_OK);
@@ -57,13 +75,20 @@ 
MasterPasswordCreateDialog::MasterPasswordCreateDialog(weld::Window* pParent, co
 : GenericDialogController(pParent, "uui/ui/setmasterpassworddlg.ui", 
"SetMasterPasswordDialog")
 , rResLocale(rLocale)
 , m_xEDMasterPasswordCrt(m_xBuilder->weld_entry("password1"))
+, m_xPasswordPolicyLabel(m_xBuilder->weld_label("passpolicylabel"))
 , m_xEDMasterPasswordRepeat(m_xBuilder->weld_entry("password2"))
 , m_xOKBtn(m_xBuilder->weld_button("ok"))
 , m_xPasswdStrengthBar(m_xBuilder->weld_level_bar("password1levelbar"))
+, 
m_oPasswordPolicy(officecfg::Office::Common::Security::Scripting::PasswordPolicy::get())
 {
 m_xOKBtn->set_sensitive(false);
 m_xOKBtn->connect_clicked( LINK( this, MasterPasswordCreateDialog, 
OKHdl_Impl ) );
 m_xEDMasterPasswordCrt->connect_changed( LINK( this, 
MasterPasswordCreateDialog, EditHdl_Impl ) );
+if (m_oPasswordPolicy)
+{
+m_xPasswordPolicyLabel->set_label(
+
officecfg::Office::Common::Security::Scripting::PasswordPolicyErrorMessage::get());
+}
 }
 
 MasterPasswordCreateDialog::~MasterPasswordCreateDialog()
diff --git a/uui/source/masterpasscrtdlg.hxx b/uui/source/masterpasscrtdlg.hxx
index f7f01cda79cc..83f981190bb1 100644
--- a/uui/source/masterpasscrtdlg.hxx
+++ b/uui/source/masterpasscrtdlg.hxx
@@ -27,9 +27,11 @@ private:
 const std::locale& rResLocale;
 
 std::unique_ptr m_xEDMasterPasswordCrt;
+std::unique_ptr m_xPasswordPolicyLabel;
 std::unique_ptr m_xEDMasterPasswordRepeat;
 std::unique_ptr m_xOKBtn;
 std::unique_ptr m_xPasswdStrengthBar;
+std::optional m_oPasswordPolicy;
 
 DECL_LINK(OKHdl_Impl, weld::Button&, void);
 DECL_LINK(EditHdl_Impl, weld::Entry&, void);
diff --git a/uui/uiconfig/ui/setmasterpassworddlg.ui 
b/uui/uiconfig/ui/setmasterpassworddlg.ui
index 52cec48eb30a..1fd06e0e5c57 100644
--- a/uui/uiconfig/ui/setmasterpassworddlg.ui
+++ b/uui/uiconfig/ui/setmasterpassworddlg.ui
@@ -95,14 +95,43 @@
   
 
 
-  
+  
+  
 True
-False
-6
-_Enter password:
-True
-password1
-0
+False
+12
+1
+
+  
+True
+False
+end
+6
+True
+_Enter password:
+True
+password1
+0
+  
+  
+0
+0
+

[Libreoffice-commits] core.git: 3 commits - cui/Library_cui.mk cui/source include/sal include/sfx2 include/svl sc/source sc/uiconfig sfx2/source sfx2/uiconfig svl/Library_svl.mk svl/source uui/source

2023-11-15 Thread Sarper Akdemir (via logerrit)
 cui/Library_cui.mk  |3 --
 cui/source/dialogs/passwdomdlg.cxx  |   13 +---
 cui/source/inc/PasswordStrength.hxx |   28 --
 cui/source/util/PasswordStrength.cxx|   48 
 include/sal/log-areas.dox   |2 -
 include/sfx2/passwd.hxx |2 +
 include/svl/PasswordHelper.hxx  |   25 
 sc/source/ui/inc/protectiondlg.hxx  |1 
 sc/source/ui/miscdlgs/protectiondlg.cxx |9 +-
 sc/uiconfig/scalc/ui/protectsheetdlg.ui |   25 
 sfx2/source/dialog/passwd.cxx   |   21 +-
 sfx2/uiconfig/ui/password.ui|   34 --
 svl/Library_svl.mk  |2 +
 svl/source/misc/PasswordHelper.cxx  |   48 
 uui/source/masterpasscrtdlg.cxx |7 
 uui/source/masterpasscrtdlg.hxx |1 
 uui/uiconfig/ui/setmasterpassworddlg.ui |   23 +++
 17 files changed, 188 insertions(+), 104 deletions(-)

New commits:
commit 861ebce9ca52cbe87121879f159d8ec0cb572755
Author: Sarper Akdemir 
AuthorDate: Wed Nov 8 09:20:34 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Nov 15 19:48:49 2023 +0100

tdf#157518: add password strength bar to protectsheetdlg.ui

Change-Id: Iedd6793446c2c339cc17d32a28c6b195dfb250e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159372
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/sc/source/ui/inc/protectiondlg.hxx 
b/sc/source/ui/inc/protectiondlg.hxx
index d36c8a820fad..e59fb3accf77 100644
--- a/sc/source/ui/inc/protectiondlg.hxx
+++ b/sc/source/ui/inc/protectiondlg.hxx
@@ -51,6 +51,7 @@ private:
 std::unique_ptr m_xOptions;
 std::unique_ptr m_xPassword1Edit;
 std::unique_ptr m_xPassword2Edit;
+std::unique_ptr m_xPasswordStrengthBar;
 std::unique_ptr m_xOptionsListBox;
 std::unique_ptr m_xBtnOk;
 std::unique_ptr m_xProtected;
diff --git a/sc/source/ui/miscdlgs/protectiondlg.cxx 
b/sc/source/ui/miscdlgs/protectiondlg.cxx
index 920e7bfc4888..1353f5f154cc 100644
--- a/sc/source/ui/miscdlgs/protectiondlg.cxx
+++ b/sc/source/ui/miscdlgs/protectiondlg.cxx
@@ -19,6 +19,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -43,6 +44,7 @@ ScTableProtectionDlg::ScTableProtectionDlg(weld::Window* 
pParent)
 , m_xOptions(m_xBuilder->weld_container("options"))
 , m_xPassword1Edit(m_xBuilder->weld_entry("password1"))
 , m_xPassword2Edit(m_xBuilder->weld_entry("password2"))
+, m_xPasswordStrengthBar(m_xBuilder->weld_level_bar("passwordbar"))
 , m_xOptionsListBox(m_xBuilder->weld_tree_view("checklist"))
 , m_xBtnOk(m_xBuilder->weld_button("ok"))
 , m_xProtected(m_xBuilder->weld_label("protected"))
@@ -144,9 +146,14 @@ IMPL_LINK_NOARG(ScTableProtectionDlg, OKHdl, 
weld::Button&, void)
 m_xDialog->response(RET_OK);
 }
 
-IMPL_LINK_NOARG(ScTableProtectionDlg, PasswordModifyHdl, weld::Entry&, void)
+IMPL_LINK(ScTableProtectionDlg, PasswordModifyHdl, weld::Entry&, rEntry, void)
 {
 OUString aPass1 = m_xPassword1Edit->get_text();
+if ( == m_xPassword1Edit.get())
+{
+m_xPasswordStrengthBar->set_percentage(
+SvPasswordHelper::GetPasswordStrengthPercentage(aPass1));
+}
 OUString aPass2 = m_xPassword2Edit->get_text();
 m_xBtnOk->set_sensitive(aPass1 == aPass2);
 }
diff --git a/sc/uiconfig/scalc/ui/protectsheetdlg.ui 
b/sc/uiconfig/scalc/ui/protectsheetdlg.ui
index 547af8e8d34e..83f1a1af012a 100644
--- a/sc/uiconfig/scalc/ui/protectsheetdlg.ui
+++ b/sc/uiconfig/scalc/ui/protectsheetdlg.ui
@@ -1,5 +1,5 @@
 
-
+
 
   
   
@@ -117,7 +117,7 @@
   
 
 
-  
+  
   
 True
 False
@@ -150,8 +150,8 @@
 1
   
   
-0
-1
+0
+2
   
 
 
@@ -182,10 +182,23 @@
 password
   
   
-1
-1
+1
+2
+  
+
+
+  
+True
+False
+  
+  
+1
+1
   
 
+
+  
+
   
   
 False
commit e8fc5d7fcab6b283ec0655b1d7cab5bf28fde240
Author: Sarper Akdemir 
AuthorDate: Wed Nov 8 08:43:41 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Nov 15 19:48:44 2023 

[Libreoffice-commits] core.git: Branch 'feature/cib_contract49b' - 7 commits - avmedia/source desktop/source extensions/source external/libcmis include/curlinit.hxx include/tools lingucomponent/source

2023-11-12 Thread Sarper Akdemir (via logerrit)
Rebased ref, commits from common ancestor:
commit 2a2f53131c8dd906b549230ea211993c094efd66
Author: Sarper Akdemir 
AuthorDate: Thu Nov 9 20:18:44 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Sun Nov 12 13:37:53 2023 +0100

Edit notes in child window

These are the initial ui bits for testing the feature

Change-Id: Ibc6e8a3f126c443453c5ecab52ba988a4f4f56e6

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index cca1b2ec38ae..618dbfa0d837 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -24,6 +24,14 @@
   S~lide
 
   
+  
+
+  Notes Panel
+
+
+  1
+
+  
   
 
   ~Page
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 926dd86ee755..d7483cb77c25 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -232,6 +232,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/dlg/AnimationChildWindow \
sd/source/ui/dlg/LayerTabBar \
sd/source/ui/dlg/NavigatorChildWindow \
+   sd/source/ui/dlg/NotesChildWindow \
sd/source/ui/dlg/PaneChildWindows \
sd/source/ui/dlg/PaneShells \
sd/source/ui/dlg/SpellDialogChildWindow \
diff --git a/sd/inc/glob.hxx b/sd/inc/glob.hxx
index 6ecfc3fd39ce..8cdfcb18491b 100644
--- a/sd/inc/glob.hxx
+++ b/sd/inc/glob.hxx
@@ -39,6 +39,7 @@
 #define SD_IF_SDDRAWTABLEOBJECTBAR  SFX_INTERFACE_SD_START + 
SfxInterfaceId(27)
 #define SD_IF_SDTOOLPANELPANESHELL  SFX_INTERFACE_SD_START + 
SfxInterfaceId(29)
 #define SD_IF_SDTOOLPANELSHELL  SFX_INTERFACE_SD_START + 
SfxInterfaceId(30)
+#define SD_IF_SDNOTESCHILDWINDOWSHELL   SFX_INTERFACE_SD_START + 
SfxInterfaceId(31)
 
 
 // Object-Ids for StarDraw UserData
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 3e1ddd1542e7..ff7fca3f5447 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -263,6 +263,7 @@
 #define STR_UNDO_HANGULHANJACONVERSION  
NC_("STR_UNDO_HANGULHANJACONVERSION", "Hangul/Hanja Conversion")
 #define STR_LEFT_PANE_IMPRESS_TITLE 
NC_("STR_LEFT_PANE_IMPRESS_TITLE", "Slides")
 #define STR_LEFT_PANE_DRAW_TITLE
NC_("STR_LEFT_PANE_DRAW_TITLE", "Pages")
+#define STR_BOTTOM_NOTES_PANE_TITLE 
NC_("STR_BOTTOM_NOTES_PANE_TITLE", "Notes")
 #define STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION
NC_("STR_TASKPANEL_NOT_AVAILABLE_SUBSTITUTION", "Preview not available")
 #define STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION
NC_("STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION", "Preparing preview")
 #define STR_TASKPANEL_LAYOUT_MENU_TITLE 
NC_("STR_TASKPANEL_LAYOUT_MENU_TITLE", "Layouts")
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index c195869b790e..c97a5d892a83 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -166,6 +167,7 @@ void SdDLL::RegisterControllers(SdModule* pMod)
 ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod);
 ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod);
 ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
+::sd::NotesChildWindow::RegisterChildWindow(false, pMod);
 DevelopmentToolChildWindow::RegisterChildWindow(false, pMod);
 
 ::sd::SdNavigatorWrapper::RegisterChildWindow(false, pMod, 
SfxChildWindowFlags::NEVERHIDE);
diff --git a/sd/source/ui/dlg/NotesChildWindow.cxx 
b/sd/source/ui/dlg/NotesChildWindow.cxx
new file mode 100644
index ..ac26af12eb6b
--- /dev/null
+++ b/sd/source/ui/dlg/NotesChildWindow.cxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * 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/.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+namespace sd
+{
+SFX_IMPL_DOCKINGWINDOW_WITHID(NotesChildWindow, SID_NOTES_WINDOW);
+
+NotesChildWindow::NotesChildWindow(vcl::Window* pParentWindow, sal_uInt16 nId,
+   SfxBindings* pBindings, SfxChildWinInfo* 
pInfo)
+: PaneChildWindow(pParentWindow, nId, pBindings, pInfo, 
STR_BOTTOM_NOTES_PANE_TITLE,
+  SfxChildAlignment::RIGHT)
+{
+}
+
+} // end of namespace ::sd
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx 

[Libreoffice-commits] core.git: Changes to 'feature/cib_contract49b'

2023-11-11 Thread Sarper Akdemir (via logerrit)
New branch 'feature/cib_contract49b' available with the following commits:
commit 2c80d7fbc7c39bf29083b0a9dc278c2f47efdd05
Author: Sarper Akdemir 
Date:   Thu Nov 9 20:18:44 2023 +0300

Edit notes in child window

These are the initial ui bits for testing the feature

Change-Id: Ibc6e8a3f126c443453c5ecab52ba988a4f4f56e6



[Libreoffice-commits] core.git: solenv/gbuild

2023-11-07 Thread Sarper Akdemir (via logerrit)
 solenv/gbuild/extensions/pre_BuildTools.mk |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit dab20fa2f6cc608a3497ff8d7e756806f8a59932
Author: Sarper Akdemir 
AuthorDate: Tue Nov 7 00:20:31 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Nov 7 09:06:33 2023 +0100

specify the reason for listing zxcvbn-c among build tools

Change-Id: I814cebc6e8ca4815c055ed6f524bfebf08611ccc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159017
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/solenv/gbuild/extensions/pre_BuildTools.mk 
b/solenv/gbuild/extensions/pre_BuildTools.mk
index deaaf0b0aff7..c31c809b9993 100644
--- a/solenv/gbuild/extensions/pre_BuildTools.mk
+++ b/solenv/gbuild/extensions/pre_BuildTools.mk
@@ -44,6 +44,8 @@ gb_BUILD_TOOLS_executables_extern = \
 python \
xsltproc \
 
+# zxcvbn-c depends on a generated header by native code, therefore it is built
+# both for the build and the host platform.
 gb_BUILD_TOOLS = \
 $(foreach executable,$(gb_BUILD_TOOLS_executables),$(call 
gb_Executable_get_runtime_dependencies,$(executable))) \
 $(foreach executable,$(gb_BUILD_TOOLS_executables_extern),$(call 
gb_ExternalExecutable_get_dependencies,$(executable))) \


[Libreoffice-commits] core.git: 2 commits - cui/Library_cui.mk cui/source cui/uiconfig include/sal officecfg/registry vcl/osx

2023-11-06 Thread Sarper Akdemir (via logerrit)
 cui/Library_cui.mk |3 
 cui/source/dialogs/passwdomdlg.cxx |  107 +--
 cui/source/inc/PasswordStrength.hxx|   28 ++
 cui/source/inc/passwdomdlg.hxx |3 
 cui/source/util/PasswordStrength.cxx   |   48 
 cui/uiconfig/ui/password.ui|  126 +++--
 include/sal/log-areas.dox  |1 
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   20 ++
 vcl/osx/salnativewidgets.cxx   |   31 +++
 9 files changed, 301 insertions(+), 66 deletions(-)

New commits:
commit 806656ce4b20aa5b096fe3f072060f6302117afc
Author: Sarper Akdemir 
AuthorDate: Thu Oct 26 14:43:59 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Nov 6 09:04:01 2023 +0100

tdf#157518: vcl: add native macOS rendering support for LevelBar control

Uses NSLevelIndicator to render LevelBar control on macOS.
Closely follows the existing implementation for ControlType::Progress

Change-Id: Ibd38e172b8b6297e6322cfe9d5a1b0a6ef0f0656
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158504
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 46d13e7473c6..8a7e81fd5d86 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -194,6 +194,7 @@ bool AquaSalGraphics::isNativeControlSupported(ControlType 
nType, ControlPart nP
 || nPart == ControlPart::MenuItemRadioMark)
 return true;
 break;
+case ControlType::LevelBar:
 case ControlType::Progress:
 case ControlType::IntroProgress:
 if (nPart == ControlPart::Entire)
@@ -611,6 +612,35 @@ bool 
AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType,
 bOK = true;
 }
 break;
+case ControlType::LevelBar:
+{
+NSRect rect = { NSZeroPoint, NSMakeSize(rc.size.width, 
rc.size.height) };
+NSLevelIndicator* pBox = [[NSLevelIndicator alloc] 
initWithFrame:rect];
+[pBox setLevelIndicatorStyle: 
NSLevelIndicatorStyleContinuousCapacity];
+[pBox setMinValue: 0];
+[pBox setMaxValue: rc.size.width];
+[pBox setCriticalValue: rc.size.width * 35.0 / 100.0];
+[pBox setWarningValue: rc.size.width * 70.0 / 100.0];
+[pBox setDoubleValue: aValue.getNumericVal()];
+
+CGContextSaveGState(context);
+CGContextTranslateCTM(context, rc.origin.x, rc.origin.y);
+
+NSGraphicsContext* savedContext = [NSGraphicsContext 
currentContext];
+NSGraphicsContext* graphicsContext = [NSGraphicsContext 
graphicsContextWithCGContext:context flipped:NO];
+[NSGraphicsContext setCurrentContext: graphicsContext];
+
+[pBox drawRect: rect];
+
+[NSGraphicsContext setCurrentContext: savedContext];
+
+CGContextRestoreGState(context);
+
+[pBox release];
+
+bOK = true;
+}
+break;
 case ControlType::Progress:
 case ControlType::IntroProgress:
 {
@@ -1104,6 +1134,7 @@ bool AquaSalGraphics::getNativeControlRegion(ControlType 
nType,
 toReturn = true;
 }
 break;
+case ControlType::LevelBar:
 case ControlType::Progress:
 {
 tools::Rectangle aRect(aCtrlBoundRect);
commit b1e24664de424a626f78b9fe002bf4d47c8907d5
Author: Sarper Akdemir 
AuthorDate: Wed Oct 18 15:55:52 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Nov 6 09:03:47 2023 +0100

tdf#157518: add password policy and strength meter to save with password 
dialog

Introduces new configuration options PasswordPolicy and
PasswordPolicyErrorMessage.

PasswordPolicy takes a regular expression. When set, it only
accepts passwords that match that regular expression.

PasswordPolicyErrorMessage is the label displayed when the
password does not meet the PasswordPolicy.
In the ideal case, it should contain an explainer of the
PasswordPolicy, so the user is aware of the requirements.

Save with password dialog had maximum password length enforcing
bits depending on the requirements of the saved file format.
These are still applicable in combination with the password
policy.

Also introduces a visual password meter under the password
entries. If the password policy isn't satisfied the password
strength meter is capped at 70%.

The entropy bits to password quality is taken as a linear range.
Where the range of [0, 112] entropy bits is mapped to percentage
[0, 

[Libreoffice-commits] core.git: 2 commits - download.lst external/Module_external.mk external/zxcvbn-c include/vcl Makefile.fetch readlicense_oo/license RepositoryExternal.mk solenv/gbuild toolkit/sou

2023-10-30 Thread Sarper Akdemir (via logerrit)
 Makefile.fetch |1 
 RepositoryExternal.mk  |   11 +
 download.lst   |5 ++
 external/Module_external.mk|1 
 external/zxcvbn-c/ExternalProject_zxcvbn-c.mk  |   35 +
 external/zxcvbn-c/Makefile |   14 ++
 external/zxcvbn-c/Module_zxcvbn-c.mk   |   18 
 external/zxcvbn-c/README.md|3 +
 external/zxcvbn-c/StaticLibrary_zxcvbn-c.mk|   26 
 external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk  |   18 
 external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch |   13 ++
 include/vcl/salnativewidgets.hxx   |1 
 include/vcl/status.hxx |2 
 include/vcl/toolkit/prgsbar.hxx|   10 
 include/vcl/weld.hxx   |9 
 readlicense_oo/license/license.xml |   24 +++
 solenv/gbuild/extensions/pre_BuildTools.mk |1 
 toolkit/source/awt/vclxtoolkit.cxx |2 
 vcl/inc/ControlCacheKey.hxx|1 
 vcl/inc/salvtables.hxx |2 
 vcl/source/app/salvtables.cxx  |   24 +++
 vcl/source/control/prgsbar.cxx |   27 -
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx|2 
 vcl/source/gdi/WidgetDefinitionReader.cxx  |1 
 vcl/source/window/builder.cxx  |8 +++
 vcl/source/window/status.cxx   |   22 --
 vcl/unx/gtk3/gtkinst.cxx   |   29 ++
 vcl/win/gdi/salnativewidgets-luna.cxx  |   33 +++-
 28 files changed, 322 insertions(+), 21 deletions(-)

New commits:
commit df79eedf6989ab4c2913a23a7e72079bd719168b
Author: Sarper Akdemir 
AuthorDate: Sun Oct 8 21:51:12 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Oct 30 08:17:18 2023 +0100

tdf#157518: vcl: Introduce vcl control LevelBar

Introduces LevelBar that shares implementation with
Progress(Bar).

LevelBar is to be as a level indicator, e.g. password strength
level. Currently with native backends for gtk and Windows.

Currently, except on gtk - the colors of the bar at different
levels are hardcoded and not dependent on any kind of themeing.

On Windows it follows the styling of progress bar of type "Meter"
according to the uxguide:
https://learn.microsoft.com/en-us/windows/win32/uxguide/progress-bars#meters

Change-Id: Id772cda23615e9582463bf589e4674fd4588c864
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157826
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx
index 907c3b618f88..aa856a16c35d 100644
--- a/include/vcl/salnativewidgets.hxx
+++ b/include/vcl/salnativewidgets.hxx
@@ -92,6 +92,7 @@ enum class ControlType {
 // application but not for the splash
 // screen (used in desktop/)
 IntroProgress  = 132,
+LevelBar   = 133,
 // tool tips
 Tooltip= 140,
 // to draw the implemented theme
diff --git a/include/vcl/status.hxx b/include/vcl/status.hxx
index 4e59481671fd..0c287ddbc1b1 100644
--- a/include/vcl/status.hxx
+++ b/include/vcl/status.hxx
@@ -36,7 +36,7 @@ struct ImplStatusItem;
 void DrawProgress(vcl::Window* pWindow, vcl::RenderContext& rRenderContext, 
const Point& rPos,
 tools::Long nOffset, tools::Long nPrgsWidth, 
tools::Long nPrgsHeight,
 sal_uInt16 nPercent1, sal_uInt16 nPercent2, 
sal_uInt16 nPercentCount,
-const tools::Rectangle& rFramePosSize);
+const tools::Rectangle& rFramePosSize, 
ControlType eControlType);
 
 
 enum class StatusBarItemBits {
diff --git a/include/vcl/toolkit/prgsbar.hxx b/include/vcl/toolkit/prgsbar.hxx
index dd9423178dda..1fcba74fdaba 100644
--- a/include/vcl/toolkit/prgsbar.hxx
+++ b/include/vcl/toolkit/prgsbar.hxx
@@ -52,6 +52,13 @@
 
 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) ProgressBar final : public vcl::Window
 {
+public:
+enum class BarStyle
+{
+Progress,
+Level,
+};
+
 private:
 Point   maPos;
 tools::LongmnPrgsWidth;
@@ -59,6 +66,7 @@ private:
 sal_uInt16  mnPercent;
 sal_uInt16  mnPercentCount;
 boolmbCalcNew;
+BarStylemeBarStyle;
 
 using Window::ImplInit;
 SAL_DLLPRIVATE void ImplInit();
@@ -66,7 +74,7 @@ private:
 SAL_DLLPRIVATE void ImplDrawProgress(vcl::RenderContext& rRenderContext, 
sal_uInt16 nNewPerc);
 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sd/qa

2023-10-23 Thread Sarper Akdemir (via logerrit)
 sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx |binary
 sd/qa/unit/import-tests2.cxx|4 ++--
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4210745f5045958f36dac1c71be7eac3b9cc3f13
Author: Sarper Akdemir 
AuthorDate: Fri Oct 20 12:03:25 2023 +0300
Commit: Xisco Fauli 
CommitDate: Mon Oct 23 11:56:42 2023 +0200

use Liberation Sans instead of Calibri in the test for tdf#144092

based on Stephan Bergmann's point on:


the font used in the test file was Calibri, which likely was
being replaced with the best approximation on a given system.
Changed that to Liberation Sans which is a font that is bundled
with LibreOffice to improve the test's robustness.

Change-Id: I7ff75baeb9259dea244913ca9d5025948291f1e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158234
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins
(cherry picked from commit 676e0527d2f31556eccae314fbb12ce204f02ec7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158277
Reviewed-by: Xisco Fauli 

diff --git a/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx 
b/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx
index c597abf9a620..949a0561b25c 100644
Binary files a/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx and 
b/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 525177ba44da..0ca3513ae00c 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1771,10 +1771,10 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, 
testTdf144092TableHeight)
 uno::Reference xTableShape(getShapeFromPage(0, 0), 
uno::UNO_QUERY);
 
 // Without the accompanying fix in place, this test would have failed with:
-// - Expected: 7208
+// - Expected: 7606
 // - Actual  : 4595
 // i.e. the table height wasn't corrected by expanding less than minimum 
sized rows.
-CPPUNIT_ASSERT_EQUAL(sal_Int32(7208), xTableShape->getSize().Height);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(7606), xTableShape->getSize().Height);
 }
 
 CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf89928BlackWhiteThreshold)


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

2023-10-21 Thread Sarper Akdemir (via logerrit)
 sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx |binary
 sd/qa/unit/import-tests2.cxx|4 ++--
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 676e0527d2f31556eccae314fbb12ce204f02ec7
Author: Sarper Akdemir 
AuthorDate: Fri Oct 20 12:03:25 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Sat Oct 21 22:58:39 2023 +0200

use Liberation Sans instead of Calibri in the test for tdf#144092

based on Stephan Bergmann's point on:


the font used in the test file was Calibri, which likely was
being replaced with the best approximation on a given system.
Changed that to Liberation Sans which is a font that is bundled
with LibreOffice to improve the test's robustness.

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

diff --git a/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx 
b/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx
index c597abf9a620..949a0561b25c 100644
Binary files a/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx and 
b/sd/qa/unit/data/pptx/tdf144092-tableHeight.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 525177ba44da..0ca3513ae00c 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1771,10 +1771,10 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, 
testTdf144092TableHeight)
 uno::Reference xTableShape(getShapeFromPage(0, 0), 
uno::UNO_QUERY);
 
 // Without the accompanying fix in place, this test would have failed with:
-// - Expected: 7208
+// - Expected: 7606
 // - Actual  : 4595
 // i.e. the table height wasn't corrected by expanding less than minimum 
sized rows.
-CPPUNIT_ASSERT_EQUAL(sal_Int32(7208), xTableShape->getSize().Height);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(7606), xTableShape->getSize().Height);
 }
 
 CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf89928BlackWhiteThreshold)


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

2023-09-26 Thread Sarper Akdemir (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit da38a44b2839480cc333c18f312979d61324d6b9
Author: Sarper Akdemir 
AuthorDate: Mon Sep 25 09:26:01 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Sep 26 08:51:50 2023 +0200

WASM: Embind: get rid of redundant EMSCRIPTEN conditional

As suggested by Stephan Bergmann in
https://gerrit.libreoffice.org/c/core/+/156273/comments/4087f8b8_8ab9a1bc

It appears whole thing was redundant since the template specialization of
emscripten::internal::raw_destructor in
codemaker/source/cppumaker/cpputype.cxx:1228.

Likely this bit causes memory leaks when the API is used and it is a
temporary workaround.

Change-Id: Ifb015754f16ddff1065b3285268acf8a339f975b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157234
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 124f323630bf..47b3d8f488a5 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1208,23 +1208,20 @@ void InterfaceType::dumpDeclaration(FileStream & out)
 << ("static inline ::css::uno::Type const & SAL_CALL"
 " static_type(void * = 0);\n\n");
 dec();
-#ifdef EMSCRIPTEN
-out << "#ifndef EMSCRIPTEN\n";
-#endif
 out << "protected:\n";
 inc();
 out << indent() << "~" << id_
 << ("() SAL_NOEXCEPT {} // avoid warnings about virtual members and"
 " non-virtual dtor\n");
-#ifdef EMSCRIPTEN
-out << "#endif\n";
-#endif
 dec();
 out << "};\n\n";
 }
 
 void InterfaceType::dumpEmbindDeclaration(FileStream & out)
 {
+// TODO: This is a temporary workaround that likely causes the Embind UNO
+// bindings to leak memory. Reference counting and cloning mechanisms of
+// Embind should be investigated to figure out what exactly we need here.
 out << "namespace emscripten { namespace internal { \n"
"template<> void raw_destructor<" << 
codemaker::cpp::scopedCppName(u2b(name_))
 << ">(" << codemaker::cpp::scopedCppName(u2b(name_)) << "*){}\n"


[Libreoffice-commits] core.git: codemaker/source desktop/Executable_soffice_bin.mk solenv/gbuild static/README.wasm.md static/source

2023-09-18 Thread Sarper Akdemir (via logerrit)
 codemaker/source/cppumaker/cppuoptions.cxx |   18 +
 codemaker/source/cppumaker/cpputype.cxx|  250 +++--
 codemaker/source/cppumaker/cpputype.hxx|9 
 codemaker/source/cppumaker/dumputils.cxx   |   14 +
 codemaker/source/cppumaker/dumputils.hxx   |3 
 codemaker/source/cppumaker/includes.cxx|   19 -
 codemaker/source/cppumaker/includes.hxx|5 
 desktop/Executable_soffice_bin.mk  |5 
 solenv/gbuild/UnoApi.mk|   17 +
 solenv/gbuild/UnoApiTarget.mk  |   18 +
 solenv/gbuild/platform/unxgcc.mk   |   14 +
 static/README.wasm.md  |   39 +++
 static/source/unoembindhelpers/PrimaryBindings.cxx |  121 ++
 13 files changed, 505 insertions(+), 27 deletions(-)

New commits:
commit 841f898574affb526a516224d7c3db9b137ea62b
Author: Sarper Akdemir 
AuthorDate: Mon Aug 7 14:41:32 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 18 19:59:57 2023 +0200

JavaScript uno bindings for WASM with Embind - first cut

A rough implementation of uno bindings for LOWA using embind.

Adds new parameter '-W' to cppumaker to generate _embind.cxx
files alongside .hdl & .hpp.

For usage examples see static/README.wasm.md

Change-Id: Iee5d05e37bfba8e101c08212b15c05f7f2fa6c33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156273
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index 0a2ad962381a..f4ccf69b1ae7 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -216,6 +216,24 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 
 m_options["-G"] = OString();
 break;
+case 'W': // generate embind javascript bindings for LOWA
+if (av[i][2] != '\0')
+{
+OString tmp("'-W', please check");
+if (i <= ac - 1)
+{
+tmp += OString::Concat(" your input '") + av[i] + 
"'";
+}
+
+throw IllegalArgument(tmp);
+}
+
+if (!isValid("-C") && !isValid("-CS") && !isValid("-L"))
+{
+throw IllegalArgument("'-W' requires '-C' or '-CS' or 
'-L' option");
+}
+m_options["-W"] = OString();
+break;
 case 'X': // support for eXtra type rdbs
 {
 if (av[i][2] == '\0')
diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index bb8e3ed7d33c..cb3422de16d0 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -53,6 +53,8 @@
 namespace
 {
 
+using FileType = codemaker::cppumaker::FileType;
+
 bool isBootstrapType(OUString const & name)
 {
 static char const * const names[] = {
@@ -150,6 +152,17 @@ bool isBootstrapType(OUString const & name)
 return std::any_of(std::begin(names), std::end(names), pred);
 }
 
+OString getFileExtension(FileType eFileType)
+{
+switch(eFileType)
+{
+default:
+case FileType::HDL: return ".hdl";
+case FileType::HPP: return ".hpp";
+case FileType::EMBIND_CXX: return "_embind.cxx";
+}
+}
+
 class CppuType
 {
 public:
@@ -163,7 +176,7 @@ public:
 void dump(CppuOptions const & options);
 
 void dumpFile(
-std::u16string_view uri, std::u16string_view name, bool hpp,
+std::u16string_view uri, std::u16string_view name, FileType eFileType,
 CppuOptions const & options);
 
 void dumpDependedTypes(
@@ -176,6 +189,8 @@ public:
 
 virtual void dumpHppFile(FileStream& o, codemaker::cppumaker::Includes & 
includes) = 0;
 
+virtual void dumpEmbindCppFile(FileStream& o);
+
 OUString dumpHeaderDefine(FileStream& o, std::u16string_view extension) 
const;
 
 void dumpGetCppuType(FileStream & out);
@@ -226,6 +241,8 @@ protected:
 assert(false);// this cannot happen
 }
 
+virtual void dumpEmbindDeclaration(FileStream &) {};
+
 virtual void dumpFiles(OUString const & uri, CppuOptions const & options);
 
 virtual void addLightGetCppuTypeIncludes(
@@ -305,8 +322,10 @@ const
 
 void CppuType::dumpFiles(OUString const & uri, CppuOptions const & options)
 {
-dumpFile(uri, name_, false, options);
-dumpFile(uri, name_, true, options);
+dumpFile(uri, name_, FileType::HDL, options);
+dumpFile(uri, name_, FileType::HPP, options);
+if(options.isValid("-W"))
+dumpFile(uri, name_, FileType::EMBIND_CXX, options);
 }
 
 void 

[Libreoffice-commits] core.git: chart2/source configure.ac sfx2/source

2023-09-18 Thread Sarper Akdemir (via logerrit)
 chart2/source/controller/main/ChartController.cxx |6 ++
 configure.ac  |2 +-
 sfx2/source/control/thumbnailview.cxx |6 ++
 3 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 971425f9b7613183a565e9b4ec5792b3f67bb133
Author: Sarper Akdemir 
AuthorDate: Fri Sep 15 23:30:42 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 18 19:56:50 2023 +0200

fix emscripten build

Change-Id: I15df992e410f741a22d1f140b85e57a97195a5f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157020
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index 7e33f4b0ccef..b4be568b5133 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1528,6 +1528,7 @@ uno::Reference< XAccessible > 
ChartController::CreateAccessible()
 
 void ChartController::impl_invalidateAccessible()
 {
+#if !ENABLE_WASM_STRIP_ACCESSIBILITY
 SolarMutexGuard aGuard;
 auto pChartWindow(GetChartWindow());
 if( pChartWindow )
@@ -1539,9 +1540,11 @@ void ChartController::impl_invalidateAccessible()
 dynamic_cast(*xInit).initialize();
 }
 }
+#endif
 }
 void ChartController::impl_initializeAccessible()
 {
+#if !ENABLE_WASM_STRIP_ACCESSIBILITY
 SolarMutexGuard aGuard;
 auto pChartWindow(GetChartWindow());
 if( !pChartWindow )
@@ -1549,9 +1552,11 @@ void ChartController::impl_initializeAccessible()
 Reference< XInterface > xInit( pChartWindow->GetAccessible(false) );
 if(xInit.is())
 impl_initializeAccessible( dynamic_cast(*xInit) 
);
+#endif
 }
 void ChartController::impl_initializeAccessible( AccessibleChartView& 
rAccChartView )
 {
+#if !ENABLE_WASM_STRIP_ACCESSIBILITY
 uno::Reference< XAccessible > xParent;
 {
 SolarMutexGuard aGuard;
@@ -1565,6 +1570,7 @@ void ChartController::impl_initializeAccessible( 
AccessibleChartView& rAccChartV
 }
 
 rAccChartView.initialize(*this, getChartModel(), m_xChartView, xParent, 
m_xViewWindow);
+#endif
 }
 
 const o3tl::sorted_vector< OUString >& 
ChartController::impl_getAvailableCommands()
diff --git a/configure.ac b/configure.ac
index 899724df2547..0cebc8b88925 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3048,7 +3048,7 @@ fi
 # also work with the default gtk3 plugin.
 if test "$enable_wasm_strip" = "yes"; then
 enable_avmedia=no
-enable_cmis=no
+enable_libcmis=no
 enable_coinmp=no
 enable_cups=no
 test "$_os" = Emscripten && enable_curl=no
diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index 65bc3d878df0..2d4e8bb57611 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -7,6 +7,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
+
 #include 
 #include 
 
@@ -40,7 +42,9 @@
 #include 
 
 #include 
+#if !ENABLE_WASM_STRIP_RECENT
 #include "recentdocsviewitem.hxx"
+#endif
 
 using namespace basegfx;
 using namespace basegfx::utils;
@@ -416,6 +420,7 @@ void ThumbnailView::CalculateItemPositions(bool 
bScrollBarUsed)
 {
 ThumbnailViewItem *const pItem = mFilteredItemList[i];
 
+#if !ENABLE_WASM_STRIP_RECENT
 // tdf#38742 - show pinned items in a separate line
 if (auto const pRecentDocsItem = 
dynamic_cast(pItem))
 {
@@ -431,6 +436,7 @@ void ThumbnailView::CalculateItemPositions(bool 
bScrollBarUsed)
 nCurCount = 0;
 }
 }
+#endif
 
 if ((nCurCount >= nFirstItem) && (nCurCount < nLastItem))
 {


[Libreoffice-commits] core.git: offapi/UnoApi_offapi.mk

2023-09-12 Thread Sarper Akdemir (via logerrit)
 offapi/UnoApi_offapi.mk |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 43df1237a091e2b0f4495d5a7e959f7beaab025d
Author: Sarper Akdemir 
AuthorDate: Tue Sep 12 21:53:25 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Sep 12 23:32:07 2023 +0200

remove repeated idl file in gb_UnoApi_add_idl_files call

XConditionEntry was repeated twice on line 3498 and 3495 of
offapi/UnoApi_offapi.mk

Removed the first one.

Change-Id: I7dd7db3c527a2a6825363ba4fb24eb266f870f53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156857
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index abfbcfb8703d..90753f08384e 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -3492,7 +3492,6 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/sheet,\
XCellSeries \
XColorScaleEntry \
XCompatibilityNames \
-   XConditionEntry \
XConditionalFormat \
XConditionalFormats \
XConditionEntry \


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

2023-09-08 Thread Sarper Akdemir (via logerrit)
 oox/source/drawingml/fillproperties.cxx |4 +++-
 sd/qa/unit/data/pptx/tdf156649.pptx |binary
 sd/qa/unit/export-tests.cxx |   14 ++
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit b0e8ce9967acf3a759e5b85c4a0d16d7dad275fe
Author: Sarper Akdemir 
AuthorDate: Thu Sep 7 13:53:25 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Sep 8 08:58:02 2023 +0200

tdf#156649: oox: correct import alphaModFix for custom shapes

alphaModFix should be imported into PROP_FillTransparency
for custom shapes.

Change-Id: I19621e424a64b097d5e6881877d60de253be636d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156660
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 9f18e7d65f7d..ff78f3183831 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -866,7 +866,9 @@ void GraphicProperties::pushToPropMap( PropertyMap& 
rPropMap, const GraphicHelpe
 
 if ( maBlipProps.moAlphaModFix.has_value() )
 {
-rPropMap.setProperty(PROP_Transparency, static_cast(100 
- (maBlipProps.moAlphaModFix.value() / PER_PERCENT)));
+rPropMap.setProperty(
+mbIsCustomShape ? PROP_FillTransparence : PROP_Transparency,
+static_cast(100 - 
(maBlipProps.moAlphaModFix.value() / PER_PERCENT)));
 }
 }
 rPropMap.setProperty(PROP_GraphicColorMode, eColorMode);
diff --git a/sd/qa/unit/data/pptx/tdf156649.pptx 
b/sd/qa/unit/data/pptx/tdf156649.pptx
new file mode 100644
index ..2b3b12a9a092
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf156649.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 61f6736fc33f..92971d4b4221 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1577,6 +1577,20 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf140714)
 CPPUNIT_ASSERT_EQUAL(OUString{ "com.sun.star.drawing.CustomShape" }, 
xShape->getShapeType());
 }
 
+CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf156649)
+{
+createSdImpressDoc("pptx/tdf156649.pptx");
+saveAndReload("Impress Office Open XML");
+
+auto xShapeProps(getShapeFromPage(0, 0));
+// Without the fix in place, this test would have failed with
+//- Expected: 55
+//- Actual  : 0
+// i.e. alphaModFix wasn't imported as fill transparency for the custom 
shape
+CPPUNIT_ASSERT_EQUAL(sal_Int16(55),
+ 
xShapeProps->getPropertyValue("FillTransparence").get());
+}
+
 CPPUNIT_TEST_FIXTURE(SdExportTest, testMasterPageBackgroundFullSize)
 {
 createSdImpressDoc("odp/background.odp");


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

2023-09-06 Thread Sarper Akdemir (via logerrit)
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit b345df89663a3a69ad55ed80ad9a6cc942786f92
Author: Sarper Akdemir 
AuthorDate: Tue Sep 5 17:41:42 2023 +0300
Commit: Xisco Fauli 
CommitDate: Wed Sep 6 12:32:53 2023 +0200

related tdf#150557: fix unified transparence initialization with alpha

In 98319164284c4a25d6a2313e6b8a35d244d94e91, shadow alpha
was passed in to UnifiedTransparencePrimitive2D instead of
shadow transparence mistakenly.

Fix that and pass shadow transparence instead.

Change-Id: Idabedade5d753961648683869cb077de0e4523eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156573
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit 300dc54b0424add2dbab5443dcbd46ba12f418fc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156594
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 33e42efc6d23..50f66391d95e 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -856,10 +856,8 @@ sal_uInt32 
SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
 if (rShadow.getTransparence() != 0.0)
 {
 Primitive2DContainer aTempContent{ aRetval.back() };
-
-double fShadowAlpha = 1.0 - rShadow.getTransparence();
 aRetval.back() = Primitive2DReference(new 
UnifiedTransparencePrimitive2D(
-std::move(aTempContent), fShadowAlpha));
+std::move(aTempContent), 
rShadow.getTransparence()));
 }
 }
 


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

2023-09-06 Thread Sarper Akdemir (via logerrit)
 svx/qa/unit/table.cxx|   14 ++
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |   13 ++---
 2 files changed, 8 insertions(+), 19 deletions(-)

New commits:
commit d9cd1fe49bd4cf32257508adab11f16f7a4a88f1
Author: Sarper Akdemir 
AuthorDate: Mon Sep 4 18:10:22 2023 +0300
Commit: Xisco Fauli 
CommitDate: Wed Sep 6 11:23:26 2023 +0200

tdf#150557: svx: don't factor in transparence twice for cell shadows

multiplying child transparence with shadow alpha to get the
correct shadow alpha has been incorrect maybe since commits:
7eb4f92ed90e13ce5cbf7286fae623770e71324c,
e735ad1c57cddaf17d6ffc0cf15b5e14fa63c4ad

In ShadowPrimitive2D::create2DDecomposition the
shadow-casting primitive's alpha(mask) itself is already
being taken into account.

Therefore getting cell shadow alpha by multiplying child
transparence with shadow alpha, has the effect of child
transparence being applied twice for the table cell.

Change-Id: I78f9bbfcb0694a86eabc061330677784e887b5dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156528
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit 98319164284c4a25d6a2313e6b8a35d244d94e91)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156591
Reviewed-by: Xisco Fauli 

diff --git a/svx/qa/unit/table.cxx b/svx/qa/unit/table.cxx
index dc3ad1e2bf67..72359dbc7820 100644
--- a/svx/qa/unit/table.cxx
+++ b/svx/qa/unit/table.cxx
@@ -73,17 +73,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTableShadowBlur)
 drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence
 = renderPageToPrimitives(xDrawPage);
 
-// Then make sure that the cell fill part of the shadow is excluded from 
blurring:
+// Then make sure that the cell fill part of the shadow has the expected 
transparency:
 drawinglayer::Primitive2dXmlDump aDumper;
 xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence);
 // Without the accompanying fix in place, this test would have failed with:
-// - number of nodes is incorrect
-// - Expected: 1
-// - Actual  : 0
-// i.e. the shadow itself was not transparent and that resulted in a 
non-transparent rendering
-// as well, while the rendering transparency should be based on the 
transparency of the shadow
-// itself and the transparency of the cell fill.
-assertXPath(pDocument, "//objectinfo/unifiedtransparence[1]", 
"transparence", "80");
+//- Expected: 0
+//- Actual  : 2
+//- In <>, XPath contents of child does not match
+// i.e. the shadow's transparency was miscalculated.
+assertXPathContent(pDocument, "count(//objectinfo/unifiedtransparence)", 
"0");
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testSvxTableControllerSetAttrToSelectedShape)
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index b5df830d73fe..33e42efc6d23 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -850,25 +850,16 @@ sal_uInt32 
SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
 Primitive2DContainer aRetval;
 for (const auto& xChild : rContentForShadow)
 {
-double fChildTransparence = 0.0;
-auto pChild = 
dynamic_cast(xChild.get());
-if (pChild)
-{
-fChildTransparence = 
pChild->getTransparenceForShadow();
-fChildTransparence /= 100;
-}
 aRetval.push_back(Primitive2DReference(
 new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), 
rShadow.getBlur(),
 Primitive2DContainer({ xChild 
};
-if (rShadow.getTransparence() != 0.0 || fChildTransparence != 
0.0)
+if (rShadow.getTransparence() != 0.0)
 {
 Primitive2DContainer aTempContent{ aRetval.back() };
 
-double fChildAlpha = 1.0 - fChildTransparence;
 double fShadowAlpha = 1.0 - rShadow.getTransparence();
-double fTransparence = 1.0 - fChildAlpha * fShadowAlpha;
 aRetval.back() = Primitive2DReference(new 
UnifiedTransparencePrimitive2D(
-std::move(aTempContent), fTransparence));
+std::move(aTempContent), fShadowAlpha));
 }
 }
 


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

2023-09-05 Thread Sarper Akdemir (via logerrit)
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 300dc54b0424add2dbab5443dcbd46ba12f418fc
Author: Sarper Akdemir 
AuthorDate: Tue Sep 5 17:41:42 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Sep 5 22:05:16 2023 +0200

related tdf#150557: fix unified transparence initialization with alpha

In 98319164284c4a25d6a2313e6b8a35d244d94e91, shadow alpha
was passed in to UnifiedTransparencePrimitive2D instead of
shadow transparence mistakenly.

Fix that and pass shadow transparence instead.

Change-Id: Idabedade5d753961648683869cb077de0e4523eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156573
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 33e42efc6d23..50f66391d95e 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -856,10 +856,8 @@ sal_uInt32 
SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
 if (rShadow.getTransparence() != 0.0)
 {
 Primitive2DContainer aTempContent{ aRetval.back() };
-
-double fShadowAlpha = 1.0 - rShadow.getTransparence();
 aRetval.back() = Primitive2DReference(new 
UnifiedTransparencePrimitive2D(
-std::move(aTempContent), fShadowAlpha));
+std::move(aTempContent), 
rShadow.getTransparence()));
 }
 }
 


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

2023-09-05 Thread Sarper Akdemir (via logerrit)
 svx/qa/unit/table.cxx|   14 ++
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |   13 ++---
 2 files changed, 8 insertions(+), 19 deletions(-)

New commits:
commit 98319164284c4a25d6a2313e6b8a35d244d94e91
Author: Sarper Akdemir 
AuthorDate: Mon Sep 4 18:10:22 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Sep 5 13:21:13 2023 +0200

tdf#150557: svx: don't factor in transparence twice for cell shadows

multiplying child transparence with shadow alpha to get the
correct shadow alpha has been incorrect maybe since commits:
7eb4f92ed90e13ce5cbf7286fae623770e71324c,
e735ad1c57cddaf17d6ffc0cf15b5e14fa63c4ad

In ShadowPrimitive2D::create2DDecomposition the
shadow-casting primitive's alpha(mask) itself is already
being taken into account.

Therefore getting cell shadow alpha by multiplying child
transparence with shadow alpha, has the effect of child
transparence being applied twice for the table cell.

Change-Id: I78f9bbfcb0694a86eabc061330677784e887b5dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156528
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/svx/qa/unit/table.cxx b/svx/qa/unit/table.cxx
index dc3ad1e2bf67..72359dbc7820 100644
--- a/svx/qa/unit/table.cxx
+++ b/svx/qa/unit/table.cxx
@@ -73,17 +73,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTableShadowBlur)
 drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence
 = renderPageToPrimitives(xDrawPage);
 
-// Then make sure that the cell fill part of the shadow is excluded from 
blurring:
+// Then make sure that the cell fill part of the shadow has the expected 
transparency:
 drawinglayer::Primitive2dXmlDump aDumper;
 xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence);
 // Without the accompanying fix in place, this test would have failed with:
-// - number of nodes is incorrect
-// - Expected: 1
-// - Actual  : 0
-// i.e. the shadow itself was not transparent and that resulted in a 
non-transparent rendering
-// as well, while the rendering transparency should be based on the 
transparency of the shadow
-// itself and the transparency of the cell fill.
-assertXPath(pDocument, "//objectinfo/unifiedtransparence[1]", 
"transparence", "80");
+//- Expected: 0
+//- Actual  : 2
+//- In <>, XPath contents of child does not match
+// i.e. the shadow's transparency was miscalculated.
+assertXPathContent(pDocument, "count(//objectinfo/unifiedtransparence)", 
"0");
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testSvxTableControllerSetAttrToSelectedShape)
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index b5df830d73fe..33e42efc6d23 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -850,25 +850,16 @@ sal_uInt32 
SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
 Primitive2DContainer aRetval;
 for (const auto& xChild : rContentForShadow)
 {
-double fChildTransparence = 0.0;
-auto pChild = 
dynamic_cast(xChild.get());
-if (pChild)
-{
-fChildTransparence = 
pChild->getTransparenceForShadow();
-fChildTransparence /= 100;
-}
 aRetval.push_back(Primitive2DReference(
 new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), 
rShadow.getBlur(),
 Primitive2DContainer({ xChild 
};
-if (rShadow.getTransparence() != 0.0 || fChildTransparence != 
0.0)
+if (rShadow.getTransparence() != 0.0)
 {
 Primitive2DContainer aTempContent{ aRetval.back() };
 
-double fChildAlpha = 1.0 - fChildTransparence;
 double fShadowAlpha = 1.0 - rShadow.getTransparence();
-double fTransparence = 1.0 - fChildAlpha * fShadowAlpha;
 aRetval.back() = Primitive2DReference(new 
UnifiedTransparencePrimitive2D(
-std::move(aTempContent), fTransparence));
+std::move(aTempContent), fShadowAlpha));
 }
 }
 


[Libreoffice-commits] core.git: 2 commits - filter/source include/sfx2 include/svl include/vcl include/xmloff offapi/com offapi/UnoApi_offapi.mk sfx2/source sfx2/uiconfig vcl/inc vcl/source xmloff/sou

2023-09-04 Thread Sarper Akdemir (via logerrit)
 filter/source/pdf/pdfexport.cxx   |   12 
 include/sfx2/dinfdlg.hxx  |   32 ++
 include/svl/memberid.h|   14 
 include/vcl/pdfwriter.hxx |8 
 include/xmloff/xmltoken.hxx   |4 
 offapi/UnoApi_offapi.mk   |1 
 offapi/com/sun/star/document/XDocumentProperties2.idl |   50 +++
 sfx2/source/dialog/dinfdlg.cxx|  118 +++-
 sfx2/source/doc/SfxDocumentMetaData.cxx   |  135 +
 sfx2/uiconfig/ui/descriptioninfopage.ui   |  260 +-
 vcl/inc/pdf/XmpMetadata.hxx   |9 
 vcl/source/gdi/pdfwriter_impl.cxx |   28 +
 vcl/source/pdf/XmpMetadata.cxx|   84 +
 xmloff/source/core/xmltoken.cxx   |4 
 xmloff/source/token/tokens.txt|4 
 15 files changed, 748 insertions(+), 15 deletions(-)

New commits:
commit b273a0c1527193e21fbd0ccbc23853205f90056b
Author: Sarper Akdemir 
AuthorDate: Thu Aug 31 19:49:42 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 4 20:54:25 2023 +0200

tdf#138792: PDF export: export metadata dc:format

Export application/pdf MIMEType in dc:format

Change-Id: I7cb658c869898df3a9436937329b4082843338bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156507
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx
index 7496ab26e3f5..cb88016365b3 100644
--- a/vcl/source/pdf/XmpMetadata.cxx
+++ b/vcl/source/pdf/XmpMetadata.cxx
@@ -73,6 +73,11 @@ void XmpMetadata::write()
 aXmlWriter.startElement("rdf:Description");
 aXmlWriter.attribute("rdf:about", OString(""));
 aXmlWriter.attribute("xmlns:dc", 
OString("http://purl.org/dc/elements/1.1/;));
+
+aXmlWriter.startElement("dc:format");
+aXmlWriter.content("application/pdf");
+aXmlWriter.endElement();
+
 if (!msTitle.isEmpty())
 {
 // this is according to PDF/A-1, technical corrigendum 1 
(2007-04-01)
commit 0deea02b1da1001fa497dc5afa5e43207af491d5
Author: Sarper Akdemir 
AuthorDate: Sat Aug 19 17:18:50 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 4 20:54:19 2023 +0200

tdf#138792: PDF export: add batch of dublin core attributes

Adds support for exporting, editing in the UI and storage in
ODF for the dublin core attributes listed below.

Contributor (http://purl.org/dc/elements/1.1/contributor)
Coverage (http://purl.org/dc/elements/1.1/coverage)
Identifier (http://purl.org/dc/elements/1.1/identifier)
Publisher (http://purl.org/dc/elements/1.1/publisher)
Relation (http://purl.org/dc/elements/1.1/relation)
Rights (http://purl.org/dc/elements/1.1/rights)
Source (http://purl.org/dc/elements/1.1/source)
Type (http://purl.org/dc/elements/1.1/type)

Introduces XDocumentProperties2 to extend XDocumentProperties interface.

Change-Id: Ie2e0b1fbbbd00b66aef477ba1bf4e4f61c03a3b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156330
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 9b6523448dfb..a9a717a56cc5 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -49,7 +49,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -470,7 +470,7 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 Reference< document::XDocumentPropertiesSupplier > 
xDocumentPropsSupplier( mxSrcDoc, UNO_QUERY );
 if ( xDocumentPropsSupplier.is() )
 {
-Reference< document::XDocumentProperties > xDocumentProps( 
xDocumentPropsSupplier->getDocumentProperties() );
+Reference< document::XDocumentProperties2 > xDocumentProps( 
xDocumentPropsSupplier->getDocumentProperties(), UNO_QUERY );
 if ( xDocumentProps.is() )
 {
 aContext.DocumentInfo.Title = xDocumentProps->getTitle();
@@ -481,6 +481,14 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 = xDocumentProps->getEditingCycles() < 1
   ? xDocumentProps->getCreationDate()
   : xDocumentProps->getModificationDate();
+aContext.DocumentInfo.Contributor = 
xDocumentProps->getContributor();
+aContext.DocumentInfo.Coverage = 
xDocumentProps->getCoverage();
+aContext.DocumentInfo.Identifier = 
xDocumentProps->getIdentifier();
+aContext.DocumentInfo.Publisher = 

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

2023-09-04 Thread Sarper Akdemir (via logerrit)
 vcl/inc/pdf/XmpMetadata.hxx   |1 +
 vcl/source/gdi/pdfwriter_impl.cxx |   32 +---
 vcl/source/pdf/XmpMetadata.cxx|8 +++-
 3 files changed, 29 insertions(+), 12 deletions(-)

New commits:
commit a45f72b8122d3bb4c0d5ac4252cf7e5a25d52291
Author: Sarper Akdemir 
AuthorDate: Thu Aug 31 02:59:51 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 4 20:53:40 2023 +0200

tdf#138792: PDF export: export metadata pdf:PDFVersion

Adds export of pdf:PDFVersion metadata.

Change-Id: Ic4c3eec3672839d0d125b64dfca6149912cd2458
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156329
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/vcl/inc/pdf/XmpMetadata.hxx b/vcl/inc/pdf/XmpMetadata.hxx
index d94d6e690c3c..a144266497cf 100644
--- a/vcl/inc/pdf/XmpMetadata.hxx
+++ b/vcl/inc/pdf/XmpMetadata.hxx
@@ -27,6 +27,7 @@ public:
 OString msAuthor;
 OString msSubject;
 OString msProducer;
+OString msPDFVersion;
 OString msKeywords;
 OString m_sCreatorTool;
 OString m_sCreateDate;
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index def3d4ee3ba5..00b59830f048 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -623,6 +623,25 @@ void appendPdfTimeDate(OStringBuffer & rBuffer,
 }
 }
 
+const char* getPDFVersionStr(PDFWriter::PDFVersion ePDFVersion)
+{
+switch (ePDFVersion)
+{
+case PDFWriter::PDFVersion::PDF_A_1:
+case PDFWriter::PDFVersion::PDF_1_4:
+return "1.4";
+case PDFWriter::PDFVersion::PDF_1_5:
+return "1.5";
+case PDFWriter::PDFVersion::PDF_1_6:
+return "1.6";
+default:
+case PDFWriter::PDFVersion::PDF_A_2:
+case PDFWriter::PDFVersion::PDF_A_3:
+case PDFWriter::PDFVersion::PDF_1_7:
+return "1.7";
+}
+}
+
 } // end namespace
 
 PDFPage::PDFPage( PDFWriterImpl* pWriter, double nPageWidth, double 
nPageHeight, PDFWriter::Orientation eOrientation )
@@ -1295,17 +1314,7 @@ PDFWriterImpl::PDFWriterImpl( const 
PDFWriter::PDFWriterContext& rContext,
 // write header
 OStringBuffer aBuffer( 20 );
 aBuffer.append( "%PDF-" );
-switch( m_aContext.Version )
-{
-case PDFWriter::PDFVersion::PDF_A_1:
-case PDFWriter::PDFVersion::PDF_1_4: aBuffer.append( "1.4" );break;
-case PDFWriter::PDFVersion::PDF_1_5: aBuffer.append( "1.5" );break;
-case PDFWriter::PDFVersion::PDF_1_6: aBuffer.append( "1.6" );break;
-default:
-case PDFWriter::PDFVersion::PDF_A_2:
-case PDFWriter::PDFVersion::PDF_A_3:
-case PDFWriter::PDFVersion::PDF_1_7: aBuffer.append( "1.7" );break;
-}
+aBuffer.append(getPDFVersionStr(m_aContext.Version));
 // append something binary as comment (suggested in PDF Reference)
 aBuffer.append( "\n%\303\244\303\274\303\266\303\237\n" );
 if( !writeBuffer( aBuffer ) )
@@ -5952,6 +5961,7 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
 lcl_assignMeta(m_aContext.DocumentInfo.Author, aMetadata.msAuthor);
 lcl_assignMeta(m_aContext.DocumentInfo.Subject, aMetadata.msSubject);
 lcl_assignMeta(m_aContext.DocumentInfo.Producer, aMetadata.msProducer);
+aMetadata.msPDFVersion = getPDFVersionStr(m_aContext.Version);
 lcl_assignMeta(m_aContext.DocumentInfo.Keywords, aMetadata.msKeywords);
 lcl_assignMeta(m_aContext.DocumentInfo.Creator, 
aMetadata.m_sCreatorTool);
 aMetadata.m_sCreateDate = m_aCreationMetaDateString;
diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx
index 7b0df42dbb92..6dae3b86ebc1 100644
--- a/vcl/source/pdf/XmpMetadata.cxx
+++ b/vcl/source/pdf/XmpMetadata.cxx
@@ -122,7 +122,7 @@ void XmpMetadata::write()
 }
 
 // PDF properties
-if (!msProducer.isEmpty() || !msKeywords.isEmpty())
+if (!msProducer.isEmpty() || !msKeywords.isEmpty() || 
!msPDFVersion.isEmpty())
 {
 aXmlWriter.startElement("rdf:Description");
 aXmlWriter.attribute("rdf:about", OString(""));
@@ -139,6 +139,12 @@ void XmpMetadata::write()
 aXmlWriter.content(msKeywords);
 aXmlWriter.endElement();
 }
+if (!msPDFVersion.isEmpty())
+{
+aXmlWriter.startElement("pdf:PDFVersion");
+aXmlWriter.content(msPDFVersion);
+aXmlWriter.endElement();
+}
 aXmlWriter.endElement();
 }
 


[Libreoffice-commits] core.git: 2 commits - filter/source include/vcl vcl/inc vcl/source

2023-09-04 Thread Sarper Akdemir (via logerrit)
 filter/source/pdf/pdfexport.cxx   |4 
 include/vcl/pdfwriter.hxx |1 +
 vcl/inc/pdf/pdfwriter_impl.hxx|1 +
 vcl/source/gdi/pdfwriter_impl.cxx |   12 ++--
 vcl/source/pdf/XmpMetadata.cxx|8 
 5 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 7803c5749365c6dca6583708c14d6229c9659572
Author: Sarper Akdemir 
AuthorDate: Thu Aug 10 08:49:24 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 4 20:53:27 2023 +0200

tdf#138792: PDF export: export metadata xmp:ModifyDate, xmp:MetadataDate

Export metadata xmp:ModifyDate & xmp:MetadataDate - populate
both with the same information as CreateDate.

Change-Id: I391a72cbe4e7d1ebba5c04c402a68534bbeb4743
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156328
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx
index d4c58c23348b..7b0df42dbb92 100644
--- a/vcl/source/pdf/XmpMetadata.cxx
+++ b/vcl/source/pdf/XmpMetadata.cxx
@@ -155,8 +155,16 @@ void XmpMetadata::write()
 aXmlWriter.startElement("xmp:CreateDate");
 aXmlWriter.content(m_sCreateDate);
 aXmlWriter.endElement();
+
+aXmlWriter.startElement("xmp:ModifyDate");
+aXmlWriter.content(m_sCreateDate);
+aXmlWriter.endElement();
+
+aXmlWriter.startElement("xmp:MetadataDate");
+aXmlWriter.content(m_sCreateDate);
 aXmlWriter.endElement();
 
+aXmlWriter.endElement();
 aXmlWriter.endElement();
 aXmlWriter.endElement();
 aXmlWriter.endDocument();
commit 07ac61f2c67020ad2941462ea7081f06495bcb92
Author: Sarper Akdemir 
AuthorDate: Mon Aug 28 11:16:34 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 4 20:53:17 2023 +0200

tdf#138792: PDF export: fix date of xmp:CreateDate

for pdf export xmp:CreateDate should be the modification
date instead of the creation date.

Change-Id: I2a86f30cb528cb2bd5e0f9e7c9a8a8b8d2993f50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156327
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 8199132b66b4..9b6523448dfb 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -477,6 +477,10 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 aContext.DocumentInfo.Author = xDocumentProps->getAuthor();
 aContext.DocumentInfo.Subject = 
xDocumentProps->getSubject();
 aContext.DocumentInfo.Keywords = 
::comphelper::string::convertCommaSeparated(xDocumentProps->getKeywords());
+aContext.DocumentInfo.ModificationDate
+= xDocumentProps->getEditingCycles() < 1
+  ? xDocumentProps->getCreationDate()
+  : xDocumentProps->getModificationDate();
 }
 }
 
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 796c1f03cd9b..2b62b26b6ef4 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -559,6 +559,7 @@ The following structure describes the permissions used in 
PDF security
 OUString  Author; // document author
 OUString  Subject;// subject
 OUString  Keywords;   // keywords
+css::util::DateTime ModificationDate;
 OUString  Creator;// application that created the 
original document
 OUString  Producer;   // OpenOffice
 };
diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx
index 75f613060c04..b9eaf4686b95 100644
--- a/vcl/inc/pdf/pdfwriter_impl.hxx
+++ b/vcl/inc/pdf/pdfwriter_impl.hxx
@@ -1115,6 +1115,7 @@ i12626
 static void computeDocumentIdentifier( std::vector< sal_uInt8 >& 
o_rIdentifier,
const vcl::PDFWriter::PDFDocInfo& 
i_rDocInfo,
const OString& i_rCString1,
+   const css::util::DateTime& 
rCreationMetaDate,
OString& o_rCString2
   );
 static sal_Int32 computeAccessPermissions( const 
vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 55ed6d514b9d..def3d4ee3ba5 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1375,7 +1375,7 @@ void PDFWriterImpl::setupDocInfo()
 {
 std::vector< sal_uInt8 > aId;
 m_aCreationDateString = PDFWriter::GetDateTime();
-computeDocumentIdentifier( aId, m_aContext.DocumentInfo, 
m_aCreationDateString, m_aCreationMetaDateString );
+computeDocumentIdentifier( 

[Libreoffice-commits] core.git: 2 commits - editeng/source include/editeng sd/source sw/source

2023-08-29 Thread Sarper Akdemir (via logerrit)
 editeng/source/editeng/editview.cxx  |   10 
 editeng/source/editeng/impedit.cxx   |   23 +++
 editeng/source/editeng/impedit.hxx   |2 +
 include/editeng/editview.hxx |2 +
 sd/source/ui/func/fuformatpaintbrush.cxx |   36 +--
 sw/source/uibase/docvw/edtwin.cxx|5 +++-
 6 files changed, 71 insertions(+), 7 deletions(-)

New commits:
commit 5eea6974d937148a9a1f3d078c2174fe8d420d31
Author: Sarper Akdemir 
AuthorDate: Mon Jul 31 17:11:04 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Aug 29 11:06:44 2023 +0200

tdf#103706: tdf#142857: sd: context aware paste for clone format

Introduces selection aware pasting for Impress/Draw's Clone
Format where paragraph properties are applied when the selection
contains a whole paragraph or there's no selection at all (i.e.
clone format applied with just a left click - without drag).

Change-Id: I37e7197580c2b8da333ada1a60408f40f85d7ef5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155108
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 72e9aec2dc3d..72411fab6588 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -316,6 +316,16 @@ bool EditView::HasSelection() const
 return pImpEditView->HasSelection();
 }
 
+bool EditView::IsSelectionFullPara() const
+{
+return pImpEditView->IsSelectionFullPara();
+}
+
+bool EditView::IsSelectionWithinSinglePara() const
+{
+return pImpEditView->IsSelectionInSinglePara();
+}
+
 bool EditView::IsSelectionAtPoint(const Point& rPointPixel)
 {
 return pImpEditView->IsSelectionAtPoint(rPointPixel);
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index f69b0d1cad82..8813376dacdd 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -2049,6 +2049,29 @@ bool ImpEditView::IsInSelection( const EditPaM& rPaM )
 return false;
 }
 
+bool ImpEditView::IsSelectionFullPara() const
+{
+if (!IsSelectionInSinglePara())
+return false;
+
+sal_Int32 nSelectionStartPos = GetEditSelection().Min().GetIndex();
+sal_Int32 nSelectionEndPos = GetEditSelection().Max().GetIndex();
+
+if (nSelectionStartPos > nSelectionEndPos)
+std::swap(nSelectionStartPos, nSelectionEndPos);
+
+if (nSelectionStartPos != 0)
+return false;
+
+const ContentNode* pNode = GetEditSelection().Min().GetNode();
+return pNode->Len() == nSelectionEndPos;
+}
+
+bool ImpEditView::IsSelectionInSinglePara() const
+{
+return GetEditSelection().Min().GetNode() == 
GetEditSelection().Max().GetNode();
+}
+
 void ImpEditView::CreateAnchor()
 {
 pEditEngine->SetInSelectionMode(true);
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 815c42328ba8..2fba7bd778f4 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -420,6 +420,8 @@ public:
 boolIsSelectionAtPoint( const Point& rPosPixel );
 boolIsInSelection( const EditPaM& rPaM );
 
+boolIsSelectionFullPara() const;
+boolIsSelectionInSinglePara() const;
 
 voidSetAnchorMode( EEAnchorMode eMode );
 EEAnchorModeGetAnchorMode() const   { return eAnchorMode; }
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 1ea777eb7d91..c7c7507a9ba8 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -219,6 +219,8 @@ public:
 voidSelectCurrentWord( sal_Int16 nWordType = 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES );
 /// Returns the rectangles of the current selection in TWIPs.
 void GetSelectionRectangles(std::vector& rLogicRects) 
const;
+bool IsSelectionFullPara() const;
+bool IsSelectionWithinSinglePara() const;
 
 boolIsInsertMode() const;
 voidSetInsertMode( bool bInsert );
diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx 
b/sd/source/ui/func/fuformatpaintbrush.cxx
index 40bde764ffaa..0d2b29d33d75 100644
--- a/sd/source/ui/func/fuformatpaintbrush.cxx
+++ b/sd/source/ui/func/fuformatpaintbrush.cxx
@@ -37,6 +37,25 @@
 
 #include 
 
+namespace
+{
+// Paragraph properties are pasted if the selection contains a whole paragraph
+// or there was no selection at all (i.e. just a left click)
+bool ShouldPasteParaFormatPerSelection(const OutlinerView* pOLV)
+{
+if(!pOLV)
+return true;
+
+if(!pOLV->GetEditView().HasSelection())
+return true;
+
+if(!pOLV->GetEditView().IsSelectionWithinSinglePara())
+return true;
+
+return pOLV->GetEditView().IsSelectionFullPara();
+}
+}
+
 namespace sd {
 
 
@@ -165,16 +184,21 @@ bool FuFormatPaintBrush::MouseButtonUp(const MouseEvent& 
rMEvt)
 {
 if( mxItemSet 

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

2023-08-29 Thread Sarper Akdemir (via logerrit)
 sw/source/uibase/docvw/edtwin.cxx   |4 ++--
 sw/source/uibase/uiview/formatclipboard.cxx |   15 +--
 2 files changed, 11 insertions(+), 8 deletions(-)

New commits:
commit e9bb17369dc6fd3064fce55a1afacaacea4faae2
Author: Sarper Akdemir 
AuthorDate: Mon Jul 31 09:15:28 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Aug 29 11:06:27 2023 +0200

related tdf#103706: sw: correct format paintbrush attribute reset

Reset all direct formatting before applying **any** attributes.

For instance, before this patch paragraph font colors were lost
on apply.

Change-Id: I62d202713e60e7e3690c67d63989179c3d5dc900
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155106
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/sw/source/uibase/uiview/formatclipboard.cxx 
b/sw/source/uibase/uiview/formatclipboard.cxx
index 74fd772f5cfa..e722c04e9046 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -450,6 +450,15 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, 
SfxStyleSheetBasePool* pPo
 
 ItemVector aItemVector;
 
+if (m_pItemSet_TextAttr && !( nSelectionType & SelectionType::DrawObject))
+{
+// reset all direct formatting before applying anything
+o3tl::sorted_vector aAttrs;
+for (sal_uInt16 nWhich = RES_CHRATR_BEGIN; nWhich < RES_CHRATR_END; 
nWhich++)
+aAttrs.insert(nWhich);
+rWrtShell.ResetAttr({ aAttrs });
+}
+
 if( nSelectionType & SelectionType::Text )
 {
 // apply the named text and paragraph formatting
@@ -535,12 +544,6 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, 
SfxStyleSheetBasePool* pPo
 // copy the stored automatic text attributes in a temporary 
SfxItemSet
 pTemplateItemSet->Put( *m_pItemSet_TextAttr );
 
-// reset all direct formatting
-o3tl::sorted_vector aAttrs;
-for( sal_uInt16 nWhich = RES_CHRATR_BEGIN; nWhich < 
RES_CHRATR_END; nWhich++ )
-aAttrs.insert( nWhich );
-rWrtShell.ResetAttr( { aAttrs } );
-
 // only attributes that were not apply by named style 
attributes and automatic
 // paragraph attributes should be applied
 lcl_RemoveEqualItems( *pTemplateItemSet, aItemVector );
commit 36aa809fbd3c44da1ed266104f175e8c872d38b3
Author: Sarper Akdemir 
AuthorDate: Thu Jul 27 21:38:34 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Aug 29 11:06:14 2023 +0200

tdf#103706: sw: Revert "Format paintbrush default behaviour"

This reverts commit 1574c76ec20d1da479ed7e9c85a6cefacc132dfe.

Reason for revert: The default behavior should copy *all* formatting.

Change-Id: If3ae81d412374433f2d95a04345c651a788de4f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155103
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index c5cbee04c77f..aa97df53e8ab 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5102,7 +5102,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 SwWrtShell& rWrtShell = m_rView.GetWrtShell();
 SfxStyleSheetBasePool* pPool=nullptr;
 bool bNoCharacterFormats = false;
-bool bNoParagraphFormats = true;
+bool bNoParagraphFormats = false;
 {
 SwDocShell* pDocSh = m_rView.GetDocShell();
 if(pDocSh)
@@ -5113,7 +5113,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 bNoParagraphFormats = false;
 }
 else if( rMEvt.GetModifier() & KEY_MOD1 )
-bNoParagraphFormats = false;
+bNoParagraphFormats = true;
 }
 //execute paste
 pFormatClipboard->Paste( rWrtShell, pPool, bNoCharacterFormats, 
bNoParagraphFormats );


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - drawinglayer/source

2023-07-24 Thread Sarper Akdemir (via logerrit)
 drawinglayer/source/processor2d/hittestprocessor2d.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9ee472895bbebe7d753e37879ec987b07cd11a2c
Author: Sarper Akdemir 
AuthorDate: Fri Jul 21 15:29:17 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Mon Jul 24 09:26:35 2023 +0200

related tdf#152992: fix minor logic error in hittestprocessor2d

Fix logic errors I've missed previously on
(2c8c436c4a8546276e285dd18f3f7ded091a2c4e) where initialization of
aDiscreteHalfLineVector wasn't adapted to new HitTolerancePerAxis in
PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D & 
PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D.

Change-Id: I5d9f0347e489301d7e4f06f98f4a9c9d1385d6d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154717
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit 3dc2f4f0d2a8a7c51d01d29fd55ca9e4e6926596)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154706
Reviewed-by: Thorsten Behrens 

diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx 
b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 77b396f60f5d..b760b24f845a 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -291,7 +291,7 @@ namespace drawinglayer::processor2d
 {
 // for all other B2DLINEJOIN_* do a hairline 
HitTest with expanded tolerance
 const basegfx::B2DVector 
aDiscreteHalfLineVector(getViewInformation2D().getObjectToViewTransformation()
-* 
basegfx::B2DVector(rLineAttribute.getWidth() * 0.5, 0.0));
+* 
basegfx::B2DVector(rLineAttribute.getWidth() * 0.5, rLineAttribute.getWidth() * 
0.5));
 mbHit = checkHairlineHitWithTolerance(
 rPolygonCandidate.getB2DPolygon(),
 getDiscreteHitTolerance() + 
aDiscreteHalfLineVector);
@@ -328,7 +328,7 @@ namespace drawinglayer::processor2d
 }
 
 const basegfx::B2DVector 
aDiscreteHalfLineVector(getViewInformation2D().getObjectToViewTransformation()
-* basegfx::B2DVector(fLogicHitTolerance, 0.0));
+* basegfx::B2DVector(fLogicHitTolerance, 
fLogicHitTolerance));
 
 mbHit = checkHairlineHitWithTolerance(
 rPolygonCandidate.getB2DPolygon(),


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - drawinglayer/source include/drawinglayer

2023-07-24 Thread Sarper Akdemir (via logerrit)
 drawinglayer/source/processor2d/hittestprocessor2d.cxx  |   36 
 include/drawinglayer/processor2d/hittestprocessor2d.hxx |   10 ++--
 2 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit 8224430181eb2255edcb8e73f892313ce9c37168
Author: Sarper Akdemir 
AuthorDate: Fri Jul 21 13:47:21 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Jul 24 09:14:38 2023 +0200

related tdf#152992: rename HitTolerance to HitTolerancePerAxis

Rename ...HitTolerance instances to ...HitTolerancePerAxis as
suggested by Noel on:

https://gerrit.libreoffice.org/c/core/+/154694/2/include/drawinglayer/processor2d/hittestprocessor2d.hxx#45

Change-Id: I9c5b69218a4809f795c9a6324d76b2e2c1b12343
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154716
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit 2acfc1448facebd254bda18b2bf286a29be636a7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154705

diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx 
b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 6e624fa4ef97..77b396f60f5d 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -41,25 +41,25 @@ namespace drawinglayer::processor2d
 {
 HitTestProcessor2D::HitTestProcessor2D(const 
geometry::ViewInformation2D& rViewInformation,
 const basegfx::B2DPoint& rLogicHitPosition,
-const basegfx::B2DVector& rLogicHitTolerance,
+const basegfx::B2DVector& rLogicHitTolerancePerAxis,
 bool bHitTextOnly)
 :   BaseProcessor2D(rViewInformation),
-maDiscreteHitTolerance(rLogicHitTolerance),
+maDiscreteHitTolerancePerAxis(rLogicHitTolerancePerAxis),
 mbCollectHitStack(false),
 mbHit(false),
 mbHitTextOnly(bHitTextOnly)
 {
 // ensure input parameters for hit tolerance is >= 0.0
-if (maDiscreteHitTolerance.getX() < 0.0)
-maDiscreteHitTolerance.setX(0.0);
-if (maDiscreteHitTolerance.getY() < 0.0)
-maDiscreteHitTolerance.setY(0.0);
+if (maDiscreteHitTolerancePerAxis.getX() < 0.0)
+maDiscreteHitTolerancePerAxis.setX(0.0);
+if (maDiscreteHitTolerancePerAxis.getY() < 0.0)
+maDiscreteHitTolerancePerAxis.setY(0.0);
 
-if (!maDiscreteHitTolerance.equalZero())
+if (!maDiscreteHitTolerancePerAxis.equalZero())
 {
 // generate discrete hit tolerance
-maDiscreteHitTolerance
-= getViewInformation2D().getObjectToViewTransformation() * 
rLogicHitTolerance;
+maDiscreteHitTolerancePerAxis
+= getViewInformation2D().getObjectToViewTransformation() * 
rLogicHitTolerancePerAxis;
 }
 
 // generate discrete hit position
@@ -72,7 +72,7 @@ namespace drawinglayer::processor2d
 
 bool HitTestProcessor2D::checkHairlineHitWithTolerance(
 const basegfx::B2DPolygon& rPolygon,
-const basegfx::B2DVector& rDiscreteHitTolerance) const
+const basegfx::B2DVector& rDiscreteHitTolerancePerAxis) const
 {
 basegfx::B2DPolygon aLocalPolygon(rPolygon);
 
aLocalPolygon.transform(getViewInformation2D().getObjectToViewTransformation());
@@ -80,9 +80,9 @@ namespace drawinglayer::processor2d
 // get discrete range
 basegfx::B2DRange aPolygonRange(aLocalPolygon.getB2DRange());
 
-if(rDiscreteHitTolerance.getX() > 0 || 
rDiscreteHitTolerance.getY() > 0)
+if(rDiscreteHitTolerancePerAxis.getX() > 0 || 
rDiscreteHitTolerancePerAxis.getY() > 0)
 {
-aPolygonRange.grow(rDiscreteHitTolerance);
+aPolygonRange.grow(rDiscreteHitTolerancePerAxis);
 }
 
 // do rough range test first
@@ -92,7 +92,7 @@ namespace drawinglayer::processor2d
 return basegfx::utils::isInEpsilonRange(
 aLocalPolygon,
 getDiscreteHitPosition(),
-std::max(rDiscreteHitTolerance.getX(), 
rDiscreteHitTolerance.getY()));
+std::max(rDiscreteHitTolerancePerAxis.getX(), 
rDiscreteHitTolerancePerAxis.getY()));
 }
 
 return false;
@@ -100,7 +100,7 @@ namespace drawinglayer::processor2d
 
 bool HitTestProcessor2D::checkFillHitWithTolerance(
 const basegfx::B2DPolyPolygon& rPolyPolygon,
-const basegfx::B2DVector& rDiscreteHitTolerance) const
+const basegfx::B2DVector& rDiscreteHitTolerancePerAxis) const
 {
 bool bRetval(false);
 basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolyPolygon);
@@ -109,12 +109,12 @@ namespace 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/svx officecfg/registry sd/source svx/source

2023-07-23 Thread Sarper Akdemir (via logerrit)
 include/svx/svddrgv.hxx |4 
 officecfg/registry/schema/org/openoffice/Office/Draw.xcs|7 
 officecfg/registry/schema/org/openoffice/Office/Impress.xcs |7 
 sd/source/ui/app/optsitem.cxx   |  102 +++-
 sd/source/ui/func/fucon3d.cxx   |2 
 sd/source/ui/func/fuconarc.cxx  |2 
 sd/source/ui/func/fuconcs.cxx   |2 
 sd/source/ui/func/fuconrec.cxx  |2 
 sd/source/ui/func/fuconstr.cxx  |4 
 sd/source/ui/func/fuconuno.cxx  |2 
 sd/source/ui/func/fuediglu.cxx  |4 
 sd/source/ui/func/fusel.cxx |6 
 sd/source/ui/func/futext.cxx|   28 +--
 sd/source/ui/func/fuzoom.cxx|2 
 sd/source/ui/inc/fupoor.hxx |1 
 sd/source/ui/inc/optsitem.hxx   |6 
 sd/source/ui/view/drviews5.cxx  |3 
 sd/source/ui/view/frmview.cxx   |1 
 svx/source/svdraw/svddrgv.cxx   |1 
 19 files changed, 121 insertions(+), 65 deletions(-)

New commits:
commit 4c0cda6831d2c401642d6b42c1f596cb68a1cece
Author: Sarper Akdemir 
AuthorDate: Wed Jul 12 17:15:13 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Sun Jul 23 15:19:51 2023 +0200

tdf#50725: sd: add new configuration option DragThresholdPixels

Adds new expert configuration option DragThresholdPixels for
Impress and Draw under Misc/DragThresholdPixels.

Also bumps up the previous hardcoded default
value from 2 to 6.
Assuming this value was set when 640x480 resolution was the
most common resolution, currently scaling the hardcoded
default by 3 makes sense.

(eg. GTK uses 8 pixels as the default)

Change-Id: I35c0eed3ce477685c759f517471ce0bdc8315864
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154379
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Reviewed-by: Thorsten Behrens 
(cherry picked from commit c9da87033fe3d681f35973cc7873644817435e95)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154698
Reviewed-by: Caolán McNamara 

diff --git a/include/svx/svddrgv.hxx b/include/svx/svddrgv.hxx
index 4e47a6bd85ea..2fb7543e0970 100644
--- a/include/svx/svddrgv.hxx
+++ b/include/svx/svddrgv.hxx
@@ -44,6 +44,7 @@ protected:
 tools::RectanglemaDragLimit;
 OUStringmaInsPointUndoStr;
 SdrHdlKind  meDragHdl;
+sal_Int32   mnDragThresholdPixels;
 
 bool mbFramDrag : 1;// currently frame dragging
 bool mbMarkedHitMovesAlways : 1; // Persistent
@@ -112,6 +113,9 @@ public:
 void SetDragWithCopy(bool bOn) { mbDragWithCopy = bOn; }
 bool IsDragWithCopy() const { return mbDragWithCopy; }
 
+void SetDragThresholdPixels(sal_Int32 nDragThresholdPixels) { 
mnDragThresholdPixels = nDragThresholdPixels; }
+sal_Int32 GetDragThresholdPixels() const { return mnDragThresholdPixels; }
+
 void SetInsertGluePoint(bool bOn) { mbInsGluePoint = bOn; }
 bool IsInsertGluePoint() const { return mbInsGluePoint; }
 
diff --git a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
index 91dce3db345d..069479636c8b 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
@@ -308,6 +308,13 @@
 
 true
   
+  
+
+  Defines number of pixels the cursor can move before 
dragging.
+  Drag Threshold
+
+6
+  
   
 
   Defines text editing related configuration items.
diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index cd7f06b87070..adb6d257b01e 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -509,6 +509,13 @@
 
 false
   
+  
+
+  Defines number of pixels the cursor can move before 
dragging.
+  Drag Threshold
+
+6
+  
   
 
   Contains text editing related configuration items.
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 91c0048246e6..fe8bf5ea3b9f 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -426,7 +426,8 @@ SdOptionsMisc::SdOptionsMisc( bool bImpress, bool 
bUseConfig ) :
 
 // The default for 6.1-and-above documents is to use printer-independent
 // formatting.
-mnPrinterIndependentLayout 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - drawinglayer/source include/basegfx include/drawinglayer include/svx sc/source sd/source svx/source

2023-07-22 Thread Sarper Akdemir (via logerrit)
 drawinglayer/source/processor2d/hittestprocessor2d.cxx  |   49 
 include/basegfx/range/Range2D.hxx   |7 ++
 include/drawinglayer/processor2d/hittestprocessor2d.hxx |   10 +--
 include/svx/sdrhittesthelper.hxx|   12 ++-
 sc/source/ui/drawfunc/fupoor.cxx|5 -
 sc/source/ui/drawfunc/fusel2.cxx|5 -
 sc/source/ui/unoobj/viewuno.cxx |5 -
 sd/source/ui/func/fudraw.cxx|   12 +--
 sd/source/ui/func/fusel.cxx |   12 +--
 sd/source/ui/view/sdview3.cxx   |   13 +---
 svx/source/accessibility/GraphCtlAccessibleContext.cxx  |2 
 svx/source/sdr/overlay/overlayobjectlist.cxx|2 
 svx/source/svdraw/sdrhittesthelper.cxx  |   19 ++
 svx/source/svdraw/svdetc.cxx|2 
 svx/source/svdraw/svdmrkv.cxx   |4 -
 svx/source/svdraw/svdobj.cxx|2 
 svx/source/svdraw/svdocapt.cxx  |2 
 svx/source/svdraw/svdoedge.cxx  |   12 +--
 svx/source/svdraw/svdview.cxx   |   25 +---
 19 files changed, 108 insertions(+), 92 deletions(-)

New commits:
commit 79669ba9f03230de616a631e85f9dd6cb7ef117a
Author: Sarper Akdemir 
AuthorDate: Tue Jul 18 16:57:59 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Sat Jul 22 23:43:10 2023 +0200

tdf#152992: for Impress/Draw add horizontal hit tolerance for quick text 
edit

Implements horizontal hit tolerance for quick text edit in Impress & Draw
making it more forgiving. Previously it was required to click exactly on
the glyph to get a direct text cursor.

Refactors hittestprocessor2d so that it now supports pseudo per axis hit
tolerance.
i.e. underlying isInEpsilonRange hit check is still the same utilizing
the larger tolerance of the two per axis tolerance, but the preliminary
check that uses aPolygonRange.grow() and later aPolygonRange.isInside()
now filters hit misses out with respect to the per axis hit tolerance.

Utilizes hittestprocessor2d's new per axis tolerance to introduce hit
tolerance for quick text edit, making it similar to TextEdit mode hit
tolerance which only has horizontal tolerance.

Fixes wrong use of BoundRect hit to determine text frame border hits.
Which previously only made sense for TextFrame borders, and was mostly
useless for shapes with text inside.

Change-Id: I749e63752da05b01270bfcab2632c41879a848ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154640
Reviewed-by: Heiko Tietze 
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 389454dcba63565690d84d693d1d43c1b95930c3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154694

diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx 
b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 9af3504a5113..6e624fa4ef97 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -41,27 +41,25 @@ namespace drawinglayer::processor2d
 {
 HitTestProcessor2D::HitTestProcessor2D(const 
geometry::ViewInformation2D& rViewInformation,
 const basegfx::B2DPoint& rLogicHitPosition,
-double fLogicHitTolerance,
+const basegfx::B2DVector& rLogicHitTolerance,
 bool bHitTextOnly)
 :   BaseProcessor2D(rViewInformation),
-mfDiscreteHitTolerance(0.0),
+maDiscreteHitTolerance(rLogicHitTolerance),
 mbCollectHitStack(false),
 mbHit(false),
 mbHitTextOnly(bHitTextOnly)
 {
-// init hit tolerance
-mfDiscreteHitTolerance = fLogicHitTolerance;
+// ensure input parameters for hit tolerance is >= 0.0
+if (maDiscreteHitTolerance.getX() < 0.0)
+maDiscreteHitTolerance.setX(0.0);
+if (maDiscreteHitTolerance.getY() < 0.0)
+maDiscreteHitTolerance.setY(0.0);
 
-if(basegfx::fTools::less(mfDiscreteHitTolerance, 0.0))
-{
-// ensure input parameter for hit tolerance is >= 0.0
-mfDiscreteHitTolerance = 0.0;
-}
-else if(basegfx::fTools::more(mfDiscreteHitTolerance, 0.0))
+if (!maDiscreteHitTolerance.equalZero())
 {
 // generate discrete hit tolerance
-mfDiscreteHitTolerance = 
(getViewInformation2D().getObjectToViewTransformation()
-* basegfx::B2DVector(mfDiscreteHitTolerance, 
0.0)).getLength();
+maDiscreteHitTolerance
+= getViewInformation2D().getObjectToViewTransformation() * 
rLogicHitTolerance;

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

2023-07-21 Thread Sarper Akdemir (via logerrit)
 drawinglayer/source/processor2d/hittestprocessor2d.cxx  |   40 
 include/drawinglayer/processor2d/hittestprocessor2d.hxx |   10 ++--
 2 files changed, 25 insertions(+), 25 deletions(-)

New commits:
commit 3dc2f4f0d2a8a7c51d01d29fd55ca9e4e6926596
Author: Sarper Akdemir 
AuthorDate: Fri Jul 21 15:29:17 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Jul 21 18:26:10 2023 +0200

related tdf#152992: fix minor logic error in hittestprocessor2d

Fix logic errors I've missed previously on
(2c8c436c4a8546276e285dd18f3f7ded091a2c4e) where initialization of
aDiscreteHalfLineVector wasn't adapted to new HitTolerancePerAxis in
PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D & 
PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D.

Change-Id: I5d9f0347e489301d7e4f06f98f4a9c9d1385d6d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154717
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx 
b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 77b396f60f5d..b760b24f845a 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -291,7 +291,7 @@ namespace drawinglayer::processor2d
 {
 // for all other B2DLINEJOIN_* do a hairline 
HitTest with expanded tolerance
 const basegfx::B2DVector 
aDiscreteHalfLineVector(getViewInformation2D().getObjectToViewTransformation()
-* 
basegfx::B2DVector(rLineAttribute.getWidth() * 0.5, 0.0));
+* 
basegfx::B2DVector(rLineAttribute.getWidth() * 0.5, rLineAttribute.getWidth() * 
0.5));
 mbHit = checkHairlineHitWithTolerance(
 rPolygonCandidate.getB2DPolygon(),
 getDiscreteHitTolerance() + 
aDiscreteHalfLineVector);
@@ -328,7 +328,7 @@ namespace drawinglayer::processor2d
 }
 
 const basegfx::B2DVector 
aDiscreteHalfLineVector(getViewInformation2D().getObjectToViewTransformation()
-* basegfx::B2DVector(fLogicHitTolerance, 0.0));
+* basegfx::B2DVector(fLogicHitTolerance, 
fLogicHitTolerance));
 
 mbHit = checkHairlineHitWithTolerance(
 rPolygonCandidate.getB2DPolygon(),
commit 2acfc1448facebd254bda18b2bf286a29be636a7
Author: Sarper Akdemir 
AuthorDate: Fri Jul 21 13:47:21 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Jul 21 18:25:59 2023 +0200

related tdf#152992: rename HitTolerance to HitTolerancePerAxis

Rename ...HitTolerance instances to ...HitTolerancePerAxis as
suggested by Noel on:

https://gerrit.libreoffice.org/c/core/+/154694/2/include/drawinglayer/processor2d/hittestprocessor2d.hxx#45

Change-Id: I9c5b69218a4809f795c9a6324d76b2e2c1b12343
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154716
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx 
b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 6e624fa4ef97..77b396f60f5d 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -41,25 +41,25 @@ namespace drawinglayer::processor2d
 {
 HitTestProcessor2D::HitTestProcessor2D(const 
geometry::ViewInformation2D& rViewInformation,
 const basegfx::B2DPoint& rLogicHitPosition,
-const basegfx::B2DVector& rLogicHitTolerance,
+const basegfx::B2DVector& rLogicHitTolerancePerAxis,
 bool bHitTextOnly)
 :   BaseProcessor2D(rViewInformation),
-maDiscreteHitTolerance(rLogicHitTolerance),
+maDiscreteHitTolerancePerAxis(rLogicHitTolerancePerAxis),
 mbCollectHitStack(false),
 mbHit(false),
 mbHitTextOnly(bHitTextOnly)
 {
 // ensure input parameters for hit tolerance is >= 0.0
-if (maDiscreteHitTolerance.getX() < 0.0)
-maDiscreteHitTolerance.setX(0.0);
-if (maDiscreteHitTolerance.getY() < 0.0)
-maDiscreteHitTolerance.setY(0.0);
+if (maDiscreteHitTolerancePerAxis.getX() < 0.0)
+maDiscreteHitTolerancePerAxis.setX(0.0);
+if (maDiscreteHitTolerancePerAxis.getY() < 0.0)
+maDiscreteHitTolerancePerAxis.setY(0.0);
 
-if (!maDiscreteHitTolerance.equalZero())
+if (!maDiscreteHitTolerancePerAxis.equalZero())
 {
 // generate discrete hit tolerance
-maDiscreteHitTolerance
-= getViewInformation2D().getObjectToViewTransformation() 

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

2023-07-21 Thread Sarper Akdemir (via logerrit)
 include/svx/svddrgv.hxx |4 
 officecfg/registry/schema/org/openoffice/Office/Draw.xcs|7 
 officecfg/registry/schema/org/openoffice/Office/Impress.xcs |7 
 sd/source/ui/app/optsitem.cxx   |  102 +++-
 sd/source/ui/func/fucon3d.cxx   |2 
 sd/source/ui/func/fuconarc.cxx  |2 
 sd/source/ui/func/fuconcs.cxx   |2 
 sd/source/ui/func/fuconrec.cxx  |2 
 sd/source/ui/func/fuconstr.cxx  |4 
 sd/source/ui/func/fuconuno.cxx  |2 
 sd/source/ui/func/fuediglu.cxx  |4 
 sd/source/ui/func/fusel.cxx |6 
 sd/source/ui/func/futext.cxx|   10 -
 sd/source/ui/func/fuzoom.cxx|2 
 sd/source/ui/inc/fupoor.hxx |1 
 sd/source/ui/inc/optsitem.hxx   |6 
 sd/source/ui/view/drviews5.cxx  |3 
 sd/source/ui/view/frmview.cxx   |1 
 svx/source/svdraw/svddrgv.cxx   |1 
 19 files changed, 111 insertions(+), 57 deletions(-)

New commits:
commit 83f7c6fe5bb233fa9827ff968710822b95562075
Author: Sarper Akdemir 
AuthorDate: Wed Jul 12 17:15:13 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Fri Jul 21 14:32:16 2023 +0200

tdf#50725: sd: add new configuration option DragThresholdPixels

Adds new expert configuration option DragThresholdPixels for
Impress and Draw under Misc/DragThresholdPixels.

Also bumps up the previous hardcoded default
value from 2 to 6.
Assuming this value was set when 640x480 resolution was the
most common resolution, currently scaling the hardcoded
default by 3 makes sense.

(eg. GTK uses 8 pixels as the default)

Change-Id: I35c0eed3ce477685c759f517471ce0bdc8315864
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154379
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Reviewed-by: Thorsten Behrens 

diff --git a/include/svx/svddrgv.hxx b/include/svx/svddrgv.hxx
index 4e47a6bd85ea..2fb7543e0970 100644
--- a/include/svx/svddrgv.hxx
+++ b/include/svx/svddrgv.hxx
@@ -44,6 +44,7 @@ protected:
 tools::RectanglemaDragLimit;
 OUStringmaInsPointUndoStr;
 SdrHdlKind  meDragHdl;
+sal_Int32   mnDragThresholdPixels;
 
 bool mbFramDrag : 1;// currently frame dragging
 bool mbMarkedHitMovesAlways : 1; // Persistent
@@ -112,6 +113,9 @@ public:
 void SetDragWithCopy(bool bOn) { mbDragWithCopy = bOn; }
 bool IsDragWithCopy() const { return mbDragWithCopy; }
 
+void SetDragThresholdPixels(sal_Int32 nDragThresholdPixels) { 
mnDragThresholdPixels = nDragThresholdPixels; }
+sal_Int32 GetDragThresholdPixels() const { return mnDragThresholdPixels; }
+
 void SetInsertGluePoint(bool bOn) { mbInsGluePoint = bOn; }
 bool IsInsertGluePoint() const { return mbInsGluePoint; }
 
diff --git a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
index 91dce3db345d..069479636c8b 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
@@ -308,6 +308,13 @@
 
 true
   
+  
+
+  Defines number of pixels the cursor can move before 
dragging.
+  Drag Threshold
+
+6
+  
   
 
   Defines text editing related configuration items.
diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index cd7f06b87070..adb6d257b01e 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -509,6 +509,13 @@
 
 false
   
+  
+
+  Defines number of pixels the cursor can move before 
dragging.
+  Drag Threshold
+
+6
+  
   
 
   Contains text editing related configuration items.
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 91c0048246e6..fe8bf5ea3b9f 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -426,7 +426,8 @@ SdOptionsMisc::SdOptionsMisc( bool bImpress, bool 
bUseConfig ) :
 
 // The default for 6.1-and-above documents is to use printer-independent
 // formatting.
-mnPrinterIndependentLayout (1)
+mnPrinterIndependentLayout (1),
+mnDragThresholdPixels(6)
 {
 EnableModify( true );
 }
@@ -461,7 +462,8 @@ bool SdOptionsMisc::operator==( const 

[Libreoffice-commits] core.git: drawinglayer/source include/basegfx include/drawinglayer include/svx sc/source sd/source svx/source

2023-07-20 Thread Sarper Akdemir (via logerrit)
 drawinglayer/source/processor2d/hittestprocessor2d.cxx  |   49 
 include/basegfx/range/Range2D.hxx   |7 ++
 include/drawinglayer/processor2d/hittestprocessor2d.hxx |   10 +--
 include/svx/sdrhittesthelper.hxx|   12 ++-
 sc/source/ui/drawfunc/fupoor.cxx|5 -
 sc/source/ui/drawfunc/fusel2.cxx|5 -
 sc/source/ui/unoobj/viewuno.cxx |5 -
 sd/source/ui/func/fudraw.cxx|   12 +--
 sd/source/ui/func/fusel.cxx |   12 +--
 sd/source/ui/view/sdview3.cxx   |   13 +---
 svx/source/accessibility/GraphCtlAccessibleContext.cxx  |2 
 svx/source/sdr/overlay/overlayobjectlist.cxx|2 
 svx/source/svdraw/sdrhittesthelper.cxx  |   19 ++
 svx/source/svdraw/svdetc.cxx|2 
 svx/source/svdraw/svdmrkv.cxx   |4 -
 svx/source/svdraw/svdobj.cxx|2 
 svx/source/svdraw/svdocapt.cxx  |2 
 svx/source/svdraw/svdoedge.cxx  |   12 +--
 svx/source/svdraw/svdview.cxx   |   25 +---
 19 files changed, 108 insertions(+), 92 deletions(-)

New commits:
commit 2c8c436c4a8546276e285dd18f3f7ded091a2c4e
Author: Sarper Akdemir 
AuthorDate: Tue Jul 18 16:57:59 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Fri Jul 21 01:37:18 2023 +0200

tdf#152992: for Impress/Draw add horizontal hit tolerance for quick text 
edit

Implements horizontal hit tolerance for quick text edit in Impress & Draw
making it more forgiving. Previously it was required to click exactly on
the glyph to get a direct text cursor.

Refactors hittestprocessor2d so that it now supports pseudo per axis hit
tolerance.
i.e. underlying isInEpsilonRange hit check is still the same utilizing
the larger tolerance of the two per axis tolerance, but the preliminary
check that uses aPolygonRange.grow() and later aPolygonRange.isInside()
now filters hit misses out with respect to the per axis hit tolerance.

Utilizes hittestprocessor2d's new per axis tolerance to introduce hit
tolerance for quick text edit, making it similar to TextEdit mode hit
tolerance which only has horizontal tolerance.

Fixes wrong use of BoundRect hit to determine text frame border hits.
Which previously only made sense for TextFrame borders, and was mostly
useless for shapes with text inside.

Change-Id: I749e63752da05b01270bfcab2632c41879a848ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154640
Reviewed-by: Heiko Tietze 
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx 
b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 9af3504a5113..6e624fa4ef97 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -41,27 +41,25 @@ namespace drawinglayer::processor2d
 {
 HitTestProcessor2D::HitTestProcessor2D(const 
geometry::ViewInformation2D& rViewInformation,
 const basegfx::B2DPoint& rLogicHitPosition,
-double fLogicHitTolerance,
+const basegfx::B2DVector& rLogicHitTolerance,
 bool bHitTextOnly)
 :   BaseProcessor2D(rViewInformation),
-mfDiscreteHitTolerance(0.0),
+maDiscreteHitTolerance(rLogicHitTolerance),
 mbCollectHitStack(false),
 mbHit(false),
 mbHitTextOnly(bHitTextOnly)
 {
-// init hit tolerance
-mfDiscreteHitTolerance = fLogicHitTolerance;
+// ensure input parameters for hit tolerance is >= 0.0
+if (maDiscreteHitTolerance.getX() < 0.0)
+maDiscreteHitTolerance.setX(0.0);
+if (maDiscreteHitTolerance.getY() < 0.0)
+maDiscreteHitTolerance.setY(0.0);
 
-if(basegfx::fTools::less(mfDiscreteHitTolerance, 0.0))
-{
-// ensure input parameter for hit tolerance is >= 0.0
-mfDiscreteHitTolerance = 0.0;
-}
-else if(basegfx::fTools::more(mfDiscreteHitTolerance, 0.0))
+if (!maDiscreteHitTolerance.equalZero())
 {
 // generate discrete hit tolerance
-mfDiscreteHitTolerance = 
(getViewInformation2D().getObjectToViewTransformation()
-* basegfx::B2DVector(mfDiscreteHitTolerance, 
0.0)).getLength();
+maDiscreteHitTolerance
+= getViewInformation2D().getObjectToViewTransformation() * 
rLogicHitTolerance;
 }
 
 // generate discrete hit position
@@ -74,7 +72,7 @@ namespace drawinglayer::processor2d
 
 bool 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - vcl/win

2023-07-18 Thread Sarper Akdemir (via logerrit)
 vcl/win/window/salframe.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 44d41ab98f5210a37cbcd04819a38c08a01464d4
Author: Sarper Akdemir 
AuthorDate: Fri Jul 14 18:04:35 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Jul 18 10:55:17 2023 +0200

tdf#90023: vcl: fix tooltip displaying over two monitors on Windows

To determine the WorkArea correctly in ImplSalGetWorkArea,
pass in the mouse pointer as pParentRect.

Similarly to how it has been done on:
vcl/win/window/salframe.cxx:1393

Change-Id: I43123be315c5ea146c118e8e2a582ceaaab0a35e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154442
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit dc5163af166cb2afb9811dbf0443e1fcceafbb9a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154463
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 2d3892f2bc51390825d6775c5f193c4864005a06)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154466

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 5f1961a7f5d6..6ab7bc61d673 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -1595,7 +1595,14 @@ void WinSalFrame::SetPluginParent( SystemParentData* 
pNewParent )
 void WinSalFrame::GetWorkArea( tools::Rectangle  )
 {
 RECT aRect;
-ImplSalGetWorkArea( mhWnd, , nullptr );
+
+// pass cursor's position to ImplSalGetWorkArea to determine work area on
+// multi monitor setups correctly.
+POINT aPoint;
+GetCursorPos();
+RECT aRect2{ aPoint.x, aPoint.y, aPoint.x + 2, aPoint.y + 2 };
+
+ImplSalGetWorkArea( mhWnd, ,  );
 rRect.SetLeft( aRect.left );
 rRect.SetRight( aRect.right-1 );
 rRect.SetTop( aRect.top );


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - vcl/win

2023-07-17 Thread Sarper Akdemir (via logerrit)
 vcl/win/window/salframe.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 2d3892f2bc51390825d6775c5f193c4864005a06
Author: Sarper Akdemir 
AuthorDate: Fri Jul 14 18:04:35 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Mon Jul 17 13:18:22 2023 +0200

tdf#90023: vcl: fix tooltip displaying over two monitors on Windows

To determine the WorkArea correctly in ImplSalGetWorkArea,
pass in the mouse pointer as pParentRect.

Similarly to how it has been done on:
vcl/win/window/salframe.cxx:1393

Change-Id: I43123be315c5ea146c118e8e2a582ceaaab0a35e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154442
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit dc5163af166cb2afb9811dbf0443e1fcceafbb9a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154463
Reviewed-by: Thorsten Behrens 

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 2e60f38c1f11..c911fff0840f 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -1590,7 +1590,14 @@ void WinSalFrame::SetPluginParent( SystemParentData* 
pNewParent )
 void WinSalFrame::GetWorkArea( tools::Rectangle  )
 {
 RECT aRect;
-ImplSalGetWorkArea( mhWnd, , nullptr );
+
+// pass cursor's position to ImplSalGetWorkArea to determine work area on
+// multi monitor setups correctly.
+POINT aPoint;
+GetCursorPos();
+RECT aRect2{ aPoint.x, aPoint.y, aPoint.x + 2, aPoint.y + 2 };
+
+ImplSalGetWorkArea( mhWnd, ,  );
 rRect.SetLeft( aRect.left );
 rRect.SetRight( aRect.right-1 );
 rRect.SetTop( aRect.top );


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

2023-07-17 Thread Sarper Akdemir (via logerrit)
 vcl/win/window/salframe.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit dc5163af166cb2afb9811dbf0443e1fcceafbb9a
Author: Sarper Akdemir 
AuthorDate: Fri Jul 14 18:04:35 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Jul 17 10:09:04 2023 +0200

tdf#90023: vcl: fix tooltip displaying over two monitors on Windows

To determine the WorkArea correctly in ImplSalGetWorkArea,
pass in the mouse pointer as pParentRect.

Similarly to how it has been done on:
vcl/win/window/salframe.cxx:1393

Change-Id: I43123be315c5ea146c118e8e2a582ceaaab0a35e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154442
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 2e60f38c1f11..c911fff0840f 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -1590,7 +1590,14 @@ void WinSalFrame::SetPluginParent( SystemParentData* 
pNewParent )
 void WinSalFrame::GetWorkArea( tools::Rectangle  )
 {
 RECT aRect;
-ImplSalGetWorkArea( mhWnd, , nullptr );
+
+// pass cursor's position to ImplSalGetWorkArea to determine work area on
+// multi monitor setups correctly.
+POINT aPoint;
+GetCursorPos();
+RECT aRect2{ aPoint.x, aPoint.y, aPoint.x + 2, aPoint.y + 2 };
+
+ImplSalGetWorkArea( mhWnd, ,  );
 rRect.SetLeft( aRect.left );
 rRect.SetRight( aRect.right-1 );
 rRect.SetTop( aRect.top );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svx/qa svx/source

2023-05-12 Thread Sarper Akdemir (via logerrit)
 svx/qa/unit/data/tdf150020-shadow-alignment.pptx |binary
 svx/qa/unit/sdr.cxx  |   81 ++-
 svx/source/table/viewcontactoftableobj.cxx   |   54 ---
 3 files changed, 81 insertions(+), 54 deletions(-)

New commits:
commit 9fe935c22a7791effe7a4a40126a43bd83948990
Author: Sarper Akdemir 
AuthorDate: Wed Apr 19 15:17:27 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri May 12 12:27:41 2023 +0200

tdf#150020: pass transform and scale matrix for the table shadow primitive

Shadow scaling related bits in createEmbeddedShadowPrimitive, requires
the ObjectMatrix with scale and translate.

Pass these in for table shadow creation too.

Change-Id: I28c30fe49d3c90e3ca03fb5294ca97eb5ba22773
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150639
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit fcf776a09a2c5cd692480c8ec4a678e3d04739c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151613
Tested-by: Jenkins CollaboraOffice 

diff --git a/svx/qa/unit/data/tdf150020-shadow-alignment.pptx 
b/svx/qa/unit/data/tdf150020-shadow-alignment.pptx
index caba1a122da5..0002667bd4d9 100644
Binary files a/svx/qa/unit/data/tdf150020-shadow-alignment.pptx and 
b/svx/qa/unit/data/tdf150020-shadow-alignment.pptx differ
diff --git a/svx/qa/unit/sdr.cxx b/svx/qa/unit/sdr.cxx
index b98df8b58041..4d6c4226d11b 100644
--- a/svx/qa/unit/sdr.cxx
+++ b/svx/qa/unit/sdr.cxx
@@ -85,46 +85,67 @@ CPPUNIT_TEST_FIXTURE(SdrTest, testShadowAlignment)
 loadFromURL(u"tdf150020-shadow-alignment.pptx");
 
 uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
-uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
- uno::UNO_QUERY);
-drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence
-= renderPageToPrimitives(xDrawPage);
+{
+// Page 1 contains 9 shapes with each shadow alignment
+uno::Reference xDrawPage(
+xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
+drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence
+= renderPageToPrimitives(xDrawPage);
 
-// Examine the created primitives.
-drawinglayer::Primitive2dXmlDump aDumper;
-xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence);
+// Examine the created primitives.
+drawinglayer::Primitive2dXmlDump aDumper;
+xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence);
 
-// Without the accompanying fix in place, this test would have failed with:
-// - Expected: -567
-// - Actual  : 162
-// - In <>, attribute 'xy13' of '(//shadow/transform)[1]' incorrect value.
-// i.e. shadow alignment was ignored while scaling the shadow.
-assertXPath(pDocument, "(//shadow/transform)[1]", "xy13", "-567");
-assertXPath(pDocument, "(//shadow/transform)[1]", "xy23", "162");
+// Without the accompanying fix in place, this test would have failed 
with:
+// - Expected: -567
+// - Actual  : 162
+// - In <>, attribute 'xy13' of '(//shadow/transform)[1]' incorrect 
value.
+// i.e. shadow alignment was ignored while scaling the shadow.
+assertXPath(pDocument, "(//shadow/transform)[1]", "xy13", "-567");
+assertXPath(pDocument, "(//shadow/transform)[1]", "xy23", "162");
 
-assertXPath(pDocument, "(//shadow/transform)[2]", "xy13", "-1794");
-assertXPath(pDocument, "(//shadow/transform)[2]", "xy23", "162");
+assertXPath(pDocument, "(//shadow/transform)[2]", "xy13", "-1794");
+assertXPath(pDocument, "(//shadow/transform)[2]", "xy23", "162");
 
-assertXPath(pDocument, "(//shadow/transform)[3]", "xy13", "-3021");
-assertXPath(pDocument, "(//shadow/transform)[3]", "xy23", "161");
+assertXPath(pDocument, "(//shadow/transform)[3]", "xy13", "-3021");
+assertXPath(pDocument, "(//shadow/transform)[3]", "xy23", "161");
 
-assertXPath(pDocument, "(//shadow/transform)[4]", "xy13", "-567");
-assertXPath(pDocument, "(//shadow/transform)[4]", "xy23", "-749");
+assertXPath(pDocument, "(//shadow/transform)[4]", "xy13", "-567");
+assertXPath(pDocument, "(//shadow/transform)[4]", "xy23", "-749");
 
-assertXPath(pDocument, "(//shadow/transform)[5]", "xy13", "-3021");
-assertXPath(pDocument, "(//shadow/transform)[5]", "xy23", "-750");
+assertXPath(pDocument, "(//shadow/transform)[5]", "xy13", "-3021");
+assertXPath(pDocument, "(//shadow/transform)[5]", "xy23", "-750");
 
-assertXPath(pDocument, "(//shadow/transform)[6]", "xy13", "-566");
-assertXPath(pDocument, "(//shadow/transform)[6]", "xy23", "-1691");
+assertXPath(pDocument, "(//shadow/transform)[6]", "xy13", "-566");
+assertXPath(pDocument, "(//shadow/transform)[6]", "xy23", 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - drawinglayer/source include/docmodel include/drawinglayer include/editeng include/svx oox/source svx/Library_svxcore.mk svx/qa svx/

2023-05-12 Thread Sarper Akdemir (via logerrit)
 drawinglayer/source/attribute/sdrshadowattribute.cxx  |   13 
 include/docmodel/theme/FormatScheme.hxx   |2 
 include/drawinglayer/attribute/sdrshadowattribute.hxx |6 ++
 include/editeng/unoprnms.hxx  |1 
 include/svx/RectangleAlignmentItem.hxx|   42 
 include/svx/svddef.hxx|4 +
 include/svx/unoshprp.hxx  |3 -
 oox/source/drawingml/effectproperties.cxx |5 +
 oox/source/drawingml/effectproperties.hxx |5 +
 oox/source/drawingml/effectpropertiescontext.cxx  |1 
 oox/source/token/properties.txt   |1 
 svx/Library_svxcore.mk|1 
 svx/qa/unit/data/tdf150020-shadow-alignment.pptx  |binary
 svx/qa/unit/sdr.cxx   |   47 ++
 svx/source/items/RectangleAlignmentItem.cxx   |   31 +++
 svx/source/sdr/primitive2d/sdrattributecreator.cxx|5 +
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx  |   45 -
 svx/source/svdraw/svdattr.cxx |4 +
 sw/qa/extras/layout/layout.cxx|   17 --
 19 files changed, 213 insertions(+), 20 deletions(-)

New commits:
commit 1b9fa684374d056b04b6b8019bd0be2b603b3d95
Author: Sarper Akdemir 
AuthorDate: Wed Mar 15 19:25:03 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri May 12 12:27:35 2023 +0200

tdf#150020 pptx import: handle algn for outerShdw

Introduces RectangleAlignmentItem that holds a value of the enum
model::RectangleAlignment.

Introduces SDRATTR_SHADOWALIGNMENT that holds alignment for a shadow.

Implements import of algn for outerShdw.

Makes the alignment considered while the shadow is being scaled.
Also adds a unit test that covers this.

Change-Id: I8f4eaed5f0d9428a7f405c65f19237f9e70ca151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148934
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151643
Tested-by: Jenkins CollaboraOffice 

diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx 
b/drawinglayer/source/attribute/sdrshadowattribute.cxx
index 6e046f1f07c7..1eb1b3ea687c 100644
--- a/drawinglayer/source/attribute/sdrshadowattribute.cxx
+++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 namespace drawinglayer::attribute
@@ -32,6 +33,7 @@ namespace drawinglayer::attribute
 basegfx::B2DVector  maSize; // 
[0.0 .. 2.0]
 double  mfTransparence; // 
[0.0 .. 1.0], 0.0==no transp.
 sal_Int32   mnBlur; // 
[0   .. 180], radius of the blur
+model::RectangleAlignment   
meAlignment{model::RectangleAlignment::Unset}; // alignment of the shadow
 basegfx::BColor maColor;// 
color of shadow
 
 ImpSdrShadowAttribute(
@@ -39,11 +41,13 @@ namespace drawinglayer::attribute
 const basegfx::B2DVector& rSize,
 double fTransparence,
 sal_Int32 nBlur,
+model::RectangleAlignment eAlignment,
 const basegfx::BColor& rColor)
 :   maOffset(rOffset),
 maSize(rSize),
 mfTransparence(fTransparence),
 mnBlur(nBlur),
+meAlignment(eAlignment),
 maColor(rColor)
 {
 }
@@ -67,6 +71,7 @@ namespace drawinglayer::attribute
 && getSize() == rCandidate.getSize()
 && getTransparence() == rCandidate.getTransparence()
 && getBlur() == rCandidate.getBlur()
+&& meAlignment == rCandidate.meAlignment
 && getColor() == rCandidate.getColor());
 }
 };
@@ -86,9 +91,10 @@ namespace drawinglayer::attribute
 const basegfx::B2DVector& rSize,
 double fTransparence,
 sal_Int32 nBlur,
+model::RectangleAlignment eAlignment,
 const basegfx::BColor& rColor)
 :   mpSdrShadowAttribute(ImpSdrShadowAttribute(
-rOffset, rSize, fTransparence,nBlur, rColor))
+rOffset, rSize, fTransparence, nBlur, eAlignment, rColor))
 {
 }
 
@@ -141,6 +147,11 @@ namespace drawinglayer::attribute
 return mpSdrShadowAttribute->getBlur();
 }
 
+model::RectangleAlignment SdrShadowAttribute::getAlignment() const
+{
+return mpSdrShadowAttribute->meAlignment;
+}
+
 const basegfx::BColor& SdrShadowAttribute::getColor() const
 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - oox/source sd/qa

2023-05-12 Thread Sarper Akdemir (via logerrit)
 oox/source/drawingml/drawingmltypes.cxx  |4 +--
 oox/source/drawingml/table/tablecell.cxx |   37 +++
 sd/qa/unit/export-tests-ooxml3.cxx   |4 +--
 sd/qa/unit/layout-tests.cxx  |   14 +++
 4 files changed, 37 insertions(+), 22 deletions(-)

New commits:
commit 57c7a776df80931c505bd39c7539ddb0f6270c2c
Author: Sarper Akdemir 
AuthorDate: Tue Apr 25 08:48:36 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri May 12 12:19:18 2023 +0200

pptx export: fix export of vertical table text

The mapping (implemented in 77655fc3dca05d4bb2366e67ccea228e3886bfe2)
used on export and the accompanying roundtrip test was incorrect. This
patch fixes both.

Rotation value of
- 9000 maps to vert270
- 27000 maps to vert

Change-Id: I9a9f889a2bff0241e62ee685492034eec6d0cccf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150955
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit 7dd994f8303a2b9396ed3848104028ff724e3bab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151610
Tested-by: Jenkins CollaboraOffice 

diff --git a/oox/source/drawingml/drawingmltypes.cxx 
b/oox/source/drawingml/drawingmltypes.cxx
index ff8c46050c15..30fed83f4391 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -382,9 +382,9 @@ std::optional GetTextVerticalType(sal_Int32 
nRotateAngle)
 switch (nRotateAngle)
 {
   case 9000:
-  return "vert";
-  case 27000:
   return "vert270";
+  case 27000:
+  return "vert";
   default:
   return {};
 }
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 78f8cc076d33..fb1a98e0a738 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -2165,8 +2165,8 @@ void 
SdOOXMLExportTest3::testTableCellVerticalPropertyRoundtrip()
 
 xmlDocUniquePtr pXml = parseExport("ppt/slides/slide1.xml");
 
-assertXPath(pXml, "(//a:tcPr)[1]", "vert", "vert270");
-assertXPath(pXml, "(//a:tcPr)[2]", "vert", "vert");
+assertXPath(pXml, "(//a:tcPr)[1]", "vert", "vert");
+assertXPath(pXml, "(//a:tcPr)[2]", "vert", "vert270");
 assertXPath(pXml, "(//a:tcPr)[3]", "vert", "wordArtVert");
 }
 
commit a8277723f6d7a8978ac3be07df37cd90bdc88cdb
Author: Sarper Akdemir 
AuthorDate: Thu Apr 20 23:31:20 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri May 12 12:19:12 2023 +0200

related tdf#154501: pptx import: push cell's RotateAngle after text

It appears to matter whether "RotateAngle" property is set
before or after insertion of the text for cells.

It only renders correctly when it is pushed after the text insertion.

RotateAngle appears to end up in the property set either way with
correct values, so I don't really know why this is the case.

Adds a unit test that covers rendering of vertical text in table cells
on import from an example pptx file.

Change-Id: Ifb8caa0b74920758fea2815b16dae7fd60587cc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150712
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit 4232907e0a8a5bd87c673afd9df0031dce74d798)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151529
Tested-by: Jenkins CollaboraOffice 

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index b0849b7002f3..9d16bce09d17 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -569,7 +569,24 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 {
 xPropSet->setPropertyValue("TextWritingMode", 
Any(css::text::WritingMode_TB_RL));
 }
-else if ( getVertToken() == XML_vert )
+
+getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, 
pMasterTextListStyle );
+
+// tdf#144092 For empty cells push character styles & endParaRPr to the 
Cell's properties
+const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs();
+if (rParagraphs.size() == 1)
+{
+const auto pFirstParagraph = rParagraphs.at(0);
+if (pFirstParagraph->getRuns().empty())
+{
+TextCharacterProperties aTextCharacterProps{ 
pFirstParagraph->getCharacterStyle(
+aTextStyleProps, *pMasterTextListStyle, 
getTextBody()->getTextListStyle()) };
+
aTextCharacterProps.assignUsed(pFirstParagraph->getEndProperties());
+aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
+}
+}
+
+if ( getVertToken() == XML_vert )
 {
 xPropSet->setPropertyValue("RotateAngle", Any(short(27000)));
 }
@@ -577,7 +594,7 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 {
 

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

2023-05-10 Thread Sarper Akdemir (via logerrit)
 include/svx/svddef.hxx|4 ++--
 svx/source/svdraw/svdattr.cxx |2 +-
 svx/source/table/cell.cxx |6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit eafc57233e90cafeee6f3c9e9ad655df5f1c3185
Author: Sarper Akdemir 
AuthorDate: Fri Apr 21 00:37:37 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed May 10 22:16:20 2023 +0200

rename SDRATTR_TABLE_GRABBAG to SDRATTR_TABLE_CELL_GRABBAG

Since SDRATTR_TABLE_GRABBAG was only used in the cell context, rename
it to SDRATTR_TABLE_CELL_GRABBAG to reflect that.

As per Miklos' suggestion in:

https://gerrit.libreoffice.org/c/core/+/150521/3/svx/source/table/cell.cxx#99

Change-Id: Id18e1ab077072d0d8ba45774ef6a3443bbea52e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150736
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx
index e5b1c884acfd..fa57a8aa0bfc 100644
--- a/include/svx/svddef.hxx
+++ b/include/svx/svddef.hxx
@@ -419,8 +419,8 @@ constexpr TypedWhichId
SDRATTR_TABLE_BORDER_INNER  (SDRATTR_T
 constexpr TypedWhichId   SDRATTR_TABLE_BORDER_TLBR   
(SDRATTR_TABLE_FIRST+2);  // 1238
 constexpr TypedWhichId   SDRATTR_TABLE_BORDER_BLTR   
(SDRATTR_TABLE_FIRST+3);  // 1239
 constexpr TypedWhichId SDRATTR_TABLE_TEXT_ROTATION 
(SDRATTR_TABLE_FIRST+4);  // 1240
-constexpr TypedWhichIdSDRATTR_TABLE_GRABBAG   
(SDRATTR_TABLE_FIRST+5);  // 1241
-constexpr sal_uInt16  SDRATTR_TABLE_LAST  
(SDRATTR_TABLE_GRABBAG);  // 1241
+constexpr TypedWhichIdSDRATTR_TABLE_CELL_GRABBAG  
(SDRATTR_TABLE_FIRST+5);  // 1241
+constexpr sal_uInt16  SDRATTR_TABLE_LAST  
(SDRATTR_TABLE_CELL_GRABBAG); // 1241
 
 constexpr sal_uInt16  SDRATTR_GLOW_FIRST 
(SDRATTR_TABLE_LAST+1);// 1242
 constexpr TypedWhichId 
SDRATTR_GLOW_RADIUS(SDRATTR_GLOW_FIRST+0);// 1242
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 4cc184246159..9ed199d34586 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -333,7 +333,7 @@ SdrItemPool::SdrItemPool(
 rPoolDefaults[ SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ] = new 
SvxLineItem( SDRATTR_TABLE_BORDER_TLBR );
 rPoolDefaults[ SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ] = new 
SvxLineItem( SDRATTR_TABLE_BORDER_BLTR );
 rPoolDefaults[ SDRATTR_TABLE_TEXT_ROTATION - SDRATTR_START ] = new 
SvxTextRotateItem(0_deg10, SDRATTR_TABLE_TEXT_ROTATION);
-rPoolDefaults[ SDRATTR_TABLE_GRABBAG - SDRATTR_START ] = new 
SfxGrabBagItem(SDRATTR_TABLE_GRABBAG);
+rPoolDefaults[ SDRATTR_TABLE_CELL_GRABBAG - SDRATTR_START ] = new 
SfxGrabBagItem(SDRATTR_TABLE_CELL_GRABBAG);
 
 rPoolDefaults[ SDRATTR_GLOW_RADIUS - SDRATTR_START ] = new 
SdrMetricItem(SDRATTR_GLOW_RADIUS, 0);
 rPoolDefaults[ SDRATTR_GLOW_COLOR - SDRATTR_START ] = new 
XColorItem(SDRATTR_GLOW_COLOR, aNullCol);
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 432084a40b83..88381056e572 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -98,7 +98,7 @@ static const SvxItemPropertySet* ImplGetSvxCellPropertySet()
 { u"LeftBorder",   SDRATTR_TABLE_BORDER,   
cppu::UnoType::get(), 0, LEFT_BORDER },
 { u"RightBorder",  SDRATTR_TABLE_BORDER,   
cppu::UnoType::get(), 0, RIGHT_BORDER },
 { u"RotateAngle",  SDRATTR_TABLE_TEXT_ROTATION,
cppu::UnoType::get(), 0, 0 },
-{ u"CellInteropGrabBag",   SDRATTR_TABLE_GRABBAG,  
cppu::UnoType>::get(), 0, 0},
+{ u"CellInteropGrabBag",   SDRATTR_TABLE_CELL_GRABBAG, 
cppu::UnoType>::get(), 0, 0 },
 
 SVX_UNOEDIT_OUTLINER_PROPERTIES,
 SVX_UNOEDIT_CHAR_PROPERTIES,
@@ -1056,7 +1056,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& 
rPropertyName, const Any&
 
mpProperties->SetObjectItem(SvxTextRotateItem(Degree10(nRotVal/10), 
SDRATTR_TABLE_TEXT_ROTATION));
 return;
 }
-case SDRATTR_TABLE_GRABBAG:
+case SDRATTR_TABLE_CELL_GRABBAG:
 {
 if (mpGrabBagItem == nullptr)
 mpGrabBagItem.reset(new SfxGrabBagItem);
@@ -1184,7 +1184,7 @@ Any SAL_CALL Cell::getPropertyValue( const OUString& 
PropertyName )
 const SvxTextRotateItem& rTextRotate = 
mpProperties->GetItem(SDRATTR_TABLE_TEXT_ROTATION);
 return Any(sal_Int32(to(rTextRotate.GetValue(;
 }
-case SDRATTR_TABLE_GRABBAG:
+case SDRATTR_TABLE_CELL_GRABBAG:
 {
 if (mpGrabBagItem != nullptr)
 {


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

2023-04-26 Thread Sarper Akdemir (via logerrit)
 oox/source/drawingml/drawingmltypes.cxx |4 ++--
 sd/qa/unit/export-tests-ooxml3.cxx  |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7dd994f8303a2b9396ed3848104028ff724e3bab
Author: Sarper Akdemir 
AuthorDate: Tue Apr 25 08:48:36 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Apr 26 21:13:31 2023 +0200

pptx export: fix export of vertical table text

The mapping (implemented in 77655fc3dca05d4bb2366e67ccea228e3886bfe2)
used on export and the accompanying roundtrip test was incorrect. This
patch fixes both.

Rotation value of
- 9000 maps to vert270
- 27000 maps to vert

Change-Id: I9a9f889a2bff0241e62ee685492034eec6d0cccf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150955
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/oox/source/drawingml/drawingmltypes.cxx 
b/oox/source/drawingml/drawingmltypes.cxx
index ff8c46050c15..30fed83f4391 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -382,9 +382,9 @@ std::optional GetTextVerticalType(sal_Int32 
nRotateAngle)
 switch (nRotateAngle)
 {
   case 9000:
-  return "vert";
-  case 27000:
   return "vert270";
+  case 27000:
+  return "vert";
   default:
   return {};
 }
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index d8d92ca54ae8..6fdf10a5bcce 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1991,8 +1991,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, 
testTableCellVerticalPropertyRoundtrip)
 
 xmlDocUniquePtr pXml = parseExport("ppt/slides/slide1.xml");
 
-assertXPath(pXml, "(//a:tcPr)[1]", "vert", "vert270");
-assertXPath(pXml, "(//a:tcPr)[2]", "vert", "vert");
+assertXPath(pXml, "(//a:tcPr)[1]", "vert", "vert");
+assertXPath(pXml, "(//a:tcPr)[2]", "vert", "vert270");
 assertXPath(pXml, "(//a:tcPr)[3]", "vert", "wordArtVert");
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - oox/source sd/qa

2023-04-25 Thread Sarper Akdemir (via logerrit)
 oox/source/drawingml/drawingmltypes.cxx |4 ++--
 sd/qa/unit/export-tests-ooxml3.cxx  |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 217294dccc072c86ca288674ff498396d303e68b
Author: Sarper Akdemir 
AuthorDate: Tue Apr 25 08:48:36 2023 +0300
Commit: Andras Timar 
CommitDate: Tue Apr 25 10:05:34 2023 +0200

pptx export: fix export of vertical table text

The mapping (implemented in 77655fc3dca05d4bb2366e67ccea228e3886bfe2)
used on export and the accompanying roundtrip test was incorrect. This
patch fixes both.

Rotation value of
- 9000 maps to vert270
- 27000 maps to vert

Change-Id: I9a9f889a2bff0241e62ee685492034eec6d0cccf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150924
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/oox/source/drawingml/drawingmltypes.cxx 
b/oox/source/drawingml/drawingmltypes.cxx
index 94d50587942a..d361ae67a3c8 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -380,9 +380,9 @@ std::optional GetTextVerticalType(sal_Int32 
nRotateAngle)
 switch (nRotateAngle)
 {
   case 9000:
-  return "vert";
-  case 27000:
   return "vert270";
+  case 27000:
+  return "vert";
   default:
   return {};
 }
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index d9da7ea8b395..41ff90b74b31 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -2100,8 +2100,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, 
testTableCellVerticalPropertyRoundtrip)
 
 xmlDocUniquePtr pXml = parseExport(tempFile, "ppt/slides/slide1.xml");
 
-assertXPath(pXml, "(//a:tcPr)[1]", "vert", "vert270");
-assertXPath(pXml, "(//a:tcPr)[2]", "vert", "vert");
+assertXPath(pXml, "(//a:tcPr)[1]", "vert", "vert");
+assertXPath(pXml, "(//a:tcPr)[2]", "vert", "vert270");
 assertXPath(pXml, "(//a:tcPr)[3]", "vert", "wordArtVert");
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - oox/source sd/qa

2023-04-23 Thread Sarper Akdemir (via logerrit)
 oox/source/drawingml/table/tablecell.cxx |   37 +++
 sd/qa/unit/layout-tests.cxx  |   21 +
 2 files changed, 40 insertions(+), 18 deletions(-)

New commits:
commit fa0312aaa687366168ed9ead00bb78eedcd054cf
Author: Sarper Akdemir 
AuthorDate: Thu Apr 20 23:31:20 2023 +0300
Commit: Andras Timar 
CommitDate: Sun Apr 23 22:09:30 2023 +0200

related tdf#154501: pptx import: push cell's RotateAngle after text

It appears to matter whether "RotateAngle" property is set
before or after insertion of the text for cells.

It only renders correctly when it is pushed after the text insertion.

RotateAngle appears to end up in the property set either way with
correct values, so I don't really know why this is the case.

Adds a unit test that covers rendering of vertical text in table cells
on import from an example pptx file.

Change-Id: Ifb8caa0b74920758fea2815b16dae7fd60587cc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150734
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 37408aaf4ba5..8692e3ffb33f 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -553,7 +553,24 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 {
 xPropSet->setPropertyValue("TextWritingMode", 
Any(css::text::WritingMode_TB_RL));
 }
-else if ( getVertToken() == XML_vert )
+
+getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, 
pMasterTextListStyle );
+
+// tdf#144092 For empty cells push character styles & endParaRPr to the 
Cell's properties
+const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs();
+if (rParagraphs.size() == 1)
+{
+const auto pFirstParagraph = rParagraphs.at(0);
+if (pFirstParagraph->getRuns().empty())
+{
+TextCharacterProperties aTextCharacterProps{ 
pFirstParagraph->getCharacterStyle(
+aTextStyleProps, *pMasterTextListStyle, 
getTextBody()->getTextListStyle()) };
+
aTextCharacterProps.assignUsed(pFirstParagraph->getEndProperties());
+aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
+}
+}
+
+if ( getVertToken() == XML_vert )
 {
 xPropSet->setPropertyValue("RotateAngle", Any(short(27000)));
 }
@@ -561,7 +578,7 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 {
 xPropSet->setPropertyValue("RotateAngle", Any(short(9000)));
 }
-else if ( getVertToken() != XML_horz )
+else if ( getVertToken() != XML_horz && getVertToken() != XML_eaVert )
 {
 // put the vert value in the grab bag for roundtrip
 const Sequence& aTokenNameSeq = 
StaticTokenMap().getUtf8TokenName(getVertToken());
@@ -583,22 +600,6 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 }
 xPropSet->setPropertyValue("CellInteropGrabBag", Any(aGrabBag));
 }
-
-getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, 
pMasterTextListStyle );
-
-// tdf#144092 For empty cells push character styles & endParaRPr to the 
Cell's properties
-const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs();
-if (rParagraphs.size() == 1)
-{
-const auto pFirstParagraph = rParagraphs.at(0);
-if (pFirstParagraph->getRuns().empty())
-{
-TextCharacterProperties aTextCharacterProps{ 
pFirstParagraph->getCharacterStyle(
-aTextStyleProps, *pMasterTextListStyle, 
getTextBody()->getTextListStyle()) };
-
aTextCharacterProps.assignUsed(pFirstParagraph->getEndProperties());
-aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
-}
-}
 }
 
 }
diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx
index 25366afedc0f..afd3e5210027 100644
--- a/sd/qa/unit/layout-tests.cxx
+++ b/sd/qa/unit/layout-tests.cxx
@@ -320,6 +320,27 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, 
testFitToFrameTextFitting)
 #endif
 }
 
+CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTableVerticalText)
+{
+sd::DrawDocShellRef xDocShRef = loadURL(
+
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tcPr-vert-roundtrip.pptx"), 
PPTX);
+
+std::shared_ptr xMetaFile = xDocShRef->GetPreviewMetaFile();
+MetafileXmlDump dumper;
+
+xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, *xMetaFile);
+CPPUNIT_ASSERT(pXmlDoc);
+
+// Without the accompanying fix, would fail with:
+// - Expected: -900
+// - Actual  : 0
+// - In <>, attribute 'orientation' of '//font[1]' incorrect value.
+// i.e. table cell text that was supposed to be vertical (rotated 90
+// degrees) was not vertical.
+assertXPath(pXmlDoc, 

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

2023-04-21 Thread Sarper Akdemir (via logerrit)
 oox/source/drawingml/table/tablecell.cxx |   37 +++
 sd/qa/unit/layout-tests.cxx  |   14 +++
 2 files changed, 33 insertions(+), 18 deletions(-)

New commits:
commit 4232907e0a8a5bd87c673afd9df0031dce74d798
Author: Sarper Akdemir 
AuthorDate: Thu Apr 20 23:31:20 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Apr 21 10:02:00 2023 +0200

related tdf#154501: pptx import: push cell's RotateAngle after text

It appears to matter whether "RotateAngle" property is set
before or after insertion of the text for cells.

It only renders correctly when it is pushed after the text insertion.

RotateAngle appears to end up in the property set either way with
correct values, so I don't really know why this is the case.

Adds a unit test that covers rendering of vertical text in table cells
on import from an example pptx file.

Change-Id: Ifb8caa0b74920758fea2815b16dae7fd60587cc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150712
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index b0849b7002f3..9d16bce09d17 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -569,7 +569,24 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 {
 xPropSet->setPropertyValue("TextWritingMode", 
Any(css::text::WritingMode_TB_RL));
 }
-else if ( getVertToken() == XML_vert )
+
+getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, 
pMasterTextListStyle );
+
+// tdf#144092 For empty cells push character styles & endParaRPr to the 
Cell's properties
+const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs();
+if (rParagraphs.size() == 1)
+{
+const auto pFirstParagraph = rParagraphs.at(0);
+if (pFirstParagraph->getRuns().empty())
+{
+TextCharacterProperties aTextCharacterProps{ 
pFirstParagraph->getCharacterStyle(
+aTextStyleProps, *pMasterTextListStyle, 
getTextBody()->getTextListStyle()) };
+
aTextCharacterProps.assignUsed(pFirstParagraph->getEndProperties());
+aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
+}
+}
+
+if ( getVertToken() == XML_vert )
 {
 xPropSet->setPropertyValue("RotateAngle", Any(short(27000)));
 }
@@ -577,7 +594,7 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 {
 xPropSet->setPropertyValue("RotateAngle", Any(short(9000)));
 }
-else if ( getVertToken() != XML_horz )
+else if ( getVertToken() != XML_horz && getVertToken() != XML_eaVert )
 {
 // put the vert value in the grab bag for roundtrip
 const Sequence& aTokenNameSeq = 
StaticTokenMap().getUtf8TokenName(getVertToken());
@@ -599,22 +616,6 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 }
 xPropSet->setPropertyValue("CellInteropGrabBag", Any(aGrabBag));
 }
-
-getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, 
pMasterTextListStyle );
-
-// tdf#144092 For empty cells push character styles & endParaRPr to the 
Cell's properties
-const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs();
-if (rParagraphs.size() == 1)
-{
-const auto pFirstParagraph = rParagraphs.at(0);
-if (pFirstParagraph->getRuns().empty())
-{
-TextCharacterProperties aTextCharacterProps{ 
pFirstParagraph->getCharacterStyle(
-aTextStyleProps, *pMasterTextListStyle, 
getTextBody()->getTextListStyle()) };
-
aTextCharacterProps.assignUsed(pFirstParagraph->getEndProperties());
-aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
-}
-}
 }
 
 }
diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx
index e401f2d0822b..5e9d0e26537b 100644
--- a/sd/qa/unit/layout-tests.cxx
+++ b/sd/qa/unit/layout-tests.cxx
@@ -340,6 +340,20 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf148966)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTableVerticalText)
+{
+xmlDocUniquePtr pXmlDoc = load("pptx/tcPr-vert-roundtrip.pptx");
+
+// Without the accompanying fix, would fail with:
+// - Expected: -900
+// - Actual  : 0
+// - In <>, attribute 'orientation' of '//font[1]' incorrect value.
+// i.e. table cell text that was supposed to be vertical (rotated 90
+// degrees) was not vertical.
+assertXPath(pXmlDoc, "//font[1]", "orientation", "-900");
+assertXPath(pXmlDoc, "//font[2]", "orientation", "900");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-04-19 Thread Sarper Akdemir (via logerrit)
 svx/qa/unit/data/tdf150020-shadow-alignment.pptx |binary
 svx/qa/unit/sdr.cxx  |   81 ++-
 svx/source/table/viewcontactoftableobj.cxx   |   54 ---
 3 files changed, 81 insertions(+), 54 deletions(-)

New commits:
commit fcf776a09a2c5cd692480c8ec4a678e3d04739c9
Author: Sarper Akdemir 
AuthorDate: Wed Apr 19 15:17:27 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Apr 19 19:06:54 2023 +0200

tdf#150020: pass transform and scale matrix for the table shadow primitive

Shadow scaling related bits in createEmbeddedShadowPrimitive, requires
the ObjectMatrix with scale and translate.

Pass these in for table shadow creation too.

Change-Id: I28c30fe49d3c90e3ca03fb5294ca97eb5ba22773
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150639
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/svx/qa/unit/data/tdf150020-shadow-alignment.pptx 
b/svx/qa/unit/data/tdf150020-shadow-alignment.pptx
index caba1a122da5..0002667bd4d9 100644
Binary files a/svx/qa/unit/data/tdf150020-shadow-alignment.pptx and 
b/svx/qa/unit/data/tdf150020-shadow-alignment.pptx differ
diff --git a/svx/qa/unit/sdr.cxx b/svx/qa/unit/sdr.cxx
index b98df8b58041..4d6c4226d11b 100644
--- a/svx/qa/unit/sdr.cxx
+++ b/svx/qa/unit/sdr.cxx
@@ -85,46 +85,67 @@ CPPUNIT_TEST_FIXTURE(SdrTest, testShadowAlignment)
 loadFromURL(u"tdf150020-shadow-alignment.pptx");
 
 uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
-uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
- uno::UNO_QUERY);
-drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence
-= renderPageToPrimitives(xDrawPage);
+{
+// Page 1 contains 9 shapes with each shadow alignment
+uno::Reference xDrawPage(
+xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
+drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence
+= renderPageToPrimitives(xDrawPage);
 
-// Examine the created primitives.
-drawinglayer::Primitive2dXmlDump aDumper;
-xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence);
+// Examine the created primitives.
+drawinglayer::Primitive2dXmlDump aDumper;
+xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence);
 
-// Without the accompanying fix in place, this test would have failed with:
-// - Expected: -567
-// - Actual  : 162
-// - In <>, attribute 'xy13' of '(//shadow/transform)[1]' incorrect value.
-// i.e. shadow alignment was ignored while scaling the shadow.
-assertXPath(pDocument, "(//shadow/transform)[1]", "xy13", "-567");
-assertXPath(pDocument, "(//shadow/transform)[1]", "xy23", "162");
+// Without the accompanying fix in place, this test would have failed 
with:
+// - Expected: -567
+// - Actual  : 162
+// - In <>, attribute 'xy13' of '(//shadow/transform)[1]' incorrect 
value.
+// i.e. shadow alignment was ignored while scaling the shadow.
+assertXPath(pDocument, "(//shadow/transform)[1]", "xy13", "-567");
+assertXPath(pDocument, "(//shadow/transform)[1]", "xy23", "162");
 
-assertXPath(pDocument, "(//shadow/transform)[2]", "xy13", "-1794");
-assertXPath(pDocument, "(//shadow/transform)[2]", "xy23", "162");
+assertXPath(pDocument, "(//shadow/transform)[2]", "xy13", "-1794");
+assertXPath(pDocument, "(//shadow/transform)[2]", "xy23", "162");
 
-assertXPath(pDocument, "(//shadow/transform)[3]", "xy13", "-3021");
-assertXPath(pDocument, "(//shadow/transform)[3]", "xy23", "161");
+assertXPath(pDocument, "(//shadow/transform)[3]", "xy13", "-3021");
+assertXPath(pDocument, "(//shadow/transform)[3]", "xy23", "161");
 
-assertXPath(pDocument, "(//shadow/transform)[4]", "xy13", "-567");
-assertXPath(pDocument, "(//shadow/transform)[4]", "xy23", "-749");
+assertXPath(pDocument, "(//shadow/transform)[4]", "xy13", "-567");
+assertXPath(pDocument, "(//shadow/transform)[4]", "xy23", "-749");
 
-assertXPath(pDocument, "(//shadow/transform)[5]", "xy13", "-3021");
-assertXPath(pDocument, "(//shadow/transform)[5]", "xy23", "-750");
+assertXPath(pDocument, "(//shadow/transform)[5]", "xy13", "-3021");
+assertXPath(pDocument, "(//shadow/transform)[5]", "xy23", "-750");
 
-assertXPath(pDocument, "(//shadow/transform)[6]", "xy13", "-566");
-assertXPath(pDocument, "(//shadow/transform)[6]", "xy23", "-1691");
+assertXPath(pDocument, "(//shadow/transform)[6]", "xy13", "-566");
+assertXPath(pDocument, "(//shadow/transform)[6]", "xy23", "-1691");
 
-assertXPath(pDocument, "(//shadow/transform)[7]", "xy13", "-1794");
-assertXPath(pDocument, "(//shadow/transform)[7]", "xy23", "-1693");
+

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - include/svx oox/source sd/qa svx/source

2023-04-19 Thread Sarper Akdemir (via logerrit)
 include/svx/svddef.hxx|4 ++
 oox/source/drawingml/table/tablecell.cxx  |   38 ++
 oox/source/export/shapes.cxx  |   14 +
 sd/qa/unit/data/pptx/tcPr-vert-roundtrip.pptx |binary
 sd/qa/unit/export-tests-ooxml3.cxx|   16 ++
 svx/source/inc/cell.hxx   |3 ++
 svx/source/svdraw/svdattr.cxx |3 ++
 svx/source/table/cell.cxx |   21 ++
 8 files changed, 93 insertions(+), 6 deletions(-)

New commits:
commit e87a5b20dd73ae1e19cd43198bb7c8ba9ec2
Author: Sarper Akdemir 
AuthorDate: Wed Mar 29 19:44:18 2023 +0300
Commit: Miklos Vajna 
CommitDate: Wed Apr 19 12:57:59 2023 +0200

oox: tcPr vert roundtrip, introduce interopability grab bag for table cell

To properly roundtrip all possible values of 

+ Introduce grab bag for table cell
+ on import: Store the unsupported values in the grab bag:
  + (e.g. wordArtVert, mongolianVert, wordArtVertRtl)
+ on export: if nothing is being exported from the doc
  model, export the value from the grabbag

Also adds a unit test covering this behavior.

Change-Id: I791ed2d992b0a554ef6da37200f027cffd8c5f2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149737
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150521
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx
index 9b3b1a358369..2bb5068f5661 100644
--- a/include/svx/svddef.hxx
+++ b/include/svx/svddef.hxx
@@ -138,6 +138,7 @@ class SdrVertShearAllItem;
 class SdrVertShearOneItem;
 class SdrYesNoItem;
 class SfxBoolItem;
+class SfxGrabBagItem;
 class SfxInt16Item;
 class SfxUInt16Item;
 class SfxUInt32Item;
@@ -416,7 +417,8 @@ constexpr TypedWhichId
SDRATTR_TABLE_BORDER_INNER  (SDRATTR_T
 constexpr TypedWhichId   SDRATTR_TABLE_BORDER_TLBR   
(SDRATTR_TABLE_FIRST+2);
 constexpr TypedWhichId   SDRATTR_TABLE_BORDER_BLTR   
(SDRATTR_TABLE_FIRST+3);
 constexpr TypedWhichId SDRATTR_TABLE_TEXT_ROTATION 
(SDRATTR_TABLE_FIRST+4);
-constexpr sal_uInt16  SDRATTR_TABLE_LAST  
(SDRATTR_TABLE_TEXT_ROTATION);
+constexpr TypedWhichIdSDRATTR_TABLE_GRABBAG   
(SDRATTR_TABLE_FIRST+5);
+constexpr sal_uInt16  SDRATTR_TABLE_LAST  
(SDRATTR_TABLE_GRABBAG);
 
 constexpr sal_uInt16  SDRATTR_GLOW_FIRST 
(SDRATTR_TABLE_LAST+1);
 constexpr TypedWhichId SDRATTR_GLOW_RADIUS   
(SDRATTR_GLOW_FIRST+0);
diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 19347db21539..37408aaf4ba5 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -29,12 +29,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 
 using namespace ::oox::core;
 using namespace ::com::sun::star;
@@ -550,6 +553,36 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 {
 xPropSet->setPropertyValue("TextWritingMode", 
Any(css::text::WritingMode_TB_RL));
 }
+else if ( getVertToken() == XML_vert )
+{
+xPropSet->setPropertyValue("RotateAngle", Any(short(27000)));
+}
+else if ( getVertToken() == XML_vert270 )
+{
+xPropSet->setPropertyValue("RotateAngle", Any(short(9000)));
+}
+else if ( getVertToken() != XML_horz )
+{
+// put the vert value in the grab bag for roundtrip
+const Sequence& aTokenNameSeq = 
StaticTokenMap().getUtf8TokenName(getVertToken());
+const OUString aTokenName{ reinterpret_cast(aTokenNameSeq.getConstArray()),
+   aTokenNameSeq.getLength(), 
RTL_TEXTENCODING_UTF8 };
+
+Sequence aGrabBag;
+xPropSet->getPropertyValue("CellInteropGrabBag") >>= aGrabBag;
+PropertyValue aPropertyValue = 
comphelper::makePropertyValue("mso-tcPr-vert-value", aTokenName);
+if (aGrabBag.hasElements())
+{
+sal_Int32 nLength = aGrabBag.getLength();
+aGrabBag.realloc(nLength + 1);
+aGrabBag.getArray()[nLength] = aPropertyValue;
+}
+else
+{
+aGrabBag = { aPropertyValue };
+}
+xPropSet->setPropertyValue("CellInteropGrabBag", Any(aGrabBag));
+}
 
 getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, 
pMasterTextListStyle );
 
@@ -566,11 +599,6 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
 }
 }
-
-if (getVertToken() == XML_vert)
-xPropSet->setPropertyValue("RotateAngle", Any(short(27000)));
-else if (getVertToken() == 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - include/oox oox/source

2023-04-19 Thread Sarper Akdemir (via logerrit)
 include/oox/drawingml/drawingmltypes.hxx |3 +++
 oox/source/drawingml/drawingmltypes.cxx  |   13 +
 oox/source/export/shapes.cxx |6 ++
 3 files changed, 22 insertions(+)

New commits:
commit 05ca303a3587a27edeb1602331ba01a9635ef6c5
Author: Sarper Akdemir 
AuthorDate: Fri Mar 24 17:35:51 2023 +0300
Commit: Miklos Vajna 
CommitDate: Wed Apr 19 12:48:34 2023 +0200

pptx export: consider RotateAngle for tcPr on export

It appears the RotateAngle property is imported, even though
it has no effect on how table cell is displayed right now.

Let's export the property so that we are able to roundtrip
the  & 

Change-Id: Idc23f3b0677fdc5ed12fa5494f0f1823bb89683f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149545
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150520
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/include/oox/drawingml/drawingmltypes.hxx 
b/include/oox/drawingml/drawingmltypes.hxx
index 4350b8d033a7..48b3aaa3d045 100644
--- a/include/oox/drawingml/drawingmltypes.hxx
+++ b/include/oox/drawingml/drawingmltypes.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_OOX_DRAWINGML_DRAWINGMLTYPES_HXX
 
 #include 
+#include 
 #include 
 
 #include 
@@ -145,6 +146,8 @@ OOX_DLLPUBLIC const char* GetTextVerticalAdjust( 
css::drawing::TextVerticalAdjus
 // Converts a Hatch object to an ooxml pattern.
 const char* GetHatchPattern( const css::drawing::Hatch& rHatch );
 
+/// Converts nRotate angle to TextVerticalType string appearing in ooxml
+std::optional GetTextVerticalType(sal_Int32 nRotateAngle);
 
 // CT_IndexRange
 struct IndexRange {
diff --git a/oox/source/drawingml/drawingmltypes.cxx 
b/oox/source/drawingml/drawingmltypes.cxx
index 3a94a449f317..94d50587942a 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -375,6 +375,19 @@ const char* GetHatchPattern( const drawing::Hatch& rHatch )
 return sPattern;
 }
 
+std::optional GetTextVerticalType(sal_Int32 nRotateAngle)
+{
+switch (nRotateAngle)
+{
+  case 9000:
+  return "vert";
+  case 27000:
+  return "vert270";
+  default:
+  return {};
+}
+}
+
 /** converts the attributes from a CT_RelativeRect to an IntegerRectangle2D */
 IntegerRectangle2D GetRelativeRect( const Reference< XFastAttributeList >& 
xAttribs )
 {
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index eeb307c1471c..d82ac51a36b8 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1951,7 +1951,13 @@ void ShapeExport::WriteTableCellProperties(const 
Reference< XPropertySet>& xCell
 aVerticalAlignment >>= eVerticalAlignment;
 sVerticalAlignment = GetTextVerticalAdjust(eVerticalAlignment);
 
+sal_Int32 nRotateAngle = 0;
+Any aRotateAngle = xCellPropSet->getPropertyValue("RotateAngle");
+aRotateAngle >>= nRotateAngle;
+std::optional aTextVerticalValue = 
GetTextVerticalType(nRotateAngle);
+
 mpFS->startElementNS(XML_a, XML_tcPr, XML_anchor, sVerticalAlignment,
+XML_vert, aTextVerticalValue,
 XML_marL, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)),
 nLeftMargin > 0),
 XML_marR, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRightMargin)),
 nRightMargin > 0));
 


[Libreoffice-commits] core.git: drawinglayer/source include/docmodel include/drawinglayer include/editeng include/svx oox/source svx/Library_svxcore.mk svx/qa svx/source sw/qa

2023-04-18 Thread Sarper Akdemir (via logerrit)
 drawinglayer/source/attribute/sdrshadowattribute.cxx  |   13 
 include/docmodel/theme/FormatScheme.hxx   |2 
 include/drawinglayer/attribute/sdrshadowattribute.hxx |6 ++
 include/editeng/unoprnms.hxx  |1 
 include/svx/RectangleAlignmentItem.hxx|   42 
 include/svx/svddef.hxx|4 +
 include/svx/unoshprp.hxx  |3 -
 oox/source/drawingml/effectproperties.cxx |5 +
 oox/source/drawingml/effectproperties.hxx |5 +
 oox/source/drawingml/effectpropertiescontext.cxx  |1 
 oox/source/token/properties.txt   |1 
 svx/Library_svxcore.mk|1 
 svx/qa/unit/data/tdf150020-shadow-alignment.pptx  |binary
 svx/qa/unit/sdr.cxx   |   47 ++
 svx/source/items/RectangleAlignmentItem.cxx   |   31 +++
 svx/source/sdr/primitive2d/sdrattributecreator.cxx|5 +
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx  |   45 -
 svx/source/svdraw/svdattr.cxx |4 +
 sw/qa/extras/layout/layout.cxx|   17 --
 19 files changed, 213 insertions(+), 20 deletions(-)

New commits:
commit c27946fb157fe46fbfaefbe93f2c6794b1af4411
Author: Sarper Akdemir 
AuthorDate: Wed Mar 15 19:25:03 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Apr 18 17:43:18 2023 +0200

tdf#150020 pptx import: handle algn for outerShdw

Introduces RectangleAlignmentItem that holds a value of the enum
model::RectangleAlignment.

Introduces SDRATTR_SHADOWALIGNMENT that holds alignment for a shadow.

Implements import of algn for outerShdw.

Makes the alignment considered while the shadow is being scaled.
Also adds a unit test that covers this.

Change-Id: I8f4eaed5f0d9428a7f405c65f19237f9e70ca151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148934
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx 
b/drawinglayer/source/attribute/sdrshadowattribute.cxx
index 6e046f1f07c7..1eb1b3ea687c 100644
--- a/drawinglayer/source/attribute/sdrshadowattribute.cxx
+++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 namespace drawinglayer::attribute
@@ -32,6 +33,7 @@ namespace drawinglayer::attribute
 basegfx::B2DVector  maSize; // 
[0.0 .. 2.0]
 double  mfTransparence; // 
[0.0 .. 1.0], 0.0==no transp.
 sal_Int32   mnBlur; // 
[0   .. 180], radius of the blur
+model::RectangleAlignment   
meAlignment{model::RectangleAlignment::Unset}; // alignment of the shadow
 basegfx::BColor maColor;// 
color of shadow
 
 ImpSdrShadowAttribute(
@@ -39,11 +41,13 @@ namespace drawinglayer::attribute
 const basegfx::B2DVector& rSize,
 double fTransparence,
 sal_Int32 nBlur,
+model::RectangleAlignment eAlignment,
 const basegfx::BColor& rColor)
 :   maOffset(rOffset),
 maSize(rSize),
 mfTransparence(fTransparence),
 mnBlur(nBlur),
+meAlignment(eAlignment),
 maColor(rColor)
 {
 }
@@ -67,6 +71,7 @@ namespace drawinglayer::attribute
 && getSize() == rCandidate.getSize()
 && getTransparence() == rCandidate.getTransparence()
 && getBlur() == rCandidate.getBlur()
+&& meAlignment == rCandidate.meAlignment
 && getColor() == rCandidate.getColor());
 }
 };
@@ -86,9 +91,10 @@ namespace drawinglayer::attribute
 const basegfx::B2DVector& rSize,
 double fTransparence,
 sal_Int32 nBlur,
+model::RectangleAlignment eAlignment,
 const basegfx::BColor& rColor)
 :   mpSdrShadowAttribute(ImpSdrShadowAttribute(
-rOffset, rSize, fTransparence,nBlur, rColor))
+rOffset, rSize, fTransparence, nBlur, eAlignment, rColor))
 {
 }
 
@@ -141,6 +147,11 @@ namespace drawinglayer::attribute
 return mpSdrShadowAttribute->getBlur();
 }
 
+model::RectangleAlignment SdrShadowAttribute::getAlignment() const
+{
+return mpSdrShadowAttribute->meAlignment;
+}
+
 const basegfx::BColor& SdrShadowAttribute::getColor() const
 {
 return mpSdrShadowAttribute->getColor();
diff --git 

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

2023-04-17 Thread Sarper Akdemir (via logerrit)
 include/svx/svddef.hxx|4 ++
 oox/source/drawingml/table/tablecell.cxx  |   38 ++
 oox/source/export/shapes.cxx  |   14 +
 sd/qa/unit/data/pptx/tcPr-vert-roundtrip.pptx |binary
 sd/qa/unit/export-tests-ooxml3.cxx|   12 
 svx/source/inc/cell.hxx   |3 ++
 svx/source/svdraw/svdattr.cxx |3 ++
 svx/source/table/cell.cxx |   21 ++
 8 files changed, 89 insertions(+), 6 deletions(-)

New commits:
commit 178832ef7139b9279a3ae0056eb11be9c476800e
Author: Sarper Akdemir 
AuthorDate: Wed Mar 29 19:44:18 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Apr 17 16:21:06 2023 +0200

oox: tcPr vert roundtrip, introduce interopability grab bag for table cell

To properly roundtrip all possible values of 

+ Introduce grab bag for table cell
+ on import: Store the unsupported values in the grab bag:
  + (e.g. wordArtVert, mongolianVert, wordArtVertRtl)
+ on export: if nothing is being exported from the doc
  model, export the value from the grabbag

Also adds a unit test covering this behavior.

Change-Id: I791ed2d992b0a554ef6da37200f027cffd8c5f2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149737
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx
index 85a72e5b713d..84db8c4d0aa4 100644
--- a/include/svx/svddef.hxx
+++ b/include/svx/svddef.hxx
@@ -138,6 +138,7 @@ class SdrVertShearAllItem;
 class SdrVertShearOneItem;
 class SdrYesNoItem;
 class SfxBoolItem;
+class SfxGrabBagItem;
 class SfxInt16Item;
 class SfxUInt16Item;
 class SfxUInt32Item;
@@ -417,7 +418,8 @@ constexpr TypedWhichId
SDRATTR_TABLE_BORDER_INNER  (SDRATTR_T
 constexpr TypedWhichId   SDRATTR_TABLE_BORDER_TLBR   
(SDRATTR_TABLE_FIRST+2);
 constexpr TypedWhichId   SDRATTR_TABLE_BORDER_BLTR   
(SDRATTR_TABLE_FIRST+3);
 constexpr TypedWhichId SDRATTR_TABLE_TEXT_ROTATION 
(SDRATTR_TABLE_FIRST+4);
-constexpr sal_uInt16  SDRATTR_TABLE_LAST  
(SDRATTR_TABLE_TEXT_ROTATION);
+constexpr TypedWhichIdSDRATTR_TABLE_GRABBAG   
(SDRATTR_TABLE_FIRST+5);
+constexpr sal_uInt16  SDRATTR_TABLE_LAST  
(SDRATTR_TABLE_GRABBAG);
 
 constexpr sal_uInt16  SDRATTR_GLOW_FIRST 
(SDRATTR_TABLE_LAST+1);
 constexpr TypedWhichId SDRATTR_GLOW_RADIUS   
(SDRATTR_GLOW_FIRST+0);
diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 17b13526084d..b0849b7002f3 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -29,12 +29,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 
 using namespace ::oox::core;
 using namespace ::com::sun::star;
@@ -566,6 +569,36 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 {
 xPropSet->setPropertyValue("TextWritingMode", 
Any(css::text::WritingMode_TB_RL));
 }
+else if ( getVertToken() == XML_vert )
+{
+xPropSet->setPropertyValue("RotateAngle", Any(short(27000)));
+}
+else if ( getVertToken() == XML_vert270 )
+{
+xPropSet->setPropertyValue("RotateAngle", Any(short(9000)));
+}
+else if ( getVertToken() != XML_horz )
+{
+// put the vert value in the grab bag for roundtrip
+const Sequence& aTokenNameSeq = 
StaticTokenMap().getUtf8TokenName(getVertToken());
+const OUString aTokenName{ reinterpret_cast(aTokenNameSeq.getConstArray()),
+   aTokenNameSeq.getLength(), 
RTL_TEXTENCODING_UTF8 };
+
+Sequence aGrabBag;
+xPropSet->getPropertyValue("CellInteropGrabBag") >>= aGrabBag;
+PropertyValue aPropertyValue = 
comphelper::makePropertyValue("mso-tcPr-vert-value", aTokenName);
+if (aGrabBag.hasElements())
+{
+sal_Int32 nLength = aGrabBag.getLength();
+aGrabBag.realloc(nLength + 1);
+aGrabBag.getArray()[nLength] = aPropertyValue;
+}
+else
+{
+aGrabBag = { aPropertyValue };
+}
+xPropSet->setPropertyValue("CellInteropGrabBag", Any(aGrabBag));
+}
 
 getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, 
pMasterTextListStyle );
 
@@ -582,11 +615,6 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
 }
 }
-
-if (getVertToken() == XML_vert)
-xPropSet->setPropertyValue("RotateAngle", Any(short(27000)));
-else if (getVertToken() == XML_vert270)
-xPropSet->setPropertyValue("RotateAngle", Any(short(9000)));
 }
 
 }
diff --git a/oox/source/export/shapes.cxx 

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

2023-04-17 Thread Sarper Akdemir (via logerrit)
 include/oox/drawingml/drawingmltypes.hxx |3 +++
 oox/source/drawingml/drawingmltypes.cxx  |   14 ++
 oox/source/export/shapes.cxx |6 ++
 3 files changed, 23 insertions(+)

New commits:
commit 77655fc3dca05d4bb2366e67ccea228e3886bfe2
Author: Sarper Akdemir 
AuthorDate: Fri Mar 24 17:35:51 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Apr 17 16:20:18 2023 +0200

pptx export: consider RotateAngle for tcPr on export

It appears the RotateAngle property is imported, even though
it has no effect on how table cell is displayed right now.

Let's export the property so that we are able to roundtrip
the  & 

Change-Id: Idc23f3b0677fdc5ed12fa5494f0f1823bb89683f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149545
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/include/oox/drawingml/drawingmltypes.hxx 
b/include/oox/drawingml/drawingmltypes.hxx
index 239d3283e55c..fda24edb0f92 100644
--- a/include/oox/drawingml/drawingmltypes.hxx
+++ b/include/oox/drawingml/drawingmltypes.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_OOX_DRAWINGML_DRAWINGMLTYPES_HXX
 
 #include 
+#include 
 #include 
 
 #include 
@@ -149,6 +150,8 @@ OOX_DLLPUBLIC const char* GetTextVerticalAdjust( 
css::drawing::TextVerticalAdjus
 // Converts a Hatch object to an ooxml pattern.
 const char* GetHatchPattern( const css::drawing::Hatch& rHatch );
 
+/// Converts nRotate angle to TextVerticalType string appearing in ooxml
+std::optional GetTextVerticalType(sal_Int32 nRotateAngle);
 
 // CT_IndexRange
 struct IndexRange {
diff --git a/oox/source/drawingml/drawingmltypes.cxx 
b/oox/source/drawingml/drawingmltypes.cxx
index 469029f48071..ff8c46050c15 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -25,6 +25,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -376,6 +377,19 @@ const char* GetHatchPattern( const drawing::Hatch& rHatch )
 return sPattern;
 }
 
+std::optional GetTextVerticalType(sal_Int32 nRotateAngle)
+{
+switch (nRotateAngle)
+{
+  case 9000:
+  return "vert";
+  case 27000:
+  return "vert270";
+  default:
+  return {};
+}
+}
+
 namespace
 {
 // ISO/IEC-29500 Part 1 ST_Percentage, and [MS-OI29500] 2.1.1324
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 83d308ca793f..eecd1b38512c 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -2312,7 +2312,13 @@ void ShapeExport::WriteTableCellProperties(const 
Reference< XPropertySet>& xCell
 aVerticalAlignment >>= eVerticalAlignment;
 sVerticalAlignment = GetTextVerticalAdjust(eVerticalAlignment);
 
+sal_Int32 nRotateAngle = 0;
+Any aRotateAngle = xCellPropSet->getPropertyValue("RotateAngle");
+aRotateAngle >>= nRotateAngle;
+std::optional aTextVerticalValue = 
GetTextVerticalType(nRotateAngle);
+
 mpFS->startElementNS(XML_a, XML_tcPr, XML_anchor, sVerticalAlignment,
+XML_vert, aTextVerticalValue,
 XML_marL, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)),
 nLeftMargin > 0),
 XML_marR, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRightMargin)),
 nRightMargin > 0));
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - include/xmloff sd/qa xmloff/source

2023-04-12 Thread Sarper Akdemir (via logerrit)
 include/xmloff/xmltoken.hxx   |2 +
 include/xmloff/xmltypes.hxx   |1 
 sd/qa/unit/data/odp/style-overflow-behavior-clip.fodp |   18 
 sd/qa/unit/import-tests2.cxx  |   25 +-
 xmloff/source/core/xmltoken.cxx   |2 +
 xmloff/source/draw/sdpropls.cxx   |1 
 xmloff/source/style/prhdlfac.cxx  |5 +++
 xmloff/source/token/tokens.txt|2 +
 8 files changed, 55 insertions(+), 1 deletion(-)

New commits:
commit d15784adcb96f1d03c20885042d93f5a1a4495f4
Author: Sarper Akdemir 
AuthorDate: Fri Apr 7 13:32:49 2023 +0300
Commit: Andras Timar 
CommitDate: Wed Apr 12 23:29:04 2023 +0200

xmloff: ODF import/export for style:overflow-behavior "clip"

Adds initial support for style:overflow-behavior

According to OpenDocument-v1.3-part3 style:overflow-behavior can take
values of:
- "clip"
- "auto-create-new-frame"

This patch doesn't properly implement support "auto-create-new-frame",
only "clip".

If "clip" is set, TextClipVerticalOverflow is set to true, causing the
vertical overflowing text to be clipped.

"auto-create-new-frame" is treated the same as omitting the
style:overflow-behavior attribute, setting TextClipVerticalOverflow to
false.

Change-Id: Iea298f41fbf0cf18dc07f41788ba0b665515db8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150122
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150305
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 4eb363dc0ee3..888f57053dc8 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -287,6 +287,7 @@ namespace xmloff::token {
 XML_AUTHOR_NAME,
 XML_AUTO,
 XML_AUTO_COMPLETE,
+XML_AUTO_CREATE_NEW_FRAME,
 XML_AUTO_GROW_HEIGHT,
 XML_AUTO_GROW_WIDTH,
 XML_AUTO_RELOAD,
@@ -1452,6 +1453,7 @@ namespace xmloff::token {
 XML_OUTLINE_STYLE,
 XML_OUTSET,
 XML_OUTSIDE,
+XML_OVERFLOW_BEHAVIOR,
 XML_OVERLAP,
 XML_OVERLAY,
 XML_P,
diff --git a/include/xmloff/xmltypes.hxx b/include/xmloff/xmltypes.hxx
index 13e7c3fcc6c0..4dbf2081db1b 100644
--- a/include/xmloff/xmltypes.hxx
+++ b/include/xmloff/xmltypes.hxx
@@ -277,6 +277,7 @@
 #define XML_TYPE_TEXT_OVERLINE_COLOR(XML_TEXT_TYPES_START + 112)
 #define XML_TYPE_TEXT_OVERLINE_HASCOLOR (XML_TEXT_TYPES_START + 113)
 #define XML_TYPE_BOOL_FALSE (XML_TEXT_TYPES_START + 114)
+#define XML_TYPE_TEXT_OVERFLOW_BEHAVIOR (XML_TEXT_TYPES_START + 115)
 
 #define XML_TYPE_CHAR_SCRIPT(XML_TEXT_TYPES_START + 116)
 #define XML_TYPE_CHAR_RFC_LANGUAGE_TAG  (XML_TEXT_TYPES_START + 117)
diff --git a/sd/qa/unit/data/odp/style-overflow-behavior-clip.fodp 
b/sd/qa/unit/data/odp/style-overflow-behavior-clip.fodp
new file mode 100644
index ..29baf838f724
--- /dev/null
+++ b/sd/qa/unit/data/odp/style-overflow-behavior-clip.fodp
@@ -0,0 +1,18 @@
+
+
+ 
+  
+   
+  
+ 
+ 
+  
+   
+
+  First line that is not clipped.
+  Second line that is clipped - but still shows up when 
editing
+
+   
+  
+ 
+
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 803408adc3f4..570e9078e914 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -178,6 +178,7 @@ public:
 void testTdf144092TableHeight();
 void testTdf151547TransparentWhiteText();
 void testTdf149588TransparentSolidFill();
+void testOverflowBehaviorClip();
 
 CPPUNIT_TEST_SUITE(SdImportTest2);
 
@@ -248,6 +249,7 @@ public:
 CPPUNIT_TEST(testTdf144092TableHeight);
 CPPUNIT_TEST(testTdf151547TransparentWhiteText);
 CPPUNIT_TEST(testTdf149588TransparentSolidFill);
+CPPUNIT_TEST(testOverflowBehaviorClip);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2064,8 +2066,29 @@ void SdImportTest2::testTdf149588TransparentSolidFill()
 xDocShRef->DoClose();
 }
 
-CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2);
+void SdImportTest2::testOverflowBehaviorClip()
+{
+sd::DrawDocShellRef xDocShRef = loadURL(
+
m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/style-overflow-behavior-clip.fodp"),
+FODP);
+{
+uno::Reference xPropSet(getShapeFromPage(0, 0, 
xDocShRef));
+// Without the accompanying fix in place, this test would have failed 
with:
+// - Expected: 1
+// - Actual  : 0
+CPPUNIT_ASSERT_EQUAL(true,
+ 
xPropSet->getPropertyValue("TextClipVerticalOverflow").get());
+}
 
+xDocShRef = saveAndReload(xDocShRef.get(), ODP);
+{
+uno::Reference xPropSet(getShapeFromPage(0, 0, 
xDocShRef));
+

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - oox/inc oox/source svx/qa

2023-04-12 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/textbodyproperties.hxx   |2 
 oox/source/drawingml/shape.cxx |5 --
 oox/source/drawingml/textbodypropertiescontext.cxx |   14 ++
 oox/source/export/drawingml.cxx|5 ++
 oox/source/token/properties.txt|1 
 svx/qa/unit/data/clip-vertical-overflow.pptx   |binary
 svx/qa/unit/svdraw.cxx |   45 +
 7 files changed, 67 insertions(+), 5 deletions(-)

New commits:
commit 37006e138407017366c3a0cb62ee71a6f7418c5d
Author: Sarper Akdemir 
AuthorDate: Thu Apr 6 13:01:02 2023 +0300
Commit: Andras Timar 
CommitDate: Wed Apr 12 23:28:26 2023 +0200

pptx import/export: consider TextClipVerticalOverflow for vertOverflow

Also adds a unit test that tests TextClipVerticalOverflow on
4 different scenarios.

Change-Id: I6232935765641c796046d90fe2207d67ae4b3eb5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150107
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150237
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/oox/inc/drawingml/textbodyproperties.hxx 
b/oox/inc/drawingml/textbodyproperties.hxx
index 7cc1b9d8041c..1945a2c185df 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -48,7 +48,7 @@ struct TextBodyProperties
 /// Normal autofit: font scale (default: 100%).
 sal_Int32 mnFontScale = 10;
 OUString msHorzOverflow;
-OUString msVertOverflow;
+std::optional< sal_Int32 > moVertOverflow{};
 
 std::array, 4> maTextDistanceValues;
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 2f4a85854dba..ae564c91ccb8 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1611,9 +1611,8 @@ Reference< XShape > const & Shape::createAndInsert(
 auto sHorzOverflow = 
getTextBody()->getTextProperties().msHorzOverflow;
 if (!sHorzOverflow.isEmpty())
 putPropertyToGrabBag("horzOverflow", 
uno::makeAny(getTextBody()->getTextProperties().msHorzOverflow));
-auto nVertOverflow = 
getTextBody()->getTextProperties().msVertOverflow;
-if (!nVertOverflow.isEmpty())
-putPropertyToGrabBag("vertOverflow", 
uno::makeAny(getTextBody()->getTextProperties().msVertOverflow));
+if (XML_ellipsis == 
getTextBody()->getTextProperties().moVertOverflow)
+putPropertyToGrabBag("vertOverflow", 
uno::makeAny(OUString{"ellipsis"}));
 }
 
 // Note that the script 
oox/source/drawingml/customshapes/generatePresetsData.pl looks
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx 
b/oox/source/drawingml/textbodypropertiescontext.cxx
index f7d4abd4e685..3c3950762c3d 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -85,7 +85,19 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( 
ContextHandler2Helper cons
   // ST_TextHorzOverflowType
 mrTextBodyProp.msHorzOverflow = rAttribs.getString(XML_horzOverflow, "");
 // ST_TextVertOverflowType
-mrTextBodyProp.msVertOverflow = rAttribs.getString(XML_vertOverflow, "");
+if( rAttribs.hasAttribute(XML_vertOverflow) )
+{
+mrTextBodyProp.moVertOverflow = 
rAttribs.getToken(XML_vertOverflow).get(XML_overflow);
+switch( mrTextBodyProp.moVertOverflow.value_or(XML_overflow) )
+{
+case XML_ellipsis:
+case XML_clip:
+
mrTextBodyProp.maPropertyMap.setProperty(PROP_TextClipVerticalOverflow, true);
+break;
+default:
+break;
+}
+}
 
 // ST_TextColumnCount
 if (const sal_Int32 nColumns = rAttribs.getInteger(XML_numCol, 0); 
nColumns > 0)
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 36006e2af562..2999f1fcd8d7 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3510,6 +3510,11 @@ void DrawingML::WriteText(const Reference& 
rXIface, bool bBodyPr, bo
 }
 }
 
+if (!sVertOverflow && GetProperty(rXPropSet, 
"TextClipVerticalOverflow") && mAny.get())
+{
+sVertOverflow = "clip";
+}
+
 mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), 
XML_bodyPr,
XML_numCol, 
sax_fastparser::UseIf(OString::number(nCols), nCols > 0),
XML_spcCol, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nColSpacing)),
 nCols > 0 && nColSpacing >= 0),
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index e3188542..cea3ea503703 100644
--- a/oox/source/token/properties.txt
+++ 

[Libreoffice-commits] core.git: include/xmloff sd/qa xmloff/inc xmloff/source

2023-04-12 Thread Sarper Akdemir (via logerrit)
 include/xmloff/xmltoken.hxx   |2 +
 include/xmloff/xmltypes.hxx   |1 
 sd/qa/unit/data/odp/style-overflow-behavior-clip.fodp |   18 
 sd/qa/unit/import-tests2.cxx  |   20 ++
 xmloff/inc/xmlprop.hxx|1 
 xmloff/source/core/xmltoken.cxx   |2 +
 xmloff/source/draw/sdpropls.cxx   |1 
 xmloff/source/style/prhdlfac.cxx  |5 
 xmloff/source/token/tokens.txt|2 +
 9 files changed, 52 insertions(+)

New commits:
commit a925476352b3cb32f6384e7b0fb07e323bb6e64f
Author: Sarper Akdemir 
AuthorDate: Fri Apr 7 13:32:49 2023 +0300
Commit: Tomaž Vajngerl 
CommitDate: Wed Apr 12 14:47:18 2023 +0200

xmloff: ODF import/export for style:overflow-behavior "clip"

Adds initial support for style:overflow-behavior

According to OpenDocument-v1.3-part3 style:overflow-behavior can take
values of:
- "clip"
- "auto-create-new-frame"

This patch doesn't properly implement support "auto-create-new-frame",
only "clip".

If "clip" is set, TextClipVerticalOverflow is set to true, causing the
vertical overflowing text to be clipped.

"auto-create-new-frame" is treated the same as omitting the
style:overflow-behavior attribute, setting TextClipVerticalOverflow to
false.

Change-Id: Iea298f41fbf0cf18dc07f41788ba0b665515db8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150122
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 5262f3b3ab5e..0fc0127813e7 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -287,6 +287,7 @@ namespace xmloff::token {
 XML_AUTHOR_NAME,
 XML_AUTO,
 XML_AUTO_COMPLETE,
+XML_AUTO_CREATE_NEW_FRAME,
 XML_AUTO_GROW_HEIGHT,
 XML_AUTO_GROW_WIDTH,
 XML_AUTO_RELOAD,
@@ -1455,6 +1456,7 @@ namespace xmloff::token {
 XML_OUTLINE_STYLE,
 XML_OUTSET,
 XML_OUTSIDE,
+XML_OVERFLOW_BEHAVIOR,
 XML_OVERLAP,
 XML_OVERLAY,
 XML_P,
diff --git a/include/xmloff/xmltypes.hxx b/include/xmloff/xmltypes.hxx
index 13e7c3fcc6c0..4dbf2081db1b 100644
--- a/include/xmloff/xmltypes.hxx
+++ b/include/xmloff/xmltypes.hxx
@@ -277,6 +277,7 @@
 #define XML_TYPE_TEXT_OVERLINE_COLOR(XML_TEXT_TYPES_START + 112)
 #define XML_TYPE_TEXT_OVERLINE_HASCOLOR (XML_TEXT_TYPES_START + 113)
 #define XML_TYPE_BOOL_FALSE (XML_TEXT_TYPES_START + 114)
+#define XML_TYPE_TEXT_OVERFLOW_BEHAVIOR (XML_TEXT_TYPES_START + 115)
 
 #define XML_TYPE_CHAR_SCRIPT(XML_TEXT_TYPES_START + 116)
 #define XML_TYPE_CHAR_RFC_LANGUAGE_TAG  (XML_TEXT_TYPES_START + 117)
diff --git a/sd/qa/unit/data/odp/style-overflow-behavior-clip.fodp 
b/sd/qa/unit/data/odp/style-overflow-behavior-clip.fodp
new file mode 100644
index ..29baf838f724
--- /dev/null
+++ b/sd/qa/unit/data/odp/style-overflow-behavior-clip.fodp
@@ -0,0 +1,18 @@
+
+
+ 
+  
+   
+  
+ 
+ 
+  
+   
+
+  First line that is not clipped.
+  Second line that is clipped - but still shows up when 
editing
+
+   
+  
+ 
+
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index e585673e3ad8..dd290907ee79 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1872,6 +1872,26 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, 
testTdf149588TransparentSolidFill)
 CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xCC636363), nCharColor);
 }
 
+CPPUNIT_TEST_FIXTURE(SdImportTest2, testOverflowBehaviorClip)
+{
+createSdImpressDoc("odp/style-overflow-behavior-clip.fodp");
+{
+uno::Reference xPropSet(getShapeFromPage(0, 0));
+// Without the accompanying fix in place, this test would have failed 
with:
+// - Expected: 1
+// - Actual  : 0
+CPPUNIT_ASSERT_EQUAL(true,
+ 
xPropSet->getPropertyValue("TextClipVerticalOverflow").get());
+}
+
+saveAndReload("impress8");
+{
+uno::Reference xPropSet(getShapeFromPage(0, 0));
+CPPUNIT_ASSERT_EQUAL(true,
+ 
xPropSet->getPropertyValue("TextClipVerticalOverflow").get());
+}
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx
index 3b2cd86816bc..b93bf926e569 100644
--- a/xmloff/inc/xmlprop.hxx
+++ b/xmloff/inc/xmlprop.hxx
@@ -611,6 +611,7 @@ inline constexpr OUStringLiteral PROP_TextAutoGrowWidth = 
u"TextAutoGrowWidth";
 inline constexpr OUStringLiteral PROP_TextBreak = u"TextBreak";
 inline constexpr OUStringLiteral PROP_TextCanOverlap = u"TextCanOverlap";
 inline constexpr OUStringLiteral PROP_TextChainNextName = u"TextChainNextName";

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - include/editeng include/svx svx/source

2023-04-11 Thread Sarper Akdemir (via logerrit)
 include/editeng/unoprnms.hxx|1 +
 include/svx/svddef.hxx  |3 ++-
 include/svx/unoshprp.hxx|1 +
 svx/source/svdraw/svdattr.cxx   |1 +
 svx/source/svdraw/svdotextdecomposition.cxx |   14 +-
 5 files changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 7e72c0cf0ac69f8c76ccaf0806ef85a8c1532664
Author: Sarper Akdemir 
AuthorDate: Thu Apr 6 13:00:53 2023 +0300
Commit: Tomaž Vajngerl 
CommitDate: Wed Apr 12 06:06:43 2023 +0200

editeng, svx: introduce ability to clip vertical text overflow

Introduces editeng text property TextClipVerticalOverflow.

Which when set causes vertical text that is overflown out of a
frame/shape truncated. (Only when text isn't being edited)

This is implemented as two steps:
(if text overflows)
  1 - Vertical adjust is forced to top.
(Forcing vert adjust to top isn't the desired behavior normally,
but good enough for a first cut I'd say.)
   -> The desired behavior would be after the overflown text is
   truncated, doing a vertical adjust (of center/bottom/top) on
   that piece of text.

  2 - ClipRange is set to the height of the frame/shape.

This appears to work with different text directions too (vertical
etc.).

Change-Id: I697715a7d28bde94a6650609b16505ffab92173f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150106
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150236
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index a85afe0788f8..d47a2337e247 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -124,6 +124,7 @@
 #define UNO_NAME_TEXT_FONTINDEPENDENTLINESPACING "FontIndependentLineSpacing"
 #define UNO_NAME_TEXT_WORDWRAP  "TextWordWrap"
 #define UNO_NAME_TEXT_CHAINNEXTNAME  "TextChainNextName"
+#define UNO_NAME_TEXT_CLIPVERTOVERFLOW  u"TextClipVerticalOverflow"
 
 #define UNO_NAME_MEASUREKIND"MeasureKind"
 #define UNO_NAME_MEASURETEXTHPOS"MeasureTextHorizontalPosition"
diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx
index 9332dc65a59f..9b3b1a358369 100644
--- a/include/svx/svddef.hxx
+++ b/include/svx/svddef.hxx
@@ -231,7 +231,8 @@ constexpr TypedWhichId 
SDRATTR_XMLATTRIBUTES
 constexpr TypedWhichId 
SDRATTR_TEXT_USEFIXEDCELLHEIGHT (SDRATTR_MISC_FIRST +23); /*   1121 */ /*   
1121 */ /*   1104 */ /* Pool V2 */
 constexpr TypedWhichId   SDRATTR_TEXT_WORDWRAP   
(SDRATTR_MISC_FIRST +24); /*   1122 */ /*   1122 */ /*   1105 */
 /* Pool V2 */
 constexpr TypedWhichId  SDRATTR_TEXT_CHAINNEXTNAME  
(SDRATTR_MISC_FIRST +25); /*   1123 */ /*   1123 */ /*   1106 */
 /* Pool V2 */
-constexpr sal_uInt16   SDRATTR_MISC_LAST   
(SDRATTR_TEXT_CHAINNEXTNAME); /* 1125   */ /* 1125   */ /* 1108   */ /* 
Pool V1: 1056 */
+constexpr TypedWhichId   
SDRATTR_TEXT_CLIPVERTOVERFLOW   (SDRATTR_MISC_FIRST +26);
+constexpr sal_uInt16   SDRATTR_MISC_LAST   
(SDRATTR_TEXT_CLIPVERTOVERFLOW); /* 1126   */ /* 1125   */ /* 1108   */ /* 
Pool V1: 1056 */
 
 constexpr sal_uInt16  SDRATTR_EDGE_FIRST 
(SDRATTR_MISC_LAST + 1);/* 1127   */ /* Pool V4 */
 constexpr TypedWhichId   SDRATTR_EDGEKIND   
(SDRATTR_EDGE_FIRST + 0);   /*   1127 */ /* Pool V4 */
diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx
index 4deec20d7783..99d305644282 100644
--- a/include/svx/unoshprp.hxx
+++ b/include/svx/unoshprp.hxx
@@ -325,6 +325,7 @@
 { u"" UNO_NAME_TEXT_VERTADJUST,   SDRATTR_TEXT_VERTADJUST,
cppu::UnoType::get(),0,  0},\
 { u"" UNO_NAME_TEXT_WORDWRAP, SDRATTR_TEXT_WORDWRAP,  
cppu::UnoType::get(),0,  0}, \
 { u"" UNO_NAME_TEXT_CHAINNEXTNAME,SDRATTR_TEXT_CHAINNEXTNAME, 
::cppu::UnoType::get(),0,  0}, \
+{ u"" UNO_NAME_TEXT_CLIPVERTOVERFLOW, SDRATTR_TEXT_CLIPVERTOVERFLOW,  
cppu::UnoType::get(),  0,  0}, \
 { u"TextColumns", OWN_ATTR_TEXTCOLUMNS,   
cppu::UnoType::get(), 0, 0 }, \
 SVX_UNOEDIT_CHAR_PROPERTIES, \
 SVX_UNOEDIT_PARA_PROPERTIES,
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index b0df93a13855..b71ac9919f4a 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -170,6 +170,7 @@ SdrItemPool::SdrItemPool(
 rPoolDefaults[SDRATTR_TEXT_CHAINNEXTNAME-SDRATTR_START]=new 
SfxStringItem(SDRATTR_TEXT_CHAINNEXTNAME, "");
 rPoolDefaults[SDRATTR_TEXT_USEFIXEDCELLHEIGHT -SDRATTR_START]=new 

[Libreoffice-commits] core.git: 2 commits - include/editeng include/svx oox/inc oox/source svx/qa svx/source

2023-04-10 Thread Sarper Akdemir (via logerrit)
 include/editeng/unoprnms.hxx   |1 
 include/svx/svddef.hxx |3 -
 include/svx/unoshprp.hxx   |1 
 oox/inc/drawingml/textbodyproperties.hxx   |2 
 oox/source/drawingml/shape.cxx |5 --
 oox/source/drawingml/textbodypropertiescontext.cxx |   14 ++
 oox/source/export/drawingml.cxx|5 ++
 oox/source/token/properties.txt|1 
 svx/qa/unit/data/clip-vertical-overflow.pptx   |binary
 svx/qa/unit/svdraw.cxx |   44 +
 svx/source/svdraw/svdattr.cxx  |1 
 svx/source/svdraw/svdotextdecomposition.cxx|   14 --
 12 files changed, 80 insertions(+), 11 deletions(-)

New commits:
commit 60bce1af8aab2115d603781193bb659b35d1aedb
Author: Sarper Akdemir 
AuthorDate: Thu Apr 6 13:01:02 2023 +0300
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 10 08:52:51 2023 +0200

pptx import/export: consider TextClipVerticalOverflow for vertOverflow

Also adds a unit test that tests TextClipVerticalOverflow on
4 different scenarios.

Change-Id: I6232935765641c796046d90fe2207d67ae4b3eb5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150107
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/oox/inc/drawingml/textbodyproperties.hxx 
b/oox/inc/drawingml/textbodyproperties.hxx
index 1daa5d592a30..d935f940638d 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -51,7 +51,7 @@ struct TextBodyProperties
 /// Normal autofit: font scale (default: 100%).
 sal_Int32 mnFontScale = 10;
 OUString msHorzOverflow;
-OUString msVertOverflow;
+std::optional< sal_Int32 > moVertOverflow{};
 
 std::array, 4> maTextDistanceValues;
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index fbd3e79c5a6e..69f3bf5a4d60 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1792,9 +1792,8 @@ Reference< XShape > const & Shape::createAndInsert(
 auto sHorzOverflow = 
getTextBody()->getTextProperties().msHorzOverflow;
 if (!sHorzOverflow.isEmpty())
 putPropertyToGrabBag("horzOverflow", 
uno::Any(getTextBody()->getTextProperties().msHorzOverflow));
-auto nVertOverflow = 
getTextBody()->getTextProperties().msVertOverflow;
-if (!nVertOverflow.isEmpty())
-putPropertyToGrabBag("vertOverflow", 
uno::Any(getTextBody()->getTextProperties().msVertOverflow));
+if (XML_ellipsis == 
getTextBody()->getTextProperties().moVertOverflow)
+putPropertyToGrabBag("vertOverflow", 
uno::Any(OUString{"ellipsis"}));
 }
 
 // Note that the script 
oox/source/drawingml/customshapes/generatePresetsData.pl looks
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx 
b/oox/source/drawingml/textbodypropertiescontext.cxx
index 47ef04797c93..46576c069c8e 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -83,7 +83,19 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( 
ContextHandler2Helper cons
   // ST_TextHorzOverflowType
 mrTextBodyProp.msHorzOverflow = 
rAttribs.getStringDefaulted(XML_horzOverflow);
 // ST_TextVertOverflowType
-mrTextBodyProp.msVertOverflow = 
rAttribs.getStringDefaulted(XML_vertOverflow);
+if( rAttribs.hasAttribute(XML_vertOverflow) )
+{
+mrTextBodyProp.moVertOverflow = rAttribs.getToken(XML_vertOverflow);
+switch( mrTextBodyProp.moVertOverflow.value_or(XML_overflow) )
+{
+case XML_ellipsis:
+case XML_clip:
+
mrTextBodyProp.maPropertyMap.setProperty(PROP_TextClipVerticalOverflow, true);
+break;
+default:
+break;
+}
+}
 
 // ST_TextColumnCount
 if (const sal_Int32 nColumns = rAttribs.getInteger(XML_numCol, 0); 
nColumns > 0)
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 59d67393bed5..270d961d6d5a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3868,6 +3868,11 @@ void DrawingML::WriteText(const Reference& 
rXIface, bool bBodyPr, bo
 }
 }
 
+if (!sVertOverflow && GetProperty(rXPropSet, 
"TextClipVerticalOverflow") && mAny.get())
+{
+sVertOverflow = "clip";
+}
+
 mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), 
XML_bodyPr,
XML_numCol, 
sax_fastparser::UseIf(OString::number(nCols), nCols > 0),
XML_spcCol, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nColSpacing)),
 nCols > 0 && nColSpacing >= 0),
diff --git 

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

2023-03-30 Thread Sarper Akdemir (via logerrit)
 include/editeng/tstpitem.hxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 6b19f32252f8ba5540ce3b1e38f8ac6112421906
Author: Sarper Akdemir 
AuthorDate: Thu Mar 30 01:37:07 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Thu Mar 30 11:30:10 2023 +

add docstring for unclear default distance property in SvxTabStopItem

Change-Id: I6c9eef0a2167f738cdab8171d082becfca401d25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149740
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/include/editeng/tstpitem.hxx b/include/editeng/tstpitem.hxx
index 4c015d6677ec..037e76636641 100644
--- a/include/editeng/tstpitem.hxx
+++ b/include/editeng/tstpitem.hxx
@@ -92,6 +92,7 @@ typedef o3tl::sorted_vector SvxTabStopArr;
 class EDITENG_DLLPUBLIC SvxTabStopItem final : public SfxPoolItem
 {
 SvxTabStopArr maTabStops;
+/// Defines default tab width for tabs without dedicated tab stop in the 
paragraph.
 sal_Int32 mnDefaultDistance = 0;
 
 public:


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - schema/libreoffice xmloff/inc xmloff/qa xmloff/source

2023-03-28 Thread Sarper Akdemir (via logerrit)
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |6 +
 xmloff/inc/xmlprop.hxx  |1 
 xmloff/qa/unit/data/paragraph-tab-stop-distance.fodp|   19 +
 xmloff/qa/unit/text.cxx |   41 
 xmloff/source/text/txtprmap.cxx |2 
 5 files changed, 69 insertions(+)

New commits:
commit aadb5323e1ebfad3d1d521229bd0ce03be2b1c81
Author: Sarper Akdemir 
AuthorDate: Fri Mar 3 18:04:46 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Mar 28 14:55:11 2023 +

related tdf#102261: xmloff: ODF import/export for ParaTabStopDefaultDistance

Introduces ODF import/export for ParaTabStopDefaultDistance
(loext:tab-stop-distance).

Also adds a unit test that covers import & export of the
property.

Change-Id: I8a69a9e2b73e8f1172f92dc35fada901f4b887f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148540
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149534
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Sarper Akdemir 

diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index cfb4e3e350a8..b0ae7f086609 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -2553,6 +2553,12 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
   
   
 
+
+
+  
+
+  
+
   
   
 
diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx
index ab7c53de01cf..3b2cd86816bc 100644
--- a/xmloff/inc/xmlprop.hxx
+++ b/xmloff/inc/xmlprop.hxx
@@ -513,6 +513,7 @@ inline constexpr OUStringLiteral 
PROP_ParaRightMarginRelative = u"ParaRightMargi
 inline constexpr OUStringLiteral PROP_ParaShadowFormat = u"ParaShadowFormat";
 inline constexpr OUStringLiteral PROP_ParaSplit = u"ParaSplit";
 inline constexpr OUStringLiteral PROP_ParaTabStops = u"ParaTabStops";
+inline constexpr OUStringLiteral PROP_ParaTabStopDefaultDistance = 
u"ParaTabStopDefaultDistance";
 inline constexpr OUStringLiteral PROP_ParaTopMargin = u"ParaTopMargin";
 inline constexpr OUStringLiteral PROP_ParaTopMarginRelative = 
u"ParaTopMarginRelative";
 inline constexpr OUStringLiteral PROP_ParaUserDefinedAttributes = 
u"ParaUserDefinedAttributes";
diff --git a/xmloff/qa/unit/data/paragraph-tab-stop-distance.fodp 
b/xmloff/qa/unit/data/paragraph-tab-stop-distance.fodp
new file mode 100644
index ..f51e75b79699
--- /dev/null
+++ b/xmloff/qa/unit/data/paragraph-tab-stop-distance.fodp
@@ -0,0 +1,19 @@
+
+
+ 
+  
+   
+  
+ 
+ 
+  
+   
+
+ 
+  starttab1tab2tab4
+ 
+
+   
+  
+ 
+
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index ded7196be09b..3664c5d8cfb8 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -1007,6 +1008,46 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testFloatingTableImport)
 CPPUNIT_ASSERT(bIsSplitAllowed);
 }
 
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testParagraphScopedTabDistance)
+{
+// Given a document with paragraph scoped default tab stop distance 
(loext:tab-stop-distance="0.5cm")
+loadFromURL(u"paragraph-tab-stop-distance.fodp");
+
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xPage(xDoc->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY_THROW);
+
+uno::Reference xShape(xPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xText
+= uno::Reference(xShape, 
uno::UNO_QUERY_THROW)->getText();
+
+uno::Reference paraEnumAccess(xText, 
uno::UNO_QUERY);
+uno::Reference 
paraEnum(paraEnumAccess->createEnumeration());
+uno::Reference xParagraph(paraEnum->nextElement(), 
uno::UNO_QUERY_THROW);
+
+uno::Reference runEnumAccess(xParagraph, 
uno::UNO_QUERY);
+uno::Reference runEnum = 
runEnumAccess->createEnumeration();
+uno::Reference xRun(runEnum->nextElement(), 
uno::UNO_QUERY);
+uno::Reference xPropSet(xRun, uno::UNO_QUERY_THROW);
+
+// Make sure the tab stop default distance is imported correctly
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+CPPUNIT_ASSERT_EQUAL(static_cast(1),
+ 
xPropSet->getPropertyValue("ParaTabStopDefaultDistance").get());
+
+// Save the imported file to test the export too
+save("impress8");
+
+// Then make sure we write the tab-stop-distance
+xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+assertXPath(pXmlDoc, 
"//style:style[@style:name='P1']/style:paragraph-properties",
+"tab-stop-distance", "10cm");
+
+

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svx/source

2023-03-28 Thread Sarper Akdemir (via logerrit)
 svx/source/dialog/svxruler.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit bc36476a50687a31e2934a5b52502f2f24424ce1
Author: Sarper Akdemir 
AuthorDate: Tue Feb 28 23:03:12 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Mar 28 14:54:50 2023 +

related tdf#102261: consider ParaTabStopDefaultDistance in SvxRuler

If there's a paragraph scoped tab default distance defined,
use that as the default tab distance in the SvxRuler instead
of the document wide setting.

Change-Id: I9b0e7d0db0b25aee08bd27948b2e462b4a4ee496
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148060
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149513
Tested-by: Sarper Akdemir 

diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index be53a0c91c58..671afa9f6737 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1027,7 +1027,10 @@ void SvxRuler::UpdateTabs()
 const tools::Long lPosPixel = ConvertHPosPixel(lParaIndent) + lLastTab;
 const tools::Long lRightIndent = ConvertHPosPixel(nRightFrameMargin - 
mxParaItem->GetRight());
 
-tools::Long nDefTabDist = ConvertHPosPixel(lDefTabDist);
+tools::Long lCurrentDefTabDist = lDefTabDist;
+if(mxTabStopItem->GetDefaultDistance())
+lCurrentDefTabDist = mxTabStopItem->GetDefaultDistance();
+tools::Long nDefTabDist = ConvertHPosPixel(lCurrentDefTabDist);
 
 const sal_uInt16 nDefTabBuf = lPosPixel > lRightIndent || lLastTab > 
lRightIndent
 ? 0
@@ -1063,13 +1066,13 @@ void SvxRuler::UpdateTabs()
 }
 
 // Adjust to previous-to-first default tab stop
-lLastTabOffsetLogic -= lLastTabOffsetLogic % lDefTabDist;
+lLastTabOffsetLogic -= lLastTabOffsetLogic % lCurrentDefTabDist;
 
 // fill the rest with default Tabs
 for (j = 0; j < nDefTabBuf; ++j)
 {
 //simply add the default distance to the last position
-lLastTabOffsetLogic += lDefTabDist;
+lLastTabOffsetLogic += lCurrentDefTabDist;
 if (bRTL)
 {
 mpTabs[nTabCount + TAB_GAP].nPos =


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - oox/source sd/qa

2023-03-28 Thread Sarper Akdemir (via logerrit)
 oox/source/export/drawingml.cxx|6 ++
 sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx |binary
 sd/qa/unit/export-tests-ooxml3.cxx |   24 
++
 3 files changed, 30 insertions(+)

New commits:
commit e76ac490a9dfc0ae1f6de3639179eac98ec1cb88
Author: Sarper Akdemir 
AuthorDate: Fri Mar 3 19:22:30 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Mar 28 14:54:32 2023 +

tdf#102261: pptx export: implement defTabSz ParaTabStopDefaultDistance

Adds export of ParaTabStopDefaultDistance property into defTabSz.

Also adds a unit test that checks pptx roundtrip of the property.

Change-Id: I5be9ea88b15e3e8cab25af79488983a71b96dae1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148539
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149512
Tested-by: Sarper Akdemir 
Reviewed-by: Sarper Akdemir 

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 4f98a8803edf..3cb7d4448a9e 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3190,6 +3190,10 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
 return false;
 }
 
+sal_Int32 nParaDefaultTabSize = 0;
+if (GetProperty(rXPropSet, "ParaTabStopDefaultDistance"))
+mAny >>= nParaDefaultTabSize;
+
 // for autofitted textboxes, scale the indents
 if (GetProperty(rXShapePropSet, "TextFitToSize") && 
mAny.get() == TextFitToSizeType_AUTOFIT)
 {
@@ -3214,6 +3218,7 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
XML_marL, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaLeftMargin)),
 nParaLeftMargin > 0),
XML_indent, 
sax_fastparser::UseIf(OString::number(!bForceZeroIndent ? 
oox::drawingml::convertHmmToEmu(nParaFirstLineIndent) : 0), (bForceZeroIndent 
|| (nParaFirstLineIndent != 0))),
XML_algn, GetAlignment( nAlignment ),
+   XML_defTabSz, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaDefaultTabSize)),
 nParaDefaultTabSize > 0),
XML_rtl, sax_fastparser::UseIf(ToPsz10(bRtl), 
bRtl));
 else
 mpFS->startElementNS( XML_a, nElement,
@@ -3221,6 +3226,7 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
XML_marL, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)),
 nLeftMargin > 0),
XML_indent, 
sax_fastparser::UseIf(OString::number(!bForceZeroIndent ? 
oox::drawingml::convertHmmToEmu(nLineIndentation) : 0), (bForceZeroIndent || ( 
nLineIndentation != 0))),
XML_algn, GetAlignment( nAlignment ),
+   XML_defTabSz, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaDefaultTabSize)),
 nParaDefaultTabSize > 0),
XML_rtl, sax_fastparser::UseIf(ToPsz10(bRtl), 
bRtl));
 
 
diff --git a/sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx 
b/sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx
new file mode 100644
index ..88438d7b5494
Binary files /dev/null and 
b/sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 287f35cc3637..4c7d020b1432 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -132,6 +132,7 @@ public:
 void testTdf151622_oleIcon();
 void testTdf152436();
 void testLinkedOLE();
+void testTdf102261_testParaTabStopDefaultDistance();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest3);
 
@@ -225,6 +226,7 @@ public:
 CPPUNIT_TEST(testTdf151622_oleIcon);
 CPPUNIT_TEST(testTdf152436);
 CPPUNIT_TEST(testLinkedOLE);
+CPPUNIT_TEST(testTdf102261_testParaTabStopDefaultDistance);
 CPPUNIT_TEST_SUITE_END();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -2135,6 +2137,28 @@ void SdOOXMLExportTest3::testLinkedOLE()
 assertXPath(pXml, "//p:oleObj", 1);
 }
 
+void SdOOXMLExportTest3::testTdf102261_testParaTabStopDefaultDistance()
+{
+createSdImpressDoc("pptx/tdf102261_testParaTabStopDefaultDistance.pptx");
+saveAndReload("Impress Office Open XML");
+
+uno::Reference xShape(getShapeFromPage(0, 0));
+{
+uno::Reference xPropSet(getParagraphFromShape(0, 
xShape),
+ uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(
+sal_Int32{ 1270 },
+
xPropSet->getPropertyValue("ParaTabStopDefaultDistance").get());
+}
+{
+uno::Reference 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - editeng/source include/editeng oox/inc oox/source sd/qa

2023-03-28 Thread Sarper Akdemir (via logerrit)
 editeng/source/editeng/editdoc.cxx  |   11 +
 editeng/source/items/paraitem.cxx   |   32 
 include/editeng/memberids.h |1 
 include/editeng/tstpitem.hxx|3 +
 include/editeng/unoprnms.hxx|1 
 include/editeng/unotext.hxx |1 
 oox/inc/drawingml/textparagraphproperties.hxx   |2 +
 oox/source/drawingml/textparagraphproperties.cxx|7 +++
 oox/source/drawingml/textparagraphpropertiescontext.cxx |   12 --
 oox/source/token/properties.txt |1 
 sd/qa/unit/import-tests2.cxx|4 +-
 11 files changed, 69 insertions(+), 6 deletions(-)

New commits:
commit e4952bbf58edeb6f385d4003f370955994426a9f
Author: Sarper Akdemir 
AuthorDate: Tue Feb 28 16:36:40 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Mar 28 14:53:32 2023 +

tdf#102261: pptx import: handle defTabSz

Introduce import of defTabSz using ParaTabStopDefaultDistance.

Change-Id: Ied59c2bc5d9dfffa6254ef87849c3dbad4c48d07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148059
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149511
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Sarper Akdemir 

diff --git a/oox/inc/drawingml/textparagraphproperties.hxx 
b/oox/inc/drawingml/textparagraphproperties.hxx
index 083b61e37da7..d3742e7377e0 100644
--- a/oox/inc/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/drawingml/textparagraphproperties.hxx
@@ -89,6 +89,7 @@ public:
 TextSpacing&getParaBottomMargin() { return 
maParaBottomMargin; }
 std::optional< sal_Int32 >&   getParaLeftMargin(){ return 
moParaLeftMargin; }
 std::optional< sal_Int32 >&   getFirstLineIndentation(){ return 
moFirstLineIndentation; }
+std::optional& getDefaultTabSize() { return 
moDefaultTabSize; }
 
 std::optional< css::style::ParagraphAdjust >&   getParaAdjust() { 
return moParaAdjust; }
 voidsetParaAdjust( 
css::style::ParagraphAdjust nParaAdjust ) { moParaAdjust = nParaAdjust; }
@@ -125,6 +126,7 @@ private:
 std::optional< sal_Int32 >moParaLeftMargin;
 std::optional< sal_Int32 >moFirstLineIndentation;
 std::optional< css::style::ParagraphAdjust >moParaAdjust;
+std::optional< sal_Int32 >  moDefaultTabSize;
 sal_Int16   mnLevel;
 TextSpacing maLineSpacing;
 };
diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index 0006b7530a76..af65e0037d16 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -395,6 +395,8 @@ void TextParagraphProperties::apply( const 
TextParagraphProperties& rSourceProps
 moParaLeftMargin = rSourceProps.moParaLeftMargin;
 if ( rSourceProps.moFirstLineIndentation )
 moFirstLineIndentation = rSourceProps.moFirstLineIndentation;
+if ( rSourceProps.moDefaultTabSize )
+moDefaultTabSize = rSourceProps.moDefaultTabSize;
 if( rSourceProps.mnLevel )
 mnLevel = rSourceProps.mnLevel;
 if( rSourceProps.moParaAdjust )
@@ -501,6 +503,11 @@ void TextParagraphProperties::pushToPropSet( const 
::oox::core::XmlFilterBase* p
 }
 }
 
+if ( moDefaultTabSize )
+{
+aPropSet.setProperty( PROP_ParaTabStopDefaultDistance, 
*moDefaultTabSize );
+}
+
 if ( moParaAdjust )
 {
 aPropSet.setProperty( PROP_ParaAdjust, *moParaAdjust);
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx 
b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 4e83d2ece24b..e75d65913cd9 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -93,10 +93,14 @@ 
TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2H
 // TODO see to do the same with RubyAdjust
 
 // ST_Coordinate32
-//  sValue = rAttribs.getString( XML_defTabSz ).get();SJ: we need to be 
able to set the default tab size for each text object,
-//  this is possible 
at the moment only for the whole document.
-//  sal_Int32 nDefTabSize = ( sValue.getLength() == 0 ? 0 : GetCoordinate(  
sValue ) );
-// TODO
+if ( rAttribs.hasAttribute(XML_defTabSz))
+{
+sValue = rAttribs.getStringDefaulted(XML_defTabSz);
+if(!sValue.isEmpty())
+{
+mrTextParagraphProperties.getDefaultTabSize() = 
GetCoordinate(sValue);
+}
+}
 
 //  bool bEaLineBrk = rAttribs.getBool( XML_eaLnBrk, true );
 if ( rAttribs.hasAttribute( XML_latinLnBrk ) )
diff --git 

[Libreoffice-commits] core.git: schema/libreoffice xmloff/inc xmloff/qa xmloff/source

2023-03-24 Thread Sarper Akdemir (via logerrit)
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |6 +
 xmloff/inc/xmlprop.hxx  |1 
 xmloff/qa/unit/data/paragraph-tab-stop-distance.fodp|   19 +
 xmloff/qa/unit/text.cxx |   41 
 xmloff/source/text/txtprmap.cxx |2 
 5 files changed, 69 insertions(+)

New commits:
commit fa5c01e67775c01b302fc08033a0eb78d3b87489
Author: Sarper Akdemir 
AuthorDate: Fri Mar 3 18:04:46 2023 +0300
Commit: Miklos Vajna 
CommitDate: Fri Mar 24 07:18:54 2023 +

related tdf#102261: xmloff: ODF import/export for ParaTabStopDefaultDistance

Introduces ODF import/export for ParaTabStopDefaultDistance
(loext:tab-stop-distance).

Also adds a unit test that covers import & export of the
property.

Change-Id: I8a69a9e2b73e8f1172f92dc35fada901f4b887f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148540
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index f0f84bd3fd40..fa38694f9cff 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -2615,6 +2615,12 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
   
   
 
+
+
+  
+
+  
+
   
   
 
diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx
index ab7c53de01cf..3b2cd86816bc 100644
--- a/xmloff/inc/xmlprop.hxx
+++ b/xmloff/inc/xmlprop.hxx
@@ -513,6 +513,7 @@ inline constexpr OUStringLiteral 
PROP_ParaRightMarginRelative = u"ParaRightMargi
 inline constexpr OUStringLiteral PROP_ParaShadowFormat = u"ParaShadowFormat";
 inline constexpr OUStringLiteral PROP_ParaSplit = u"ParaSplit";
 inline constexpr OUStringLiteral PROP_ParaTabStops = u"ParaTabStops";
+inline constexpr OUStringLiteral PROP_ParaTabStopDefaultDistance = 
u"ParaTabStopDefaultDistance";
 inline constexpr OUStringLiteral PROP_ParaTopMargin = u"ParaTopMargin";
 inline constexpr OUStringLiteral PROP_ParaTopMarginRelative = 
u"ParaTopMarginRelative";
 inline constexpr OUStringLiteral PROP_ParaUserDefinedAttributes = 
u"ParaUserDefinedAttributes";
diff --git a/xmloff/qa/unit/data/paragraph-tab-stop-distance.fodp 
b/xmloff/qa/unit/data/paragraph-tab-stop-distance.fodp
new file mode 100644
index ..f51e75b79699
--- /dev/null
+++ b/xmloff/qa/unit/data/paragraph-tab-stop-distance.fodp
@@ -0,0 +1,19 @@
+
+
+ 
+  
+   
+  
+ 
+ 
+  
+   
+
+ 
+  starttab1tab2tab4
+ 
+
+   
+  
+ 
+
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 7fe762580ac1..5d3a9cf4ac99 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -1047,6 +1048,46 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testFloatingTableImport)
 CPPUNIT_ASSERT(bIsSplitAllowed);
 }
 
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testParagraphScopedTabDistance)
+{
+// Given a document with paragraph scoped default tab stop distance 
(loext:tab-stop-distance="0.5cm")
+loadFromURL(u"paragraph-tab-stop-distance.fodp");
+
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xPage(xDoc->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY_THROW);
+
+uno::Reference xShape(xPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xText
+= uno::Reference(xShape, 
uno::UNO_QUERY_THROW)->getText();
+
+uno::Reference paraEnumAccess(xText, 
uno::UNO_QUERY);
+uno::Reference 
paraEnum(paraEnumAccess->createEnumeration());
+uno::Reference xParagraph(paraEnum->nextElement(), 
uno::UNO_QUERY_THROW);
+
+uno::Reference runEnumAccess(xParagraph, 
uno::UNO_QUERY);
+uno::Reference runEnum = 
runEnumAccess->createEnumeration();
+uno::Reference xRun(runEnum->nextElement(), 
uno::UNO_QUERY);
+uno::Reference xPropSet(xRun, uno::UNO_QUERY_THROW);
+
+// Make sure the tab stop default distance is imported correctly
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+CPPUNIT_ASSERT_EQUAL(static_cast(1),
+ 
xPropSet->getPropertyValue("ParaTabStopDefaultDistance").get());
+
+// Save the imported file to test the export too
+save("impress8");
+
+// Then make sure we write the tab-stop-distance
+xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+assertXPath(pXmlDoc, 
"//style:style[@style:name='P1']/style:paragraph-properties",
+"tab-stop-distance", "10cm");
+
+assertXPath(pXmlDoc, "//text:p[@text:style-name='P1']");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

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

2023-03-17 Thread Sarper Akdemir (via logerrit)
 svx/source/dialog/svxruler.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit f92721bf182952be88b0349a17e46b684d630c29
Author: Sarper Akdemir 
AuthorDate: Tue Feb 28 23:03:12 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Mar 17 11:06:43 2023 +

related tdf#102261: consider ParaTabStopDefaultDistance in SvxRuler

If there's a paragraph scoped tab default distance defined,
use that as the default tab distance in the SvxRuler instead
of the document wide setting.

Change-Id: I9b0e7d0db0b25aee08bd27948b2e462b4a4ee496
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148060
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index be53a0c91c58..671afa9f6737 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1027,7 +1027,10 @@ void SvxRuler::UpdateTabs()
 const tools::Long lPosPixel = ConvertHPosPixel(lParaIndent) + lLastTab;
 const tools::Long lRightIndent = ConvertHPosPixel(nRightFrameMargin - 
mxParaItem->GetRight());
 
-tools::Long nDefTabDist = ConvertHPosPixel(lDefTabDist);
+tools::Long lCurrentDefTabDist = lDefTabDist;
+if(mxTabStopItem->GetDefaultDistance())
+lCurrentDefTabDist = mxTabStopItem->GetDefaultDistance();
+tools::Long nDefTabDist = ConvertHPosPixel(lCurrentDefTabDist);
 
 const sal_uInt16 nDefTabBuf = lPosPixel > lRightIndent || lLastTab > 
lRightIndent
 ? 0
@@ -1063,13 +1066,13 @@ void SvxRuler::UpdateTabs()
 }
 
 // Adjust to previous-to-first default tab stop
-lLastTabOffsetLogic -= lLastTabOffsetLogic % lDefTabDist;
+lLastTabOffsetLogic -= lLastTabOffsetLogic % lCurrentDefTabDist;
 
 // fill the rest with default Tabs
 for (j = 0; j < nDefTabBuf; ++j)
 {
 //simply add the default distance to the last position
-lLastTabOffsetLogic += lDefTabDist;
+lLastTabOffsetLogic += lCurrentDefTabDist;
 if (bRTL)
 {
 mpTabs[nTabCount + TAB_GAP].nPos =


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

2023-03-16 Thread Sarper Akdemir (via logerrit)
 oox/source/export/drawingml.cxx|6 ++
 sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx |binary
 sd/qa/unit/export-tests-ooxml3.cxx |   22 
++
 3 files changed, 28 insertions(+)

New commits:
commit f039fe0da31907a58a4c3b6717cf29caf2685101
Author: Sarper Akdemir 
AuthorDate: Fri Mar 3 19:22:30 2023 +0300
Commit: Miklos Vajna 
CommitDate: Thu Mar 16 15:47:29 2023 +

tdf#102261: pptx export: implement defTabSz ParaTabStopDefaultDistance

Adds export of ParaTabStopDefaultDistance property into defTabSz.

Also adds a unit test that checks pptx roundtrip of the property.

Change-Id: I5be9ea88b15e3e8cab25af79488983a71b96dae1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148539
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8f16b1ebc95e..5335dca58486 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3290,6 +3290,10 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
 return false;
 }
 
+sal_Int32 nParaDefaultTabSize = 0;
+if (GetProperty(rXPropSet, "ParaTabStopDefaultDistance"))
+mAny >>= nParaDefaultTabSize;
+
 // for autofitted textboxes, scale the indents
 if (GetProperty(rXShapePropSet, "TextFitToSize") && 
mAny.get() == TextFitToSizeType_AUTOFIT)
 {
@@ -3314,6 +3318,7 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
XML_marL, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaLeftMargin)),
 nParaLeftMargin > 0),
XML_indent, 
sax_fastparser::UseIf(OString::number(!bForceZeroIndent ? 
oox::drawingml::convertHmmToEmu(nParaFirstLineIndent) : 0), (bForceZeroIndent 
|| (nParaFirstLineIndent != 0))),
XML_algn, GetAlignment( nAlignment ),
+   XML_defTabSz, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaDefaultTabSize)),
 nParaDefaultTabSize > 0),
XML_rtl, sax_fastparser::UseIf(ToPsz10(bRtl), 
bRtl));
 else
 mpFS->startElementNS( XML_a, nElement,
@@ -3321,6 +3326,7 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
XML_marL, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)),
 nLeftMargin > 0),
XML_indent, 
sax_fastparser::UseIf(OString::number(!bForceZeroIndent ? 
oox::drawingml::convertHmmToEmu(nLineIndentation) : 0), (bForceZeroIndent || ( 
nLineIndentation != 0))),
XML_algn, GetAlignment( nAlignment ),
+   XML_defTabSz, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaDefaultTabSize)),
 nParaDefaultTabSize > 0),
XML_rtl, sax_fastparser::UseIf(ToPsz10(bRtl), 
bRtl));
 
 
diff --git a/sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx 
b/sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx
new file mode 100644
index ..88438d7b5494
Binary files /dev/null and 
b/sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 997dd15009fd..ccbfc6e35335 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1965,6 +1965,28 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testLinkedOLE)
 assertXPath(pXml, "//p:oleObj", 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, 
testTdf102261_testParaTabStopDefaultDistance)
+{
+createSdImpressDoc("pptx/tdf102261_testParaTabStopDefaultDistance.pptx");
+saveAndReload("Impress Office Open XML");
+
+uno::Reference xShape(getShapeFromPage(0, 0));
+{
+uno::Reference xPropSet(getParagraphFromShape(0, 
xShape),
+ uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(
+sal_Int32{ 1270 },
+
xPropSet->getPropertyValue("ParaTabStopDefaultDistance").get());
+}
+{
+uno::Reference xPropSet(getParagraphFromShape(1, 
xShape),
+ uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(
+sal_Int32{ 2540 },
+
xPropSet->getPropertyValue("ParaTabStopDefaultDistance").get());
+}
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-03-16 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/textparagraphproperties.hxx   |2 ++
 oox/source/drawingml/textparagraphproperties.cxx|7 +++
 oox/source/drawingml/textparagraphpropertiescontext.cxx |   12 
 oox/source/token/properties.txt |1 +
 sd/qa/unit/import-tests2.cxx|4 ++--
 5 files changed, 20 insertions(+), 6 deletions(-)

New commits:
commit 44271f3997f2374d81a2336131fef7ac79499048
Author: Sarper Akdemir 
AuthorDate: Tue Feb 28 16:36:40 2023 +0300
Commit: Miklos Vajna 
CommitDate: Thu Mar 16 14:12:00 2023 +

tdf#102261: pptx import: handle defTabSz

Introduce import of defTabSz using ParaTabStopDefaultDistance.

Change-Id: Ied59c2bc5d9dfffa6254ef87849c3dbad4c48d07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148059
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/oox/inc/drawingml/textparagraphproperties.hxx 
b/oox/inc/drawingml/textparagraphproperties.hxx
index 083b61e37da7..d3742e7377e0 100644
--- a/oox/inc/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/drawingml/textparagraphproperties.hxx
@@ -89,6 +89,7 @@ public:
 TextSpacing&getParaBottomMargin() { return 
maParaBottomMargin; }
 std::optional< sal_Int32 >&   getParaLeftMargin(){ return 
moParaLeftMargin; }
 std::optional< sal_Int32 >&   getFirstLineIndentation(){ return 
moFirstLineIndentation; }
+std::optional& getDefaultTabSize() { return 
moDefaultTabSize; }
 
 std::optional< css::style::ParagraphAdjust >&   getParaAdjust() { 
return moParaAdjust; }
 voidsetParaAdjust( 
css::style::ParagraphAdjust nParaAdjust ) { moParaAdjust = nParaAdjust; }
@@ -125,6 +126,7 @@ private:
 std::optional< sal_Int32 >moParaLeftMargin;
 std::optional< sal_Int32 >moFirstLineIndentation;
 std::optional< css::style::ParagraphAdjust >moParaAdjust;
+std::optional< sal_Int32 >  moDefaultTabSize;
 sal_Int16   mnLevel;
 TextSpacing maLineSpacing;
 };
diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index 0006b7530a76..af65e0037d16 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -395,6 +395,8 @@ void TextParagraphProperties::apply( const 
TextParagraphProperties& rSourceProps
 moParaLeftMargin = rSourceProps.moParaLeftMargin;
 if ( rSourceProps.moFirstLineIndentation )
 moFirstLineIndentation = rSourceProps.moFirstLineIndentation;
+if ( rSourceProps.moDefaultTabSize )
+moDefaultTabSize = rSourceProps.moDefaultTabSize;
 if( rSourceProps.mnLevel )
 mnLevel = rSourceProps.mnLevel;
 if( rSourceProps.moParaAdjust )
@@ -501,6 +503,11 @@ void TextParagraphProperties::pushToPropSet( const 
::oox::core::XmlFilterBase* p
 }
 }
 
+if ( moDefaultTabSize )
+{
+aPropSet.setProperty( PROP_ParaTabStopDefaultDistance, 
*moDefaultTabSize );
+}
+
 if ( moParaAdjust )
 {
 aPropSet.setProperty( PROP_ParaAdjust, *moParaAdjust);
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx 
b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 4e83d2ece24b..e75d65913cd9 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -93,10 +93,14 @@ 
TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2H
 // TODO see to do the same with RubyAdjust
 
 // ST_Coordinate32
-//  sValue = rAttribs.getString( XML_defTabSz ).get();SJ: we need to be 
able to set the default tab size for each text object,
-//  this is possible 
at the moment only for the whole document.
-//  sal_Int32 nDefTabSize = ( sValue.getLength() == 0 ? 0 : GetCoordinate(  
sValue ) );
-// TODO
+if ( rAttribs.hasAttribute(XML_defTabSz))
+{
+sValue = rAttribs.getStringDefaulted(XML_defTabSz);
+if(!sValue.isEmpty())
+{
+mrTextParagraphProperties.getDefaultTabSize() = 
GetCoordinate(sValue);
+}
+}
 
 //  bool bEaLineBrk = rAttribs.getBool( XML_eaLnBrk, true );
 if ( rAttribs.hasAttribute( XML_latinLnBrk ) )
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 43bed81c5d62..edf799c2c8df 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -385,6 +385,7 @@ ParaLeftMargin
 ParaLineSpacing
 ParaRightMargin
 ParaTabStops
+ParaTabStopDefaultDistance
 ParaTopMargin
 Path
 PercentageNumberFormat
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 37a185c4d3f8..9d44f11552d8 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1343,8 +1343,8 

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

2023-03-16 Thread Sarper Akdemir (via logerrit)
 editeng/source/editeng/editdoc.cxx |   11 +++
 editeng/source/items/paraitem.cxx  |   32 
 include/editeng/memberids.h|1 +
 include/editeng/tstpitem.hxx   |3 +++
 include/editeng/unoprnms.hxx   |1 +
 include/editeng/unotext.hxx|1 +
 6 files changed, 49 insertions(+)

New commits:
commit cced51a1ed7c140276aabfe857510afb974fcef5
Author: Sarper Akdemir 
AuthorDate: Tue Feb 28 16:13:48 2023 +0300
Commit: Miklos Vajna 
CommitDate: Thu Mar 16 11:20:48 2023 +

tdf#102261: introduce editeng paragraph tab stop default distance

Adds mnDefaultDistance to SvxTabStopItem that if defined
will set a paragraph wide tab stop default distance and
override the document wide setting.

Also makes editeng consider mnDefaultDistance while getting
tab stop default distance.

Change-Id: I0fa098f874d6b9c91ddbaa2634224ff55cafcc95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148058
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 1fbf46de184b..9fff222d9368 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -857,6 +857,13 @@ void ConvertItem( std::unique_ptr& rPoolItem, 
MapUnit eSourceUnit,
 assert(dynamic_cast(rPoolItem.get()) != 
nullptr);
 SvxTabStopItem& rItem = static_cast(*rPoolItem);
 SvxTabStopItem* pNewItem(new SvxTabStopItem(EE_PARA_TABS));
+
+if (sal_Int32 nDefTabDistance = rItem.GetDefaultDistance())
+{
+pNewItem->SetDefaultDistance(
+OutputDevice::LogicToLogic(nDefTabDistance, eSourceUnit, 
eDestUnit));
+}
+
 for ( sal_uInt16 i = 0; i < rItem.Count(); i++ )
 {
 const SvxTabStop& rTab = rItem[i];
@@ -1821,6 +1828,10 @@ SvxTabStop ContentAttribs::FindTabStop( sal_Int32 
nCurPos, sal_uInt16 nDefTab )
 return rTab;
 }
 
+// if there's a default tab size defined for this item use that instead
+if (rTabs.GetDefaultDistance())
+nDefTab = rTabs.GetDefaultDistance();
+
 // Determine DefTab ...
 SvxTabStop aTabStop;
 const sal_Int32 x = nCurPos / nDefTab + 1;
diff --git a/editeng/source/items/paraitem.cxx 
b/editeng/source/items/paraitem.cxx
index 9368dfdf3c2a..f67ddf599b06 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -821,6 +821,15 @@ sal_uInt16 SvxTabStopItem::GetPos( const sal_Int32 nPos ) 
const
 return it != maTabStops.end() ? it - maTabStops.begin() : SVX_TAB_NOTFOUND;
 }
 
+void SvxTabStopItem::SetDefaultDistance(sal_Int32 nDefaultDistance)
+{
+mnDefaultDistance = nDefaultDistance;
+}
+
+sal_Int32 SvxTabStopItem::GetDefaultDistance() const
+{
+return mnDefaultDistance;
+}
 
 bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
 {
@@ -859,6 +868,11 @@ bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 rVal <<= static_cast(bConvert ? 
convertTwipToMm100(rTab.GetTabPos()) : rTab.GetTabPos());
 break;
 }
+case MID_TABSTOP_DEFAULT_DISTANCE:
+{
+rVal <<= static_cast(bConvert ? 
convertTwipToMm100(mnDefaultDistance) : mnDefaultDistance);
+break;
+}
 }
 return true;
 }
@@ -956,6 +970,18 @@ bool SvxTabStopItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 Insert( aNewTab );
 break;
 }
+case MID_TABSTOP_DEFAULT_DISTANCE:
+{
+sal_Int32 nNewDefaultDistance = 0;
+if (!(rVal >>= nNewDefaultDistance))
+return false;
+if (bConvert)
+nNewDefaultDistance = o3tl::toTwips(nNewDefaultDistance, 
o3tl::Length::mm100);
+if (nNewDefaultDistance <= 0)
+return false;
+mnDefaultDistance = nNewDefaultDistance;
+break;
+}
 }
 return true;
 }
@@ -967,6 +993,9 @@ bool SvxTabStopItem::operator==( const SfxPoolItem& rAttr ) 
const
 
 const SvxTabStopItem& rTSI = static_cast(rAttr);
 
+if ( mnDefaultDistance != rTSI.GetDefaultDistance() )
+return false;
+
 if ( Count() != rTSI.Count() )
 return false;
 
@@ -990,6 +1019,7 @@ bool SvxTabStopItem::GetPresentation
 )   const
 {
 rText.clear();
+// TODO also consider mnDefaultTabDistance here
 
 bool bComma = false;
 
@@ -1038,6 +1068,8 @@ void SvxTabStopItem::Insert( const SvxTabStopItem* pTabs )
 void SvxTabStopItem::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxTabStopItem"));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("mnDefaultDistance"),
+  
BAD_CAST(OString::number(mnDefaultDistance).getStr()));
 for 

  1   2   3   >