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

2022-02-16 Thread Tomaž Vajngerl (via logerrit)
 cui/source/tabpages/grfpage.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit cea4e0beb1cc99d8b81d478c206cc9a24591d8f6
Author: Tomaž Vajngerl 
AuthorDate: Mon Feb 14 09:19:48 2022 +0900
Commit: Miklos Vajna 
CommitDate: Wed Feb 16 11:30:43 2022 +0100

cui: show image pixel size below logic size

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

diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index aca4dd392bf0..cf0f13e42350 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -657,6 +657,7 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
  }
  sTemp = sTemp.replaceAll("%1", sPPI);
 }
+sTemp += "\n" + OUString::number(aOrigPixelSize.Width()) + u"\u00D7" + 
OUString::number(aOrigPixelSize.Height()) + " px";
 m_xOrigSizeFT->set_label(sTemp);
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - cui/source include/sfx2 include/svx sd/inc svx/source sw/source

2022-01-06 Thread Tomaž Vajngerl (via logerrit)
 cui/source/inc/grfpage.hxx   |3 ++-
 cui/source/tabpages/grfpage.cxx  |   31 +--
 include/sfx2/tabdlg.hxx  |8 
 include/svx/svdmodel.hxx |2 ++
 sd/inc/drawdoc.hxx   |2 +-
 svx/source/tbxctrls/grafctrl.cxx |2 ++
 sw/source/ui/frmdlg/frmdlg.cxx   |7 +++
 7 files changed, 47 insertions(+), 8 deletions(-)

New commits:
commit ab63ad95c1538a0d03961cebfb0ffc77b6925d69
Author: Tomaž Vajngerl 
AuthorDate: Sun Dec 19 22:31:31 2021 +0900
Commit: Miklos Vajna 
CommitDate: Thu Jan 6 09:19:17 2022 +0100

Set the original size in crop dialog to preferred DPI calc. size

If we have the document setting preferred image size set, then
use that as the default DPI and recalcualte the logical image
size using the DPI and the size in pixels.
This is useful so we have the preferred DPI size as 100% in the
crop dialog, so we can adjust the size in relation to that value.

This adds to SfxTabPage a new member maAdditionalProperties, to
make it easier to transfer additional properties into a tab page.
This is then used to transfer the preferred DPI into the tab page,
which was previously done by user data, which is less than ideal
and always doesn't work.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127096
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit e34067483ef78c1569641becfe99b79a97600aed)

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

diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx
index afdc7cb6ba6f..922126a1b6b7 100644
--- a/cui/source/inc/grfpage.hxx
+++ b/cui/source/inc/grfpage.hxx
@@ -57,6 +57,7 @@ class SvxGrfCropPage : public SfxTabPage
 longnOldWidth;
 longnOldHeight;
 boolbSetOrigSize;
+sal_Int32 m_aPreferredDPI;
 
 SvxCropExample m_aExampleWN;
 
@@ -93,7 +94,7 @@ class SvxGrfCropPage : public SfxTabPage
 voidGraphicHasChanged(bool bFound);
 virtual voidActivatePage(const SfxItemSet& rSet) override;
 
-static Size GetGrfOrigSize(const Graphic&);
+Size GetGrfOrigSize(const Graphic& rGraphic);
 public:
 SvxGrfCropPage(weld::Container* pPage, weld::DialogController* 
pController, const SfxItemSet );
 static std::unique_ptr Create( weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet *rSet );
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 091ef70faddf..aca4dd392bf0 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -57,6 +57,7 @@ SvxGrfCropPage::SvxGrfCropPage(weld::Container* pPage, 
weld::DialogController* p
 , nOldWidth(0)
 , nOldHeight(0)
 , bSetOrigSize(false)
+, m_aPreferredDPI(0)
 , m_xCropFrame(m_xBuilder->weld_widget("cropframe"))
 , m_xZoomConstRB(m_xBuilder->weld_radio_button("keepscale"))
 , m_xSizeConstRB(m_xBuilder->weld_radio_button("keepsize"))
@@ -287,6 +288,10 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet)
 DBG_ASSERT( pPool, "Where is the pool?" );
 #endif
 
+auto& aProperties = getAdditionalProperties();
+if (aProperties.find("PreferredDPI") != aProperties.end())
+m_aPreferredDPI = aProperties.at("PreferredDPI").get();
+
 bSetOrigSize = false;
 
 // Size
@@ -664,13 +669,27 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
 
 Size SvxGrfCropPage::GetGrfOrigSize(const Graphic& rGrf)
 {
-const MapMode aMapTwip( MapUnit::MapTwip );
-Size aSize( rGrf.GetPrefSize() );
-if( MapUnit::MapPixel == rGrf.GetPrefMapMode().GetMapUnit() )
-aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMapTwip);
+Size aSize;
+
+if (m_aPreferredDPI > 0)
+{
+Size aPixelSize = rGrf.GetSizePixel();
+double fWidth = aPixelSize.Width() / double(m_aPreferredDPI);
+double fHeight = aPixelSize.Height() / double(m_aPreferredDPI);
+fWidth = fWidth * 1440.0;
+fHeight = fHeight * 1440.0;
+aSize = Size(fWidth, fHeight);
+}
 else
-aSize = OutputDevice::LogicToLogic( aSize,
-rGrf.GetPrefMapMode(), aMapTwip );
+{
+const MapMode aMapTwip( MapUnit::MapTwip );
+aSize = rGrf.GetPrefSize();
+if( MapUnit::MapPixel == rGrf.GetPrefMapMode().GetMapUnit() )
+aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, 
aMapTwip);
+else
+aSize = OutputDevice::LogicToLogic( aSize,
+rGrf.GetPrefMapMode(), aMapTwip );
+}
 return aSize;
 }
 
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index d5522a0cd253..13ac3ab90173 100644
--- 

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

2021-03-17 Thread Henry Castro (via logerrit)
 cui/source/customize/cfgutil.cxx |   16 
 cui/source/inc/cfgutil.hxx   |2 +-
 2 files changed, 5 insertions(+), 13 deletions(-)

New commits:
commit c8881fa20aa7b194cc2b87b78903d6d2e5780120
Author: Henry Castro 
AuthorDate: Wed Mar 17 07:35:39 2021 -0400
Commit: Szymon Kłos 
CommitDate: Wed Mar 17 16:18:24 2021 +0100

lok: fix the empty script node type container without "+" symbol expander

According to description in https://bz.apache.org/ooo/show_bug.cgi?id=30923

"In this case I think it's an acceptable solution to display a '+' symbol 
for all
library nodes, and if a library has no children and the user clicks on the 
'+'
symbol, the '+' will disappear".

Unfortunately this behaviour is not well driven for final users'
client side, so they misinterpret as a bug.

After tracing the method hasChildNodes(), the log result indicates
that this method does not load the libraries, but it is necessary
to iterate applying the method getChildNodes(), which will cause
to load all libraries and determine if the child has a script
CONTAINER node type to assign the '+' symbol.

Also, I have traced the loading libraries when the Macro Selector
dialog pops up and the result it load once, so I do not think it
is a problem loading a small finite number of libraries today.

Change-Id: I4ae5395b6afa7b7d6ff2b2ec692771e93c46c529
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112636
Reviewed-by: Pedro Silva 
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 24fec3396858..758dd2adb700 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -481,7 +481,7 @@ void CuiConfigGroupListBox::InitModule()
 }
 
 void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< 
css::script::browse::XBrowseNode >& xRootNode,
-   const weld::TreeIter* pParentEntry, 
bool bCheapChildrenOnDemand)
+   const weld::TreeIter* pParentEntry)
 {
 try {
 if ( xRootNode->hasChildNodes() )
@@ -544,7 +544,7 @@ void CuiConfigGroupListBox::FillScriptList(const 
css::uno::Reference< css::scrip
 theChild->acquire();
 
 bool bChildOnDemand = false;
-if ( !bCheapChildrenOnDemand && 
children[n]->hasChildNodes() )
+if ( children[n]->hasChildNodes() )
 {
 Sequence< Reference< browse::XBrowseNode > > 
grandchildren =
 children[n]->getChildNodes();
@@ -558,14 +558,6 @@ void CuiConfigGroupListBox::FillScriptList(const 
css::uno::Reference< css::scrip
 }
 }
 }
-else
-{
-/* i30923 - Would be nice if there was a better
-* way to determine if a basic lib had children
-* without having to ask for them (which forces
-* the library to be loaded */
-bChildOnDemand = true;
-}
 
 OUString aImage = GetImage(theChild, m_xContext, 
bIsRootNode);
 
@@ -651,7 +643,7 @@ void CuiConfigGroupListBox::Init(const css::uno::Reference< 
css::uno::XComponent
 {
  //We are only showing scripts not slot APIs so skip
  //Root node and show location nodes
-FillScriptList(rootNode, nullptr, false);
+FillScriptList(rootNode, nullptr);
 }
 }
 
@@ -938,7 +930,7 @@ IMPL_LINK(CuiConfigGroupListBox, ExpandingHdl, const 
weld::TreeIter&, rIter, boo
 {
 Reference< browse::XBrowseNode > rootNode(
 static_cast< browse::XBrowseNode* >( pInfo->pObject ) ) ;
-FillScriptList(rootNode, , true /* i30923 */ );
+FillScriptList(rootNode, );
 }
 break;
 }
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index 20da0fc6f4a6..f6301f4e09bb 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -203,7 +203,7 @@ class CuiConfigGroupListBox
 
 void InitModule();
 void FillScriptList(const css::uno::Reference< 
css::script::browse::XBrowseNode >& xRootNode,
-const weld::TreeIter* pParentEntry, bool 
bCheapChildrenOnDemand);
+const weld::TreeIter* pParentEntry);
 void FillFunctionsList(const css::uno::Sequence< 
css::frame::DispatchInformation >& xCommands);
 OUString MapCommand2UIName(const OUString& sCommand);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

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

2021-03-11 Thread Szymon Kłos (via logerrit)
 cui/source/customize/cfgutil.cxx   |3 ++-
 cui/source/inc/cfgutil.hxx |1 +
 cui/uiconfig/ui/macroselectordialog.ui |2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 295c8262f7e7e0436301deed5edde9963b19dd11
Author: Szymon Kłos 
AuthorDate: Thu Mar 11 12:33:52 2021 +0100
Commit: Szymon Kłos 
CommitDate: Thu Mar 11 13:28:06 2021 +0100

Remove description from mobile macro selector

Change-Id: I76d9a73c65d0c7759b56a3d7b69aadf5b58d7da1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112327
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index fa9d9139d1f5..24fec3396858 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -1060,6 +1060,7 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
 , m_xOKButton(m_xBuilder->weld_button("ok"))
 , m_xCancelButton(m_xBuilder->weld_button("cancel"))
 , m_xDescriptionText(m_xBuilder->weld_text_view("description"))
+, m_xDescriptionFrame(m_xBuilder->weld_frame("descriptionframe"))
 {
 m_xCancelButton->show();
 m_xDialogDescription->show();
@@ -1096,7 +1097,7 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
 UpdateUI();
 
 if (comphelper::LibreOfficeKit::isActive())
-m_xDescriptionText->hide();
+m_xDescriptionFrame->hide();
 }
 
 SvxScriptSelectorDialog::~SvxScriptSelectorDialog()
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index 885ccd8df8e7..20da0fc6f4a6 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -243,6 +243,7 @@ class SvxScriptSelectorDialog : public 
weld::GenericDialogController
 std::unique_ptr m_xOKButton;
 std::unique_ptr m_xCancelButton;
 std::unique_ptr m_xDescriptionText;
+std::unique_ptr m_xDescriptionFrame;
 
 DECL_LINK(ClickHdl, weld::Button&, void);
 DECL_LINK(SelectHdl, weld::TreeView&, void);
diff --git a/cui/uiconfig/ui/macroselectordialog.ui 
b/cui/uiconfig/ui/macroselectordialog.ui
index 4e65088cf94f..6b190e8cbde5 100644
--- a/cui/uiconfig/ui/macroselectordialog.ui
+++ b/cui/uiconfig/ui/macroselectordialog.ui
@@ -274,7 +274,7 @@
   
 
 
-  
+  
 True
 False
 True
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-11 Thread Szymon Kłos (via logerrit)
 cui/source/customize/cfgutil.cxx   |   41 ++
 cui/source/customize/macropg.cxx   |2 
 cui/source/factory/dlgfact.cxx |2 
 cui/source/inc/cfgutil.hxx |5 -
 cui/uiconfig/ui/macroselectordialog.ui |  132 -
 5 files changed, 31 insertions(+), 151 deletions(-)

New commits:
commit fe902aa8f3b7e6d43bc0d7ea3e6f77d25da40311
Author: Szymon Kłos 
AuthorDate: Thu Mar 11 09:11:38 2021 +0100
Commit: Szymon Kłos 
CommitDate: Thu Mar 11 11:49:22 2021 +0100

Remove unused code from Macro Selector dialog

Change-Id: I9930fd7eaf2410447f84aa4798478a10915ea738
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112316
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index a980d4b7fa3f..fa9d9139d1f5 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -1050,37 +1050,27 @@ void CuiConfigGroupListBox::SelectMacro( const 
OUString& rBasic,
  */
 
 SvxScriptSelectorDialog::SvxScriptSelectorDialog(
-weld::Window* pParent, bool bShowSlots, const css::uno::Reference< 
css::frame::XFrame >& xFrame)
+weld::Window* pParent, const css::uno::Reference< css::frame::XFrame >& 
xFrame)
 : GenericDialogController(pParent, "cui/ui/macroselectordialog.ui", 
"MacroSelectorDialog")
-, m_bShowSlots(bShowSlots)
-, m_xDialogDescription(m_xBuilder->weld_label(bShowSlots ? "helptoolbar" : 
"helpmacro"))
+, m_xDialogDescription(m_xBuilder->weld_label("helpmacro"))
 , m_xCategories(new 
CuiConfigGroupListBox(m_xBuilder->weld_tree_view("categories")))
 , m_xCommands(new 
CuiConfigFunctionListBox(m_xBuilder->weld_tree_view("commands")))
 , m_xLibraryFT(m_xBuilder->weld_label("libraryft"))
-, m_xCategoryFT(m_xBuilder->weld_label("categoryft"))
 , m_xMacronameFT(m_xBuilder->weld_label("macronameft"))
-, m_xCommandsFT(m_xBuilder->weld_label("commandsft"))
-, m_xOKButton(m_xBuilder->weld_button(bShowSlots ? "add" : "ok"))
-, m_xCancelButton(m_xBuilder->weld_button(bShowSlots ? "close" : "cancel"))
+, m_xOKButton(m_xBuilder->weld_button("ok"))
+, m_xCancelButton(m_xBuilder->weld_button("cancel"))
 , m_xDescriptionText(m_xBuilder->weld_text_view("description"))
 {
-if (m_bShowSlots)
-{
-// If we are showing Slot API commands update labels in the UI
-m_xDialog->set_title(CuiResId(RID_SVXSTR_SELECTOR_ADD_COMMANDS));
-}
 m_xCancelButton->show();
 m_xDialogDescription->show();
 m_xOKButton->show();
 
-m_xLibraryFT->set_visible(!m_bShowSlots);
-m_xCategoryFT->set_visible(m_bShowSlots);
-m_xMacronameFT->set_visible(!m_bShowSlots);
-m_xCommandsFT->set_visible(m_bShowSlots);
+m_xLibraryFT->set_visible(true);
+m_xMacronameFT->set_visible(true);
 
 const OUString 
aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame));
 m_xCategories->SetFunctionListBox(m_xCommands.get());
-m_xCategories->Init(comphelper::getProcessComponentContext(), xFrame, 
aModuleName, bShowSlots);
+m_xCategories->Init(comphelper::getProcessComponentContext(), xFrame, 
aModuleName, /*bShowSlots*/false);
 
 m_xCategories->connect_changed(
 LINK( this, SvxScriptSelectorDialog, SelectHdl ) );
@@ -1104,6 +1094,9 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
 m_xCategories->SetStylesInfo(_aStylesInfo);
 
 UpdateUI();
+
+if (comphelper::LibreOfficeKit::isActive())
+m_xDescriptionText->hide();
 }
 
 SvxScriptSelectorDialog::~SvxScriptSelectorDialog()
@@ -1154,19 +1147,7 @@ IMPL_LINK(SvxScriptSelectorDialog, ClickHdl, 
weld::Button&, rButton, void)
 }
 else if ( == m_xOKButton.get())
 {
-// If we are displaying Slot API commands then this the dialog is being
-// run from Tools/Configure and we should not close it
-if ( !m_bShowSlots )
-{
-m_xDialog->response(RET_OK);
-}
-else
-{
-// Select the next entry in the list if possible
-std::unique_ptr xIter = 
m_xCommands->make_iterator();
-if (m_xCommands->get_selected(xIter.get()) && 
m_xCommands->iter_next_sibling(*xIter))
-m_xCommands->select(*xIter);
-}
+m_xDialog->response(RET_OK);
 }
 }
 
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 2fb442dbdb24..cdf07498f83e 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -460,7 +460,7 @@ void 
SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const weld::
 else if( bAssEnabled )
 {
 // assign pressed
-SvxScriptSelectorDialog aDlg(pThis->GetFrameWeld(), false, 
pThis->GetFrame());
+SvxScriptSelectorDialog aDlg(pThis->GetFrameWeld(), pThis->GetFrame());
 short ret = aDlg.run();
 if ( ret )
   

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

2021-03-04 Thread Henry Castro (via logerrit)
 cui/source/dialogs/scriptdlg.cxx |   16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 1c1604cf6ca6012efcc7f1642906ce686081b3c4
Author: Henry Castro 
AuthorDate: Tue Mar 2 19:58:08 2021 -0400
Commit: Jan Holesovsky 
CommitDate: Thu Mar 4 16:09:00 2021 +0100

lok: async exception dialog messages for VBA macros

Change-Id: Ia713343541f8102de85f7ac57202780afba3da00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111855
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 12da15e0c2b6..e6238f7c665c 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -46,6 +47,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -1343,10 +1345,18 @@ IMPL_STATIC_LINK( SvxScriptErrorDialog, ShowDialog, 
void*, p, void )
 message = CuiResId( RID_SVXSTR_ERROR_TITLE );
 }
 
-std::unique_ptr 
xBox(Application::CreateMessageDialog(nullptr,
-  VclMessageType::Warning, 
VclButtonsType::Ok, message));
+const SfxViewFrame* pViewFrame = SfxViewFrame::Current();
+std::shared_ptr xBox(
+Application::CreateMessageDialog(
+pViewFrame->GetWindow().GetFrameWeld(),
+VclMessageType::Warning,
+VclButtonsType::Ok,
+message,
+comphelper::LibreOfficeKit::isActive() ? true : false));
+
 xBox->set_title(CuiResId(RID_SVXSTR_ERROR_TITLE));
-xBox->run();
+
+xBox->runAsync(xBox, [](sal_Int32 /*nResult*/) {});
 
 delete pMessage;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-18 Thread Henry Castro (via logerrit)
 cui/source/customize/cfgutil.cxx |1 +
 cui/source/factory/dlgfact.cxx   |7 ++-
 cui/source/factory/dlgfact.hxx   |5 +++--
 sfx2/source/appl/appserv.cxx |   39 ++-
 4 files changed, 32 insertions(+), 20 deletions(-)

New commits:
commit 3557bb2a5cb2119dba7d84bdd723c5887e64c2d0
Author: Henry Castro 
AuthorDate: Fri Dec 4 17:34:48 2020 -0400
Commit: Henry Castro 
CommitDate: Mon Jan 18 22:06:56 2021 +0100

lok: run async the Macro Selector Dialog

Required to be called by the client side

Change-Id: I9c9d22dd249839009bdc6a701553f3b9d776347a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107246
Tested-by: Jenkins
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109137
Tested-by: Jenkins CollaboraOffice 

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 1d94255e73eb..a980d4b7fa3f 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index be6351d04b8b..f8399d259071 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -148,6 +148,11 @@ short AbstractTitleDialog_Impl::Execute()
 return m_xDlg->run();
 }
 
+bool AbstractScriptSelectorDialog_Impl::StartExecuteAsync(AsyncContext )
+{
+return SfxDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
+}
+
 short AbstractScriptSelectorDialog_Impl::Execute()
 {
 return m_xDlg->run();
@@ -1132,7 +1137,7 @@ VclPtr 
AbstractDialogFactory_Impl::CreateScriptErrorDialog(co
 VclPtr 
AbstractDialogFactory_Impl::CreateScriptSelectorDialog(weld::Window* pParent,
 const Reference& rxFrame)
 {
-return 
VclPtr::Create(std::make_unique(pParent,
 false/*bShowSlots*/, rxFrame));
+return 
VclPtr::Create(std::make_shared(pParent,
 false/*bShowSlots*/, rxFrame));
 }
 
 OUString AbstractScriptSelectorDialog_Impl::GetScriptURL() const
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 27566e6a7224..08a78ef42d57 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -313,13 +313,14 @@ public:
 class SvxScriptSelectorDialog;
 class AbstractScriptSelectorDialog_Impl : public AbstractScriptSelectorDialog
 {
-std::unique_ptr m_xDlg;
+std::shared_ptr m_xDlg;
 public:
-explicit 
AbstractScriptSelectorDialog_Impl(std::unique_ptr p)
+explicit 
AbstractScriptSelectorDialog_Impl(std::shared_ptr p)
 : m_xDlg(std::move(p))
 {
 }
 virtual short Execute() override;
+virtual bool StartExecuteAsync(AsyncContext ) override;
 virtual OUString GetScriptURL() const override;
 virtual void SetRunLabel() override;
 };
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 0633c12df3e7..07f56777b5af 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -1535,32 +1535,37 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
 
 do  // artificial loop for flow control
 {
-ScopedVclPtr 
pDlg(pFact->CreateScriptSelectorDialog(lcl_getDialogParent(xFrame), xFrame));
+VclPtr 
pDlg(pFact->CreateScriptSelectorDialog(lcl_getDialogParent(xFrame), xFrame));
 OSL_ENSURE( pDlg, "SfxApplication::OfaExec_Impl( SID_RUNMACRO 
): no dialog!" );
 if ( !pDlg )
 break;
 pDlg->SetRunLabel();
 
-short nDialogResult = pDlg->Execute();
-if ( !nDialogResult )
-break;
+pDlg->StartExecuteAsync([pDlg, xFrame](sal_Int32 
nDialogResult) {
+if ( !nDialogResult )
+{
+pDlg->disposeOnce();
+return;
+}
 
-Sequence< Any > args;
-Sequence< sal_Int16 > outIndex;
-Sequence< Any > outArgs;
-Any ret;
+Sequence< Any > args;
+Sequence< sal_Int16 > outIndex;
+Sequence< Any > outArgs;
+Any ret;
 
-Reference< XInterface > xScriptContext;
+Reference< XInterface > xScriptContext;
 
-Reference< XController > xController;
-if ( xFrame.is() )
-xController = xFrame->getController();
-if ( xController.is() )
-xScriptContext = xController->getModel();
-if ( !xScriptContext.is() )
-xScriptContext = xController;
+Reference< XController > xController;
+if ( xFrame.is() )
+xController = xFrame->getController();
+ 

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

2020-12-17 Thread Miklos Vajna (via logerrit)
 cui/source/dialogs/sdrcelldlg.cxx|7 +
 cui/source/inc/sdrcelldlg.hxx|2 +
 cui/uiconfig/ui/formatcellsdialog.ui |   48 +++
 svx/source/table/tablecontroller.cxx |   12 
 4 files changed, 69 insertions(+)

New commits:
commit 14363dd0dad9a4d3f7c64b9e6bcec559251a125b
Author: Miklos Vajna 
AuthorDate: Mon Dec 14 12:15:09 2020 +0100
Commit: Miklos Vajna 
CommitDate: Thu Dec 17 16:51:09 2020 +0100

tdf#129961 cui: start UI for table shadow as direct format

It reads from the doc model and shows it, but doesn't write it back yet.

(cherry picked from commit 74ba28fe238b7f15d1fb7d119e4cef3a7b544e0b)

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

diff --git a/cui/source/dialogs/sdrcelldlg.cxx 
b/cui/source/dialogs/sdrcelldlg.cxx
index 3c745692f7ea..fda8b4ce1385 100644
--- a/cui/source/dialogs/sdrcelldlg.cxx
+++ b/cui/source/dialogs/sdrcelldlg.cxx
@@ -27,6 +27,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* 
pParent, const SfxItemS
 : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", 
"FormatCellsDialog", pAttr)
 , mrOutAttrs(*pAttr)
 , mpColorTab(rModel.GetColorList())
+, mnColorTabState ( ChangeType::NONE )
 , mpGradientList(rModel.GetGradientList())
 , mpHatchingList(rModel.GetHatchList())
 , mpBitmapList(rModel.GetBitmapList())
@@ -36,6 +37,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* 
pParent, const SfxItemS
 AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS);
 AddTabPage("border", RID_SVXPAGE_BORDER );
 AddTabPage("area", RID_SVXPAGE_AREA);
+AddTabPage("shadow", SvxShadowTabPage::Create, nullptr);
 }
 
 void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage )
@@ -55,6 +57,11 @@ void SvxFormatCellsDialog::PageCreated(const OString& rId, 
SfxTabPage )
 SvxBorderTabPage& rBorderPage = static_cast(rPage);
 rBorderPage.SetTableMode();
 }
+else if (rId == "shadow")
+{
+static_cast(rPage).SetColorList( mpColorTab );
+static_cast(rPage).SetColorChgd(  );
+}
 else
 SfxTabDialogController::PageCreated(rId, rPage);
 }
diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx
index 50ab4b39ac70..9f068d552393 100644
--- a/cui/source/inc/sdrcelldlg.hxx
+++ b/cui/source/inc/sdrcelldlg.hxx
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 
 class SdrModel;
 class SvxFormatCellsDialog : public SfxTabDialogController
@@ -31,6 +32,7 @@ private:
 const SfxItemSet&   mrOutAttrs;
 
 XColorListRef   mpColorTab;
+ChangeType  mnColorTabState;
 XGradientListRefmpGradientList;
 XHatchListRef   mpHatchingList;
 XBitmapListRef  mpBitmapList;
diff --git a/cui/uiconfig/ui/formatcellsdialog.ui 
b/cui/uiconfig/ui/formatcellsdialog.ui
index 82243f0bad10..49dfc705483c 100644
--- a/cui/uiconfig/ui/formatcellsdialog.ui
+++ b/cui/uiconfig/ui/formatcellsdialog.ui
@@ -281,6 +281,54 @@
 False
   
 
+
+  
+  
+True
+False
+
+  
+
+
+  
+
+
+  
+
+
+  
+
+
+  
+
+
+  
+
+
+  
+
+
+  
+
+
+  
+
+  
+  
+4
+  
+
+
+  
+True
+False
+Shadow
+  
+  
+5
+False
+  
+
   
   
 False
diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 232ed782414a..07fb110756b0 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -920,6 +920,18 @@ void SvxTableController::onFormatTable(const SfxRequest& 
rReq)
 aNewAttr.Put( aBoxItem );
 aNewAttr.Put( aBoxInfoItem );
 
+// Fill in shadow properties.
+const SfxItemSet& rTableItemSet = rTableObj.GetMergedItemSet();
+for (sal_uInt16 nWhich = SDRATTR_SHADOW_FIRST; nWhich <= 
SDRATTR_SHADOW_LAST; ++nWhich)
+{
+if (rTableItemSet.GetItemState(nWhich, false) != SfxItemState::SET)
+{
+continue;
+}
+
+aNewAttr.Put(rTableItemSet.Get(nWhich));
+}
+
 SvxAbstractDialogFactory* pFact = 

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

2020-11-30 Thread Caolán McNamara (via logerrit)
 cui/source/options/optjava.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 94971b17131de5294efe543a3fa257fa9b6c3bd1
Author: Caolán McNamara 
AuthorDate: Tue Aug 4 20:02:40 2020 +0100
Commit: Szymon Kłos 
CommitDate: Mon Nov 30 18:27:28 2020 +0100

tdf#135367 enable_toggle_buttons sets SvTreeFlags::CHKBTN

designating that the special auto-sized toggle column is in use

Change-Id: I23aa927c56e706590f397d15ef7329d20e0b18a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100136
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106892
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 

diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index d107eaeeb28f..25be071fa8fc 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -360,7 +360,7 @@ void SvxJavaOptionsPage::AddJRE( JavaInfo const * _pInfo )
 #if HAVE_FEATURE_JAVA
 int nPos = m_xJavaList->n_children();
 m_xJavaList->append();
-m_xJavaList->set_toggle(nPos, TRISTATE_FALSE, 0);
+m_xJavaList->set_toggle(nPos, TRISTATE_FALSE);
 m_xJavaList->set_text(nPos, _pInfo->sVendor, 1);
 m_xJavaList->set_text(nPos, _pInfo->sVersion, 2);
 OUString sFeature;
@@ -383,7 +383,7 @@ void SvxJavaOptionsPage::HandleCheckEntry(int nCheckedRow)
 for (int i = 0, nCount = m_xJavaList->n_children(); i < nCount; ++i)
 {
 // we have radio button behavior -> so uncheck the other entries
-m_xJavaList->set_toggle(i, i == nCheckedRow ? TRISTATE_TRUE : 
TRISTATE_FALSE, 0);
+m_xJavaList->set_toggle(i, i == nCheckedRow ? TRISTATE_TRUE : 
TRISTATE_FALSE);
 }
 }
 
@@ -522,7 +522,7 @@ bool SvxJavaOptionsPage::FillItemSet( SfxItemSet* 
/*rCoreSet*/ )
 sal_uInt32 nCount = m_xJavaList->n_children();
 for (sal_uInt32 i = 0; i < nCount; ++i)
 {
-if (m_xJavaList->get_toggle(i, 0) == TRISTATE_TRUE)
+if (m_xJavaList->get_toggle(i) == TRISTATE_TRUE)
 {
 JavaInfo const * pInfo;
 if ( i < m_parJavaInfo.size() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-06 Thread Szymon Kłos (via logerrit)
 cui/source/dialogs/splitcelldlg.cxx  |   35 ++-
 cui/source/factory/dlgfact.cxx   |2 +-
 cui/source/inc/splitcelldlg.hxx  |   20 ++--
 svx/source/table/tablecontroller.cxx |9 +
 sw/source/uibase/shells/tabsh.cxx|   33 +++--
 5 files changed, 73 insertions(+), 26 deletions(-)

New commits:
commit ca189b78bc9bfb0e6fad72e3374bf8e8408093f0
Author: Szymon Kłos 
AuthorDate: Wed Sep 30 10:49:12 2020 +0200
Commit: Szymon Kłos 
CommitDate: Tue Oct 6 13:33:45 2020 +0200

Make Split Table Cell dialog async

Change-Id: I4efbb24f721aa50cc4dbbe78ae1e7e6087f8c876
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103670
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/cui/source/dialogs/splitcelldlg.cxx 
b/cui/source/dialogs/splitcelldlg.cxx
index 40b798b7c2c9..3de8082c939a 100644
--- a/cui/source/dialogs/splitcelldlg.cxx
+++ b/cui/source/dialogs/splitcelldlg.cxx
@@ -74,15 +74,40 @@ long SvxSplitTableDlg::GetCount() const
 return m_xCountEdit->get_value();
 }
 
-short SvxSplitTableDlg::Execute()
-{
-return run();
-}
-
 void SvxSplitTableDlg::SetSplitVerticalByDefault()
 {
 if( mnMaxVertical >= 2 )
 m_xVertBox->set_active(true); // tdf#60242
 }
 
+bool SvxAbstractSplitTableDialog_Impl::IsHorizontal() const
+{
+return m_xDlg->IsHorizontal();
+}
+
+bool SvxAbstractSplitTableDialog_Impl::IsProportional() const
+{
+return m_xDlg->IsProportional();
+}
+
+long SvxAbstractSplitTableDialog_Impl::GetCount() const
+{
+return m_xDlg->GetCount();
+}
+
+void SvxAbstractSplitTableDialog_Impl::SetSplitVerticalByDefault()
+{
+m_xDlg->SetSplitVerticalByDefault();
+}
+
+short SvxAbstractSplitTableDialog_Impl::Execute()
+{
+return m_xDlg->run();
+}
+
+bool SvxAbstractSplitTableDialog_Impl::StartExecuteAsync(AsyncContext& 
rContext)
+{
+return weld::DialogController::runAsync(m_xDlg, rContext.maEndDialogFn);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 46180fc4435c..be6351d04b8b 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1619,7 +1619,7 @@ std::shared_ptr 
AbstractDialogFactory_Impl::CreateSvxForm
 
 VclPtr 
AbstractDialogFactory_Impl::CreateSvxSplitTableDialog(weld::Window* pParent, 
bool bIsTableVertical, long nMaxVertical)
 {
-return VclPtr::Create( pParent, bIsTableVertical, 
nMaxVertical, 99 );
+return VclPtr::Create( 
std::make_shared(pParent, bIsTableVertical, nMaxVertical, 99 
));
 }
 
 std::shared_ptr 
AbstractDialogFactory_Impl::CreateSvxNewTableDialog(weld::Window* pParent)
diff --git a/cui/source/inc/splitcelldlg.hxx b/cui/source/inc/splitcelldlg.hxx
index b0c2fddae3c7..44df027d3a93 100644
--- a/cui/source/inc/splitcelldlg.hxx
+++ b/cui/source/inc/splitcelldlg.hxx
@@ -22,7 +22,7 @@
 #include 
 #include 
 
-class SvxSplitTableDlg : public SvxAbstractSplitTableDialog, public 
weld::GenericDialogController
+class SvxSplitTableDlg : public weld::GenericDialogController
 {
 private:
 std::unique_ptr m_xCountEdit;
@@ -38,12 +38,28 @@ public:
 
 DECL_LINK(ClickHdl, weld::Button&, void);
 
+virtual bool IsHorizontal() const;
+virtual bool IsProportional() const;
+virtual long GetCount() const;
+
+virtual void SetSplitVerticalByDefault();
+};
+
+class SvxAbstractSplitTableDialog_Impl : public SvxAbstractSplitTableDialog
+{
+std::shared_ptr m_xDlg;
+
+public:
+SvxAbstractSplitTableDialog_Impl(std::shared_ptr pDlg) : 
m_xDlg(std::move(pDlg)) {}
+
 virtual bool IsHorizontal() const override;
 virtual bool IsProportional() const override;
 virtual long GetCount() const override;
 
-virtual short Execute() override;
 virtual void SetSplitVerticalByDefault() override;
+
+virtual short Execute() override;
+virtual bool StartExecuteAsync(AsyncContext& rContext) override;
 };
 
 #endif
diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 48a73e528143..d6541073be6e 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1279,10 +1279,9 @@ void SvxTableController::SplitMarkedCells(const 
SfxRequest& rReq)
 return;
 
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-ScopedVclPtr 
xDlg(pFact->CreateSvxSplitTableDialog(rReq.GetFrameWeld(), false, 99));
+VclPtr 
xDlg(pFact->CreateSvxSplitTableDialog(rReq.GetFrameWeld(), false, 99));
 
-if( xDlg->Execute() )
-{
+xDlg->StartExecuteAsync([xDlg, this](int) {
 const sal_Int32 nCount = xDlg->GetCount() - 1;
 
 if( nCount < 1 )
@@ -1324,7 +1323,9 @@ void SvxTableController::SplitMarkedCells(const 
SfxRequest& rReq)
 aEnd.mnCol += mxTable->getColumnCount() - nColCount;
 
 setSelectedCells( aStart, aEnd );
-}
+
+

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

2020-06-29 Thread Andras Timar (via logerrit)
 cui/source/dialogs/SpellDialog.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 9f0c02854c0a94534fcdfc7ba2af1045bbe89e65
Author: Andras Timar 
AuthorDate: Sun Jun 28 22:03:02 2020 +0200
Commit: Andras Timar 
CommitDate: Mon Jun 29 08:31:56 2020 +0200

LOKit: do not show 'Add to Dictionary' button for Online

Because user profiles (user dictionaries) are not persistent.

Change-Id: I78261068cfc1cc9fb2ddecd085ac58ff31c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97352
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index 85dc7027ceed..64a1b0270589 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -52,6 +52,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -322,8 +323,8 @@ void SpellDialog::UpdateBoxes_Impl(bool bCallFromSelectHdl)
 m_xLanguageLB->set_sensitive( bShowChangeAll );
 m_xIgnoreAllPB->set_visible( bShowChangeAll );
 
-m_xAddToDictMB->set_visible( bShowChangeAll && nDicts > 1);
-m_xAddToDictPB->set_visible( bShowChangeAll && nDicts <= 1);
+m_xAddToDictMB->set_visible( bShowChangeAll && nDicts > 1 && 
!comphelper::LibreOfficeKit::isActive());
+m_xAddToDictPB->set_visible( bShowChangeAll && nDicts <= 1 && 
!comphelper::LibreOfficeKit::isActive());
 m_xIgnoreRulePB->set_visible( !bShowChangeAll );
 m_xIgnoreRulePB->set_sensitive(bSpellErrorDescription && 
!aSpellErrorDescription.sRuleId.isEmpty());
 m_xAutoCorrPB->set_visible( bShowChangeAll && rParent.HasAutoCorrection() 
);
@@ -798,8 +799,8 @@ int SpellDialog::InitUserDicts()
 
 int nDicts = nItemId-1;
 
-m_xAddToDictMB->set_visible( nDicts > 1 );
-m_xAddToDictPB->set_visible( nDicts <= 1 );
+m_xAddToDictMB->set_visible(nDicts > 1 && 
!comphelper::LibreOfficeKit::isActive());
+m_xAddToDictPB->set_visible(nDicts <= 1 && 
!comphelper::LibreOfficeKit::isActive());
 
 return nDicts;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - cui/source include/svx sd/source svx/source

2020-06-26 Thread Miklos Vajna (via logerrit)
 cui/source/dialogs/signature-line-draw.svg |   10 ++---
 include/svx/signaturelinehelper.hxx|8 
 sd/source/ui/func/fuconrec.cxx |   50 -
 svx/source/dialog/signaturelinehelper.cxx  |   27 +++
 4 files changed, 68 insertions(+), 27 deletions(-)

New commits:
commit 0e399d36472d8bf6a1b50f137587d30610d13e4e
Author: Miklos Vajna 
AuthorDate: Tue Jun 9 18:03:22 2020 +0200
Commit: Miklos Vajna 
CommitDate: Fri Jun 26 08:54:19 2020 +0200

sd signature line: select certificate after drawing the shape's rectangle

Also move the shape-type-specific setup to
FuConstructRectangle::SetAttributes() where the rest of the shape types
are handled.

(cherry picked from commit f1566f0b813e439531a37154b52d491fd9d3224b)

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

diff --git a/cui/source/dialogs/signature-line-draw.svg 
b/cui/source/dialogs/signature-line-draw.svg
index cd256d098a27..564b5cdf3ef9 100644
--- a/cui/source/dialogs/signature-line-draw.svg
+++ b/cui/source/dialogs/signature-line-draw.svg
@@ -1,5 +1,5 @@
 
-http://purl.org/dc/elements/1.1/; 
xmlns:cc="http://creativecommons.org/ns#; 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#; 
xmlns:svg="http://www.w3.org/2000/svg; xmlns="http://www.w3.org/2000/svg; 
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd; 
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape; version="1.2" 
width="90mm" height="45mm" viewBox="0 0 9000 4500" 
preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" 
stroke-linejoin="round" xml:space="preserve" id="svg577" 
inkscape:version="0.92.2 5c3e80d, 2017-08-06">
+http://purl.org/dc/elements/1.1/; 
xmlns:cc="http://creativecommons.org/ns#; 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#; 
xmlns:svg="http://www.w3.org/2000/svg; xmlns="http://www.w3.org/2000/svg; 
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd; 
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape; version="1.2" 
width="90mm" height="45mm" viewBox="0 0 9000 4500" 
preserveAspectRatio="xMidYMid" xml:space="preserve" id="svg577" 
inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="test.svg" 
stroke-linejoin="round" stroke-width="28.222" fill-rule="evenodd">
   
 
   
@@ -9,7 +9,7 @@
   
 
   
-  
+  
   
 
   
@@ -28,9 +28,9 @@
   
   
 
-[SIGNER_NAME]
-Digitally 
signed by:
-Date: 
[DATE]
+Digitally signed by:
+[SIGNER_NAME]
+Date: [DATE]
 
   
 
diff --git a/include/svx/signaturelinehelper.hxx 
b/include/svx/signaturelinehelper.hxx
index 4cdb40651479..0906d88ef095 100644
--- a/include/svx/signaturelinehelper.hxx
+++ b/include/svx/signaturelinehelper.hxx
@@ -21,6 +21,7 @@ namespace weld
 {
 class Window;
 }
+class SdrView;
 class SfxObjectShell;
 
 namespace svx::SignatureLineHelper
@@ -52,6 +53,13 @@ SVX_DLLPUBLIC OUString getLocalizedDate();
  * Interprets rSVG as a graphic and gives back the resuling UNO wrapper.
  */
 SVX_DLLPUBLIC css::uno::Reference importSVG(const 
OUString& rSVG);
+
+/**
+ * Sets xCertificate as the signing certificate of the selected shape on pView.
+ */
+SVX_DLLPUBLIC void
+setShapeCertificate(SdrView* pView,
+const css::uno::Reference& 
xCertificate);
 }
 
 #endif
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index 63daa06171c4..91ed61ad3d63 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -59,6 +59,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -430,28 +431,6 @@ void FuConstructRectangle::Activate()
 
 void FuConstructRectangle::Deactivate()
 {
-if (nSlotId == SID_INSERT_SIGNATURELINE)
-{
-const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-if (rMarkList.GetMarkCount() > 0)
-{
-// Avoid the default solid fill and line, we'll set a graphic 
instead.
-const SdrMark* pMark = rMarkList.GetMark(0);
-SdrObject* pObject = pMark->GetMarkedSdrObj();
-SfxItemSet aSet = pObject->GetMergedItemSet();
-
-XFillStyleItem aFillStyleItem(aSet.Get(XATTR_FILLSTYLE));
-aFillStyleItem.SetValue(drawing::FillStyle_NONE);
-aSet.Put(aFillStyleItem);
-
-XLineStyleItem aLineStyleItem(aSet.Get(XATTR_LINESTYLE));
-aLineStyleItem.SetValue(drawing::LineStyle_NONE);
-aSet.Put(aLineStyleItem);
-
-pObject->SetMergedItemSet(aSet);
-}
-}
-
 if( nSlotId == SID_TOOL_CONNECTOR   ||
 nSlotId == SID_CONNECTOR_ARROW_START||
 nSlotId == SID_CONNECTOR_ARROW_END  ||
@@ -491,6 +470,27 @@ void FuConstructRectangle::Deactivate()
 mpView->SetGlueVisible( false );
 

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

2020-06-26 Thread Miklos Vajna (via logerrit)
 cui/source/dialogs/signature-line-draw.svg |4 ++--
 include/svx/strings.hrc|3 +++
 svx/source/dialog/signaturelinehelper.cxx  |4 
 3 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 13e6fa10d31147cc6b483d6ae132de33ff8d905a
Author: Miklos Vajna 
AuthorDate: Wed Jun 10 13:43:15 2020 +0200
Commit: Miklos Vajna 
CommitDate: Fri Jun 26 08:54:55 2020 +0200

sd signature line: localize signature graphic

Now the svg template is free from user-visible strings.

(cherry picked from commit eda9e23370f5ca0b413c9b5cc6eaffd87e596498)

Conflicts:
include/svx/strings.hrc

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

diff --git a/cui/source/dialogs/signature-line-draw.svg 
b/cui/source/dialogs/signature-line-draw.svg
index 564b5cdf3ef9..b8552c41b82c 100644
--- a/cui/source/dialogs/signature-line-draw.svg
+++ b/cui/source/dialogs/signature-line-draw.svg
@@ -28,9 +28,9 @@
   
   
 
-Digitally signed by:
+[SIGNED_BY]
 [SIGNER_NAME]
-Date: [DATE]
+[DATE]
 
   
 
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index 3eea6ce8aa4c..3ae4e219ef76 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1705,6 +1705,9 @@
 #define RID_SVXSTR_PAGEDIR_LTR_VERT 
NC_("RID_SVXSTR_PAGEDIR_LTR_VERT", "Left-to-right (vertical)")
 #define RID_SVXSTR_PAGEDIR_LTR_BTT_VERT 
NC_("RID_SVXSTR_PAGEDIR_LTR_BTT_VERT", "Bottom-to-top, left-to-right 
(vertical)")
 
+#define RID_SVXSTR_SIGNATURELINE_DSIGNED_BY 
NC_("RID_SVXSTR_SIGNATURELINE_DSIGNED_BY", "Digitally signed by:")
+#define RID_SVXSTR_SIGNATURELINE_DATE   
NC_("RID_SVXSTR_SIGNATURELINE_DATE", "Date: %1")
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/signaturelinehelper.cxx 
b/svx/source/dialog/signaturelinehelper.cxx
index bdc78e39be37..00d798e5d002 100644
--- a/svx/source/dialog/signaturelinehelper.cxx
+++ b/svx/source/dialog/signaturelinehelper.cxx
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -138,9 +140,11 @@ void setShapeCertificate(SdrView* pView,
 
 // Read svg and replace placeholder texts.
 OUString 
aSvgImage(svx::SignatureLineHelper::getSignatureImage("signature-line-draw.svg"));
+aSvgImage = aSvgImage.replaceAll("[SIGNED_BY]", 
SvxResId(RID_SVXSTR_SIGNATURELINE_DSIGNED_BY));
 OUString aSignerName = 
svx::SignatureLineHelper::getSignerName(xCertificate);
 aSvgImage = aSvgImage.replaceAll("[SIGNER_NAME]", aSignerName);
 OUString aDate = svx::SignatureLineHelper::getLocalizedDate();
+aDate = SvxResId(RID_SVXSTR_SIGNATURELINE_DATE).replaceFirst("%1", aDate);
 aSvgImage = aSvgImage.replaceAll("[DATE]", aDate);
 
 uno::Reference xGraphic = 
svx::SignatureLineHelper::importSVG(aSvgImage);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - cui/source include/svx svx/Library_svx.mk svx/source

2020-06-26 Thread Miklos Vajna (via logerrit)
 cui/source/dialogs/SignSignatureLineDialog.cxx |   37 +---
 cui/source/dialogs/SignatureLineDialog.cxx |   14 ---
 cui/source/dialogs/SignatureLineDialogBase.cxx |   14 ---
 cui/source/inc/SignatureLineDialogBase.hxx |1 
 include/svx/signaturelinehelper.hxx|   59 
 svx/Library_svx.mk |1 
 svx/source/dialog/signaturelinehelper.cxx  |  114 +
 7 files changed, 185 insertions(+), 55 deletions(-)

New commits:
commit d3506785b59442a7f747eccedea557f5645b33cb
Author: Miklos Vajna 
AuthorDate: Mon Jun 8 17:14:14 2020 +0200
Commit: Miklos Vajna 
CommitDate: Fri Jun 26 08:53:20 2020 +0200

sd signature line: extract part of signature line UI from cui to svx

So the "sign existing pdf" code in sd can reuse that.

(cherry picked from commit 85b68061a5a904ca82e5db40600af741d30f0bb8)

Conflicts:
cui/source/dialogs/SignSignatureLineDialog.cxx

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

diff --git a/cui/source/dialogs/SignSignatureLineDialog.cxx 
b/cui/source/dialogs/SignSignatureLineDialog.cxx
index 96fa94248106..10223e2b68fa 100644
--- a/cui/source/dialogs/SignSignatureLineDialog.cxx
+++ b/cui/source/dialogs/SignSignatureLineDialog.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -166,22 +167,14 @@ IMPL_LINK_NOARG(SignSignatureLineDialog, 
chooseCertificate, weld::Button&, void)
 if (!pShell->PrepareForSigning(m_xDialog.get()))
 return;
 
-Reference 
xSigner(DocumentDigitalSignatures::createWithVersion(
-comphelper::getProcessComponentContext(), "1.2"));
-xSigner->setParentWindow(m_xDialog->GetXWindow());
-OUString aDescription;
-CertificateKind certificateKind = CertificateKind_NONE;
-// When signing ooxml, we only want X.509 certificates
-if (pShell->GetMedium()->GetFilter()->IsAlienFormat())
-certificateKind = CertificateKind_X509;
 Reference xSignCertificate
-= xSigner->selectSigningCertificateWithType(certificateKind, 
aDescription);
+= svx::SignatureLineHelper::getSignatureCertificate(pShell, 
m_xDialog.get());
 
 if (xSignCertificate.is())
 {
 m_xSelectedCertifate = xSignCertificate;
-m_xBtnChooseCertificate->set_label(xmlsec::GetContentPart(
-xSignCertificate->getSubjectName(), 
xSignCertificate->getCertificateKind()));
+m_xBtnChooseCertificate->set_label(
+svx::SignatureLineHelper::getSignerName(xSignCertificate));
 }
 ValidateFields();
 }
@@ -217,15 +210,13 @@ void SignSignatureLineDialog::Apply()
 css::uno::Reference 
SignSignatureLineDialog::getSignedGraphic(bool bValid)
 {
 // Read svg and replace placeholder texts
-OUString aSvgImage(getSignatureImage());
+OUString aSvgImage(svx::SignatureLineHelper::getSignatureImage());
 aSvgImage = aSvgImage.replaceAll("[SIGNER_NAME]", 
getCDataString(m_aSuggestedSignerName));
 aSvgImage = aSvgImage.replaceAll("[SIGNER_TITLE]", 
getCDataString(m_aSuggestedSignerTitle));
 
 OUString aIssuerLine
 = CuiResId(RID_SVXSTR_SIGNATURELINE_SIGNED_BY)
-  .replaceFirst("%1",
-
xmlsec::GetContentPart(m_xSelectedCertifate->getSubjectName(),
-   
m_xSelectedCertifate->getCertificateKind()));
+  .replaceFirst("%1", 
svx::SignatureLineHelper::getSignerName(m_xSelectedCertifate));
 aSvgImage = aSvgImage.replaceAll("[SIGNED_BY]", 
getCDataString(aIssuerLine));
 if (bValid)
 aSvgImage = aSvgImage.replaceAll("[INVALID_SIGNATURE]", "");
@@ -233,10 +224,7 @@ css::uno::Reference 
SignSignatureLineDialog::getSignedGr
 OUString aDate;
 if (m_bShowSignDate && bValid)
 {
-const SvtSysLocale aSysLocale;
-const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
-Date aDateTime(Date::SYSTEM);
-aDate = rLocaleData.getDate(aDateTime);
+aDate = svx::SignatureLineHelper::getLocalizedDate();
 }
 aSvgImage = aSvgImage.replaceAll("[DATE]", aDate);
 
@@ -266,16 +254,7 @@ css::uno::Reference 
SignSignatureLineDialog::getSignedGr
 }
 
 // Create graphic
-SvMemoryStream aSvgStream(4096, 4096);
-aSvgStream.WriteOString(OUStringToOString(aSvgImage, 
RTL_TEXTENCODING_UTF8));
-Reference xInputStream(new 
utl::OSeekableInputStreamWrapper(aSvgStream));
-Reference 
xContext(comphelper::getProcessComponentContext());
-Reference xProvider = 
css::graphic::GraphicProvider::create(xContext);
-
-Sequence aMediaProperties(1);
-aMediaProperties[0].Name = "InputStream";
-aMediaProperties[0].Value <<= xInputStream;
-return xProvider->queryGraphic(aMediaProperties);
+return 

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

2020-05-20 Thread Henry Castro (via logerrit)
 cui/source/tabpages/tpline.cxx   |8 ++--
 svx/source/tbxctrls/linectrl.cxx |6 +-
 svx/source/tbxctrls/tbcontrl.cxx |8 ++--
 svx/source/xoutdev/xattr2.cxx|4 +++-
 svx/source/xoutdev/xtabdash.cxx  |5 -
 5 files changed, 24 insertions(+), 7 deletions(-)

New commits:
commit ae56b554ded2eea3c11fa95352ba8a96b56ae6cc
Author: Henry Castro 
AuthorDate: Mon Feb 24 13:34:03 2020 -0400
Commit: Henry Castro 
CommitDate: Thu May 21 00:39:14 2020 +0200

lok: use "None" string item in the ListBox control

The string item "- none -" confuse mobile users,
it is preferable to use the "None" string

Change-Id: Ib9b5716aa796624255fed7fac5413db69e028bb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89839
Tested-by: Jenkins
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94513
Tested-by: Henry Castro 

diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index beb9018d4361..29c998734e32 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -63,6 +63,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define MAX_BMP_WIDTH   16
 #define MAX_BMP_HEIGHT  16
@@ -230,7 +231,8 @@ void SvxLineTabPage::FillListboxes()
 m_xLbLineStyle->set_active( nOldSelect );
 
 // Line end style
-OUString sNone( SvxResId( RID_SVXSTR_NONE ) );
+OUString sNone( comphelper::LibreOfficeKit::isActive() ? SvxResId( 
RID_SVXSTR_INVISIBLE )
+: SvxResId( RID_SVXSTR_NONE ) );
 nOldSelect = m_xLbStartStyle->get_active();
 m_xLbStartStyle->clear();
 m_xLbStartStyle->append_text(sNone);
@@ -292,7 +294,9 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
 *m_pnLineEndListState = ChangeType::NONE;
 
 nPos = m_xLbLineStyle->get_active();
-OUString sNone(SvxResId(RID_SVXSTR_NONE));
+OUString sNone( comphelper::LibreOfficeKit::isActive() ? SvxResId( 
RID_SVXSTR_INVISIBLE )
+: SvxResId( RID_SVXSTR_NONE ) );
+
 m_xLbStartStyle->clear();
 m_xLbStartStyle->append_text(sNone);
 
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index dfe0be2dd57c..2d4506dbde6f 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -45,6 +45,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::util;
@@ -378,7 +380,9 @@ void SvxLineEndWindow::FillValueSet()
 // First entry: no line end.
 // An entry is temporarily added to get the UI bitmap
 basegfx::B2DPolyPolygon aNothing;
-mpLineEndList->Insert(std::make_unique(aNothing, 
SvxResId(RID_SVXSTR_NONE)));
+mpLineEndList->Insert(std::make_unique(aNothing,
+comphelper::LibreOfficeKit::isActive() ? SvxResId(RID_SVXSTR_INVISIBLE)
+: SvxResId(RID_SVXSTR_NONE)));
 const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd(nCount);
 BitmapEx aBmp = mpLineEndList->GetUiBitmap( nCount );
 OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 6741954f7581..6385517cc321 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -117,6 +117,8 @@
 #include 
 #include 
 
+#include 
+
 #define MAX_MRU_FONTNAME_ENTRIES5
 
 // don't make more than 15 entries visible at once
@@ -1971,7 +1973,8 @@ namespace
 
 NamedColor GetNoneColor()
 {
-return std::make_pair(COL_NONE_COLOR, SvxResId(RID_SVXSTR_NONE));
+return std::make_pair(COL_NONE_COLOR, 
comphelper::LibreOfficeKit::isActive() ? SvxResId(RID_SVXSTR_INVISIBLE)
+: SvxResId(RID_SVXSTR_NONE));
 }
 }
 
@@ -2709,7 +2712,8 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( 
svt::ToolboxController& rController, vcl
 SetOutputSizePixel( Size( 114, 144 ) );
 
 m_aLineStyleLb->SetSourceUnit( FieldUnit::TWIP );
-m_aLineStyleLb->SetNone( SvxResId(RID_SVXSTR_NONE) );
+m_aLineStyleLb->SetNone( comphelper::LibreOfficeKit::isActive() ? 
SvxResId(RID_SVXSTR_INVISIBLE)
+:SvxResId(RID_SVXSTR_NONE) );
 
 m_aLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( 
SvxBorderLineStyle::SOLID ), SvxBorderLineStyle::SOLID );
 m_aLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( 
SvxBorderLineStyle::DOTTED ), SvxBorderLineStyle::DOTTED );
diff --git a/svx/source/xoutdev/xattr2.cxx b/svx/source/xoutdev/xattr2.cxx
index 6a59871ce1d2..83ab1904d8b4 100644
--- a/svx/source/xoutdev/xattr2.cxx
+++ b/svx/source/xoutdev/xattr2.cxx
@@ -47,6 +47,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 
 XLineTransparenceItem::XLineTransparenceItem(sal_uInt16 nLineTransparence) :
@@ -107,7 +109,7 @@ bool XLineJointItem::GetPresentation( SfxItemPresentation 
/*ePres*/, MapUnit /*e
 {
 case 

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

2020-05-13 Thread Armin Le Grand (via logerrit)
 cui/source/tabpages/grfpage.cxx |   56 
 1 file changed, 45 insertions(+), 11 deletions(-)

New commits:
commit 5566618ad375617313abfb23829b3ea70bde0ee1
Author: Armin Le Grand 
AuthorDate: Wed Apr 1 19:21:13 2020 +0200
Commit: Andras Timar 
CommitDate: Wed May 13 17:56:15 2020 +0200

Avoid XOR paint in Crop dialog

Change-Id: I9d3709f9d2a09de1eaace916dc6033de13dbff86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91528
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 586f9806ce8d..091ef70faddf 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -35,6 +35,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #define CM_1_TO_TWIP567
 #define TWIP_TO_INCH1440
@@ -694,27 +697,58 @@ void SvxCropExample::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 
 void SvxCropExample::Paint(vcl::RenderContext& rRenderContext, const 
::tools::Rectangle&)
 {
-rRenderContext.Push(PushFlags::MAPMODE | PushFlags::RASTEROP);
+rRenderContext.Push(PushFlags::MAPMODE);
 rRenderContext.SetMapMode(m_aMapMode);
 
-Size aWinSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
+// Win BG
+const Size aWinSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
 rRenderContext.SetLineColor();
 
rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor());
 rRenderContext.DrawRect(::tools::Rectangle(Point(), aWinSize));
 
-rRenderContext.SetLineColor(COL_WHITE);
-::tools::Rectangle aRect(Point((aWinSize.Width() - m_aFrameSize.Width())/2,
-  (aWinSize.Height() - m_aFrameSize.Height())/2),
-  m_aFrameSize);
+// use AA, the Graphic may be a metafile/svg and would then look ugly
+rRenderContext.SetAntialiasing(AntialiasingFlags::EnableB2dDraw);
+
+// draw Graphic
+::tools::Rectangle aRect(
+Point((aWinSize.Width() - m_aFrameSize.Width())/2, (aWinSize.Height() 
- m_aFrameSize.Height())/2),
+m_aFrameSize);
 m_aGrf.Draw(, aRect.TopLeft(), aRect.GetSize());
 
-rRenderContext.SetFillColor(COL_TRANSPARENT);
-rRenderContext.SetRasterOp(RasterOp::Invert);
-aRect.AdjustLeft(m_aTopLeft.Y() );
-aRect.AdjustTop(m_aTopLeft.X() );
+// Remove one more case that uses XOR paint (RasterOp::Invert).
+// Get colors and logic DashLength from settings, use equal to
+// PolygonMarkerPrimitive2D, may be changed to that primitive later.
+// Use this to guarantee good visibility - that was the purpose of
+// the former used XOR paint.
+const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+const Color aColA(aSvtOptionsDrawinglayer.GetStripeColorA().getBColor());
+const Color aColB(aSvtOptionsDrawinglayer.GetStripeColorB().getBColor());
+const double fStripeLength(aSvtOptionsDrawinglayer.GetStripeLength());
+const basegfx::B2DVector 
aDashVector(rRenderContext.GetInverseViewTransformation() * 
basegfx::B2DVector(fStripeLength, 0.0));
+const double fLogicDashLength(aDashVector.getX());
+
+// apply current crop settings
+aRect.AdjustLeft(m_aTopLeft.Y());
+aRect.AdjustTop(m_aTopLeft.X());
 aRect.AdjustRight(-m_aBottomRight.Y());
 aRect.AdjustBottom(-m_aBottomRight.X());
-rRenderContext.DrawRect(aRect);
+
+// apply dash with direct paint callbacks
+basegfx::utils::applyLineDashing(
+basegfx::utils::createPolygonFromRect(
+basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), 
aRect.Bottom())),
+std::vector< double >(2, fLogicDashLength),
+[,](const basegfx::B2DPolygon& rSnippet)
+{
+rRenderContext.SetLineColor(aColA);
+rRenderContext.DrawPolyLine(rSnippet);
+},
+[,](const basegfx::B2DPolygon& rSnippet)
+{
+rRenderContext.SetLineColor(aColB);
+rRenderContext.DrawPolyLine(rSnippet);
+},
+2.0 * fLogicDashLength);
 
 rRenderContext.Pop();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits