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

2021-02-05 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 73f807f8b1f558b509012b89d73bb497722bcaad
Author: Szymon Kłos 
AuthorDate: Tue Jan 26 11:48:16 2021 +0100
Commit: Szymon Kłos 
CommitDate: Fri Feb 5 14:02:09 2021 +0100

lok: send paragraph spacing state

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7372a767d645..7c52af48f554 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2769,7 +2769,10 @@ static void doc_iniUnoCommands ()
 OUString(".uno:AcceptTrackedChange"),
 OUString(".uno:RejectTrackedChange"),
 OUString(".uno:BorderInner"),
-OUString(".uno:BorderOuter")
+OUString(".uno:BorderOuter"),
+OUString(".uno:SpacePara1"),
+OUString(".uno:SpacePara15"),
+OUString(".uno:SpacePara2")
 };
 
 util::URL aCommandURL;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-23 Thread Gülşah Köse (via logerrit)
 desktop/source/lib/init.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 1c44b8d103dca932b893fbf1dcdff0650ea91e1b
Author: Gülşah Köse 
AuthorDate: Fri Oct 23 01:35:41 2020 +0300
Commit: Andras Timar 
CommitDate: Fri Oct 23 12:41:28 2020 +0200

Prevent crash with invalid lang tag.

Change-Id: I778b5b007d4edce946e8b4c26e5a07f12103a968
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104673
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
(cherry picked from commit fb8286255ff8d9872156a73dc0cf32ab04bf8f2a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104678

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 89cf49dbf6f7..2f0092177d25 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2192,8 +2192,9 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
 // not pass it as a parameter to the filter
 OUString aOptions = getUString(pOptions);
 const OUString aLanguage = extractParameter(aOptions, "Language");
+bool isValidLangTag = LanguageTag::isValidBcp47(aLanguage, nullptr);
 
-if (!aLanguage.isEmpty())
+if (!aLanguage.isEmpty() && isValidLangTag)
 {
 SfxLokHelper::setDefaultLanguage(aLanguage);
 // Set the LOK language tag, used for dialog tunneling.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-16 Thread Jan Holesovsky (via logerrit)
 desktop/source/lib/init.cxx |   54 
 1 file changed, 25 insertions(+), 29 deletions(-)

New commits:
commit 800c0aebe7dffb88eb5c1d96fd47eb99032fdfe9
Author: Jan Holesovsky 
AuthorDate: Thu Oct 15 18:05:35 2020 +0200
Commit: Andras Timar 
CommitDate: Fri Oct 16 16:24:27 2020 +0200

lok: Simplify the check for command in sendDialogEvent.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b9fd1f9195e7..c8971182893f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3656,11 +3656,11 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 
 bIsWeldedDialog = pWidget != nullptr;
 bool bContinueWithLOKWindow = false;
+OUString sAction = aMap["cmd"];
 
 if (bIsWeldedDialog)
 {
 OUString sControlType = aMap["type"];
-OUString sAction = aMap["cmd"];
 
 if (sControlType == "tabcontrol")
 {
@@ -3746,36 +3746,32 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 if (pUIWindow) {
 bool bIsClickAction = false;
 
-if (aMap.find("cmd") != aMap.end()) {
-if (aMap["cmd"] == "selected")
-{
-aMap["POS"] = aMap["data"];
-aMap["TEXT"] = aMap["data"];
+if (sAction == "selected")
+{
+aMap["POS"] = aMap["data"];
+aMap["TEXT"] = aMap["data"];
 
-pUIWindow->execute(sSelectAction, aMap);
-}
-else if (aMap["cmd"] == "plus")
-{
-pUIWindow->execute(sUpAction, aMap);
-}
-else if (aMap["cmd"] == "minus")
-{
-pUIWindow->execute(sDownAction, aMap);
-}
-else if (aMap["cmd"] == "set")
-{
-aMap["TEXT"] = aMap["data"];
+pUIWindow->execute(sSelectAction, aMap);
+}
+else if (sAction == "plus")
+{
+pUIWindow->execute(sUpAction, aMap);
+}
+else if (sAction == "minus")
+{
+pUIWindow->execute(sDownAction, aMap);
+}
+else if (sAction == "set")
+{
+aMap["TEXT"] = aMap["data"];
 
-pUIWindow->execute(sClearAction, aMap);
-pUIWindow->execute(sTypeAction, aMap);
-}
-else if (aMap["cmd"] == "value")
-{
-aMap["VALUE"] = aMap["data"];
-pUIWindow->execute(sValue, aMap);
-}
-else
-bIsClickAction = true;
+pUIWindow->execute(sClearAction, aMap);
+pUIWindow->execute(sTypeAction, aMap);
+}
+else if (sAction == "value")
+{
+aMap["VALUE"] = aMap["data"];
+pUIWindow->execute(sValue, aMap);
 }
 else
 bIsClickAction = 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.2' - desktop/source

2020-09-22 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3c292e1c9991fa3d365cbe2acc4c6fa2ec7ada92
Author: Szymon Kłos 
AuthorDate: Mon Sep 21 11:16:35 2020 +0200
Commit: Andras Timar 
CommitDate: Tue Sep 22 10:22:40 2020 +0200

Allow to save file if chart editing is active

This helps in online where autosave after user
closed view with chart editing active caused
document to be broken and not allowing to open again.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a2cf174ba599..b9fd1f9195e7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3952,7 +3952,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 bool bResult = false;
 LokChartHelper aChartHelper(SfxViewShell::Current());
 
-if (aChartHelper.GetWindow() )
+if (aChartHelper.GetWindow() && aCommand != ".uno:Save" )
 {
 util::URL aCommandURL;
 aCommandURL.Path = aCommand.copy(5);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/vcl vcl/source

2020-09-17 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |2 +-
 include/vcl/uitest/uiobject.hxx |2 ++
 vcl/source/uitest/uiobject.cxx  |   33 -
 3 files changed, 31 insertions(+), 6 deletions(-)

New commits:
commit 7b922966bf6bcf16f34cc22f60f0f962deb5f24a
Author: Szymon Kłos 
AuthorDate: Thu Sep 17 10:18:23 2020 +0200
Commit: Szymon Kłos 
CommitDate: Thu Sep 17 13:33:34 2020 +0200

jsdialog: use window only if visible

When there is a name conflict we should take
currently visible window.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ca825da01637..a2cf174ba599 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3742,7 +3742,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 if (!bIsWeldedDialog || bContinueWithLOKWindow)
 {
 WindowUIObject aUIObject(pWindow);
-std::unique_ptr 
pUIWindow(aUIObject.get_child(aMap["id"]));
+std::unique_ptr 
pUIWindow(aUIObject.get_visible_child(aMap["id"]));
 if (pUIWindow) {
 bool bIsClickAction = false;
 
diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx
index c7ab3d51af93..4d4f98478adc 100644
--- a/include/vcl/uitest/uiobject.hxx
+++ b/include/vcl/uitest/uiobject.hxx
@@ -117,6 +117,8 @@ public:
 
 virtual std::unique_ptr get_child(const OUString& rID) override;
 
+virtual std::unique_ptr get_visible_child(const OUString& rID);
+
 virtual std::set get_children() const override;
 
 virtual OUString dumpState() const override;
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index efbf8e06dcf4..77f4014eea7c 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -374,7 +374,7 @@ OUString WindowUIObject::get_type() const
 
 namespace {
 
-vcl::Window* findChild(vcl::Window* pParent, const OUString& rID)
+vcl::Window* findChild(vcl::Window* pParent, const OUString& rID, bool 
bRequireVisible = false)
 {
 if (!pParent)
 return nullptr;
@@ -386,12 +386,16 @@ vcl::Window* findChild(vcl::Window* pParent, const 
OUString& rID)
 for (size_t i = 0; i < nCount; ++i)
 {
 vcl::Window* pChild = pParent->GetChild(i);
-if (pChild && pChild->get_id() == rID)
+if (pChild && pChild->get_id() == rID
+&& (!bRequireVisible || pChild->IsVisible()))
 return pChild;
 
-vcl::Window* pResult = findChild(pChild, rID);
-if (pResult)
-return pResult;
+if (!bRequireVisible || pChild->IsVisible())
+{
+vcl::Window* pResult = findChild(pChild, rID);
+if (pResult)
+return pResult;
+}
 }
 
 return nullptr;
@@ -441,6 +445,25 @@ std::unique_ptr WindowUIObject::get_child(const 
OUString& rID)
 return aFunction(pWindow);
 }
 
+std::unique_ptr WindowUIObject::get_visible_child(const OUString& 
rID)
+{
+// in a first step try the real children before moving to the top level 
parent
+// This makes it easier to handle cases with the same ID as there is a way
+// to resolve conflicts
+vcl::Window* pWindow = findChild(mxWindow.get(), rID, true);
+if (!pWindow)
+{
+vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
+pWindow = findChild(pDialogParent, rID, true);
+}
+
+if (!pWindow)
+throw css::uno::RuntimeException("Could not find child with id: " + 
rID);
+
+FactoryFunction aFunction = pWindow->GetUITestFactory();
+return aFunction(pWindow);
+}
+
 std::set WindowUIObject::get_children() const
 {
 vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source editeng/source sd/qa

2020-09-11 Thread Marco Cecchetti (via logerrit)
 desktop/source/lib/init.cxx   |2 
 editeng/source/editeng/impedit.cxx|  279 --
 editeng/source/editeng/impedit.hxx|2 
 editeng/source/editeng/impedit3.cxx   |5 
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |4 
 5 files changed, 144 insertions(+), 148 deletions(-)

New commits:
commit dbca79d09acf5439e59c693db941b1d6e73c94c9
Author: Marco Cecchetti 
AuthorDate: Wed Aug 26 09:06:59 2020 +0200
Commit: Andras Timar 
CommitDate: Fri Sep 11 14:09:59 2020 +0200

Online: selection highlight in Calc should follow font size changes.

When user changes font size of selected text, markers and highlight 
rectangle should be updated.
impedit3.cxx: Line had no effect, removed.
Lokitsearchtest.cxx: Test had bug.
Other changes: LOKit code is separated. Now callback_text_selection is 
fired when font size is changed (Calc). On Writer it already behaves that way.

Change-Id: I9b7e3224ad162bfb7d8f0853b6cb17b4feafa0cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101193
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Marco Cecchetti 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102458
Tested-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d0982e0bdcf1..c5f19c23eb93 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1393,6 +1393,8 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 type != LOK_CALLBACK_CURSOR_VISIBLE &&
 type != LOK_CALLBACK_VIEW_CURSOR_VISIBLE &&
 type != LOK_CALLBACK_TEXT_SELECTION &&
+type != LOK_CALLBACK_TEXT_SELECTION_START &&
+type != LOK_CALLBACK_TEXT_SELECTION_END &&
 type != LOK_CALLBACK_REFERENCE_MARKS)
 {
 SAL_INFO("lok", "Skipping while painting [" << type << "]: [" << 
payload << "].");
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index b67a847c615d..58ba2ce6d43d 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -198,6 +198,124 @@ void ImpEditView::SelectionChanged()
 }
 }
 
+// This function is also called when a text's font || size is changed. Because 
its highlight rectangle must be updated.
+void ImpEditView::lokSelectionCallback(std::unique_ptr 
, bool bStartHandleVisible, bool bEndHandleVisible) {
+VclPtr pParent = pOutWin->GetParentWithLOKNotifier();
+vcl::Region pRegion = vcl::Region( *pPolyPoly );
+
+if (pParent && pParent->GetLOKWindowId() != 0)
+{
+const long nX = pOutWin->GetOutOffXPixel() - 
pParent->GetOutOffXPixel();
+const long nY = pOutWin->GetOutOffYPixel() - 
pParent->GetOutOffYPixel();
+
+std::vector aRectangles;
+pRegion.GetRegionRectangles(aRectangles);
+
+std::vector v;
+for (tools::Rectangle & rRectangle : aRectangles)
+{
+rRectangle = pOutWin->LogicToPixel(rRectangle);
+rRectangle.Move(nX, nY);
+v.emplace_back(rRectangle.toString().getStr());
+}
+OString sRectangle = comphelper::string::join("; ", v);
+
+const vcl::ILibreOfficeKitNotifier* pNotifier = 
pParent->GetLOKNotifier();
+const OUString rAction("text_selection");
+std::vector aItems;
+aItems.emplace_back("rectangles", sRectangle);
+aItems.emplace_back("startHandleVisible", 
OString::boolean(bStartHandleVisible));
+aItems.emplace_back("endHandleVisible", 
OString::boolean(bEndHandleVisible));
+pNotifier->notifyWindow(pParent->GetLOKWindowId(), rAction, aItems);
+}
+else
+{
+pOutWin->Push(PushFlags::MAPMODE);
+if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
+{
+// Find the parent that is not right
+// on top of us to use its offset.
+vcl::Window* parent = pOutWin->GetParent();
+while (parent &&
+parent->GetOutOffXPixel() == pOutWin->GetOutOffXPixel() &&
+parent->GetOutOffYPixel() == pOutWin->GetOutOffYPixel())
+{
+parent = parent->GetParent();
+}
+
+if (parent)
+{
+lcl_translateTwips(*parent, *pOutWin);
+}
+}
+
+bool bMm100ToTwip = (pOutWin->GetMapMode().GetMapUnit() == 
MapUnit::Map100thMM);
+
+Point aOrigin;
+if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
+// Writer comments: they use editeng, but are separate widgets.
+aOrigin = pOutWin->GetMapMode().GetOrigin();
+
+OString sRectangle;
+
+std::vector aRectangles;
+pRegion.GetRegionRectangles(aRectangles);
+
+if (!aRectangles.empty())
+{
+if (pOutWin->IsChart())
+{
+ 

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

2020-08-19 Thread Mert Tumer (via logerrit)
 desktop/source/lib/init.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 7621398ad1b4e25b87d6da709b41966e7e3a9484
Author: Mert Tumer 
AuthorDate: Mon Aug 17 11:40:38 2020 +0300
Commit: Andras Timar 
CommitDate: Wed Aug 19 08:58:44 2020 +0200

Fix hyperlink popup does not show up

The popup does not show up when double clicking
same cell after first one when the cell has a
hyperlink. This is because LOK_CALLBACK_INVALIDATE
_VISIBLE_CURSOR message is filtered out when it
is duplicate and hyperlink is inside this callback.

Selecting different cell after editing one does not
make calc to send another invalidate cursor message
because it is only sent if the selected cell is being
edited. This confuses the ui experience, so this patch
prevents the callback from being filtered out
if only it contains a hyperlink. If there is not a hyperlink
on the cursor position the duplicate callbacks will still
be filtered out.

Signed-off-by: Mert Tumer 
Change-Id: Ibca0887b7d49633e476bc63d08bc0b7cc309d710
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100851
Tested-by: Jenkins
Reviewed-by: Andras Timar 
(cherry picked from commit 06bed3046b4ca62a50566f42d3a7079f0b563935)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100935
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d33454297cf8..d0982e0bdcf1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1519,10 +1519,15 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_VIEW_CURSOR_VISIBLE:
 case LOK_CALLBACK_CALC_FUNCTION_LIST:
 {
+// deleting the duplicate of visible cursor message can cause 
hyperlink popup not to show up on second/or more click on the same place.
+// If the hyperlink is not empty we can bypass that to show 
the popup
+const bool hyperLinkException = type == 
LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR &&
+payload.find("\"hyperlink\":\"\"") == std::string::npos &&
+payload.find("\"hyperlink\": {}") == std::string::npos;
 const int nViewId = lcl_getViewId(payload);
 removeAll(
-[type, nViewId] (const queue_type::value_type& elem) {
-return (elem.Type == type && nViewId == 
lcl_getViewId(elem));
+[type, nViewId, hyperLinkException] (const 
queue_type::value_type& elem) {
+return (elem.Type == type && nViewId == 
lcl_getViewId(elem) && !hyperLinkException);
 }
 );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source editeng/source include/editeng

2020-08-10 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx   |4 +++-
 editeng/source/items/frmitems.cxx |   31 +++
 include/editeng/boxitem.hxx   |4 
 3 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit 035d850179688137dcf145cf3e779b6e05779239
Author: Szymon Kłos 
AuthorDate: Mon Aug 10 12:57:00 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Mon Aug 10 21:09:01 2020 +0200

lok: send cell border state updates

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7e6b71c77c1e..d33454297cf8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2756,7 +2756,9 @@ static void doc_iniUnoCommands ()
 OUString(".uno:ParaspaceIncrease"),
 OUString(".uno:ParaspaceDecrease"),
 OUString(".uno:AcceptTrackedChange"),
-OUString(".uno:RejectTrackedChange")
+OUString(".uno:RejectTrackedChange"),
+OUString(".uno:BorderInner"),
+OUString(".uno:BorderOuter")
 };
 
 util::URL aCommandURL;
diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 0e1c22731ad7..d21e3ce75591 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1440,6 +1440,23 @@ SvxBoxItem& SvxBoxItem::operator=( const SvxBoxItem& 
rBox )
 }
 
 
+boost::property_tree::ptree SvxBoxItem::dumpAsJSON() const
+{
+boost::property_tree::ptree aTree;
+
+boost::property_tree::ptree aState;
+aState.put("top", GetTop() && !GetTop()->isEmpty());
+aState.put("bottom", GetBottom() && !GetBottom()->isEmpty());
+aState.put("left", GetLeft() && !GetLeft()->isEmpty());
+aState.put("right", GetRight() && !GetRight()->isEmpty());
+
+aTree.push_back(std::make_pair("state", aState));
+aTree.put("commandName", ".uno:BorderOuter");
+
+return aTree;
+}
+
+
 static bool CmpBrdLn( const std::unique_ptr & pBrd1, const 
SvxBorderLine* pBrd2 )
 {
 if( pBrd1.get() == pBrd2 )
@@ -2318,6 +2335,20 @@ SvxBoxInfoItem::~SvxBoxInfoItem()
 {
 }
 
+boost::property_tree::ptree SvxBoxInfoItem::dumpAsJSON() const
+{
+boost::property_tree::ptree aTree;
+
+boost::property_tree::ptree aState;
+aState.put("vertical", GetVert() && !GetVert()->isEmpty());
+aState.put("horizontal", GetHori() && !GetHori()->isEmpty());
+
+aTree.push_back(std::make_pair("state", aState));
+aTree.put("commandName", ".uno:BorderInner");
+
+return aTree;
+}
+
 SvxBoxInfoItem ::operator=( const SvxBoxInfoItem& rCpy )
 {
 if (this != )
diff --git a/include/editeng/boxitem.hxx b/include/editeng/boxitem.hxx
index 103967578f20..8cf1c2d60545 100644
--- a/include/editeng/boxitem.hxx
+++ b/include/editeng/boxitem.hxx
@@ -118,6 +118,8 @@ public:
 static css::table::BorderLine2 SvxLineToLine( const 
editeng::SvxBorderLine* pLine, bool bConvert );
 static bool LineToSvxLine(const css::table::BorderLine& rLine, 
editeng::SvxBorderLine& rSvxLine, bool bConvert);
 static bool LineToSvxLine(const css::table::BorderLine2& rLine, 
editeng::SvxBorderLine& rSvxLine, bool bConvert);
+
+virtual boost::property_tree::ptree dumpAsJSON() const override;
 };
 
 inline void SvxBoxItem::SetAllDistances(sal_uInt16 const nNew)
@@ -234,6 +236,8 @@ public:
 nValidFlags &= ~nValid;
 }
 voidResetFlags();
+
+virtual boost::property_tree::ptree dumpAsJSON() const override;
 };
 
 namespace editeng
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-22 Thread Aron Budea (via logerrit)
 desktop/source/lib/init.cxx  |   12 
 sfx2/source/control/unoctitm.cxx |   15 +--
 2 files changed, 25 insertions(+), 2 deletions(-)

New commits:
commit 09407951bba3808483bb2e7d2fd7e4b8660b134b
Author: Aron Budea 
AuthorDate: Fri Apr 24 17:01:47 2020 +0200
Commit: Andras Timar 
CommitDate: Wed Jul 22 18:25:27 2020 +0200

Send various state changes to LOK

Change-Id: I0d5dc63015364cd1586555b6dced81afa50745bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92865
Tested-by: Jenkins
Reviewed-by: Aron Budea 
(cherry picked from commit f2e059ca3b1d55c721c6a698e6761536534224ba)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97585
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 5a08b856e5a5f722e6b49d2e5e526593a4ad65de)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97794
Reviewed-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2e5f9380fa44..7e6b71c77c1e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2661,6 +2661,7 @@ static void doc_iniUnoCommands ()
 OUString(".uno:InsertRowsAfter"),
 OUString(".uno:InsertColumnsBefore"),
 OUString(".uno:InsertColumnsAfter"),
+OUString(".uno:MergeCells"),
 OUString(".uno:DeleteRows"),
 OUString(".uno:DeleteColumns"),
 OUString(".uno:DeleteTable"),
@@ -2709,9 +2710,20 @@ static void doc_iniUnoCommands ()
 OUString(".uno:InsertPageHeader"),
 OUString(".uno:InsertPageFooter"),
 OUString(".uno:OnlineAutoFormat"),
+OUString(".uno:InsertObjectChart"),
+OUString(".uno:InsertSection"),
+OUString(".uno:InsertAnnotation"),
+OUString(".uno:InsertPagebreak"),
+OUString(".uno:InsertColumnBreak"),
+OUString(".uno:HyperlinkDialog"),
 OUString(".uno:InsertSymbol"),
 OUString(".uno:EditRegion"),
 OUString(".uno:ThesaurusDialog"),
+OUString(".uno:FormatArea"),
+OUString(".uno:FormatLine"),
+OUString(".uno:FormatColumns"),
+OUString(".uno:Watermark"),
+OUString(".uno:ResetAttributes"),
 OUString(".uno:Orientation"),
 OUString(".uno:ObjectAlignLeft"),
 OUString(".uno:ObjectAlignRight"),
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index b8955d6ba1c5..405208e03766 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1068,6 +1068,13 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "InsertRowsAfter" ||
  aEvent.FeatureURL.Path == "InsertColumnsBefore" ||
  aEvent.FeatureURL.Path == "InsertColumnsAfter" ||
+ aEvent.FeatureURL.Path == "MergeCells" ||
+ aEvent.FeatureURL.Path == "InsertObjectChart" ||
+ aEvent.FeatureURL.Path == "InsertSection" ||
+ aEvent.FeatureURL.Path == "InsertAnnotation" ||
+ aEvent.FeatureURL.Path == "InsertPagebreak" ||
+ aEvent.FeatureURL.Path == "InsertColumnBreak" ||
+ aEvent.FeatureURL.Path == "HyperlinkDialog" ||
  aEvent.FeatureURL.Path == "InsertSymbol" ||
  aEvent.FeatureURL.Path == "InsertPage" ||
  aEvent.FeatureURL.Path == "DeletePage" ||
@@ -1122,8 +1129,12 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "OutlineRight" ||
  aEvent.FeatureURL.Path == "OutlineLeft" ||
  aEvent.FeatureURL.Path == "OutlineDown" ||
- aEvent.FeatureURL.Path == "OutlineUp")
-
+ aEvent.FeatureURL.Path == "OutlineUp" ||
+ aEvent.FeatureURL.Path == "FormatArea" ||
+ aEvent.FeatureURL.Path == "FormatLine" ||
+ aEvent.FeatureURL.Path == "FormatColumns" ||
+ aEvent.FeatureURL.Path == "Watermark" ||
+ aEvent.FeatureURL.Path == "ResetAttributes")
 {
 aBuffer.append(aEvent.IsEnabled ? OUString("enabled") : 
OUString("disabled"));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-24 Thread Mert Tumer (via logerrit)
 desktop/source/lib/init.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit d046bad4fad89b1afeed78703afa695528338299
Author: Mert Tumer 
AuthorDate: Wed Jun 10 14:41:41 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Wed Jun 24 13:31:30 2020 +0200

Fix .uno:SidebarHide command works for online

Change-Id: I03743d15300687b1da947d3c44be6a42aab83107
Signed-off-by: Mert Tumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96618
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b34f814ff472..568363fea289 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1172,6 +1172,16 @@ void setupSidebar(bool bShow, OUString sidebarDeckId = 
"")
 SetLastExceptionMsg("No view shell or sidebar");
 }
 
+void hideSidebar()
+{
+SfxViewShell* pViewShell = SfxViewShell::Current();
+SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): nullptr;
+if (pViewFrame)
+pViewFrame->SetChildWindow(SID_SIDEBAR, false, false);
+else
+SetLastExceptionMsg("No view shell or sidebar");
+}
+
 VclPtr getSidebarWindow()
 {
 VclPtr xRet;
@@ -3921,7 +3931,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 }
 else if (gImpl && aCommand == ".uno:SidebarHide")
 {
-setupSidebar(false);
+hideSidebar();
 return;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-20 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 0b53ab935694c956170ceeab1c7cdef1d4e4a9dd
Author: Szymon Kłos 
AuthorDate: Wed Mar 18 10:31:09 2020 +0100
Commit: Szymon Kłos 
CommitDate: Wed May 20 17:27:45 2020 +0200

jsdialog: implement plus/minus for welded spinfields

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 62ee41ce8b6b..6afdd5fbe955 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3684,6 +3684,23 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 bContinueWithLOKWindow = true;
 }
 }
+else if (sControlType == "spinfield")
+{
+auto pSpinField = dynamic_cast(pWidget);
+if (pSpinField)
+{
+if (sAction == "plus")
+{
+pSpinField->set_value(pSpinField->get_value() + 1);
+}
+else if (sAction == "minus")
+{
+pSpinField->set_value(pSpinField->get_value() - 1);
+}
+else
+bContinueWithLOKWindow = true;
+}
+}
 else
 {
 bContinueWithLOKWindow = 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.2' - desktop/source

2020-05-20 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 73886f62f26ae26d4a0fe1687b31dfd0d7394c92
Author: Szymon Kłos 
AuthorDate: Tue Mar 10 16:46:37 2020 +0100
Commit: Szymon Kłos 
CommitDate: Wed May 20 14:30:53 2020 +0200

jsdialog: use welding for button click event

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b91240ad1b31..62ee41ce8b6b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3671,6 +3671,19 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 bContinueWithLOKWindow = true;
 }
 }
+else if (sControlType == "pushbutton")
+{
+auto pButton = dynamic_cast(pWidget);
+if (pButton)
+{
+if (sAction == "click")
+{
+pButton->clicked();
+}
+else
+bContinueWithLOKWindow = true;
+}
+}
 else
 {
 bContinueWithLOKWindow = 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.2' - desktop/source

2020-05-18 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit d1cc69426e126611d026aafe5d6b27a59e53849d
Author: Szymon Kłos 
AuthorDate: Tue Mar 10 16:24:16 2020 +0100
Commit: Szymon Kłos 
CommitDate: Mon May 18 10:12:17 2020 +0200

jsdialog: avoid crash in watermark dialog

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 322a691bd908..b91240ad1b31 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3615,12 +3615,14 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 static const OUString sDownAction("DOWN");
 static const OUString sValue("VALUE");
 
+bool bIsWeldedDialog = false;
+
 try
 {
 OString sControlId = OUStringToOString(aMap["id"], 
RTL_TEXTENCODING_ASCII_US);
 weld::Widget* pWidget = 
JSInstanceBuilder::FindWeldWidgetsMap(nWindowId, sControlId);
 
-bool bIsWeldedDialog = pWidget != nullptr;
+bIsWeldedDialog = pWidget != nullptr;
 bool bContinueWithLOKWindow = false;
 
 if (bIsWeldedDialog)
@@ -3723,7 +3725,8 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 } catch(...) {}
 
 // force resend
-pWindow->Resize();
+if (!bIsWeldedDialog)
+pWindow->Resize();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/vcl vcl/jsdialog

2020-05-16 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx  |   16 -
 include/vcl/jsdialog/jsdialogbuilder.hxx |8 ++
 include/vcl/weld.hxx |2 
 vcl/jsdialog/jsdialogbuilder.cxx |   85 ++-
 4 files changed, 81 insertions(+), 30 deletions(-)

New commits:
commit 374df6dbce390d994e9c333ff35e6268e9fdbb17
Author: Szymon Kłos 
AuthorDate: Fri Mar 6 11:11:57 2020 +0100
Commit: Szymon Kłos 
CommitDate: Sat May 16 08:36:40 2020 +0200

jsdialog: remember weld instances

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 52b75514870f..322a691bd908 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3596,7 +3596,6 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 
 StringMap aMap(jsonToStringMap(pArguments));
 VclPtr pWindow = vcl::Window::FindLOKWindow(nWindowId);
-JSInstanceBuilder* pBuilder = 
JSInstanceBuilder::FindLOKWeldBuilder(nWindowId);
 
 if (!pWindow && nWindowId >= 10 /* why unsigned? */)
 pWindow = getSidebarWindow();
@@ -3618,18 +3617,20 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 
 try
 {
-bool bIsWeldedDialog = pBuilder != nullptr;
+OString sControlId = OUStringToOString(aMap["id"], 
RTL_TEXTENCODING_ASCII_US);
+weld::Widget* pWidget = 
JSInstanceBuilder::FindWeldWidgetsMap(nWindowId, sControlId);
+
+bool bIsWeldedDialog = pWidget != nullptr;
 bool bContinueWithLOKWindow = false;
 
 if (bIsWeldedDialog)
 {
-OString sControlId = OUStringToOString(aMap["id"], 
RTL_TEXTENCODING_ASCII_US);
 OUString sControlType = aMap["type"];
 OUString sAction = aMap["cmd"];
 
 if (sControlType == "tabcontrol")
 {
-auto pNotebook = pBuilder->weld_notebook(sControlId, 
false);
+auto pNotebook = dynamic_cast(pWidget);
 if (pNotebook)
 {
 if (sAction == "selecttab")
@@ -3645,7 +3646,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 }
 else if (sControlType == "combobox")
 {
-auto pCombobox = pBuilder->weld_combo_box(sControlId, 
false);
+auto pCombobox = dynamic_cast(pWidget);
 if (pCombobox)
 {
 if (sAction == "selected")
@@ -3659,6 +3660,11 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 pCombobox->set_active(pos);
 }
 }
+else if (sAction == "change")
+{
+pCombobox->set_entry_text(aMap["data"]);
+pCombobox->signal_changed();
+}
 else
 bContinueWithLOKWindow = true;
 }
diff --git a/include/vcl/jsdialog/jsdialogbuilder.hxx 
b/include/vcl/jsdialog/jsdialogbuilder.hxx
index b26b2ac2ff16..e0d4bc2dcdc1 100644
--- a/include/vcl/jsdialog/jsdialogbuilder.hxx
+++ b/include/vcl/jsdialog/jsdialogbuilder.hxx
@@ -10,6 +10,8 @@
 #include 
 #include 
 
+typedef std::map WidgetMap;
+
 class JSDialogSender
 {
 VclPtr m_aOwnedToplevel;
@@ -27,6 +29,9 @@ class VCL_DLLPUBLIC JSInstanceBuilder : public 
SalInstanceBuilder
 {
 vcl::LOKWindowId m_nWindowId;
 
+static std::map& GetLOKWeldWidgetsMap();
+void RememberWidget(const OString& id, weld::Widget* pWidget);
+
 public:
 JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const 
OUString& rUIFile);
 virtual ~JSInstanceBuilder() override;
@@ -43,8 +48,7 @@ public:
 virtual std::unique_ptr weld_notebook(const OString& id,
   bool bTakeOwnership 
= false) override;
 
-static std::map& 
GetLOKWeldBuilderMap();
-static JSInstanceBuilder* FindLOKWeldBuilder(vcl::LOKWindowId nWindowId);
+static weld::Widget* FindWeldWidgetsMap(vcl::LOKWindowId nWindowId, const 
OString& rWidget);
 };
 
 template 
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 0017c56e2b1b..e9b816a0f5fa 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -322,9 +322,9 @@ protected:
 Link m_aEntryActivateHdl;
 Link m_aEntryInsertTextHdl;
 
+public:
 void signal_changed() { m_aChangeHdl.Call(*this); }
 
-public:
 virtual void insert(int pos, const OUString& rStr, const OUString* pId,
   

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

2020-05-15 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |  120 +++-
 1 file changed, 85 insertions(+), 35 deletions(-)

New commits:
commit 420ccf4bdd398558bc080e969e600204a286c82a
Author: Szymon Kłos 
AuthorDate: Thu Mar 5 12:24:27 2020 +0100
Commit: Szymon Kłos 
CommitDate: Fri May 15 16:02:31 2020 +0200

jsdialog: execute actions using weld wrapper

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9b02d51a65f2..52b75514870f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -156,6 +156,7 @@
 #include 
 #include 
 #include 
+#include 
 
 // Needef for getUndoManager()
 #include 
@@ -3595,6 +3596,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 
 StringMap aMap(jsonToStringMap(pArguments));
 VclPtr pWindow = vcl::Window::FindLOKWindow(nWindowId);
+JSInstanceBuilder* pBuilder = 
JSInstanceBuilder::FindLOKWeldBuilder(nWindowId);
 
 if (!pWindow && nWindowId >= 10 /* why unsigned? */)
 pWindow = getSidebarWindow();
@@ -3616,53 +3618,101 @@ static void 
doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
 
 try
 {
-WindowUIObject aUIObject(pWindow);
-std::unique_ptr 
pUIWindow(aUIObject.get_child(aMap["id"]));
-if (pUIWindow) {
-bool bIsClickAction = false;
+bool bIsWeldedDialog = pBuilder != nullptr;
+bool bContinueWithLOKWindow = false;
 
-if (aMap.find("cmd") != aMap.end()) {
-if (aMap["cmd"] == "selected")
-{
-aMap["POS"] = aMap["data"];
-aMap["TEXT"] = aMap["data"];
+if (bIsWeldedDialog)
+{
+OString sControlId = OUStringToOString(aMap["id"], 
RTL_TEXTENCODING_ASCII_US);
+OUString sControlType = aMap["type"];
+OUString sAction = aMap["cmd"];
 
-pUIWindow->execute(sSelectAction, aMap);
-}
-else if (aMap["cmd"] == "plus")
-{
-pUIWindow->execute(sUpAction, aMap);
-}
-else if (aMap["cmd"] == "minus")
-{
-pUIWindow->execute(sDownAction, aMap);
-}
-else if (aMap["cmd"] == "set")
+if (sControlType == "tabcontrol")
+{
+auto pNotebook = pBuilder->weld_notebook(sControlId, 
false);
+if (pNotebook)
 {
-aMap["TEXT"] = aMap["data"];
+if (sAction == "selecttab")
+{
+OString pageId = OUStringToOString(aMap["data"], 
RTL_TEXTENCODING_ASCII_US);
+int page = std::atoi(pageId.getStr());
 
-pUIWindow->execute(sClearAction, aMap);
-pUIWindow->execute(sTypeAction, aMap);
+pNotebook->set_current_page(page);
+}
+else
+bContinueWithLOKWindow = true;
 }
-else if (aMap["cmd"] == "value")
+}
+else if (sControlType == "combobox")
+{
+auto pCombobox = pBuilder->weld_combo_box(sControlId, 
false);
+if (pCombobox)
 {
-aMap["VALUE"] = aMap["data"];
-pUIWindow->execute(sValue, aMap);
+if (sAction == "selected")
+{
+int separatorPos = aMap["data"].indexOf(';');
+if (separatorPos)
+{
+OUString entryPos = aMap["data"].copy(0, 
separatorPos);
+OString posString = 
OUStringToOString(entryPos, RTL_TEXTENCODING_ASCII_US);
+int pos = std::atoi(posString.getStr());
+pCombobox->set_active(pos);
+}
+}
+else
+bContinueWithLOKWindow = true;
 }
-else if (aMap["cmd"] == "selecttab")
-{
-aMap["POS"] = aMap["data"];
+}
+else
+{
+bContinueWithLOKWindow = true;
+}
+}
+
+if (!bIsWeldedDialog || 

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

2020-05-15 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6623adee97a2be4d63cf5bd647db6e2559690214
Author: Szymon Kłos 
AuthorDate: Fri May 15 10:06:58 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 15 11:38:41 2020 +0200

Revert "jsdialog: react on edit text change"

This reverts commit 40e0b90266573c3531a610ead44da6063ee12edb.

Reason for revert: broken checkboxes

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 42850f58dca2..9b02d51a65f2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3637,7 +3637,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 {
 pUIWindow->execute(sDownAction, aMap);
 }
-else if (aMap["cmd"] == "set" || aMap["cmd"] == "change")
+else if (aMap["cmd"] == "set")
 {
 aMap["TEXT"] = aMap["data"];
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/vcl vcl/source

2020-05-14 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx|6 ++
 include/vcl/tabctrl.hxx|2 ++
 vcl/source/control/tabctrl.cxx |   18 ++
 3 files changed, 26 insertions(+)

New commits:
commit eaddcdf4fe79e9a1c393bd0ed737c898a7113844
Author: Szymon Kłos 
AuthorDate: Wed Mar 4 16:04:08 2020 +0100
Commit: Szymon Kłos 
CommitDate: Thu May 14 13:46:09 2020 +0200

jsdialog: send tab names

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5d5e41ee09b5..42850f58dca2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3649,6 +3649,12 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 aMap["VALUE"] = aMap["data"];
 pUIWindow->execute(sValue, aMap);
 }
+else if (aMap["cmd"] == "selecttab")
+{
+aMap["POS"] = aMap["data"];
+
+pUIWindow->execute(sSelectAction, aMap);
+}
 else
 bIsClickAction = true;
 }
diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx
index 39b45b1b423b..8e094020231b 100644
--- a/include/vcl/tabctrl.hxx
+++ b/include/vcl/tabctrl.hxx
@@ -187,6 +187,8 @@ public:
 virtual FactoryFunction GetUITestFactory() const override;
 
 virtual void queue_resize(StateChangedType eReason = 
StateChangedType::Layout) override;
+
+virtual boost::property_tree::ptree DumpAsPropertyTree() override;
 };
 
 class NotebookBar;
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 6f284f8e042f..cab39a8feb94 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -2184,6 +2184,24 @@ FactoryFunction TabControl::GetUITestFactory() const
 return TabControlUIObject::create;
 }
 
+boost::property_tree::ptree TabControl::DumpAsPropertyTree()
+{
+boost::property_tree::ptree aTree = Control::DumpAsPropertyTree();
+
+boost::property_tree::ptree aTabs;
+for(auto id : GetPageIDs())
+{
+boost::property_tree::ptree aTab;
+aTab.put("text", GetPageText(id));
+aTab.put("id", id);
+aTabs.push_back(std::make_pair("", aTab));
+}
+
+aTree.add_child("tabs", aTabs);
+
+return aTree;
+}
+
 sal_uInt16 NotebookbarTabControlBase::m_nHeaderHeight = 0;
 
 IMPL_LINK_NOARG(NotebookbarTabControlBase, OpenMenu, Button*, void)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-14 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 40e0b90266573c3531a610ead44da6063ee12edb
Author: Szymon Kłos 
AuthorDate: Fri Feb 28 14:39:35 2020 +0100
Commit: Szymon Kłos 
CommitDate: Thu May 14 12:18:32 2020 +0200

jsdialog: react on edit text change

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 203ece44ef51..5d5e41ee09b5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3637,7 +3637,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 {
 pUIWindow->execute(sDownAction, aMap);
 }
-else if (aMap["cmd"] == "set")
+else if (aMap["cmd"] == "set" || aMap["cmd"] == "change")
 {
 aMap["TEXT"] = aMap["data"];
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/sfx2

2020-05-10 Thread Mert Tumer (via logerrit)
 desktop/source/lib/init.cxx|   20 
 include/sfx2/sidebar/SidebarController.hxx |1 +
 2 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit 3ea23d3b13e08f2ac9d83446acc588bbf1d4ad74
Author: Mert Tumer 
AuthorDate: Fri May 8 17:23:12 2020 +0300
Commit: Andras Timar 
CommitDate: Sun May 10 16:38:58 2020 +0200

mobile: fix calc chart wizard properties is not shown

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 40c19ca439fd..203ece44ef51 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1147,10 +1147,24 @@ void setupSidebar(bool bShow, OUString sidebarDeckId = 
"")
 if (!pDockingWin)
 return;
 
+OUString currentDeckId = 
pDockingWin->GetSidebarController()->GetCurrentDeckId();
+
+// check if it is the chart deck id, if it is, don't switch to default 
deck
+bool switchToDefault = true;
+
+if (currentDeckId == "ChartDeck")
+switchToDefault = false;
+
 if (!sidebarDeckId.isEmpty())
 {
 pDockingWin->GetSidebarController()->SwitchToDeck(sidebarDeckId);
 }
+else
+{
+if (switchToDefault)
+pDockingWin->GetSidebarController()->SwitchToDefaultDeck();
+}
+
 pDockingWin->SyncUpdate();
 }
 else
@@ -3661,7 +3675,6 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 SfxObjectShell* pDocSh = SfxObjectShell::Current();
 OUString aCommand(pCommand, strlen(pCommand), RTL_TEXTENCODING_UTF8);
 LibLODocument_Impl* pDocument = static_cast(pThis);
-OUString sidebarDeckId = "PropertyDeck";
 
 std::vector 
aPropertyValuesVector(jsonToPropertyValuesVector(pArguments));
 
@@ -3795,13 +3808,12 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 }
 else if (gImpl && aCommand == ".uno:LOKSidebarWriterPage")
 {
-sidebarDeckId = "WriterPageDeck";
-setupSidebar(true, sidebarDeckId);
+setupSidebar(true, "WriterPageDeck");
 return;
 }
 else if (gImpl && aCommand == ".uno:SidebarShow")
 {
-setupSidebar(true, sidebarDeckId);
+setupSidebar(true);
 return;
 }
 else if (gImpl && aCommand == ".uno:SidebarHide")
diff --git a/include/sfx2/sidebar/SidebarController.hxx 
b/include/sfx2/sidebar/SidebarController.hxx
index e65bbae42537..92a063c9f403 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -140,6 +140,7 @@ public:
 FocusManager& GetFocusManager() { return maFocusManager;}
 
 ResourceManager* GetResourceManager() { return mpResourceManager.get();}
+auto& GetCurrentDeckId() const { return msCurrentDeckId; }
 
// std::unique_ptr GetResourceManager() { return 
mpResourceManager;}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-08 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx  |   27 ++-
 sfx2/source/control/unoctitm.cxx |   27 +++
 2 files changed, 53 insertions(+), 1 deletion(-)

New commits:
commit e20b4a62c9fa7d57f8ef7aa9667584feaecbe7bd
Author: Szymon Kłos 
AuthorDate: Fri May 8 09:25:13 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 8 12:23:57 2020 +0200

notebookbar: send uno items state update

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index fa04e95e2424..a6f87754b411 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2689,7 +2689,32 @@ static void doc_iniUnoCommands ()
 OUString(".uno:TransformPosX"),
 OUString(".uno:TransformPosY"),
 OUString(".uno:TransformWidth"),
-OUString(".uno:TransformHeight")
+OUString(".uno:TransformHeight"),
+OUString(".uno:ObjectBackOne"),
+OUString(".uno:SendToBack"),
+OUString(".uno:ObjectForwardOne"),
+OUString(".uno:BringToFront"),
+OUString(".uno:WrapRight"),
+OUString(".uno:WrapThrough"),
+OUString(".uno:WrapLeft"),
+OUString(".uno:WrapIdeal"),
+OUString(".uno:WrapOn"),
+OUString(".uno:WrapOff"),
+OUString(".uno:UpdateCurIndex"),
+OUString(".uno:InsertCaptionDialog"),
+OUString(".uno:FormatGroup"),
+OUString(".uno:SplitTable"),
+OUString(".uno:MergeCells"),
+OUString(".uno:DeleteNote"),
+OUString(".uno:AcceptChanges"),
+OUString(".uno:FormatPaintbrush"),
+OUString(".uno:SetDefault"),
+OUString(".uno:ParaLeftToRight"),
+OUString(".uno:ParaRightToLeft"),
+OUString(".uno:ParaspaceIncrease"),
+OUString(".uno:ParaspaceDecrease"),
+OUString(".uno:AcceptTrackedChange"),
+OUString(".uno:RejectTrackedChange")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 27daebaf3e9e..7dcbf16e5f2b 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1083,6 +1083,33 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "SortDescending" ||
  aEvent.FeatureURL.Path == "AcceptAllTrackedChanges" ||
  aEvent.FeatureURL.Path == "RejectAllTrackedChanges" ||
+ aEvent.FeatureURL.Path == "AcceptTrackedChange" ||
+ aEvent.FeatureURL.Path == "RejectTrackedChange" ||
+ aEvent.FeatureURL.Path == "NextTrackedChange" ||
+ aEvent.FeatureURL.Path == "PreviousTrackedChange" ||
+ aEvent.FeatureURL.Path == "FormatGroup" ||
+ aEvent.FeatureURL.Path == "ObjectBackOne" ||
+ aEvent.FeatureURL.Path == "SendToBack" ||
+ aEvent.FeatureURL.Path == "ObjectForwardOne" ||
+ aEvent.FeatureURL.Path == "BringToFront" ||
+ aEvent.FeatureURL.Path == "WrapRight" ||
+ aEvent.FeatureURL.Path == "WrapThrough" ||
+ aEvent.FeatureURL.Path == "WrapLeft" ||
+ aEvent.FeatureURL.Path == "WrapIdeal" ||
+ aEvent.FeatureURL.Path == "WrapOn" ||
+ aEvent.FeatureURL.Path == "WrapOff" ||
+ aEvent.FeatureURL.Path == "UpdateCurIndex" ||
+ aEvent.FeatureURL.Path == "InsertCaptionDialog" ||
+ aEvent.FeatureURL.Path == "MergeCells" ||
+ aEvent.FeatureURL.Path == "SplitTable" ||
+ aEvent.FeatureURL.Path == "DeleteNote" ||
+ aEvent.FeatureURL.Path == "AcceptChanges" ||
+ aEvent.FeatureURL.Path == "FormatPaintbrush" ||
+ aEvent.FeatureURL.Path == "SetDefault" ||
+ aEvent.FeatureURL.Path == "ParaLeftToRight" ||
+ aEvent.FeatureURL.Path == "ParaRightToLeft" ||
+ aEvent.FeatureURL.Path == "ParaspaceIncrease" ||
+ aEvent.FeatureURL.Path == "ParaspaceDecrease" ||
  aEvent.FeatureURL.Path == "TableDialog" ||
  aEvent.FeatureURL.Path == "FormatCellDialog" ||
  aEvent.FeatureURL.Path == "FontDialog" ||
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/LibreOfficeKit include/vcl sc/inc sc/source

2020-05-08 Thread Jan Holesovsky (via logerrit)
 desktop/source/lib/init.cxx   |6 +++---
 include/LibreOfficeKit/LibreOfficeKit.h   |2 +-
 include/LibreOfficeKit/LibreOfficeKit.hxx |4 ++--
 include/vcl/ITiledRenderable.hxx  |2 +-
 sc/inc/docuno.hxx |2 +-
 sc/source/ui/app/inputhdl.cxx |   16 ++--
 sc/source/ui/inc/inputhdl.hxx |2 +-
 sc/source/ui/unoobj/docuno.cxx|6 +++---
 8 files changed, 22 insertions(+), 18 deletions(-)

New commits:
commit f56ace63f3bae98dc0185043d85157d366fd9311
Author: Jan Holesovsky 
AuthorDate: Thu May 7 15:47:49 2020 +0200
Commit: Andras Timar 
CommitDate: Fri May 8 10:46:09 2020 +0200

formula bar: Change completeFunction() to accept string instead of index.

The 'index' is unsafe, because the set it tries to index can change in
the meantime.  Instead, use the function name and search for it in the
set, to get the recent index.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e6c2d6630a58..fa04e95e2424 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1090,7 +1090,7 @@ static size_t 
doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOu
 static void doc_resizeWindow(LibreOfficeKitDocument* pThis, unsigned 
nLOKWindowId,
  const int nWidth, const int nHeight);
 
-static void doc_completeFunction(LibreOfficeKitDocument* pThis, int nIndex);
+static void doc_completeFunction(LibreOfficeKitDocument* pThis, const char*);
 } // extern "C"
 
 namespace {
@@ -5411,7 +5411,7 @@ static void doc_resizeWindow(LibreOfficeKitDocument* 
/*pThis*/, unsigned nLOKWin
 pWindow->SetSizePixel(Size(nWidth, nHeight));
 }
 
-static void doc_completeFunction(LibreOfficeKitDocument* pThis, int nIndex)
+static void doc_completeFunction(LibreOfficeKitDocument* pThis, const char* 
pFunctionName)
 {
 SolarMutexGuard aGuard;
 SetLastExceptionMsg();
@@ -5423,7 +5423,7 @@ static void doc_completeFunction(LibreOfficeKitDocument* 
pThis, int nIndex)
 return;
 }
 
-pDoc->completeFunction(nIndex);
+pDoc->completeFunction(OUString::fromUtf8(pFunctionName));
 }
 
 static char* lo_getError (LibreOfficeKit *pThis)
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 6203c11fb044..f95c8cb7858b 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -437,7 +437,7 @@ struct _LibreOfficeKitDocumentClass
 int viewId);
 
 /// @see lok::Document::completeFunction().
-void (*completeFunction) (LibreOfficeKitDocument* pThis, int nIndex);
+void (*completeFunction) (LibreOfficeKitDocument* pThis, const char* 
pFunctionName);
 
 /// @see lok::Document::setWindowTextSelection
 void (*setWindowTextSelection) (LibreOfficeKitDocument* pThis,
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index b80a35209bc3..ae72a3258357 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -762,9 +762,9 @@ public:
  *
  * @param nIndex is the index of the selected function
  */
-void completeFunction(int nIndex)
+void completeFunction(const char* pFunctionName)
 {
-mpDoc->pClass->completeFunction(mpDoc, nIndex);
+mpDoc->pClass->completeFunction(mpDoc, pFunctionName);
 }
 
 /**
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index a204713dd91b..b68157d32468 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -337,7 +337,7 @@ public:
 virtual void moveSelectedParts(int /*nPosition*/, bool /*bDuplicate*/) {}
 
 /// @see lok::Document::completeFunction().
-virtual void completeFunction(int /*nIndex*/)
+virtual void completeFunction(const OUString& /*rFunctionName*/)
 {
 }
 
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 5a5cf33bd3e9..3229dd86d720 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -385,7 +385,7 @@ public:
 OUString getPostItsPos() override;
 
 /// @see vcl::ITiledRenderable::completeFunction().
-virtual void completeFunction(int nIndex) override;
+virtual void completeFunction(const OUString& rFunctionName) override;
 };
 
 class ScDrawPagesObj : public cppu::WeakImplHelper<
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 8f422831c6a6..68e2f780fc14 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1642,7 +1642,7 @@ void ScInputHandler::PasteFunctionData()
 pActiveView->ShowCursor();
 }
 
-void ScInputHandler::LOKPasteFunctionData( 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/sfx2 sfx2/source

2020-05-06 Thread Mert Tumer (via logerrit)
 desktop/source/lib/init.cxx   |   17 +++--
 include/sfx2/sidebar/SidebarDockingWindow.hxx |1 +
 sfx2/source/sidebar/ResourceManager.cxx   |9 +
 3 files changed, 25 insertions(+), 2 deletions(-)

New commits:
commit 7f578ebe3cd824c05492c8fce9a1ed60bb5cfdfa
Author: Mert Tumer 
AuthorDate: Wed Apr 29 16:29:57 2020 +0300
Commit: Andras Timar 
CommitDate: Thu May 7 07:06:26 2020 +0200

added ability to switch sidebar deck on init.cxx for mobilewizard

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7c3a86ca5878..e6c2d6630a58 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -113,6 +113,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1120,7 +1121,7 @@ rtl::Reference 
forceSetClipboardForCurrentView(LibreOfficeKitDocum
 
 #endif
 
-void setupSidebar(bool bShow)
+void setupSidebar(bool bShow, OUString sidebarDeckId = "")
 {
 SfxViewShell* pViewShell = SfxViewShell::Current();
 SfxViewFrame* pViewFrame = pViewShell ? pViewShell->GetViewFrame() : 
nullptr;
@@ -1142,6 +1143,11 @@ void setupSidebar(bool bShow)
 auto pDockingWin = dynamic_cast(pChild->GetWindow());
 if (!pDockingWin)
 return;
+
+if (!sidebarDeckId.isEmpty())
+{
+pDockingWin->GetSidebarController()->SwitchToDeck(sidebarDeckId);
+}
 pDockingWin->SyncUpdate();
 }
 else
@@ -3625,6 +3631,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 SfxObjectShell* pDocSh = SfxObjectShell::Current();
 OUString aCommand(pCommand, strlen(pCommand), RTL_TEXTENCODING_UTF8);
 LibLODocument_Impl* pDocument = static_cast(pThis);
+OUString sidebarDeckId = "PropertyDeck";
 
 std::vector 
aPropertyValuesVector(jsonToPropertyValuesVector(pArguments));
 
@@ -3756,9 +3763,15 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 return;
 }
 }
+else if (gImpl && aCommand == ".uno:LOKSidebarWriterPage")
+{
+sidebarDeckId = "WriterPageDeck";
+setupSidebar(true, sidebarDeckId);
+return;
+}
 else if (gImpl && aCommand == ".uno:SidebarShow")
 {
-setupSidebar(true);
+setupSidebar(true, sidebarDeckId);
 return;
 }
 else if (gImpl && aCommand == ".uno:SidebarHide")
diff --git a/include/sfx2/sidebar/SidebarDockingWindow.hxx 
b/include/sfx2/sidebar/SidebarDockingWindow.hxx
index 049cf241aacd..64287cfe74a5 100644
--- a/include/sfx2/sidebar/SidebarDockingWindow.hxx
+++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx
@@ -47,6 +47,7 @@ public:
 
 void SetReadyToDrag( bool bStartDrag ) { mbIsReadyToDrag = bStartDrag; }
 bool IsReadyToDrag() const { return mbIsReadyToDrag; }
+auto& GetSidebarController() const { return mpSidebarController; }
 
 /// Force generation of all panels by completion.
 void SyncUpdate();
diff --git a/sfx2/source/sidebar/ResourceManager.cxx 
b/sfx2/source/sidebar/ResourceManager.cxx
index f563943e150d..0642109b1dd2 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -430,6 +430,15 @@ void ResourceManager::ReadPanelList()
 if (!aPanelNode.isValid())
 continue;
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+// Hide these panels in LOK as they aren't fully functional.
+OUString aPanelId = getString(aPanelNode, "Id");
+if (aPanelId == "PageStylesPanel" || aPanelId == "PageHeaderPanel"
+|| aPanelId == "PageFooterPanel")
+continue;
+}
+
 maPanels.push_back(std::make_shared());
 PanelDescriptor& rPanelDescriptor(*maPanels.back());
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source vcl/source

2020-05-05 Thread Tor Lillqvist (via logerrit)
 desktop/source/app/app.cxx  |4 
 vcl/source/app/salusereventlist.cxx |4 
 2 files changed, 8 insertions(+)

New commits:
commit a8c8192e3f4ef922465f0f1462fa4e1cd3fe2c8d
Author: Tor Lillqvist 
AuthorDate: Tue May 5 19:15:52 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Wed May 6 07:02:25 2020 +0200

On iOS, avoid catching exceptions to just immediately exit or abort anyway

It is better to let the exception be uncaught and then catch that in
the debugger. (Maybe even inspect its backtrace from a crash dump
automatically sent from an end-user device.)

Change-Id: Ice02d5cbd7f4a59eae7ce8a9fac47dec8b234a5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93505
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 59d6a0db378f..dda31df281e9 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1618,7 +1618,9 @@ int Desktop::Main()
 }
 
 // call Application::Execute to process messages in vcl message loop
+#ifndef IOS
 try
+#endif
 {
 #if HAVE_FEATURE_JAVA
 // The JavaContext contains an interaction handler which is used 
when
@@ -1638,6 +1640,7 @@ int Desktop::Main()
 Execute();
 }
 }
+#ifndef IOS
 catch(const css::document::CorruptedFilterConfigurationException& 
exFilterCfg)
 {
 RequestHandler::SetDowning();
@@ -1663,6 +1666,7 @@ int Desktop::Main()
 RequestHandler::SetDowning();
 FatalError( "Caught Unknown Exception: Aborting!");
 }
+#endif
 }
 else
 {
diff --git a/vcl/source/app/salusereventlist.cxx 
b/vcl/source/app/salusereventlist.cxx
index b71b5ed2031a..e8266c316764 100644
--- a/vcl/source/app/salusereventlist.cxx
+++ b/vcl/source/app/salusereventlist.cxx
@@ -106,10 +106,13 @@ bool SalUserEventList::DispatchUserEvents( bool 
bHandleAllCurrentEvents )
 continue;
 }
 
+#ifndef IOS
 try
+#endif
 {
 ProcessEvent( aEvent );
 }
+#ifndef IOS
 catch (css::uno::Exception&)
 {
 auto const e2 = cppu::getCaughtException();
@@ -126,6 +129,7 @@ bool SalUserEventList::DispatchUserEvents( bool 
bHandleAllCurrentEvents )
 SAL_WARN("vcl", "Uncaught exception during 
DispatchUserEvents!");
 std::abort();
 }
+#endif
 if (!bHandleAllCurrentEvents)
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source sc/source

2020-05-05 Thread Pranam Lashkari (via logerrit)
 desktop/source/lib/init.cxx   |5 ++---
 sc/source/ui/app/inputwin.cxx |2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 756bbe3f94fe1736406b7fd16ce62a67e7e62769
Author: Pranam Lashkari 
AuthorDate: Wed Apr 29 00:20:12 2020 +0530
Commit: Marco Cecchetti 
CommitDate: Tue May 5 11:53:26 2020 +0200

tdf#131230: Sidebar: Can't set Automatic color

This also solved the issue in sidebar with some controls
when selecting an item it selects the item below

Change-Id: I607b8bc44402b57b5c4833f918fb41b23ddf48c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93099
Tested-by: Marco Cecchetti 
Reviewed-by: Marco Cecchetti 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c735451b8e0c..7c3a86ca5878 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3830,9 +3830,8 @@ static void 
doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned
 return;
 }
 
-Size aOffset(pWindow->GetOutOffXPixel(), pWindow->GetOutOffYPixel());
-Point aPos(nX, nY);
-aPos.Move(aOffset);
+const Point aPos(nX, nY);
+
 MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, 
nButtons, nModifier);
 
 if (Dialog* pDialog = dynamic_cast(pWindow.get()))
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 1d1963feb61a..a8ecde9b214b 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -576,7 +576,7 @@ void ScInputWindow::NotifyLOKClient()
 {
 std::vector aItems;
 aItems.emplace_back("type", "calc-input-win");
-aItems.emplace_back(std::make_pair("position", Point(0, 
0).toString()));
+aItems.emplace_back(std::make_pair("position", 
Point(GetOutOffXPixel(), GetOutOffYPixel()).toString()));
 aItems.emplace_back(std::make_pair("size", aSize.toString()));
 aItems.emplace_back("lines", 
OString::number(aTextWindow.GetNumLines()));
 pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/vcl vcl/source

2020-04-27 Thread Henry Castro (via logerrit)
 desktop/source/lib/init.cxx |6 ++
 include/vcl/field.hxx   |3 +++
 include/vcl/uitest/uiobject.hxx |   19 +++
 vcl/source/control/field.cxx|   22 ++
 vcl/source/uitest/uiobject.cxx  |   38 ++
 5 files changed, 88 insertions(+)

New commits:
commit 08dbff244c6b58e34ca9658b7405b641fcaaffec
Author: Henry Castro 
AuthorDate: Wed Apr 22 18:22:33 2020 -0400
Commit: Henry Castro 
CommitDate: Tue Apr 28 04:53:40 2020 +0200

lok: add MetricFieldUIObject class

Add new action "VALUE" to set the value number
for metric input controls

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index daf2eb90b8bc..cde112ba3fa4 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3559,6 +3559,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 static const OUString sTypeAction("TYPE");
 static const OUString sUpAction("UP");
 static const OUString sDownAction("DOWN");
+static const OUString sValue("VALUE");
 
 try
 {
@@ -3590,6 +3591,11 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 pUIWindow->execute(sClearAction, aMap);
 pUIWindow->execute(sTypeAction, aMap);
 }
+else if (aMap["cmd"] == "value")
+{
+aMap["VALUE"] = aMap["data"];
+pUIWindow->execute(sValue, aMap);
+}
 else
 bIsClickAction = true;
 }
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index 172c128c0f3e..c855fa8c69f3 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -155,6 +155,8 @@ public:
 sal_Int64   Normalize( sal_Int64 nValue ) const;
 sal_Int64   Denormalize( sal_Int64 nValue ) const;
 
+virtual voidSetValueFromString(const OUString& rStr);
+
 protected:
 sal_Int64   mnFieldValue;
 sal_Int64   mnLastValue;
@@ -519,6 +521,7 @@ public:
 virtual voiddispose() override;
 
 virtual boost::property_tree::ptree DumpAsPropertyTree() override;
+virtual FactoryFunction GetUITestFactory() const override;
 };
 
 
diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx
index e56801af17f4..f5734e1a2949 100644
--- a/include/vcl/uitest/uiobject.hxx
+++ b/include/vcl/uitest/uiobject.hxx
@@ -381,6 +381,25 @@ protected:
 virtual OUString get_name() const override;
 };
 
+class UITEST_DLLPUBLIC MetricFieldUIObject : public SpinFieldUIObject
+{
+VclPtr mxMetricField;
+
+public:
+
+MetricFieldUIObject(const VclPtr& xEdit);
+virtual ~MetricFieldUIObject() override;
+
+virtual void execute(const OUString& rAction,
+const StringMap& rParameters) override;
+
+static std::unique_ptr create(vcl::Window* pWindow);
+
+protected:
+
+virtual OUString get_name() const override;
+};
+
 class UITEST_DLLPUBLIC TabControlUIObject : public WindowUIObject
 {
 private:
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index e75a55b52c5c..abdcaa798bc6 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -640,6 +641,22 @@ sal_Int64 NumericFormatter::GetValueFromString(const 
OUString& rStr) const
 return mnLastValue;
 }
 
+// currently used by online
+void NumericFormatter::SetValueFromString(const OUString& rStr)
+{
+sal_Int64 nValue;
+
+if (ImplNumericGetValue(rStr, nValue, GetDecimalDigits(),
+Application::GetSettings().GetNeutroLocaleDataWrapper()))
+{
+SetValue(nValue);
+}
+else
+{
+SAL_WARN("vcl", "fail to convert the value: " << rStr );
+}
+}
+
 sal_Int64 NumericFormatter::GetValue() const
 {
 if (mbFormatting) //don't parse the entry if we're currently formatting 
what to put in it
@@ -1715,6 +1732,11 @@ boost::property_tree::ptree 
MetricField::DumpAsPropertyTree()
 return aTree;
 }
 
+FactoryFunction MetricField::GetUITestFactory() const
+{
+return MetricFieldUIObject::create;
+}
+
 MetricBox::MetricBox(vcl::Window* pParent, WinBits nWinStyle)
 : ComboBox(pParent, nWinStyle)
 , MetricFormatter(this)
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index af3f486569d8..671e698e494d 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -1205,6 +1205,44 @@ std::unique_ptr 
SpinFieldUIObject::create(vcl::Window* pWindow)
   

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

2020-04-16 Thread Muhammet Kara (via logerrit)
 desktop/source/lib/init.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit d9a0e2fe5bf95bf0bfba424a3625d7f952884932
Author: Muhammet Kara 
AuthorDate: Thu Apr 16 23:01:54 2020 +0300
Commit: Muhammet Kara 
CommitDate: Thu Apr 16 23:12:37 2020 +0200

Move uno:Text param from core to online - core part

Change-Id: Idf51a688a868c2d140fcf5eb54e1bfdefc3690b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92394
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 146f65889a1a..daf2eb90b8bc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3646,10 +3646,6 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 ExecuteOrientationChange();
 return;
 }
-else if (gImpl && aCommand == ".uno:Text")
-{
-aCommand = ".uno:Text?CreateDirectly:bool=true";
-}
 
 // handle potential interaction
 if (gImpl && aCommand == ".uno:Save")
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-04-15 Thread Mert Tumer (via logerrit)
 desktop/source/lib/init.cxx  |1 +
 sfx2/source/control/unoctitm.cxx |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 2f6cbb67099edde535a81e7b0a32c1418805d6d6
Author: Mert Tumer 
AuthorDate: Tue Apr 14 18:19:09 2020 +0300
Commit: Andras Timar 
CommitDate: Wed Apr 15 11:44:20 2020 +0200

send state changes of .uno:NumberFormatDecimal command to LOK

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 612b6a51ceac..146f65889a1a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2648,6 +2648,7 @@ static void doc_iniUnoCommands ()
 OUString(".uno:ToggleMergeCells"),
 OUString(".uno:NumberFormatCurrency"),
 OUString(".uno:NumberFormatPercent"),
+OUString(".uno:NumberFormatDecimal"),
 OUString(".uno:NumberFormatDate"),
 OUString(".uno:FrameLineColor"),
 OUString(".uno:SortAscending"),
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 3f84d441562a..cedf079234ff 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1152,6 +1152,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "WrapText" ||
  aEvent.FeatureURL.Path == "NumberFormatCurrency" ||
  aEvent.FeatureURL.Path == "NumberFormatPercent" ||
+ aEvent.FeatureURL.Path == "NumberFormatDecimal" ||
  aEvent.FeatureURL.Path == "NumberFormatDate")
 {
 bool aBool;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-04-02 Thread Dennis Francis (via logerrit)
 desktop/source/lib/init.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 6e5cf6d3aafaede128dd762be273729a271462f8
Author: Dennis Francis 
AuthorDate: Wed Apr 1 20:20:19 2020 +0530
Commit: Andras Timar 
CommitDate: Thu Apr 2 09:54:57 2020 +0200

tdf#127158 :lokit: preload liblocaledata_others.so

...even if LOK_WHITELIST_LANGUAGES does not contain an Asian language.
Not preloading this module causes locale-fallbacks for example
when a calc-cell with Asian locale has some date with number-formatting,
LOOL displays the date with the fallback locale(en_US).
(more details in comments)

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c544984ade50..612b6a51ceac 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -95,6 +95,8 @@
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -5662,6 +5664,14 @@ static void preloadData()
 }
 std::cerr << "\n";
 
+// Hack to load and cache the module liblocaledata_others.so which is not 
loaded normally
+// (when loading dictionaries of just non-Asian locales). Creating a 
XCalendar4 of one Asian locale
+// will cheaply load this missing "others" locale library. Appending an 
Asian locale in
+// LOK_WHITELIST_LANGUAGES env-var also works but at the cost of loading 
that dictionary.
+css::uno::Reference< css::i18n::XCalendar4 > xCal = 
css::i18n::LocaleCalendar2::create(comphelper::getProcessComponentContext());
+css::lang::Locale aAsianLocale = {"hi", "IN", ""};
+xCal->loadDefaultCalendar(aAsianLocale);
+
 // preload all available thesauri
 css::uno::Reference 
xThesaurus(xLngSvcMgr->getThesaurus());
 css::uno::Reference 
xThesLocales(xSpellChecker, css::uno::UNO_QUERY_THROW);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-31 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx  |1 +
 sfx2/source/control/unoctitm.cxx |3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 56e64fde5af48e6ed3358591af8627c123b12b9d
Author: Michael Meeks 
AuthorDate: Tue Mar 31 20:27:00 2020 +0100
Commit: Andras Timar 
CommitDate: Tue Mar 31 22:48:42 2020 +0200

listen for and broadcast FrameLineColor state changes.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8045eed42b75..c544984ade50 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2647,6 +2647,7 @@ static void doc_iniUnoCommands ()
 OUString(".uno:NumberFormatCurrency"),
 OUString(".uno:NumberFormatPercent"),
 OUString(".uno:NumberFormatDate"),
+OUString(".uno:FrameLineColor"),
 OUString(".uno:SortAscending"),
 OUString(".uno:SortDescending"),
 OUString(".uno:TrackChanges"),
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index b27bb75451c8..3f84d441562a 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1037,7 +1037,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "BackgroundColor" ||
  aEvent.FeatureURL.Path == "CharBackColor" ||
  aEvent.FeatureURL.Path == "Color" ||
- aEvent.FeatureURL.Path == "FontColor")
+ aEvent.FeatureURL.Path == "FontColor" ||
+ aEvent.FeatureURL.Path == "FrameLineColor")
 {
 sal_Int32 nColor = -1;
 aEvent.State >>= nColor;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source sfx2/source svx/source

2020-03-31 Thread Henry Castro (via logerrit)
 desktop/source/lib/init.cxx |6 +++-
 sfx2/source/control/unoctitm.cxx|   27 +---
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx |   23 -
 3 files changed, 51 insertions(+), 5 deletions(-)

New commits:
commit 52ef588267d191304138a88b962314b5dec84356
Author: Henry Castro 
AuthorDate: Fri Mar 27 19:36:11 2020 -0400
Commit: Henry Castro 
CommitDate: Tue Mar 31 17:14:08 2020 +0200

LOk: notify the state values of the position and size property panel

Notify to client side when the UNO commands (TransformPosX, TransformPosY,
TransformWidth,TransformHeight) have changed only valid for mobile devices.
The state values are obtained from "position and a size" property panel of
the sidebar and they have a converted units formatted text and simplify
client side not to convert the units again.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 4a4a10efaa65..8045eed42b75 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2672,7 +2672,11 @@ static void doc_iniUnoCommands ()
 OUString(".uno:Orientation"),
 OUString(".uno:ObjectAlignLeft"),
 OUString(".uno:ObjectAlignRight"),
-OUString(".uno:AlignCenter")
+OUString(".uno:AlignCenter"),
+OUString(".uno:TransformPosX"),
+OUString(".uno:TransformPosY"),
+OUString(".uno:TransformWidth"),
+OUString(".uno:TransformHeight")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 7bc2cad90b63..b27bb75451c8 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -107,7 +107,7 @@ const char* const URLTypeNames[URLType_COUNT] =
 "double"
 };
 
-static void InterceptLOKStateChangeEvent( const SfxViewFrame* pViewFrame, 
const css::frame::FeatureStateEvent& aEvent, const SfxPoolItem* pState );
+static void InterceptLOKStateChangeEvent( sal_uInt16 nSID, SfxViewFrame* 
pViewFrame, const css::frame::FeatureStateEvent& aEvent, const SfxPoolItem* 
pState );
 
 void SfxStatusDispatcher::ReleaseAll()
 {
@@ -955,7 +955,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 
nSID, SfxItemState eSt
 
 if (pDispatcher && pDispatcher->GetFrame())
 {
-InterceptLOKStateChangeEvent(pDispatcher->GetFrame(), aEvent, 
pState);
+InterceptLOKStateChangeEvent(nSID, pDispatcher->GetFrame(), 
aEvent, pState);
 }
 
 for (const OUString& rName: 
pDispatch->GetListeners().getContainedTypes())
@@ -971,7 +971,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 
nSID, SfxItemState eSt
 StateChanged( nSID, eState, pState, nullptr );
 }
 
-static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const 
css::frame::FeatureStateEvent& aEvent, const SfxPoolItem* pState)
+static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* 
pViewFrame, const css::frame::FeatureStateEvent& aEvent, const SfxPoolItem* 
pState)
 {
 if (!comphelper::LibreOfficeKit::isActive())
 return;
@@ -1108,6 +1108,27 @@ static void InterceptLOKStateChangeEvent(const 
SfxViewFrame* pViewFrame, const c
 aBuffer.append(OUString::number(aInt32));
 }
 }
+else if (aEvent.FeatureURL.Path == "TransformPosX" ||
+ aEvent.FeatureURL.Path == "TransformPosY" ||
+ aEvent.FeatureURL.Path == "TransformWidth" ||
+ aEvent.FeatureURL.Path == "TransformHeight")
+{
+if (aEvent.IsEnabled && 
comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()))
+{
+boost::property_tree::ptree aTree;
+boost::property_tree::ptree aState;
+OUString aStr(aEvent.FeatureURL.Complete);
+
+aTree.put("commandName", aStr.toUtf8().getStr());
+pViewFrame->GetBindings().QueryControlState(nSID, aState);
+aTree.add_child("state", aState);
+
+aBuffer.setLength(0);
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, aTree);
+aBuffer.appendAscii(aStream.str().c_str());
+}
+}
 else if (aEvent.FeatureURL.Path == "StatusDocPos" ||
  aEvent.FeatureURL.Path == "RowColSelCount" ||
  aEvent.FeatureURL.Path == "StatusPageStyle" ||
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx 
b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index e684d4da2bc2..120b753a29d6 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -844,8 +844,29 @@ void PosSizePropertyPanel::NotifyItemUpdate(
 

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

2020-02-24 Thread Muhammet Kara (via logerrit)
 desktop/source/lib/init.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 2b6f2fe5ba4d85310ce76f7f783889c566a8d299
Author: Muhammet Kara 
AuthorDate: Mon Feb 24 16:04:37 2020 +0300
Commit: Muhammet Kara 
CommitDate: Mon Feb 24 17:22:23 2020 +0100

lok: Create Text boxes directly

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 40abb74cd060..d64e827e006a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3639,6 +3639,10 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 ExecuteOrientationChange();
 return;
 }
+else if (gImpl && aCommand == ".uno:Text")
+{
+aCommand = ".uno:Text?CreateDirectly:bool=true";
+}
 
 // handle potential interaction
 if (gImpl && aCommand == ".uno:Save")
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source sfx2/source svx/sdi sw/source

2020-02-10 Thread Dennis Francis (via logerrit)
 desktop/source/lib/init.cxx   |5 -
 sfx2/source/control/unoctitm.cxx  |5 -
 svx/sdi/svx.sdi   |   12 ++--
 sw/source/uibase/shells/frmsh.cxx |   23 +++
 4 files changed, 37 insertions(+), 8 deletions(-)

New commits:
commit 00e1597c9a8a3451ae4d67ac0d1257c5ccac6a16
Author: Dennis Francis 
AuthorDate: Thu Feb 6 12:23:21 2020 +0530
Commit: Jan Holesovsky 
CommitDate: Mon Feb 10 11:49:54 2020 +0100

Allow boolean valued statechange messages for...

object align commands :

ObjectAlignLeft [SID_OBJECT_ALIGN_LEFT]
ObjectAlignRight [SID_OBJECT_ALIGN_RIGHT]
AlignCenter [SID_OBJECT_ALIGN_CENTER]

What is pending is to set correct align state items for Impress in
DrawViewShell::GetMenuStateSel(). For doing that we need to store
the object align state somewhere when we execute SID_OBJECT_ALIGN_*
in DrawViewShell::FuTemporary().

For Writer the align state information was already available in
frame-format-manager object.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8916065bc273..aa6452e3d2cd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2656,7 +2656,10 @@ static void doc_iniUnoCommands ()
 OUString(".uno:InsertSymbol"),
 OUString(".uno:EditRegion"),
 OUString(".uno:ThesaurusDialog"),
-OUString(".uno:Orientation")
+OUString(".uno:Orientation"),
+OUString(".uno:ObjectAlignLeft"),
+OUString(".uno:ObjectAlignRight"),
+OUString(".uno:AlignCenter")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index b95ed01dc784..7bc2cad90b63 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1006,7 +1006,10 @@ static void InterceptLOKStateChangeEvent(const 
SfxViewFrame* pViewFrame, const c
 aEvent.FeatureURL.Path == "AlignLeft" ||
 aEvent.FeatureURL.Path == "AlignHorizontalCenter" ||
 aEvent.FeatureURL.Path == "AlignRight" ||
-aEvent.FeatureURL.Path == "DocumentRepair")
+aEvent.FeatureURL.Path == "DocumentRepair" ||
+aEvent.FeatureURL.Path == "ObjectAlignLeft" ||
+aEvent.FeatureURL.Path == "ObjectAlignRight" ||
+aEvent.FeatureURL.Path == "AlignCenter")
 {
 bool bTemp = false;
 aEvent.State >>= bTemp;
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 9429689d8e81..4774f61fa44e 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -106,10 +106,10 @@ SfxBoolItem Polygon SID_DRAW_POLYGON
 GroupId = SfxGroupId::Drawing;
 ]
 
-SfxVoidItem AlignCenter SID_OBJECT_ALIGN_CENTER
+SfxBoolItem AlignCenter SID_OBJECT_ALIGN_CENTER
 ()
 [
-AutoUpdate = FALSE,
+AutoUpdate = TRUE,
 FastCall = FALSE,
 ReadOnlyDoc = FALSE,
 Toggle = FALSE,
@@ -142,10 +142,10 @@ SfxVoidItem AlignDown SID_OBJECT_ALIGN_DOWN
 ]
 
 
-SfxVoidItem ObjectAlignLeft SID_OBJECT_ALIGN_LEFT
+SfxBoolItem ObjectAlignLeft SID_OBJECT_ALIGN_LEFT
 ()
 [
-AutoUpdate = FALSE,
+AutoUpdate = TRUE,
 FastCall = FALSE,
 ReadOnlyDoc = FALSE,
 Toggle = FALSE,
@@ -197,10 +197,10 @@ SfxVoidItem AlignMiddle SID_OBJECT_ALIGN_MIDDLE
 ]
 
 
-SfxVoidItem ObjectAlignRight SID_OBJECT_ALIGN_RIGHT
+SfxBoolItem ObjectAlignRight SID_OBJECT_ALIGN_RIGHT
 ()
 [
-AutoUpdate = FALSE,
+AutoUpdate = TRUE,
 FastCall = FALSE,
 ReadOnlyDoc = FALSE,
 Toggle = FALSE,
diff --git a/sw/source/uibase/shells/frmsh.cxx 
b/sw/source/uibase/shells/frmsh.cxx
index 12f0f8216ede..a34ca5783b87 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -808,7 +808,30 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
  bProtect ||
  ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER  || nWhich == 
SID_OBJECT_ALIGN_CENTER) &&
   bHtmlMode ))
+{
 rSet.DisableItem( nWhich );
+}
+else
+{
+sal_Int16 nHoriOrient = -1;
+switch(nWhich)
+{
+case SID_OBJECT_ALIGN_LEFT:
+nHoriOrient = text::HoriOrientation::LEFT;
+break;
+case SID_OBJECT_ALIGN_CENTER:
+nHoriOrient = text::HoriOrientation::CENTER;
+break;
+case SID_OBJECT_ALIGN_RIGHT:
+nHoriOrient = text::HoriOrientation::RIGHT;
+break;
+

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

2020-02-10 Thread Jan Holesovsky (via logerrit)
 desktop/source/deployment/misc/dp_dependencies.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit cc8b02a4f9b484590bda45059336053095be90f7
Author: Jan Holesovsky 
AuthorDate: Fri Feb 7 15:43:50 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Mon Feb 10 11:25:31 2020 +0100

android hunspell: Hardcode the ReferenceOOoMajorMinor for version check.

From some reason it fails to be read from the versionrc; and I'm not
really eager to debug why...

Without this, only the dictionaries that do not mention the
OpenOffice.org-minimal-version are registered; which would be just 2 of
them.

Change-Id: I9fe0bc138eadbdcbe5e0d8231e7e90ef268163bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88219
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx 
b/desktop/source/deployment/misc/dp_dependencies.cxx
index 49b64780ec04..c5507d9ba659 100644
--- a/desktop/source/deployment/misc/dp_dependencies.cxx
+++ b/desktop/source/deployment/misc/dp_dependencies.cxx
@@ -61,10 +61,15 @@ OUString getLibreOfficeMajorMinorMicro() {
 }
 
 OUString getReferenceOpenOfficeOrgMajorMinor() {
+#ifdef ANDROID
+// just hardcode the version
+OUString v("4.1");
+#else
 OUString v(
 "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version")
 ":Version:ReferenceOOoMajorMinor}");
 rtl::Bootstrap::expandMacros(v); //TODO: check for failure
+#endif
 return v;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source extensions/Module_extensions.mk postprocess/Rdb_services.mk solenv/bin

2020-02-10 Thread Jan Holesovsky (via logerrit)
 desktop/source/lib/init.cxx |8 
 extensions/Module_extensions.mk |7 ++-
 postprocess/Rdb_services.mk |8 
 solenv/bin/native-code.py   |6 ++
 4 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit f2d67ee76778c27d56eb1d663f8c5cc09906da44
Author: Jan Holesovsky 
AuthorDate: Thu Feb 6 22:48:29 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Mon Feb 10 11:18:26 2020 +0100

android hunspell: Turn on the hunspell build on Android...

...and try to register it for use - it's a bundled extension.

The attempt to use the Android's native spell checking failed because
the combination of gboard + google's spell checker makes every word in
the app appear as if spelled correctly.

I haven't found any easy way around that, so let's use hunspell instead;
but for that, we need to make the bundled extensions work on Android.

Change-Id: If6563e497f1d3085c26eda571567242b2c1f6181
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88217
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 35964dae4447..8916065bc273 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5910,6 +5910,14 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 SfxApplication::GetOrCreate();
 #endif
 
+#ifdef ANDROID
+// Register the bundled extensions - so that the dictionaries work
+desktop::Desktop::SynchronizeExtensionRepositories(false);
+bool bFailed = desktop::Desktop::CheckExtensionDependencies();
+if (bFailed)
+SAL_INFO("lok", "CheckExtensionDependencies failed");
+#endif
+
 if (eStage == PRE_INIT)
 {
 {
diff --git a/extensions/Module_extensions.mk b/extensions/Module_extensions.mk
index e30a5c1593f1..be00bbc69800 100644
--- a/extensions/Module_extensions.mk
+++ b/extensions/Module_extensions.mk
@@ -17,7 +17,6 @@ ifneq ($(filter-out iOS ANDROID,$(OS)),)
 $(eval $(call gb_Module_add_targets,extensions,\
Library_abp \
Library_ldapbe2 \
-   Library_log \
Library_scn \
$(if $(filter WNT,$(OS)), \
Library_WinUserInfoBe \
@@ -28,6 +27,12 @@ $(eval $(call gb_Module_add_targets,extensions,\
 ))
 endif
 
+ifneq ($(filter-out iOS,$(OS)),)
+$(eval $(call gb_Module_add_targets,extensions,\
+   Library_log \
+))
+endif
+
 $(eval $(call gb_Module_add_targets,extensions,\
Library_bib \
 ))
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index bcfd9fd8a18d..2b6073da42cb 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -330,6 +330,14 @@ $(eval $(call gb_Rdb_add_components,services,\
) \
 ))
 
+else # DESKTOP
+
+$(eval $(call gb_Rdb_add_components,services,\
+   $(if $(filter ANDROID,$(OS)),\
+   extensions/source/logging/log \
+   ) \
+))
+
 endif # DESKTOP
 
 ifeq ($(ENABLE_PDFIMPORT),TRUE)
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 9a688a3b470d..9ac86f9c0f25 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -41,6 +41,7 @@ core_factory_list = [
 ("libsrtrs1.a", "srtrs1_component_getFactory"),
 ("libstoragefdlo.a", "storagefd_component_getFactory"),
 ("libucb1.a", "ucb_component_getFactory"),
+("libucpexpand1lo.a", "ucpexpand1_component_getFactory", "#ifdef ANDROID"),
 ("libucpfile1.a", "ucpfile_component_getFactory"),
 ("libucphier1.a", "ucphier1_component_getFactory"),
 ("libucptdoc1lo.a", "ucptdoc1_component_getFactory"),
@@ -138,6 +139,11 @@ core_constructor_list = [
 "com_sun_star_comp_util_OfficeInstallationDirectories",
 # dbaccess/util/dba.component
 "com_sun_star_comp_dba_ORowSet_get_implementation",
+# extensions/source/logging/log.component
+("com_sun_star_comp_extensions_FileHandler", "#ifdef ANDROID"),
+("com_sun_star_comp_extensions_LoggerPool", "#ifdef ANDROID"),
+("com_sun_star_comp_extensions_PlainTextFormatter", "#ifdef ANDROID"),
+("com_sun_star_comp_extensions_SimpleTextFormatter", "#ifdef ANDROID"),
 # forms/util/frm.component
 ("com_sun_star_comp_forms_FormOperations_get_implementation", "#if 
HAVE_FEATURE_DBCONNECTIVITY"),
 ("com_sun_star_comp_forms_ODatabaseForm_get_implementation", "#if 
HAVE_FEATURE_DBCONNECTIVITY"),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-03 Thread Tor Lillqvist (via logerrit)
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f92e4bed51de1625bc8fba2d7a432420db6841d0
Author: Tor Lillqvist 
AuthorDate: Wed Jan 29 16:25:25 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Feb 3 09:51:53 2020 +0100

Log what UNO command we failed to dispatch

Change-Id: I79ed68a1e271d44f8afd2858c979a66691233fc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87688
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0353e672210c..656d7d32a40f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3760,7 +3760,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 
 if (!bResult && gImpl)
 {
-SetLastExceptionMsg("Failed to dispatch the .uno: command");
+SetLastExceptionMsg("Failed to dispatch " + aCommand);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source sw/source

2020-01-26 Thread Muhammet Kara (via logerrit)
 desktop/source/lib/init.cxx  |3 ++-
 sw/source/uibase/uiview/viewstat.cxx |7 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 8b67c09ea2679c8c4273b84d5eeddebccf6e810b
Author: Muhammet Kara 
AuthorDate: Sat Jan 25 04:10:38 2020 +0300
Commit: Aron Budea 
CommitDate: Mon Jan 27 08:42:36 2020 +0100

lok: Add LOK_CALLBACK_STATE_CHANGED for uno:Orientation

Change-Id: Iab3aaf742bdb9fc4b9c5875fee7d769fa0581eeb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87370
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c0aa5919e41c..0353e672210c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2649,7 +2649,8 @@ static void doc_iniUnoCommands ()
 OUString(".uno:OnlineAutoFormat"),
 OUString(".uno:InsertSymbol"),
 OUString(".uno:EditRegion"),
-OUString(".uno:ThesaurusDialog")
+OUString(".uno:ThesaurusDialog"),
+OUString(".uno:Orientation")
 };
 
 util::URL aCommandURL;
diff --git a/sw/source/uibase/uiview/viewstat.cxx 
b/sw/source/uibase/uiview/viewstat.cxx
index 909ba9a67225..cd48203dc44e 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -185,6 +185,13 @@ void SwView::GetState(SfxItemSet )
 }
 
 ::PageDescToItemSet( rDesc, rSet);
+
+if (nWhich == SID_ATTR_PAGE_ORIENTATION && 
comphelper::LibreOfficeKit::isActive())
+{
+OString aPayload(".uno:Orientation=");
+aPayload += rDesc.GetLandscape() ? "IsLandscape" : 
"IsPortrait";
+libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aPayload.getStr());
+}
 }
 break;
 case RES_BACKGROUND:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-10 Thread Mike Kaganski (via logerrit)
 desktop/source/lib/init.cxx |  102 ++--
 1 file changed, 51 insertions(+), 51 deletions(-)

New commits:
commit 24c4f84c33cef84672a37810009081cd6fca5309
Author: Mike Kaganski 
AuthorDate: Fri Jan 10 10:47:37 2020 +0300
Commit: Mike Kaganski 
CommitDate: Fri Jan 10 09:52:53 2020 +0100

Fix --enable-werror build

... producing this error in MSVC2017:

C:/lo/src/core2/desktop/source/lib/init.cxx(3486): error C2220: warning 
treated as error - no 'object' file generated
C:/lo/src/core2/desktop/source/lib/init.cxx(3486): warning C4190: 
'getSidebarWindow' has C-linkage specified, but returns UDT 
'VclPtr' which is incompatible with C
C:\lo\src\core2\include\vcl/cursor.hxx(49): note: see declaration of 
'VclPtr'

... because getSidebarWindow was inside 'extern "C"' block.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ee258f499384..c0aa5919e41c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1112,6 +1112,57 @@ rtl::Reference 
forceSetClipboardForCurrentView(LibreOfficeKitDocum
 
 #endif
 
+void setupSidebar(bool bShow)
+{
+SfxViewShell* pViewShell = SfxViewShell::Current();
+SfxViewFrame* pViewFrame = pViewShell ? pViewShell->GetViewFrame() : 
nullptr;
+if (pViewFrame)
+{
+if (bShow && !pViewFrame->GetChildWindow(SID_SIDEBAR))
+pViewFrame->SetChildWindow(SID_SIDEBAR, false /* create it */, 
true /* focus */);
+
+pViewFrame->ShowChildWindow(SID_SIDEBAR, bShow);
+
+if (!bShow)
+return;
+
+// Force synchronous population of panels
+SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
+if (!pChild)
+return;
+
+auto pDockingWin = dynamic_cast(pChild->GetWindow());
+if (!pDockingWin)
+return;
+pDockingWin->SyncUpdate();
+}
+else
+SetLastExceptionMsg("No view shell or sidebar");
+}
+
+VclPtr getSidebarWindow()
+{
+VclPtr xRet;
+
+setupSidebar(true);
+SfxViewShell* pViewShell = SfxViewShell::Current();
+SfxViewFrame* pViewFrame = pViewShell ? pViewShell->GetViewFrame() : 
nullptr;
+if (!pViewFrame)
+return xRet;
+
+// really a SidebarChildWindow
+SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
+if (!pChild)
+return xRet;
+
+// really a SidebarDockingWindow
+vcl::Window *pWin = pChild->GetWindow();
+if (!pWin)
+return xRet;
+xRet = pWin;
+return xRet;
+}
+
 } // anonymous namespace
 
 LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
 )
@@ -3454,57 +3505,6 @@ public:
 virtual void SAL_CALL disposing(const css::lang::EventObject&) override {}
 };
 
-static void setupSidebar(bool bShow)
-{
-SfxViewShell* pViewShell = SfxViewShell::Current();
-SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): nullptr;
-if (pViewFrame)
-{
-if (bShow && !pViewFrame->GetChildWindow(SID_SIDEBAR))
-pViewFrame->SetChildWindow(SID_SIDEBAR, false /* create it */, 
true /* focus */);
-
-pViewFrame->ShowChildWindow(SID_SIDEBAR, bShow);
-
-if (!bShow)
-return;
-
-// Force synchronous population of panels
-SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
-if (!pChild)
-return;
-
-auto pDockingWin = dynamic_cast(pChild->GetWindow());
-if (!pDockingWin)
-return;
-pDockingWin->SyncUpdate();
-}
-else
-SetLastExceptionMsg("No view shell or sidebar");
-}
-
-static VclPtr getSidebarWindow()
-{
-VclPtr xRet;
-
-setupSidebar(true);
-SfxViewShell* pViewShell = SfxViewShell::Current();
-SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): nullptr;
-if (!pViewFrame)
-return xRet;
-
-// really a SidebarChildWindow
-SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
-if (!pChild)
-return xRet;
-
-// really a SidebarDockingWindow
-vcl::Window *pWin = pChild->GetWindow();
-if (!pWin)
-return xRet;
-xRet = pWin;
-return xRet;
-}
-
 static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned 
nWindowId, const char* pArguments)
 {
 SolarMutexGuard aGuard;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-21 Thread Muhammet Kara (via logerrit)
 desktop/source/lib/init.cxx |  154 
 1 file changed, 154 insertions(+)

New commits:
commit 7f9e67a70b7c84de1d84ced1409271fb8845ee9f
Author: Muhammet Kara 
AuthorDate: Fri Dec 20 22:24:49 2019 +0300
Commit: Muhammet Kara 
CommitDate: Sat Dec 21 13:07:49 2019 +0100

lok: Add pseudo uno command ToggleOrientation

Toggles orientation of the Writer page

Change-Id: Ifcd5ca96bd16e50e5a4fa304f82f60e2425bd8f0
Reviewed-on: https://gerrit.libreoffice.org/85635
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5d369a996e0c..ee258f499384 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -153,6 +153,12 @@
 #include 
 #include 
 
+// Needef for getUndoManager()
+#include 
+#include 
+#include 
+#include 
+
 #include 
 
 #include "../app/cmdlineargs.hxx"
@@ -706,6 +712,149 @@ std::string extractPrivateKey(const std::string & 
privateKey)
 return privateKey.substr(pos1, pos2);
 }
 
+// Gets an undo manager to enter and exit undo context. Needed by 
ToggleOrientation
+const css::uno::Reference< css::document::XUndoManager > getUndoManager( const 
css::uno::Reference< css::frame::XFrame >& rxFrame )
+{
+const css::uno::Reference< css::frame::XController >& xController = 
rxFrame->getController();
+if ( xController.is() )
+{
+const css::uno::Reference< css::frame::XModel >& xModel = 
xController->getModel();
+if ( xModel.is() )
+{
+const css::uno::Reference< css::document::XUndoManagerSupplier > 
xSuppUndo( xModel, css::uno::UNO_QUERY_THROW );
+const css::uno::Reference< css::document::XUndoManager > 
xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_QUERY_THROW );
+return xUndoManager;
+}
+}
+
+return css::uno::Reference< css::document::XUndoManager > ();
+}
+
+// Adjusts page margins for Writer doc. Needed by ToggleOrientation
+void ExecuteMarginLRChange(
+const long nPageLeftMargin,
+const long nPageRightMargin,
+std::shared_ptr mpPageLRMarginItem)
+{
+mpPageLRMarginItem->SetLeft( nPageLeftMargin );
+mpPageLRMarginItem->SetRight( nPageRightMargin );
+
SfxViewShell::Current()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_LRSPACE,
+SfxCallMode::RECORD, { mpPageLRMarginItem.get() });
+}
+
+// Adjusts page margins for Writer doc. Needed by ToggleOrientation
+void ExecuteMarginULChange(
+const long nPageTopMargin,
+const long nPageBottomMargin,
+std::shared_ptr mpPageULMarginItem)
+{
+mpPageULMarginItem->SetUpper( nPageTopMargin );
+mpPageULMarginItem->SetLower( nPageBottomMargin );
+
SfxViewShell::Current()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_ULSPACE,
+  SfxCallMode::RECORD, 
{ mpPageULMarginItem.get() });
+}
+
+// Main function which toggles page orientation of the Writer doc. Needed by 
ToggleOrientation
+void ExecuteOrientationChange()
+{
+std::unique_ptr mpPageItem(new SvxPageItem(SID_ATTR_PAGE));
+std::unique_ptr mpPageSizeItem(new 
SvxSizeItem(SID_ATTR_PAGE_SIZE));
+std::shared_ptr mpPageLRMarginItem(new 
SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ));
+std::shared_ptr mpPageULMarginItem(new 
SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ));
+const long MINBODY = 284; //0.5 cm in twips
+bool bIsLandscape = false;
+
+css::uno::Reference< css::document::XUndoManager > mxUndoManager(
+getUndoManager( 
SfxViewFrame::Current()->GetFrame().GetFrameInterface() ) );
+
+if ( mxUndoManager.is() )
+mxUndoManager->enterUndoContext( "" );
+
+
+const SfxPoolItem* pItem;
+
+
+
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_SIZE,
 pItem);
+mpPageSizeItem.reset( static_cast(pItem->Clone()) );
+
+
+
+
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_LRSPACE,
 pItem);
+mpPageLRMarginItem.reset( static_cast(pItem->Clone()) 
);
+
+
+
+
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_ULSPACE,
 pItem);
+mpPageULMarginItem.reset( static_cast(pItem->Clone()) 
);
+
+
+{
+if ( mpPageSizeItem->GetSize().Width() > 
mpPageSizeItem->GetSize().Height())
+bIsLandscape = true;
+
+// toggle page orientation
+mpPageItem->SetLandscape(!bIsLandscape);
+
+
+// swap the width and height of the page size
+const long nRotatedWidth = mpPageSizeItem->GetSize().Height();
+const long nRotatedHeight = mpPageSizeItem->GetSize().Width();
+mpPageSizeItem->SetSize(Size(nRotatedWidth, nRotatedHeight));
+
+
+// apply changed attributes
+if (SfxViewShell::Current())
+{
+
SfxViewShell::Current()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE,
+  

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/sfx2 sfx2/source svx/source

2019-12-19 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx  |   68 +++
 include/sfx2/sidebar/AsynchronousCall.hxx|1 
 include/sfx2/sidebar/SidebarController.hxx   |2 
 include/sfx2/sidebar/SidebarDockingWindow.hxx|5 +
 sfx2/source/sidebar/AsynchronousCall.cxx |8 ++
 sfx2/source/sidebar/SidebarController.cxx|7 +
 sfx2/source/sidebar/SidebarDockingWindow.cxx |6 +
 svx/source/sidebar/ContextChangeEventMultiplexer.cxx |   14 +--
 8 files changed, 103 insertions(+), 8 deletions(-)

New commits:
commit 2d90583fb9026b3c8ee466029423dad3e957eb7e
Author: Michael Meeks 
AuthorDate: Thu Dec 19 11:16:15 2019 +
Commit: Michael Meeks 
CommitDate: Thu Dec 19 12:53:14 2019 +

sidebar: bring new sidebar commands in-house & be more assertive with sfx2

Force the sidebar to do it's asynchronous things synchronously to help
keep things sane. Also emit our (in-process on Android / iOS) context
change notification after everyone else got it & updated their panels.

Change-Id: If94de6c83f1b783d7deee515fc2ee9a8d3754765

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c779682e1d71..5d369a996e0c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -108,6 +108,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -142,6 +144,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3302,12 +3305,67 @@ public:
 virtual void SAL_CALL disposing(const css::lang::EventObject&) override {}
 };
 
+static void setupSidebar(bool bShow)
+{
+SfxViewShell* pViewShell = SfxViewShell::Current();
+SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): nullptr;
+if (pViewFrame)
+{
+if (bShow && !pViewFrame->GetChildWindow(SID_SIDEBAR))
+pViewFrame->SetChildWindow(SID_SIDEBAR, false /* create it */, 
true /* focus */);
+
+pViewFrame->ShowChildWindow(SID_SIDEBAR, bShow);
+
+if (!bShow)
+return;
+
+// Force synchronous population of panels
+SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
+if (!pChild)
+return;
+
+auto pDockingWin = dynamic_cast(pChild->GetWindow());
+if (!pDockingWin)
+return;
+pDockingWin->SyncUpdate();
+}
+else
+SetLastExceptionMsg("No view shell or sidebar");
+}
+
+static VclPtr getSidebarWindow()
+{
+VclPtr xRet;
+
+setupSidebar(true);
+SfxViewShell* pViewShell = SfxViewShell::Current();
+SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): nullptr;
+if (!pViewFrame)
+return xRet;
+
+// really a SidebarChildWindow
+SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
+if (!pChild)
+return xRet;
+
+// really a SidebarDockingWindow
+vcl::Window *pWin = pChild->GetWindow();
+if (!pWin)
+return xRet;
+xRet = pWin;
+return xRet;
+}
+
 static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned 
nWindowId, const char* pArguments)
 {
 SolarMutexGuard aGuard;
 
 StringMap aMap(jsonToStringMap(pArguments));
 VclPtr pWindow = vcl::Window::FindLOKWindow(nWindowId);
+
+if (!pWindow && nWindowId >= 10 /* why unsigned? */)
+pWindow = getSidebarWindow();
+
 if (!pWindow)
 {
 SetLastExceptionMsg("Document doesn't support dialog rendering, or 
window not found.");
@@ -3515,6 +3573,16 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 return;
 }
 }
+else if (gImpl && aCommand == ".uno:SidebarShow")
+{
+setupSidebar(true);
+return;
+}
+else if (gImpl && aCommand == ".uno:SidebarHide")
+{
+setupSidebar(false);
+return;
+}
 
 bool bResult = false;
 LokChartHelper aChartHelper(SfxViewShell::Current());
diff --git a/include/sfx2/sidebar/AsynchronousCall.hxx 
b/include/sfx2/sidebar/AsynchronousCall.hxx
index b42caf50ed19..0b6464cb713f 100644
--- a/include/sfx2/sidebar/AsynchronousCall.hxx
+++ b/include/sfx2/sidebar/AsynchronousCall.hxx
@@ -41,6 +41,7 @@ public:
 
 void RequestCall();
 void CancelRequest();
+void Sync();
 
 private:
 Action const maAction;
diff --git a/include/sfx2/sidebar/SidebarController.hxx 
b/include/sfx2/sidebar/SidebarController.hxx
index bad4220ce547..e65bbae42537 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -170,6 +170,8 @@ public:
 
 css::uno::Reference getXFrame() {return mxFrame;}
 
+void SyncUpdate();
+
 private:
 SidebarController(SidebarDockingWindow* pParentWindow, const SfxViewFrame* 
pViewFrame);
 
diff --git a/include/sfx2/sidebar/SidebarDockingWindow.hxx 
b/include/sfx2/sidebar/SidebarDockingWindow.hxx

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

2019-12-18 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |   21 ++---
 1 file changed, 18 insertions(+), 3 deletions(-)

New commits:
commit 46fbc12dac86579708695fddeaf4a3a2f8098955
Author: Michael Meeks 
AuthorDate: Wed Dec 18 13:31:58 2019 +
Commit: Michael Meeks 
CommitDate: Wed Dec 18 15:29:11 2019 +0100

lok: catch and log exceptions during key / mouse event emission.

Change-Id: I2be8219f6b2648f3f0192caeccf8e8b037634dc2
Reviewed-on: https://gerrit.libreoffice.org/85387
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f97cd6707187..c779682e1d71 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3071,7 +3071,15 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* 
pThis, int nType, int nChar
 return;
 }
 
-pDoc->postKeyEvent(nType, nCharCode, nKeyCode);
+try
+{
+pDoc->postKeyEvent(nType, nCharCode, nKeyCode);
+}
+catch (const uno::Exception& exception)
+{
+SetLastExceptionMsg(exception.Message);
+SAL_INFO("lok", "Failed to postKeyEvent " << exception.Message);
+}
 }
 
 static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, 
unsigned nWindowId, int nType, const char* pText)
@@ -3546,8 +3554,15 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* 
pThis, int nType, int nX,
 SetLastExceptionMsg("Document doesn't support tiled rendering");
 return;
 }
-
-pDoc->postMouseEvent(nType, nX, nY, nCount, nButtons, nModifier);
+try
+{
+pDoc->postMouseEvent(nType, nX, nY, nCount, nButtons, nModifier);
+}
+catch (const uno::Exception& exception)
+{
+SetLastExceptionMsg(exception.Message);
+SAL_INFO("lok", "Failed to postMouseEvent " << exception.Message);
+}
 }
 
 static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, 
unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int 
nModifier)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/sfx2 include/svx sfx2/sdi sfx2/source

2019-12-16 Thread Ashod Nakashian (via logerrit)
 desktop/source/lib/init.cxx  |   12 -
 include/sfx2/sfxsids.hrc |2 +
 include/svx/svxids.hrc   |5 +++
 sfx2/sdi/frmslots.sdi|   10 +++
 sfx2/sdi/sfx.sdi |   36 +++
 sfx2/source/sidebar/SidebarController.cxx|2 -
 sfx2/source/sidebar/SidebarDockingWindow.cxx |4 ++-
 sfx2/source/view/viewfrm.cxx |   19 +++---
 8 files changed, 77 insertions(+), 13 deletions(-)

New commits:
commit bc2181cfc7280716c48d8bd0a07db849a32a97aa
Author: Ashod Nakashian 
AuthorDate: Sun Dec 15 21:12:17 2019 -0500
Commit: Michael Meeks 
CommitDate: Mon Dec 16 10:25:35 2019 +0100

sfx2: sidebar: new .uno commands to show and hide sidebars

Change-Id: I9afba5eec855d6de590086736177b543d52d3b20
Reviewed-on: https://gerrit.libreoffice.org/85192
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5597f5be9bb4..f97cd6707187 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3307,12 +3307,12 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 }
 else if (aMap.find("id") != aMap.end())
 {
-const OUString sClickAction("CLICK");
-const OUString sSelectAction("SELECT");
-const OUString sClearAction("CLEAR");
-const OUString sTypeAction("TYPE");
-const OUString sUpAction("UP");
-const OUString sDownAction("DOWN");
+static const OUString sClickAction("CLICK");
+static const OUString sSelectAction("SELECT");
+static const OUString sClearAction("CLEAR");
+static const OUString sTypeAction("TYPE");
+static const OUString sUpAction("UP");
+static const OUString sDownAction("DOWN");
 
 try
 {
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 558a303fb573..b1200ecc2f57 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -565,6 +565,8 @@ class SfxDocumentInfoItem;
 #define SID_TABLE_BORDER_TYPE   (SID_SVX_START + 1065)
 #define SID_TABLE_BORDER_INDEX  (SID_SVX_START + 1066)
 #define SID_TABLE_BORDER_OFFSET (SID_SVX_START + 1067)
+#define SID_SHOW_SIDEBAR(SID_SVX_START + 1190)
+#define SID_HIDE_SIDEBAR(SID_SVX_START + 1191)
 
 #define FID_SVX_START   (SID_LIB_START + 500)
 #define FID_SEARCH_NOW  (FID_SVX_START + 2)
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 2924a1bec218..d429b17f2af0 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -986,8 +986,11 @@ class SfxStringItem;
 
 #define SID_TOGGLE_RESOLVED_NOTES   ( SID_SVX_START + 1189 
)
 
+// #define SID_SHOW_SIDEBAR( SID_SVX_START + 
1190 ) -> sfxsids.hrc
+// #define SID_HIDE_SIDEBAR( SID_SVX_START + 
1191 ) -> sfxsids.hrc
+
 // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE   ( 
SID_TOGGLE_RESOLVED_NOTES + 1 )
+#define SID_SVX_FIRSTFREE   ( SID_HIDE_SIDEBAR + 1 
)
 
 // Overflow check for slot IDs
 #if SID_SVX_FIRSTFREE > SID_SVX_END
diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi
index 09aafef95b7d..53a13b479a7c 100644
--- a/sfx2/sdi/frmslots.sdi
+++ b/sfx2/sdi/frmslots.sdi
@@ -43,6 +43,16 @@ interface Window
 ExecMethod = ChildWindowExecute ;
 StateMethod = ChildWindowState ;
 ]
+SID_SHOW_SIDEBAR // status(final|play)
+[
+ExecMethod = ChildWindowExecute ;
+StateMethod = ChildWindowState ;
+]
+SID_HIDE_SIDEBAR // status(final|play)
+[
+ExecMethod = ChildWindowExecute ;
+StateMethod = ChildWindowState ;
+]
 SID_BROWSER // ole(no) api()
 [
 ExecMethod = ChildWindowExecute ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 2540782a7427..fcda39ddae2b 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -2577,6 +2577,42 @@ SfxBoolItem Sidebar SID_SIDEBAR
 GroupId = SfxGroupId::View;
 ]
 
+SfxBoolItem SidebarShow SID_SHOW_SIDEBAR
+[
+AutoUpdate = TRUE,
+FastCall = FALSE,
+ReadOnlyDoc = TRUE,
+Toggle = FALSE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerSet;
+Asynchron;
+
+
+AccelConfig = TRUE,
+MenuConfig = TRUE,
+ToolBoxConfig = TRUE,
+GroupId = SfxGroupId::View;
+]
+
+SfxBoolItem SidebarHide SID_HIDE_SIDEBAR
+[
+AutoUpdate = TRUE,
+FastCall = FALSE,
+ReadOnlyDoc = TRUE,
+Toggle = FALSE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerSet;
+Asynchron;
+
+
+AccelConfig = TRUE,
+MenuConfig = TRUE,
+ToolBoxConfig = TRUE,
+

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

2019-12-04 Thread Ashod Nakashian (via logerrit)
 desktop/source/lib/init.cxx|   18 +---
 sfx2/source/view/lokhelper.cxx |   58 +++--
 2 files changed, 52 insertions(+), 24 deletions(-)

New commits:
commit 303d1e5bd3565b94ca342b832146beee815d1392
Author: Ashod Nakashian 
AuthorDate: Wed Dec 4 08:19:22 2019 -0500
Commit: Ashod Nakashian 
CommitDate: Wed Dec 4 15:15:37 2019 +0100

LOK: don't send LOK notifications while switching views

Changing the active view is done for virtually every
LOK API, and in some cases simply changing the view
results in a flurry of notifications that themselves
caues further API calls that need to change the view.

This moves the disabling of callbacks during setView
to SfxLokHelper to make sure no view gets any
notifications. This is needed because even when
we disable notifications for the current view,
the _other_ view(s) can still get notified as they
lose their frame.

Change-Id: Ia88a58d6a1162e48c40f4c4ce73c40ecb2c1fb7e
Reviewed-on: https://gerrit.libreoffice.org/84417
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 949f8fe0e93e..5597f5be9bb4 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4623,28 +4623,14 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* /*pThis
 SfxLokHelper::destroyView(nId);
 }
 
-static void doc_setView(LibreOfficeKitDocument* pThis, int nId)
+static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* 
/*pThis*/, int nId)
 {
 comphelper::ProfileZone aZone("doc_setView");
 
 SolarMutexGuard aGuard;
 SetLastExceptionMsg();
 
-LibLODocument_Impl* pDocument = static_cast(pThis);
-const auto handlerIt = pDocument->mpCallbackFlushHandlers.find(nId);
-if (handlerIt != pDocument->mpCallbackFlushHandlers.end())
-handlerIt->second->disableCallbacks();
-
-try
-{
-SfxLokHelper::setView(nId);
-}
-catch (const std::exception&)
-{
-}
-
-if (handlerIt != pDocument->mpCallbackFlushHandlers.end())
-handlerIt->second->enableCallbacks();
+SfxLokHelper::setView(nId);
 }
 
 static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index e9c7248941fd..65f8e5090972 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -30,6 +30,34 @@
 
 using namespace com::sun::star;
 
+/// Used to disable callbacks.
+/// Needed to avoid recursion when switching views,
+/// which can cause clients to invoke LOKit API and
+/// implicitly set the view, which might cause an
+/// infinite recursion if not detected and prevented.
+class DisableCallbacks
+{
+public:
+DisableCallbacks()
+{
+assert(m_nDisabled >= 0 && "Expected non-negative DisabledCallbacks 
state when disabling.");
+++m_nDisabled;
+}
+
+~DisableCallbacks()
+{
+assert(m_nDisabled > 0 && "Expected positive DisabledCallbacks state 
when re-enabling.");
+--m_nDisabled;
+}
+
+static bool disabled() { return m_nDisabled != 0; }
+
+private:
+static int m_nDisabled;
+};
+
+int DisableCallbacks::m_nDisabled = 0;
+
 int SfxLokHelper::createView()
 {
 SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst();
@@ -77,6 +105,8 @@ void SfxLokHelper::setView(int nId)
 {
 if (static_cast(pViewShell->GetViewShellId()) == 
nViewShellId)
 {
+DisableCallbacks dc;
+
 // update the current LOK language for the dialog tunneling
 
comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
 
@@ -162,6 +192,9 @@ static OString lcl_escapeQuotes(const OString )
 
 void SfxLokHelper::notifyOtherView(SfxViewShell* pThisView, SfxViewShell 
const* pOtherView, int nType, const OString& rKey, const OString& rPayload)
 {
+if (DisableCallbacks::disabled())
+return;
+
 OString aPayload = OString("{ \"viewId\": \"") + 
OString::number(SfxLokHelper::getView(pThisView)) +
"\", \"part\": \"" + 
OString::number(pThisView->getPart()) +
"\", \"" + rKey + "\": \"" + lcl_escapeQuotes(rPayload) 
+ "\" }";
@@ -171,7 +204,7 @@ void SfxLokHelper::notifyOtherView(SfxViewShell* pThisView, 
SfxViewShell const*
 
 void SfxLokHelper::notifyOtherViews(SfxViewShell* pThisView, int nType, const 
OString& rKey, const OString& rPayload)
 {
-if (SfxLokHelper::getViewsCount() <= 1)
+if (SfxLokHelper::getViewsCount() <= 1 || DisableCallbacks::disabled())
 return;
 
 SfxViewShell* pViewShell = SfxViewShell::GetFirst();
@@ -204,7 +237,7 @@ namespace {
 
 void SfxLokHelper::sendUnoStatus(const SfxViewShell* pShell, const SfxItemSet* 
pSet)
 {
-if (!pShell || !pSet)
+if (!pShell || !pSet || DisableCallbacks::disabled())
 

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

2019-12-02 Thread Jan Holesovsky (via logerrit)
 desktop/source/lib/init.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 51af04c9d1cb7b0955201b6a13714899c998cf50
Author: Jan Holesovsky 
AuthorDate: Mon Dec 2 12:01:05 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Mon Dec 2 12:13:35 2019 +0100

lok: Fix the condition of setting the transparent background.

Change-Id: I7b201296efe6541761896e0af1b230aecb534cdc
Reviewed-on: https://gerrit.libreoffice.org/84210
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ec13f24fae3b..afe99e3213de 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2749,12 +2749,13 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 #else
 ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), 
DeviceFormat::DEFAULT) ;
 
-#if HAVE_FEATURE_ANDROID_LOK
+#if defined(ANDROID) && !HAVE_FEATURE_ANDROID_LOK
+// Don't set the transparent background in the 'old' (JNI-based) Android
+// app - no idea why it needs avoiding this.
+if (false)
+#endif
 // Set background to transparent by default.
-// [Unless it is the 'old' (JNI-based) Android app - no idea why it
-// needs avoiding this.]
 pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
-#endif
 
 pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
 Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source sal/android

2019-12-02 Thread Jan Holesovsky (via logerrit)
 desktop/source/lib/init.cxx  |   21 ++---
 sal/android/libreofficekit-jni.c |5 -
 2 files changed, 6 insertions(+), 20 deletions(-)

New commits:
commit fa6979f1f5e781aa8d141a7a6691e2de55937c39
Author: Jan Holesovsky 
AuthorDate: Wed Nov 20 17:55:43 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Mon Dec 2 10:23:25 2019 +0100

android: Get rid of the 'old' vs. Online-based runtime distinction.

No need for this when we have a compile-time distinction now anyway.

Change-Id: Ic86c8cce38a86635ea3efb4229c08f63059c9ee6
Reviewed-on: https://gerrit.libreoffice.org/83343
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index afbd4d283b35..ec13f24fae3b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include 
 
 #include 
@@ -2711,13 +2712,6 @@ static void doc_setPartMode(LibreOfficeKitDocument* 
pThis,
 }
 }
 
-#if defined(ANDROID)
-/// For the distinction if the LOK is used for the 'old' (JNI-based) or the
-/// 'new' (loolwsd-based) app.  Default to the 'new', ie. not used from JNI as
-/// implemented in sal/android/libreofficekit-jni.c.
-bool android_lok_from_jni = false;
-#endif
-
 static void doc_paintTile(LibreOfficeKitDocument* pThis,
   unsigned char* pBuffer,
   const int nCanvasWidth, const int nCanvasHeight,
@@ -2755,15 +2749,12 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 #else
 ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), 
DeviceFormat::DEFAULT) ;
 
-#if defined(ANDROID)
-if (!android_lok_from_jni)
+#if HAVE_FEATURE_ANDROID_LOK
+// Set background to transparent by default.
+// [Unless it is the 'old' (JNI-based) Android app - no idea why it
+// needs avoiding this.]
+pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
 #endif
-{
-// Set background to transparent by default.
-// [Unless it is the 'old' (JNI-based) Android app - no idea why it
-// needs avoiding this.]
-pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
-}
 
 pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
 Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c
index 93742833168b..b853d8e75380 100644
--- a/sal/android/libreofficekit-jni.c
+++ b/sal/android/libreofficekit-jni.c
@@ -37,7 +37,6 @@ extern const char* data_dir;
 extern const char* cache_dir;
 extern void* apk_file;
 extern int apk_file_size;
-extern bool android_lok_from_jni; ///< for the distinction if the LOK is used 
for the 'old' (JNI-based) or the 'new' (loolwsd-based) app
 AAssetManager* native_asset_manager;
 
 extern void Java_org_libreoffice_android_Bootstrap_putenv(JNIEnv* env, jobject 
clazz, jstring string);
@@ -163,10 +162,6 @@ jboolean 
Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
 
 (void) clazz;
 
-// the 'old' app needs to avoid setting the virtual device to transparent
-// in paintTile(), so indicate we are using the 'old' app
-android_lok_from_jni = true;
-
 libreofficekit_initialize(env, dataDir, cacheDir, apkFile, assetManager);
 
 // LibreOfficeKit expects a path to the program/ directory
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-20 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 67680709e7fe8246b084e719e75462546f003c00
Author: Szymon Kłos 
AuthorDate: Wed Nov 20 16:10:33 2019 +0100
Commit: Szymon Kłos 
CommitDate: Wed Nov 20 17:17:49 2019 +0100

jsdialogs: simply resize to reload

Change-Id: I4eaee0f1ec27674d74fc7abfa05abaf39cb97117
Reviewed-on: https://gerrit.libreoffice.org/83326
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 062ceb3dcb45..2211c1124891 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3345,8 +3345,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 } catch(...) {}
 
 // force resend
-pWindow->Hide();
-pWindow->Show();
+pWindow->Resize();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-20 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 98c678527579d7fdd5a4811d9f5f05ae7fdb282b
Author: Szymon Kłos 
AuthorDate: Tue Nov 19 17:59:17 2019 +0200
Commit: Szymon Kłos 
CommitDate: Wed Nov 20 10:20:45 2019 +0100

Revert "jsdialogs: don't recreate sidebar on event"

This reverts commit 0c75ccd84ea64f2c69afe104a4b4ebd55b3cc215.

Change-Id: I127cd0179d24af52f695c9f1ee0792b9573e6e0e
Reviewed-on: https://gerrit.libreoffice.org/83219
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d77fa4052814..062ceb3dcb45 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3343,6 +3343,10 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 pUIWindow->execute(sClickAction, aMap);
 }
 } catch(...) {}
+
+// force resend
+pWindow->Hide();
+pWindow->Show();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-14 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit 0c75ccd84ea64f2c69afe104a4b4ebd55b3cc215
Author: Szymon Kłos 
AuthorDate: Thu Nov 14 12:05:11 2019 +0100
Commit: Szymon Kłos 
CommitDate: Thu Nov 14 13:18:02 2019 +0100

jsdialogs: don't recreate sidebar on event

This will allow to use mobile wizard in multiple views.
JS listeners on uno commands are used instead. Also
vcl events broadcasting is needed.

Change-Id: Iddb230bfcf899384749d92da359b0a6a1260bc9f
Reviewed-on: https://gerrit.libreoffice.org/82669
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 062ceb3dcb45..d77fa4052814 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3343,10 +3343,6 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 pUIWindow->execute(sClickAction, aMap);
 }
 } catch(...) {}
-
-// force resend
-pWindow->Hide();
-pWindow->Show();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-06 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ae975010255fbaedd356afb952d0008ac27b39c6
Author: Szymon Kłos 
AuthorDate: Wed Nov 6 19:13:12 2019 +0100
Commit: Michael Meeks 
CommitDate: Wed Nov 6 22:06:13 2019 +0100

jsdialogs: refresh after event

Change-Id: Ie0128ec38dd442a04d6ea9e24cea254f5bc69791
Reviewed-on: https://gerrit.libreoffice.org/82170
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bac4319a778d..ac5fca9f39db 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3337,8 +3337,8 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 } catch(...) {}
 
 // force resend
-pWindow->GetParent()->Hide();
-pWindow->GetParent()->Show();
+pWindow->Hide();
+pWindow->Show();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-04 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |   79 +---
 1 file changed, 25 insertions(+), 54 deletions(-)

New commits:
commit 0aafd218df888310d7eeb4a47994e85d1746
Author: Michael Meeks 
AuthorDate: Mon Nov 4 15:44:04 2019 +
Commit: Michael Meeks 
CommitDate: Mon Nov 4 20:06:41 2019 +0100

lok: share conversion of OUString to C strings.

Change-Id: I0178f673dc1e59d9fba8f3daae532f19b46e4d36
Reviewed-on: https://gerrit.libreoffice.org/82036
Tested-by: Jenkins
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/82039
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 36d6015db423..abe37f9356dd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -260,7 +260,21 @@ static OUString getUString(const char* pString)
 return OStringToOUString(sString, RTL_TEXTENCODING_UTF8);
 }
 
-/// Try to convert a relative URL to an absolute one, unless it already looks 
like an URL.
+// Tolerate embedded \0s etc.
+static char *convertOString(const OString )
+{
+char* pMemory = static_cast(malloc(rStr.getLength() + 1));
+assert(pMemory); // don't tolerate failed allocations.
+memcpy(pMemory, rStr.getStr(), rStr.getLength() + 1);
+return pMemory;
+}
+
+static char *convertOUString(const OUString )
+{
+return convertOString(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8));
+}
+
+/// Try to convert a relative URL to an absolute one, unless it already looks 
like a URL.
 static OUString getAbsoluteURL(const char* pURL)
 {
 OUString aURL(getUString(pURL));
@@ -2547,12 +2561,7 @@ static char* doc_getPartInfo(LibreOfficeKitDocument* 
pThis, int nPart)
 return nullptr;
 }
 
-OUString aPartInfo = pDoc->getPartInfo( nPart );
-OString aString = OUStringToOString(aPartInfo, RTL_TEXTENCODING_UTF8);
-
-char* pMemory = static_cast(malloc(aString.getLength() + 1));
-strcpy(pMemory, aString.getStr());
-return pMemory;
+return convertOUString(pDoc->getPartInfo(nPart));
 }
 
 static void doc_selectPart(LibreOfficeKitDocument* pThis, int nPart, int 
nSelect)
@@ -2601,12 +2610,7 @@ static char* 
doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
 return nullptr;
 }
 
-OUString sRectangles = pDoc->getPartPageRectangles();
-OString aString = OUStringToOString(sRectangles, RTL_TEXTENCODING_UTF8);
-char* pMemory = static_cast(malloc(aString.getLength() + 1));
-strcpy(pMemory, aString.getStr());
-return pMemory;
-
+return convertOUString(pDoc->getPartPageRectangles());
 }
 
 static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
@@ -2623,12 +2627,7 @@ static char* doc_getPartName(LibreOfficeKitDocument* 
pThis, int nPart)
 return nullptr;
 }
 
-OUString sName = pDoc->getPartName( nPart );
-OString aString = OUStringToOString(sName, RTL_TEXTENCODING_UTF8);
-char* pMemory = static_cast(malloc(aString.getLength() + 1));
-strcpy(pMemory, aString.getStr());
-return pMemory;
-
+return convertOUString(pDoc->getPartName(nPart));
 }
 
 static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart)
@@ -2645,12 +2644,7 @@ static char* doc_getPartHash(LibreOfficeKitDocument* 
pThis, int nPart)
 return nullptr;
 }
 
-OUString sHash = pDoc->getPartHash(nPart);
-OString aString = OUStringToOString(sHash, RTL_TEXTENCODING_UTF8);
-char* pMemory = static_cast(malloc(aString.getLength() + 1));
-strcpy(pMemory, aString.getStr());
-return pMemory;
-
+return convertOUString(pDoc->getPartHash(nPart));
 }
 
 static void doc_setPartMode(LibreOfficeKitDocument* pThis,
@@ -3754,14 +3748,6 @@ static bool getFromTransferrable(
 return true;
 }
 
-// Tolerate embedded \0s etc.
-static char *convertOString(const OString )
-{
-char* pMemory = static_cast(malloc(rStr.getLength() + 1));
-memcpy(pMemory, rStr.getStr(), rStr.getLength() + 1);
-return pMemory;
-}
-
 static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* 
pMimeType, char** pUsedMimeType)
 {
 comphelper::ProfileZone aZone("doc_getTextSelection");
@@ -3912,7 +3898,7 @@ static int doc_getClipboard(LibreOfficeKitDocument* pThis,
 else
 {
 (*pOutSizes)[i] = aRet.getLength();
-(*pOutStreams)[i] =  convertOString(aRet);
+(*pOutStreams)[i] = convertOString(aRet);
 }
 }
 
@@ -4483,12 +4469,8 @@ static char* 
doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
 OUString aHeaders = pDoc->getRowColumnHeaders(aRectangle);
 if (aHeaders.isEmpty())
 return nullptr;
-
-OString aString = OUStringToOString(aHeaders, RTL_TEXTENCODING_UTF8);
-
-char* pMemory = static_cast(malloc(aString.getLength() + 1));
-strcpy(pMemory, aString.getStr());
-return pMemory;
+else
+

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

2019-10-31 Thread Tor Lillqvist (via logerrit)
 desktop/source/lib/init.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0ab5be0e1e2a0149d57549613c32cee3668a7ac1
Author: Tor Lillqvist 
AuthorDate: Tue Oct 15 12:36:42 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Oct 31 09:48:45 2019 +0100

Bin a fairly pointless unconditional NSLog() call

Change-Id: I7c1910c3e1bf345966ec289aaf5f9c9b6cbabc22
(cherry picked from commit 525163c074785a0b59590ca13f0d1cd6cdc1b2db)
Reviewed-on: https://gerrit.libreoffice.org/81823
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d316997bab46..3124e999fe56 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5589,10 +5589,10 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 {
 // Quick test that ICU works...
 UConverter *cnv = ucnv_open("iso-8859-3", );
-NSLog(@"ucnv_open(iso-8859-3)-> %p, err = %s, name=%s",
-  (void *)cnv, u_errorName(icuStatus), 
(!cnv)?"?":ucnv_getName(cnv,));
 if (U_SUCCESS(icuStatus))
 ucnv_close(cnv);
+else
+NSLog(@"ucnv_open() failed: %s", 
u_errorName(icuStatus));
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-22 Thread Henry Castro (via logerrit)
 desktop/source/lib/init.cxx |   74 +---
 1 file changed, 30 insertions(+), 44 deletions(-)

New commits:
commit 762ee9c8339695ff9471124b448a25a83638bfba
Author: Henry Castro 
AuthorDate: Sun Oct 20 10:06:20 2019 -0400
Commit: Henry Castro 
CommitDate: Tue Oct 22 19:50:39 2019 +0200

lok: convert JSON to StringMap in sent DialogEvent function

The StringMap type is used to the class UIObject methods to get state
and execute actions. So the idea is the loleaflet client side send
a raw JSON string:

{
  ctrl: "id_control",
  cmd: "SELECT",
  ID: "item_id",
  ...   // more parameters
}

Then it is transformed with a simple JSON to StringMap, finally
it is dispatched to execute the actions.

Change-Id: Icd628598fe46ae28b4afa3ca17ac75797c1b9308
Reviewed-on: https://gerrit.libreoffice.org/81167
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 200be4cf465f..d316997bab46 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -413,6 +413,25 @@ std::vector 
desktop::jsonToPropertyValuesVector(const char
 return aArguments;
 }
 
+
+static StringMap jsonToStringMap(const char* pJSON)
+{
+StringMap aArgs;
+if (pJSON && pJSON[0] != '\0')
+{
+std::stringstream aStream(pJSON);
+boost::property_tree::ptree aTree;
+boost::property_tree::read_json(aStream, aTree);
+
+for (const auto& rPair : aTree)
+{
+aArgs[OUString::fromUtf8(rPair.first.c_str())] = 
OUString::fromUtf8(rPair.second.get_value(".").c_str());
+}
+}
+return aArgs;
+}
+
+
 static boost::property_tree::ptree unoAnyToPropertyTree(const uno::Any& 
anyItem)
 {
 boost::property_tree::ptree aTree;
@@ -3272,34 +3291,14 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 {
 SolarMutexGuard aGuard;
 
-char* pCopy = strdup(pArguments);
-if (!pCopy)
-{
-SetLastExceptionMsg("String copying error.");
-return;
-}
-
-char* pIdChar = strtok(pCopy, " ");
-char* pOptionalEventType = strtok(nullptr, " ");
-char* pOptionalData = strtok(nullptr, " ");
-
-if (!pIdChar)
-{
-SetLastExceptionMsg("Error parsing the command.");
-free(pCopy);
-return;
-}
-
-OUString sId = OUString::createFromAscii(pIdChar);
-
+StringMap aMap(jsonToStringMap(pArguments));
 VclPtr pWindow = vcl::Window::FindLOKWindow(nWindowId);
 if (!pWindow)
 {
 SetLastExceptionMsg("Document doesn't support dialog rendering, or 
window not found.");
-free(pCopy);
 return;
 }
-else
+else if (aMap.find("id") != aMap.end())
 {
 const OUString sClickAction("CLICK");
 const OUString sSelectAction("SELECT");
@@ -3311,40 +3310,29 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 try
 {
 WindowUIObject aUIObject(pWindow);
-std::unique_ptr pUIWindow(aUIObject.get_child(sId));
+std::unique_ptr 
pUIWindow(aUIObject.get_child(aMap["id"]));
 if (pUIWindow) {
 bool bIsClickAction = false;
-StringMap aMap;
 
-if (pOptionalEventType) {
-if (strcmp(pOptionalEventType, "selected") == 0 && 
pOptionalData)
+if (aMap.find("cmd") != aMap.end()) {
+if (aMap["cmd"] == "selected")
 {
-char* pPos = strtok(pOptionalData, ";");
-char* pText = strtok(nullptr, ";");
-
-if (!pPos || !pText)
-{
-SetLastExceptionMsg("Error parsing the command.");
-free(pCopy);
-return;
-}
-
-aMap["POS"] = OUString::createFromAscii(pPos);
-aMap["TEXT"] = OUString::createFromAscii(pText);
+aMap["POS"] = aMap["data"];
+aMap["TEXT"] = aMap["data"];
 
 pUIWindow->execute(sSelectAction, aMap);
 }
-else if (strcmp(pOptionalEventType, "plus") == 0)
+else if (aMap["cmd"] == "plus")
 {
 pUIWindow->execute(sUpAction, aMap);
 }
-else if (strcmp(pOptionalEventType, "minus") == 0)
+else if (aMap["cmd"] == "minus")
 {
 pUIWindow->execute(sDownAction, aMap);
 }
-else if (pOptionalData)
+else if (aMap["cmd"] == "set")
 {
-

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

2019-10-22 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |   23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

New commits:
commit cf76e876c37384a6583f4f9681c8c192c34f615a
Author: Szymon Kłos 
AuthorDate: Mon Oct 21 13:16:50 2019 +0200
Commit: Szymon Kłos 
CommitDate: Tue Oct 22 11:16:41 2019 +0200

jsdialogs: handle spinfields

Change-Id: I9b845917ff1a7cb2242d7ef2b6b370007d0091b4
Reviewed-on: https://gerrit.libreoffice.org/81230
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit af9238d913c24d3bb326d3b0834c5008c9745446)
Reviewed-on: https://gerrit.libreoffice.org/81305
Tested-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 43dfaf896259..200be4cf465f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3303,6 +3303,10 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 {
 const OUString sClickAction("CLICK");
 const OUString sSelectAction("SELECT");
+const OUString sClearAction("CLEAR");
+const OUString sTypeAction("TYPE");
+const OUString sUpAction("UP");
+const OUString sDownAction("DOWN");
 
 try
 {
@@ -3310,6 +3314,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 std::unique_ptr pUIWindow(aUIObject.get_child(sId));
 if (pUIWindow) {
 bool bIsClickAction = false;
+StringMap aMap;
 
 if (pOptionalEventType) {
 if (strcmp(pOptionalEventType, "selected") == 0 && 
pOptionalData)
@@ -3324,12 +3329,26 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 return;
 }
 
-StringMap aMap;
 aMap["POS"] = OUString::createFromAscii(pPos);
 aMap["TEXT"] = OUString::createFromAscii(pText);
 
 pUIWindow->execute(sSelectAction, aMap);
 }
+else if (strcmp(pOptionalEventType, "plus") == 0)
+{
+pUIWindow->execute(sUpAction, aMap);
+}
+else if (strcmp(pOptionalEventType, "minus") == 0)
+{
+pUIWindow->execute(sDownAction, aMap);
+}
+else if (pOptionalData)
+{
+aMap["TEXT"] = 
OUString::createFromAscii(pOptionalData);
+
+pUIWindow->execute(sClearAction, aMap);
+pUIWindow->execute(sTypeAction, aMap);
+}
 else
 bIsClickAction = true;
 }
@@ -3337,7 +3356,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 bIsClickAction = true;
 
 if (bIsClickAction)
-pUIWindow->execute(sClickAction, StringMap());
+pUIWindow->execute(sClickAction, aMap);
 }
 } catch(...) {}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-22 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |   20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 7eb60b0d656679e88619084103e5c3eca2dde511
Author: Szymon Kłos 
AuthorDate: Mon Oct 21 10:55:29 2019 +0200
Commit: Szymon Kłos 
CommitDate: Tue Oct 22 09:39:26 2019 +0200

jsdialogs: use click event if not a combobox

Change-Id: I377de66bd086fa2cb5ef70514f5f1613a3fcb5cd
Reviewed-on: https://gerrit.libreoffice.org/81214
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 12cd3a40d86a..43dfaf896259 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3273,7 +3273,8 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 SolarMutexGuard aGuard;
 
 char* pCopy = strdup(pArguments);
-if (!pCopy) {
+if (!pCopy)
+{
 SetLastExceptionMsg("String copying error.");
 return;
 }
@@ -3282,7 +3283,8 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 char* pOptionalEventType = strtok(nullptr, " ");
 char* pOptionalData = strtok(nullptr, " ");
 
-if (!pIdChar) {
+if (!pIdChar)
+{
 SetLastExceptionMsg("Error parsing the command.");
 free(pCopy);
 return;
@@ -3307,8 +3309,11 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 WindowUIObject aUIObject(pWindow);
 std::unique_ptr pUIWindow(aUIObject.get_child(sId));
 if (pUIWindow) {
+bool bIsClickAction = false;
+
 if (pOptionalEventType) {
-if (strcmp(pOptionalEventType, "selected") == 0 && 
pOptionalData) {
+if (strcmp(pOptionalEventType, "selected") == 0 && 
pOptionalData)
+{
 char* pPos = strtok(pOptionalData, ";");
 char* pText = strtok(nullptr, ";");
 
@@ -3325,9 +3330,14 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 
 pUIWindow->execute(sSelectAction, aMap);
 }
-} else {
-pUIWindow->execute(sClickAction, StringMap());
+else
+bIsClickAction = true;
 }
+else
+bIsClickAction = true;
+
+if (bIsClickAction)
+pUIWindow->execute(sClickAction, StringMap());
 }
 } catch(...) {}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-21 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit dcc79dfb0af14b0e6e4f439b04d0d23d610a8440
Author: Szymon Kłos 
AuthorDate: Fri Oct 18 16:02:45 2019 +0200
Commit: Szymon Kłos 
CommitDate: Mon Oct 21 10:01:39 2019 +0200

jsdialogs: force resend UI description

Change-Id: I8d3466df6f2ad75c33ce2f9a91da9e9361201c0b
Reviewed-on: https://gerrit.libreoffice.org/81050
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit 05e67eeb3ddb08b5480c160db21430fafae37e37)
Reviewed-on: https://gerrit.libreoffice.org/81206
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f5cbcc4f5b63..12cd3a40d86a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3332,7 +3332,8 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 } catch(...) {}
 
 // force resend
-pWindow->Resize();
+pWindow->Hide();
+pWindow->Show();
 }
 
 free(pCopy);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-18 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |   36 
 1 file changed, 32 insertions(+), 4 deletions(-)

New commits:
commit 712c1ea7d31e3e89c87f7e019f5c224c924dfcbd
Author: Szymon Kłos 
AuthorDate: Thu Oct 17 19:23:22 2019 +0200
Commit: Szymon Kłos 
CommitDate: Fri Oct 18 11:21:24 2019 +0200

jsdialogs: handle combobox selections

Change-Id: Ib968bfaf7ad9e7becd16355259142d583bf7b5e3
Reviewed-on: https://gerrit.libreoffice.org/80991
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit cdeff4f1b4021c5fca55743e119a70fa2bd52b91)
Reviewed-on: https://gerrit.libreoffice.org/81028
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3d43fe6e82fe..f5cbcc4f5b63 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3279,35 +3279,63 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 }
 
 char* pIdChar = strtok(pCopy, " ");
+char* pOptionalEventType = strtok(nullptr, " ");
+char* pOptionalData = strtok(nullptr, " ");
 
 if (!pIdChar) {
 SetLastExceptionMsg("Error parsing the command.");
+free(pCopy);
 return;
 }
 
 OUString sId = OUString::createFromAscii(pIdChar);
-free(pCopy);
 
 VclPtr pWindow = vcl::Window::FindLOKWindow(nWindowId);
 if (!pWindow)
 {
 SetLastExceptionMsg("Document doesn't support dialog rendering, or 
window not found.");
+free(pCopy);
 return;
 }
 else
 {
-OUString sAction("CLICK");
+const OUString sClickAction("CLICK");
+const OUString sSelectAction("SELECT");
+
 try
 {
 WindowUIObject aUIObject(pWindow);
 std::unique_ptr pUIWindow(aUIObject.get_child(sId));
-if (pUIWindow)
-pUIWindow->execute(sAction, StringMap());
+if (pUIWindow) {
+if (pOptionalEventType) {
+if (strcmp(pOptionalEventType, "selected") == 0 && 
pOptionalData) {
+char* pPos = strtok(pOptionalData, ";");
+char* pText = strtok(nullptr, ";");
+
+if (!pPos || !pText)
+{
+SetLastExceptionMsg("Error parsing the command.");
+free(pCopy);
+return;
+}
+
+StringMap aMap;
+aMap["POS"] = OUString::createFromAscii(pPos);
+aMap["TEXT"] = OUString::createFromAscii(pText);
+
+pUIWindow->execute(sSelectAction, aMap);
+}
+} else {
+pUIWindow->execute(sClickAction, StringMap());
+}
+}
 } catch(...) {}
 
 // force resend
 pWindow->Resize();
 }
+
+free(pCopy);
 }
 
 static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* 
pCommand, const char* pArguments, bool bNotifyWhenFinished)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-18 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit c51aeb9847eb6a0c0eddc4778ab80f1d1758791f
Author: Szymon Kłos 
AuthorDate: Thu Oct 17 18:41:10 2019 +0200
Commit: Szymon Kłos 
CommitDate: Fri Oct 18 10:44:30 2019 +0200

jsdialogs: avoid exception crashing app on events

Change-Id: I83ddb44f54061d9f585eef3864415a472151976a
Reviewed-on: https://gerrit.libreoffice.org/80989
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit dfabe21ac98d22150b23fbb973ef3d77ea839061)
Reviewed-on: https://gerrit.libreoffice.org/81012
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a0d10c2cb609..3d43fe6e82fe 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3297,10 +3297,13 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 else
 {
 OUString sAction("CLICK");
-WindowUIObject aUIObject(pWindow);
-std::unique_ptr pUIWindow(aUIObject.get_child(sId));
-if (pUIWindow)
-pUIWindow->execute(sAction, StringMap());
+try
+{
+WindowUIObject aUIObject(pWindow);
+std::unique_ptr pUIWindow(aUIObject.get_child(sId));
+if (pUIWindow)
+pUIWindow->execute(sAction, StringMap());
+} catch(...) {}
 
 // force resend
 pWindow->Resize();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-16 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx   |   10 +-
 sfx2/source/view/ipclient.cxx |7 +++
 2 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit b8e56ce14ea67a195d47f1ba1709d7e3d38f99ae
Author: Szymon Kłos 
AuthorDate: Fri May 31 11:31:34 2019 +0200
Commit: Szymon Kłos 
CommitDate: Wed Oct 16 12:06:16 2019 +0200

Send 'INPLACE EXIT' on inplace deactivation

Change-Id: Ieb44fb356966df0eb92141a5f22f1df13683f6fc
Reviewed-on: https://gerrit.libreoffice.org/80684
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 253adffceb77..a0d10c2cb609 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1187,7 +1187,6 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_TEXT_SELECTION_START:
 case LOK_CALLBACK_TEXT_SELECTION_END:
 case LOK_CALLBACK_TEXT_SELECTION:
-case LOK_CALLBACK_GRAPHIC_SELECTION:
 case LOK_CALLBACK_MOUSE_POINTER:
 case LOK_CALLBACK_CELL_CURSOR:
 case LOK_CALLBACK_CELL_FORMULA:
@@ -1249,6 +1248,15 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 if (processWindowEvent(aCallbackData))
 return;
 break;
+
+case LOK_CALLBACK_GRAPHIC_SELECTION:
+{
+// remove only selection ranges and 'EMPTY' messages
+// always send 'INPLACE' and 'INPLACE EXIT' messages
+removeAll([type, payload] (const queue_type::value_type& elem)
+{ return (elem.Type == type && elem.PayloadString[0] != 
'I'); });
+}
+break;
 }
 }
 
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 861608dc5211..8bcf71a0c5dc 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -358,6 +358,13 @@ void SAL_CALL SfxInPlaceClient_Impl::deactivatedInplace()
 {
 if ( !m_pClient || !m_pClient->GetViewShell() )
 throw uno::RuntimeException();
+
+if ( comphelper::LibreOfficeKit::isActive() )
+{
+if ( SfxViewShell* pViewShell = m_pClient->GetViewShell() ) {
+pViewShell->libreOfficeKitViewCallback( 
LOK_CALLBACK_GRAPHIC_SELECTION, "INPLACE EXIT" );
+}
+}
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source filter/uiconfig

2019-10-11 Thread Muhammet Kara (via logerrit)
 desktop/source/lib/init.cxx  |6 +++---
 filter/uiconfig/ui/pdfgeneralpage.ui |2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 75db2b08856ddc522a949a07145b33b0fae4801e
Author: Muhammet Kara 
AuthorDate: Fri Oct 11 09:42:52 2019 +0300
Commit: Muhammet Kara 
CommitDate: Fri Oct 11 10:13:59 2019 +0200

Rename 'Single-page sheets' to 'Full-Sheet Previews' to avoid confusion

Because this option creates a pdf output which simply contains
full-sheet preview, disregarding most of the other options.

The created output is meant for preview, to see all content
of all shaeets at once, and not meant for usual printing.

And also put in some explicit casts, to avoid compiler warnings.

Change-Id: I62936337e26f04878ecb7291335a5da952d8dced
Reviewed-on: https://gerrit.libreoffice.org/80638
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a648918b750c..a9c7fd897808 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2194,7 +2194,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 aFilterOptions = temp + aFilterOptions.copy(bIndex+16);
 }
 
-bool bFullSheetPreview = sFullSheetPreview == "true" ? true : false;
+bool bFullSheetPreview = sFullSheetPreview == "true";
 
 // 'TakeOwnership' == this is a 'real' SaveAs (that is, the document
 // gets a new name).  When this is not provided, the meaning of
@@ -2224,7 +2224,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 
 if(!watermarkText.isEmpty() || bFullSheetPreview)
 {
-uno::Sequence< beans::PropertyValue > aFilterData( 
bFullSheetPreview + !watermarkText.isEmpty() );
+uno::Sequence< beans::PropertyValue > aFilterData( 
static_cast(bFullSheetPreview) + 
static_cast(!watermarkText.isEmpty()) );
 
 if (!watermarkText.isEmpty())
 {
@@ -2234,7 +2234,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 
 if (bFullSheetPreview)
 {
-int nOptIndex = !watermarkText.isEmpty();
+int nOptIndex = static_cast(!watermarkText.isEmpty());
 
 aFilterData[ nOptIndex ].Name = "SinglePageSheets";
 aFilterData[ nOptIndex ].Value <<= true;
diff --git a/filter/uiconfig/ui/pdfgeneralpage.ui 
b/filter/uiconfig/ui/pdfgeneralpage.ui
index aee2993b5f6a..0a40383e2aaf 100644
--- a/filter/uiconfig/ui/pdfgeneralpage.ui
+++ b/filter/uiconfig/ui/pdfgeneralpage.ui
@@ -718,7 +718,7 @@
 
 
   
-Single-page sheets
+Full-Sheet Previews
 True
 True
 False
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-08 Thread Muhammet Kara (via logerrit)
 desktop/source/lib/init.cxx |   12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

New commits:
commit 4d4205311709450e378a2672b9d58ed2f430634d
Author: Muhammet Kara 
AuthorDate: Tue Oct 8 16:44:09 2019 +0300
Commit: Muhammet Kara 
CommitDate: Tue Oct 8 16:24:09 2019 +0200

lok: Avoid accidental removal of filter options

Change-Id: I178bcb19aa3073ea72a3bc8712e5e904665b1510
Reviewed-on: https://gerrit.libreoffice.org/80462
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1707cad91d5c..cf59037fcb3f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2175,15 +2175,9 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 {
 int bIndex = aFilterOptions.indexOf("WATERMARKEND");
 watermarkText = aFilterOptions.copy(aIndex+11, bIndex-(aIndex+11));
-if(aIndex > 0)
-{
-OUString temp = aFilterOptions.copy(0, aIndex);
-aFilterOptions = temp + aFilterOptions.copy(bIndex+12);
-}
-else
-{
-aFilterOptions.clear();
-}
+
+OUString temp = aFilterOptions.copy(0, aIndex);
+aFilterOptions = temp + aFilterOptions.copy(bIndex+12);
 }
 
 aIndex = -1;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-08 Thread Muhammet Kara (via logerrit)
 desktop/source/lib/init.cxx |   36 +++-
 1 file changed, 31 insertions(+), 5 deletions(-)

New commits:
commit 673726fd8b24bd9e5ae0eeb697703b4e7aa29b24
Author: Muhammet Kara 
AuthorDate: Mon Oct 7 22:08:56 2019 +0300
Commit: Muhammet Kara 
CommitDate: Tue Oct 8 15:17:46 2019 +0200

Add FullSheetPreview support for convert-to endpoint of online

Change-Id: I31e4f3cbcf0cf49c5446d9460bd42965ce756c0d
Reviewed-on: https://gerrit.libreoffice.org/80397
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 017152e77352..1707cad91d5c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2169,7 +2169,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 
 // Check if watermark for pdf is passed by filteroptions..
 // It is not a real filter option so it must be filtered out.
-OUString watermarkText;
+OUString watermarkText, sFullSheetPreview;
 int aIndex = -1;
 if ((aIndex = aFilterOptions.indexOf(",Watermark=")) >= 0)
 {
@@ -2186,6 +2186,18 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 }
 }
 
+aIndex = -1;
+if ((aIndex = aFilterOptions.indexOf(",FullSheetPreview=")) >= 0)
+{
+int bIndex = aFilterOptions.indexOf("FULLSHEETPREVEND");
+sFullSheetPreview = aFilterOptions.copy(aIndex+18, 
bIndex-(aIndex+18));
+
+OUString temp = aFilterOptions.copy(0, aIndex);
+aFilterOptions = temp + aFilterOptions.copy(bIndex+16);
+}
+
+bool bFullSheetPreview = sFullSheetPreview == "true" ? true : false;
+
 // 'TakeOwnership' == this is a 'real' SaveAs (that is, the document
 // gets a new name).  When this is not provided, the meaning of
 // saveAs() is more like save-a-copy, which allows saving to any
@@ -2211,11 +2223,25 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 auto aFilteredOptionSeq = 
comphelper::containerToSequence(aFilteredOptionVec);
 aFilterOptions = 
comphelper::string::convertCommaSeparated(aFilteredOptionSeq);
 aSaveMediaDescriptor[MediaDescriptor::PROP_FILTEROPTIONS()] <<= 
aFilterOptions;
-if(!watermarkText.isEmpty())
+
+if(!watermarkText.isEmpty() || bFullSheetPreview)
 {
-uno::Sequence< beans::PropertyValue > aFilterData( 1 );
-aFilterData[ 0 ].Name = "TiledWatermark";
-aFilterData[ 0 ].Value <<= watermarkText;
+uno::Sequence< beans::PropertyValue > aFilterData( 
bFullSheetPreview + !watermarkText.isEmpty() );
+
+if (!watermarkText.isEmpty())
+{
+aFilterData[ 0 ].Name = "TiledWatermark";
+aFilterData[ 0 ].Value <<= watermarkText;
+}
+
+if (bFullSheetPreview)
+{
+int nOptIndex = !watermarkText.isEmpty();
+
+aFilterData[ nOptIndex ].Name = "SinglePageSheets";
+aFilterData[ nOptIndex ].Value <<= true;
+}
+
 aSaveMediaDescriptor["FilterData"] <<= aFilterData;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/LibreOfficeKit include/sfx2 include/svx libreofficekit/source svx/sdi sw/inc sw/sdi sw/source

2019-08-15 Thread Tomaž Vajngerl (via logerrit)
 desktop/source/lib/init.cxx  |   16 -
 include/LibreOfficeKit/LibreOfficeKitEnums.h |9 +++
 include/sfx2/sfxsids.hrc |3 +
 include/svx/svxids.hrc   |1 
 libreofficekit/source/gtk/lokdocview.cxx |2 
 svx/sdi/svx.sdi  |   19 ++
 sw/inc/crsrsh.hxx|1 
 sw/sdi/_viewsh.sdi   |4 +
 sw/source/core/crsr/crsrsh.cxx   |   81 +++
 sw/source/uibase/uiview/viewtab.cxx  |   81 ++-
 10 files changed, 214 insertions(+), 3 deletions(-)

New commits:
commit 820b043101a5b2c64a29ad2f60bc69366189c46c
Author: Tomaž Vajngerl 
AuthorDate: Wed Aug 14 18:08:18 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 15 15:21:42 2019 +0200

tdf#122529 lok - table border position manipulation

This adds a new LOK callback (LOK_CALLBACK_TABLE_SELECTED) that
sends the border positions to the client when the user has the
cursor or slelection in a table.

In addition this adds a .uno:TableChangeCurrentBorderPosition
uno command, which implements changing a specific border in
the current table. Border can be either a column or a row border,
which is either at the first, middle or last position.

Reviewed-on: https://gerrit.libreoffice.org/77365
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 43cce4ef2cf865b2bb637e17b70102a4260295b0)

Change-Id: Ife7cff14d91ffc84c95c040f0b42319e3d6194b4
Reviewed-on: https://gerrit.libreoffice.org/77485
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a999d8d308ae..7f4a323eecd5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -364,9 +364,21 @@ std::vector 
desktop::jsonToPropertyValuesVector(const char
 else if (rType == "long")
 aValue.Value <<= OString(rValue.c_str()).toInt32();
 else if (rType == "short")
-aValue.Value <<= 
static_cast(OString(rValue.c_str()).toInt32());
+aValue.Value <<= sal_Int16(OString(rValue.c_str()).toInt32());
 else if (rType == "unsigned short")
-aValue.Value <<= 
static_cast(OString(rValue.c_str()).toUInt32());
+aValue.Value <<= 
sal_uInt16(OString(rValue.c_str()).toUInt32());
+else if (rType == "int64")
+aValue.Value <<= OString(rValue.c_str()).toInt64();
+else if (rType == "int32")
+aValue.Value <<= OString(rValue.c_str()).toInt32();
+else if (rType == "int16")
+aValue.Value <<= sal_Int16(OString(rValue.c_str()).toInt32());
+else if (rType == "uint64")
+aValue.Value <<= OString(rValue.c_str()).toUInt64();
+else if (rType == "uint32")
+aValue.Value <<= OString(rValue.c_str()).toUInt32();
+else if (rType == "uint16")
+aValue.Value <<= 
sal_uInt16(OString(rValue.c_str()).toUInt32());
 else if (rType == "[]byte")
 {
 aNodeValue = rPair.second.get_child("value", aNodeNull);
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index a5cc4a92ae04..b32099928efe 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -672,6 +672,15 @@ typedef enum
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
 LOK_CALLBACK_CELL_AUTO_FILL_AREA = 43,
+
+/**
+ * When the cursor is in a table or a table is selected in the
+ * document, this sends the table's column and row border positions
+ * to the client. If the payload is empty (empty JSON object), then
+ * no table is currently selected or the cursor is not inside a table
+ * cell.
+ */
+LOK_CALLBACK_TABLE_SELECTED = 44,
 }
 LibreOfficeKitCallbackType;
 
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 14ded948873b..de3318ea18cd 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -561,6 +561,9 @@ class SfxDocumentInfoItem;
 #define SID_OPEN_SMARTTAGOPTIONS(SID_SVX_START + 1062)
 #define SID_RULER_MARGIN1   (SID_SVX_START + 1063)
 #define SID_RULER_MARGIN2   (SID_SVX_START + 1064)
+#define SID_TABLE_BORDER_TYPE   (SID_SVX_START + 1065)
+#define SID_TABLE_BORDER_INDEX  (SID_SVX_START + 1066)
+#define SID_TABLE_BORDER_NEW_POSITION   (SID_SVX_START + 1067)
 
 #define FID_SVX_START   (SID_LIB_START + 500)
 #define FID_SEARCH_NOW  (FID_SVX_START + 2)
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index a3bf0d5f7f76..73b760b9d772 

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

2019-08-12 Thread Tomaž Vajngerl (via logerrit)
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 05fc232be8082d0a3b42d354eb830da582c2c335
Author: Tomaž Vajngerl 
AuthorDate: Thu Aug 8 17:45:49 2019 +0900
Commit: Tor Lillqvist 
CommitDate: Mon Aug 12 11:46:39 2019 +0200

lok: Output a SAL_WARN only if message is not empty

Because we call SetLastExceptionMsg with an empty message when we
want to reset the exception message and this happens all the time
in the LOK code.

Change-Id: Iead1b561d303d610db5e02f79a7af6c72b43834a
Reviewed-on: https://gerrit.libreoffice.org/77144
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 502f0690c362518681723e029d810762f652c675)
Reviewed-on: https://gerrit.libreoffice.org/77339
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bce7c5594dca..a999d8d308ae 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -167,7 +167,7 @@ static std::weak_ptr< LibreOfficeKitDocumentClass > 
gDocumentClass;
 
 static void SetLastExceptionMsg(const OUString& s = OUString())
 {
-SAL_WARN("lok", "lok exception " + s);
+SAL_WARN_IF(!s.isEmpty(), "lok", "lok exception '" + s + "'");
 if (gImpl)
 gImpl->maLastExceptionMsg = s;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/LibreOfficeKit libreofficekit/source

2019-07-31 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx  |   36 +++
 include/LibreOfficeKit/LibreOfficeKitEnums.h |6 
 libreofficekit/source/gtk/lokdocview.cxx |2 +
 3 files changed, 44 insertions(+)

New commits:
commit 9fd9e61c8211b76996116389631ead52a58c3d0e
Author: Michael Meeks 
AuthorDate: Fri Apr 12 21:16:38 2019 +0100
Commit: Tor Lillqvist 
CommitDate: Wed Jul 31 15:11:42 2019 +0200

lok: emit ProfileZone data in messages when requested.

Change-Id: I42a773e2d5b8e4deeafa8eeb2785913db36a47d7
Reviewed-on: https://gerrit.libreoffice.org/70688
Tested-by: Jenkins
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/76748
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index cdf3c01a2c41..7dd7fe6644e1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -4124,6 +4125,31 @@ static void preloadData()
 }
 }
 
+class ProfileZoneDumper : public AutoTimer
+{
+static const int dumpTimeoutMS = 5000;
+public:
+ProfileZoneDumper() : AutoTimer( "zone dumper" )
+{
+SetTimeout(dumpTimeoutMS);
+Start();
+}
+virtual void Invoke() override
+{
+css::uno::Sequence aEvents =
+comphelper::ProfileRecording::getRecordingAndClear();
+OStringBuffer aOutput;
+for (auto  : aEvents)
+{
+aOutput.append(OUStringToOString(s, RTL_TEXTENCODING_UTF8));
+aOutput.append("\n");
+}
+OString aChunk = aOutput.makeStringAndClear();
+if (gImpl && gImpl->mpCallback)
+gImpl->mpCallback(LOK_CALLBACK_PROFILE_FRAME, aChunk.getStr(), 
gImpl->mpCallbackData);
+}
+};
+
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const 
char* pUserProfileUrl)
 {
 enum {
@@ -4134,6 +4160,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 
 // Did we do a pre-initialize
 static bool bPreInited = false;
+static bool bProfileZones = getenv("SAL_PROFILEZONE_STDOUT") != nullptr;
 
 // What stage are we at ?
 if (pThis == nullptr)
@@ -4148,6 +4175,15 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 if (bInitialized)
 return 1;
 
+// Turn profile zones on early
+if (bProfileZones && eStage == SECOND_INIT)
+{
+comphelper::ProfileRecording::startRecording(true);
+new ProfileZoneDumper();
+}
+
+comphelper::ProfileZone aZone("lok-init");
+
 if (eStage == PRE_INIT)
 rtl_alloc_preInit(true);
 else if (eStage == SECOND_INIT)
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index cb9091711acc..f5549ec3cd42 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -608,6 +608,12 @@ typedef enum
  * On-load notification of the document signature status.
  */
 LOK_CALLBACK_SIGNATURE_STATUS = 40,
+
+/**
+ * Profiling tracing information single string of multiple lines
+ * containing   and zone start/stop information
+ */
+LOK_CALLBACK_PROFILE_FRAME = 41
 }
 LibreOfficeKitCallbackType;
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 7d288a449651..d3363c3c8976 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -448,6 +448,8 @@ callbackTypeToString (int nType)
 return "LOK_CALLBACK_CONTEXT_CHANGED";
 case LOK_CALLBACK_SIGNATURE_STATUS:
 return "LOK_CALLBACK_SIGNATURE_STATUS";
+case LOK_CALLBACK_PROFILE_FRAME:
+return "LOK_CALLBACK_PROFILE_FRAME";
 }
 g_assert(false);
 return nullptr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source include/vcl vcl/source

2019-07-04 Thread Miklos Vajna (via logerrit)
 desktop/source/lib/init.cxx |3 +++
 include/vcl/graphicfilter.hxx   |2 ++
 vcl/source/filter/graphicfilter.cxx |   26 ++
 3 files changed, 31 insertions(+)

New commits:
commit 4965569d21395e7cc7176c63b820986808fe6211
Author: Miklos Vajna 
AuthorDate: Thu Jul 4 11:57:27 2019 +0200
Commit: Miklos Vajna 
CommitDate: Thu Jul 4 16:37:02 2019 +0200

vcl lok: pre-load graphic libraries

This is needed to be able to load e.g. TIFF files in Online, which does
not have code in the chroot since online.git commit
ad21717498cc214d5d5d5c0ff378238552137e2f (Avoid copying most code into
the chroot jail., 2018-03-10).

Change-Id: Ib095191ee690d9da6269878a82b1c6995df50dfa
Reviewed-on: https://gerrit.libreoffice.org/75077
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit ad8f4c4432e0c5c052b6f87977d1ad8663debe09)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2b8a6f956d2f..cdf3c01a2c41 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4266,6 +4266,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 std::cerr << "Init vcl\n";
 InitVCL();
 
+// pre-load all graphic libraries.
+GraphicFilter::GetGraphicFilter().preload();
+
 // pre-load all component libraries.
 if (!xContext.is())
 throw css::uno::DeploymentException("preInit: 
XComponentContext is not created");
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index 5ef927761f97..ef66d16544e1 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -309,6 +309,8 @@ public:
 
 ErrCode compressAsPNG(const Graphic& rGraphic, SvStream& 
rOutputStream);
 
+void preload();
+
 private:
 OUStringaFilterPath;
 FilterConfigCache*  pConfig;
diff --git a/vcl/source/filter/graphicfilter.cxx 
b/vcl/source/filter/graphicfilter.cxx
index 2661cf32bf00..0fb9b2992899 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -68,6 +68,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -1667,6 +1669,30 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& 
rIStream, sal_uInt64 size
 return aGraphic;
 }
 
+void GraphicFilter::preload()
+{
+sal_Int32 nTokenCount = comphelper::string::getTokenCount(aFilterPath, 
';');
+ImpFilterLibCache& rCache = Cache::get();
+static const std::initializer_list aFilterNames = {
+"icd", "idx", "ime", "ipb", "ipd", "ips", "ipt", "ipx", "ira", "itg", 
"iti",
+};
+
+// Load library for each filter.
+for (const auto& rFilterName : aFilterNames)
+{
+ImpFilterLibCacheEntry* pFilter = nullptr;
+// Look at the library in each element inside the filter path.
+for (sal_Int32 i = 0; i < nTokenCount; ++i)
+{
+pFilter = rCache.GetFilter(aFilterPath.getToken(i, ';'), 
SVLIBRARY("gie"), rFilterName);
+if (pFilter)
+{
+break;
+}
+}
+}
+}
+
 ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& 
rPath, SvStream& rIStream,
  sal_uInt16 nFormat, sal_uInt16* 
pDeterminedFormat, GraphicFilterImportFlags nImportFlags,
  css::uno::Sequence< 
css::beans::PropertyValue >* pFilterData,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-19 Thread Mike Kaganski (via logerrit)
 desktop/source/lib/init.cxx |  240 ++--
 1 file changed, 99 insertions(+), 141 deletions(-)

New commits:
commit 5fdde854ff54926bc93d45192458adf5ed553b20
Author: Mike Kaganski 
AuthorDate: Sun Apr 28 23:29:49 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 19 13:32:54 2019 +0200

tdf#120703 PVS: dereference before nullptr check

Use a function to consistently check if gImpl is valid before assigning last
exception message.

V595 The 'gImpl' pointer was utilized before it was verified against 
nullptr.
 Check lines: 2673, 2683.

Change-Id: I18fc0d632c84f37b05e9d1c3c83689e6eaa6f66c
Reviewed-on: https://gerrit.libreoffice.org/71488
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/74351
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1ea6dd95eb03..5d2dd070ef30 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -150,6 +150,12 @@ static LibLibreOffice_Impl *gImpl = nullptr;
 static std::weak_ptr< LibreOfficeKitClass > gOfficeClass;
 static std::weak_ptr< LibreOfficeKitDocumentClass > gDocumentClass;
 
+static void SetLastExceptionMsg(const OUString& s = OUString())
+{
+if (gImpl)
+gImpl->maLastExceptionMsg = s;
+}
+
 typedef struct
 {
 const char *extn;
@@ -1643,8 +1649,7 @@ static void lo_registerCallback (LibreOfficeKit* pThis,
 static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const 
char* pFormat, const char* pFilterOptions)
 {
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();
 
 LibLODocument_Impl* pDocument = static_cast(pThis);
 
@@ -1652,7 +1657,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 OUString aURL(getAbsoluteURL(sUrl));
 if (aURL.isEmpty())
 {
-gImpl->maLastExceptionMsg = "Filename to save to was not provided.";
+SetLastExceptionMsg("Filename to save to was not provided.");
 SAL_INFO("lok", "URL for save is empty");
 return false;
 }
@@ -1691,7 +1696,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 }
 else
 {
-gImpl->maLastExceptionMsg = "input filename without a suffix";
+SetLastExceptionMsg("input filename without a suffix");
 return false;
 }
 }
@@ -1707,7 +1712,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 }
 if (aFilterName.isEmpty())
 {
-gImpl->maLastExceptionMsg = "no output filter found for provided 
suffix";
+SetLastExceptionMsg("no output filter found for provided suffix");
 return false;
 }
 
@@ -1761,7 +1766,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 }
 catch (const uno::Exception& exception)
 {
-gImpl->maLastExceptionMsg = "exception: " + exception.Message;
+SetLastExceptionMsg("exception: " + exception.Message);
 }
 return false;
 }
@@ -1769,8 +1774,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 static void doc_iniUnoCommands ()
 {
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();
 
 OUString sUnoCommands[] =
 {
@@ -1912,8 +1916,7 @@ static void doc_iniUnoCommands ()
 static int doc_getDocumentType (LibreOfficeKitDocument* pThis)
 {
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();
 
 LibLODocument_Impl* pDocument = static_cast(pThis);
 
@@ -1939,12 +1942,12 @@ static int doc_getDocumentType (LibreOfficeKitDocument* 
pThis)
 }
 else
 {
-gImpl->maLastExceptionMsg = "unknown document type";
+SetLastExceptionMsg("unknown document type");
 }
 }
 catch (const uno::Exception& exception)
 {
-gImpl->maLastExceptionMsg = "exception: " + exception.Message;
+SetLastExceptionMsg("exception: " + exception.Message);
 }
 return LOK_DOCTYPE_OTHER;
 }
@@ -1956,7 +1959,7 @@ static int doc_getParts (LibreOfficeKitDocument* pThis)
 ITiledRenderable* pDoc = getTiledRenderable(pThis);
 if (!pDoc)
 {
-gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+SetLastExceptionMsg("Document doesn't support tiled rendering");
 return 0;
 }
 
@@ -1966,13 +1969,12 @@ static int doc_getParts (LibreOfficeKitDocument* pThis)
 static int doc_getPart (LibreOfficeKitDocument* pThis)
 {
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();