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

2016-07-15 Thread Henry Castro
 desktop/source/lib/init.cxx  |4 +++-
 sfx2/source/control/unoctitm.cxx |   10 ++
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 6f1c8e1428cd3bbc26484bccf2897f2b85903985
Author: Henry Castro 
Date:   Thu Jul 14 10:59:47 2016 -0400

sc lok: add more toolbar items

.uno:SortAscending
.uno:SortDescending

Change-Id: I3d307b43fb18ffce75b00a0b919b63320bf6db05
Reviewed-on: https://gerrit.libreoffice.org/27223
Tested-by: Jenkins 
Reviewed-by: Henry Castro 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a052b6f..2413b3f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -814,7 +814,9 @@ static void doc_iniUnoCommands ()
 OUString(".uno:ToggleMergeCells"),
 OUString(".uno:NumberFormatCurrency"),
 OUString(".uno:NumberFormatPercent"),
-OUString(".uno:NumberFormatDate")
+OUString(".uno:NumberFormatDate"),
+OUString(".uno:SortAscending"),
+OUString(".uno:SortDescending")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index d585a31..867bfdb 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1140,14 +1140,17 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 }
 else if (aEvent.FeatureURL.Path == "InsertPage" ||
  aEvent.FeatureURL.Path == "DeletePage" ||
- aEvent.FeatureURL.Path == "DuplicatePage")
+ aEvent.FeatureURL.Path == "DuplicatePage" ||
+ aEvent.FeatureURL.Path == "SortAscending" ||
+ aEvent.FeatureURL.Path == "SortDescending")
 {
 aBuffer.append(OUString::boolean(aEvent.IsEnabled));
 }
 else if (aEvent.FeatureURL.Path == "AssignLayout" ||
  aEvent.FeatureURL.Path == "StatusSelectionMode" ||
  aEvent.FeatureURL.Path == "Signature" ||
- aEvent.FeatureURL.Path == "SelectionMode")
+ aEvent.FeatureURL.Path == "SelectionMode" ||
+ aEvent.FeatureURL.Path == "StatusBarFunc")
 {
 sal_Int32 aInt32;
 
@@ -1197,8 +1200,7 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 aBuffer.append(OUString::number(aPoint.X) + OUString(" / ") + 
OUString::number(aPoint.Y));
 }
 }
-else if (aEvent.FeatureURL.Path == "StatusBarFunc" ||
- aEvent.FeatureURL.Path == "Size")
+else if (aEvent.FeatureURL.Path == "Size")
 {
 css::awt::Size aSize;
 
___
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-5.0' - desktop/source sfx2/source

2016-07-12 Thread Henry Castro
 desktop/source/lib/init.cxx  |   20 ++-
 sfx2/source/control/unoctitm.cxx |   68 ---
 2 files changed, 82 insertions(+), 6 deletions(-)

New commits:
commit 4fb1a8705549dd471d1ec687f8828818c106f20e
Author: Henry Castro 
Date:   Thu Jun 30 10:33:20 2016 -0400

lok: add status and tool bar UNO commands

Change-Id: I2dbed808a23609773baf9154820a7121c7919c70
Reviewed-on: https://gerrit.libreoffice.org/26809
Tested-by: Jenkins 
Reviewed-by: Henry Castro 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e88dce8..a052b6f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -796,7 +796,25 @@ static void doc_iniUnoCommands ()
 OUString(".uno:EntireColumn"),
 OUString(".uno:EntireCell"),
 OUString(".uno:MergeCells"),
-OUString(".uno:AssignLayout")
+OUString(".uno:AssignLayout"),
+OUString(".uno:StatusDocPos"),
+OUString(".uno:RowColSelCount"),
+OUString(".uno:StatusPageStyle"),
+OUString(".uno:InsertMode"),
+OUString(".uno:StatusSelectionMode"),
+OUString(".uno:StateTableCell"),
+OUString(".uno:StatusBarFunc"),
+OUString(".uno:StatePageNumber"),
+OUString(".uno:StateWordCount"),
+OUString(".uno:SelectionMode"),
+OUString(".uno:PageStatus"),
+OUString(".uno:LayoutStatus"),
+OUString(".uno:Context"),
+OUString(".uno:WrapText"),
+OUString(".uno:ToggleMergeCells"),
+OUString(".uno:NumberFormatCurrency"),
+OUString(".uno:NumberFormatPercent"),
+OUString(".uno:NumberFormatDate")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index e317ae4..bca77ec 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1064,7 +1064,7 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 
 OUStringBuffer aBuffer;
 aBuffer.append(aEvent.FeatureURL.Complete);
-aBuffer.append("=");
+aBuffer.append(static_cast('='));
 
 if (aEvent.FeatureURL.Path == "Bold" ||
 aEvent.FeatureURL.Path == "CenterPara" ||
@@ -1143,16 +1143,74 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 {
 aBuffer.append(OUString::boolean(aEvent.IsEnabled));
 }
-else if (aEvent.FeatureURL.Path == "AssignLayout")
+else if (aEvent.FeatureURL.Path == "AssignLayout" ||
+ aEvent.FeatureURL.Path == "StatusSelectionMode" ||
+ aEvent.FeatureURL.Path == "Signature" ||
+ aEvent.FeatureURL.Path == "SelectionMode")
 {
-sal_Int32 nLayout = 0;
-aEvent.State >>= nLayout;
-aBuffer.append(nLayout);
+sal_Int32 aInt32;
+
+if (aEvent.IsEnabled && (aEvent.State >>= aInt32))
+{
+aBuffer.append(OUString::number(aInt32));
+}
+}
+else if (aEvent.FeatureURL.Path == "StatusDocPos" ||
+ aEvent.FeatureURL.Path == "RowColSelCount" ||
+ aEvent.FeatureURL.Path == "StatusPageStyle" ||
+ aEvent.FeatureURL.Path == "StateTableCell" ||
+ aEvent.FeatureURL.Path == "StatePageNumber" ||
+ aEvent.FeatureURL.Path == "StateWordCount" ||
+ aEvent.FeatureURL.Path == "PageStyleName" ||
+ aEvent.FeatureURL.Path == "PageStatus" ||
+ aEvent.FeatureURL.Path == "LayoutStatus" ||
+ aEvent.FeatureURL.Path == "Context")
+{
+OUString aString;
+
+if (aEvent.IsEnabled && (aEvent.State >>= aString))
+{
+aBuffer.append(aString);
+}
+}
+else if (aEvent.FeatureURL.Path == "InsertMode" ||
+ aEvent.FeatureURL.Path == "WrapText" ||
+ aEvent.FeatureURL.Path == "ToggleMergeCells" ||
+ aEvent.FeatureURL.Path == "NumberFormatCurrency" ||
+ aEvent.FeatureURL.Path == "NumberFormatPercent" ||
+ aEvent.FeatureURL.Path == "NumberFormatDate")
+{
+sal_Bool aBool;
+
+if (aEvent.IsEnabled && (aEvent.State >>= aBool))
+{
+aBuffer.append(OUString::boolean(aBool));
+}
+}
+else if (aEvent.FeatureURL.Path == "Position")
+{
+css::awt::Point aPoint;
+
+if (aEvent.IsEnabled && (aEvent.State >>= aPoint))
+{
+aBuffer.append(OUString::number(aPoint.X) + OUString(" / ") + 
OUString::number(aPoint.Y));
+}
+}
+else if (aEvent.FeatureURL.Path == "StatusBarFunc" ||
+ aEvent.FeatureURL.Path == "Size")
+{
+css::awt::Size aSize;
+
+if (aEvent.IsEnabled && (aEvent.State >>= aSize))
+{
+aBuffer.append(OUString::number(aSize.Width) + OUString(" x ") + 
OUString::number(aSize.Height));
+ 

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

2016-05-27 Thread Henry Castro
 desktop/source/lib/init.cxx  |3 ++-
 sfx2/source/control/unoctitm.cxx |6 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit b0c0d4eff911a1d2619c0cac5a0e86220d9747ab
Author: Henry Castro 
Date:   Fri May 27 16:38:47 2016 -0400

lok: add uno command AssignLayout

Change-Id: I959d1a57945a3b5aa3f2c273c4b885ed5f628f6e

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6660268..8caa011 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -792,7 +792,8 @@ static void doc_iniUnoCommands ()
 OUString(".uno:EntireRow"),
 OUString(".uno:EntireColumn"),
 OUString(".uno:EntireCell"),
-OUString(".uno:MergeCells")
+OUString(".uno:MergeCells"),
+OUString(".uno:AssignLayout")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 35508ae..e317ae4 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1143,6 +1143,12 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 {
 aBuffer.append(OUString::boolean(aEvent.IsEnabled));
 }
+else if (aEvent.FeatureURL.Path == "AssignLayout")
+{
+sal_Int32 nLayout = 0;
+aEvent.State >>= nLayout;
+aBuffer.append(nLayout);
+}
 else
 {
 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-5.0' - desktop/source sfx2/source

2016-05-23 Thread Pranav Kant
 desktop/source/lib/init.cxx  |   19 ++-
 sfx2/source/control/unoctitm.cxx |   19 ++-
 2 files changed, 36 insertions(+), 2 deletions(-)

New commits:
commit ddcbda3c48acab14928b91756836ca44543720c3
Author: Pranav Kant 
Date:   Mon May 23 13:32:47 2016 +0530

lok: Subcribe to more uno commands for state change

Change-Id: Id2870b176de4163fbe01e4ac380b4981d3187d90

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 20a40ce..6660268 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -775,7 +775,24 @@ static void doc_iniUnoCommands ()
 OUString(".uno:Redo"),
 OUString(".uno:InsertPage"),
 OUString(".uno:DeletePage"),
-OUString(".uno:DuplicatePage")
+OUString(".uno:DuplicatePage"),
+OUString(".uno:Cut"),
+OUString(".uno:Copy"),
+OUString(".uno:Paste"),
+OUString(".uno:SelectAll"),
+OUString(".uno:InsertAnnotation"),
+OUString(".uno:InsertRowsBefore"),
+OUString(".uno:InsertRowsAfter"),
+OUString(".uno:InsertColumnsBefore"),
+OUString(".uno:InsertColumnsAfter"),
+OUString(".uno:DeleteRows"),
+OUString(".uno:DeleteColumns"),
+OUString(".uno:DeleteTable"),
+OUString(".uno:SelectTable"),
+OUString(".uno:EntireRow"),
+OUString(".uno:EntireColumn"),
+OUString(".uno:EntireCell"),
+OUString(".uno:MergeCells")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 895e105..35508ae 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1116,7 +1116,24 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 aBuffer.append(nColor);
 }
 else if (aEvent.FeatureURL.Path == "Undo" ||
- aEvent.FeatureURL.Path == "Redo")
+ aEvent.FeatureURL.Path == "Redo" ||
+ aEvent.FeatureURL.Path == "Cut" ||
+ aEvent.FeatureURL.Path == "Copy" ||
+ aEvent.FeatureURL.Path == "Paste" ||
+ aEvent.FeatureURL.Path == "SelectAll" ||
+ aEvent.FeatureURL.Path == "InsertAnnotation" ||
+ aEvent.FeatureURL.Path == "InsertRowsBefore" ||
+ aEvent.FeatureURL.Path == "InsertRowsAfter" ||
+ aEvent.FeatureURL.Path == "InsertColumnsBefore" ||
+ aEvent.FeatureURL.Path == "InsertColumnsAfter" ||
+ aEvent.FeatureURL.Path == "DeleteRows" ||
+ aEvent.FeatureURL.Path == "DeleteColumns" ||
+ aEvent.FeatureURL.Path == "DeleteTable" ||
+ aEvent.FeatureURL.Path == "SelectTable" ||
+ aEvent.FeatureURL.Path == "EntireRow" ||
+ aEvent.FeatureURL.Path == "EntireColumn" ||
+ aEvent.FeatureURL.Path == "EntireCell" ||
+ aEvent.FeatureURL.Path == "MergeCells")
 {
 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-5.0' - desktop/source editeng/source include/editeng include/LibreOfficeKit include/sfx2 include/svx include/vcl ios/experimental libreoffic

2016-05-08 Thread Miklos Vajna
 desktop/source/lib/init.cxx  |1 -
 desktop/source/lib/lokandroid.cxx|2 --
 editeng/source/editeng/impedit.hxx   |1 -
 include/LibreOfficeKit/LibreOfficeKit.h  |8 

 include/LibreOfficeKit/LibreOfficeKit.hxx|8 

 include/LibreOfficeKit/LibreOfficeKitEnums.h |4 ++--
 include/LibreOfficeKit/LibreOfficeKitTypes.h |4 ++--
 include/editeng/editview.hxx |1 -
 include/editeng/outliner.hxx |2 --
 include/sfx2/objsh.hxx   |1 -
 include/sfx2/viewsh.hxx  |1 -
 include/svx/svdmodel.hxx |1 -
 include/vcl/ITiledRenderable.hxx |1 -
 ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m |1 -
 ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.h   |1 -
 ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m   |1 -
 ios/experimental/TiledLibreOffice/TiledLibreOffice/View.m|1 -
 libreofficekit/README|2 +-
 libreofficekit/qa/tilebench/tilebench.cxx|2 --
 libreofficekit/qa/unit/tiledrendering.cxx|1 -
 libreofficekit/source/gtk/lokdocview.cxx |1 -
 sc/source/ui/view/gridwin.cxx|1 -
 sc/source/ui/view/gridwin4.cxx   |1 -
 sd/qa/unit/tiledrendering/tiledrendering.cxx |1 -
 sw/inc/PostItMgr.hxx |1 -
 sw/inc/docsh.hxx |1 -
 sw/inc/viewsh.hxx|1 -
 sw/source/uibase/docvw/SidebarScrollBar.cxx  |1 -
 sw/source/uibase/uno/unotxdoc.cxx|1 -
 29 files changed, 13 insertions(+), 40 deletions(-)

New commits:
commit dfc2c194cf28c364328c9fcb484d56c51dba3e76
Author: Miklos Vajna 
Date:   Mon Dec 7 09:25:42 2015 +0100

Let LIBO_INTERNAL_ONLY imply LOK_USE_UNSTABLE_API

(cherry picked from commit 958b9a7fbdd58fdce762021917155c58fbb90d18)

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8742c49..1ee6e25 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -23,7 +23,6 @@
 #include 
 #endif
 
-#define LOK_USE_UNSTABLE_API
 #include 
 #include 
 
diff --git a/desktop/source/lib/lokandroid.cxx 
b/desktop/source/lib/lokandroid.cxx
index 9f15796..c9181a9 100644
--- a/desktop/source/lib/lokandroid.cxx
+++ b/desktop/source/lib/lokandroid.cxx
@@ -17,8 +17,6 @@
 
 #include 
 
-#define LOK_USE_UNSTABLE_API
-
 #include 
 
 /* LibreOfficeKit */
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index a44e335..5895e26 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -54,7 +54,6 @@
 
 #include 
 #include 
-#define LOK_USE_UNSTABLE_API
 #include 
 
 #include 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 9f604a3..68ae432 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -12,7 +12,7 @@
 
 #include 
 
-#ifdef LOK_USE_UNSTABLE_API
+#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 // the unstable API needs C99's bool
 #include 
 #include 
@@ -58,7 +58,7 @@ struct _LibreOfficeKitClass
 const char* pOptions);
 void (*freeError) (char* pFree);
 
-#ifdef LOK_USE_UNSTABLE_API
+#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 void (*registerCallback) (LibreOfficeKit* pThis,
   LibreOfficeKitCallback pCallback,
   void* pData);
@@ -95,7 +95,7 @@ struct _LibreOfficeKitDocumentClass
const char* pFormat,
const char* pFilterOptions);
 
-#ifdef LOK_USE_UNSTABLE_API
+#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 /// @see lok::Document::getDocumentType().
 int (*getDocumentType) (LibreOfficeKitDocument* pThis);
 
@@ -239,7 +239,7 @@ struct _LibreOfficeKitDocumentClass
const int nTileWidth,
const int nTileHeight);
 
-#endif // LOK_USE_UNSTABLE_API
+#endif // defined 

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

2016-05-06 Thread Ashod Nakashian
 desktop/source/lib/init.cxx |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit aadab5f4a72e38ccc8bbe9b7811d2cdcaa00124c
Author: Ashod Nakashian 
Date:   Fri May 6 11:01:42 2016 -0400

Don't change part on text documents to paint tiles

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d043a2f..8742c49 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1101,15 +1101,21 @@ void doc_paintPartTile(LibreOfficeKitDocument* pThis,
 pDocument->mpCallbackFlushHandler->setPartTilePainting(true);
 try
 {
-const int nOrigPart = doc_getPart(pThis);
-if (nPart != nOrigPart)
+// Text documents have a single coordinate system; don't change part.
+int nOrigPart = 0;
+const bool isText = (doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT);
+if (!isText)
 {
-doc_setPart(pThis, nPart);
+nOrigPart = doc_getPart(pThis);
+if (nPart != nOrigPart)
+{
+doc_setPart(pThis, nPart);
+}
 }
 
 doc_paintTile(pThis, pBuffer, nCanvasWidth, nCanvasHeight, nTilePosX, 
nTilePosY, nTileWidth, nTileHeight);
 
-if (nPart != nOrigPart)
+if (!isText && nPart != nOrigPart)
 {
 doc_setPart(pThis, nOrigPart);
 }
___
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-5.0' - desktop/source

2016-03-04 Thread Pranav Kant
 desktop/source/lib/init.cxx |   43 +--
 1 file changed, 9 insertions(+), 34 deletions(-)

New commits:
commit 8689612a0d9d96033f9f9a0abb3fa3964daeca77
Author: Pranav Kant 
Date:   Mon Feb 22 20:56:12 2016 +0530

lok: Export only programmatic style names

First, it reverts b0111f494c1ee2d75ac4f1544c06c24d464cc416. It
was a bad idea to export UI names via LOK because the client
would need the programmatic ones anyways for UNO commands. We
cannot expect UNO commands to accept UI style names and work,
though that's another thing that they will work in most cases
because mostly UI names are equal to programmatic ones. Clients
are now supposed to have their own UI name <-> programmatic name
mapping, if they want style names to use for translations.

Secondly, it fixes a bug that was already there mixing programmatic
names with UI ones in an effort to put default writer styles on
the top of the list.

Change-Id: I307f987fe740b3c43b0e14ec4773edcb672a11df
Reviewed-on: https://gerrit.libreoffice.org/22810
Tested-by: Jenkins 
Reviewed-by: Andras Timar 
(cherry picked from commit e04284587a5db51d96430137baa76bbef3937a5d)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8371686..a40285b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1409,49 +1409,24 @@ static char* getStyles(LibreOfficeKitDocument* pThis, 
const char* pCommand)
 {
 for (const OUString& rStyle: aWriterStyles)
 {
-uno::Reference< beans::XPropertySet > xStyle;
-xStyleFamily->getByName(rStyle) >>= xStyle;
-OUString sName;
-xStyle->getPropertyValue("DisplayName") >>= sName;
-if( !sName.isEmpty() )
-{
-aDefaultStyleNames.insert( sName );
+aDefaultStyleNames.insert( rStyle );
 
-boost::property_tree::ptree aChild;
-aChild.put("", sName.toUtf8());
-aChildren.push_back(std::make_pair("", aChild));
-}
+boost::property_tree::ptree aChild;
+aChild.put("", rStyle.toUtf8());
+aChildren.push_back(std::make_pair("", aChild));
 }
 }
 
 uno::Sequence aStyles = xStyleFamily->getElementNames();
 for (const OUString& rStyle: aStyles )
 {
-uno::Reference< beans::XPropertySet > xStyle 
(xStyleFamily->getByName(rStyle), uno::UNO_QUERY);
-bool bStyleInserted = false;
-// Its possible that the style does not implement XPropertySet.
-// For example, TableDesignFamily doesn't yet.
-if (xStyle.is())
-{
-// Filter out the default styles - they are already at the top
-// of the list
-OUString sName;
-xStyle->getPropertyValue("DisplayName") >>= sName;
-if (!sName.isEmpty() && aDefaultStyleNames.find(sName) == 
aDefaultStyleNames.end())
-{
-boost::property_tree::ptree aChild;
-aChild.put("", sName.toUtf8());
-aChildren.push_back(std::make_pair("", aChild));
-bStyleInserted = true;
-}
-}
-
-// If XPropertySet is not implemented or DisplayName is empty 
string,
-// fallback to LO internal names
-if (!bStyleInserted)
+// Filter out the default styles - they are already at the top
+// of the list
+if (aDefaultStyleNames.find(rStyle) == aDefaultStyleNames.end() ||
+(sStyleFam != "ParagraphStyles" || doc_getDocumentType(pThis) 
!= LOK_DOCTYPE_TEXT) )
 {
 boost::property_tree::ptree aChild;
-aChild.put("", rStyle);
+aChild.put("", rStyle.toUtf8());
 aChildren.push_back(std::make_pair("", aChild));
 }
 }
___
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-5.0' - desktop/source

2016-03-01 Thread Miklos Vajna
 desktop/source/lib/init.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit a57b2fd453c53d6fc1075321cf3b7d4284781e68
Author: Miklos Vajna 
Date:   Tue Mar 1 10:50:29 2016 +0100

ccu#1568 desktop: disable alpha buffer for Calc

As far as I see, the alpha buffer is used for Writer and Impress only,
while it causes problems for Calc hyperlink rendering, so conditionally
disable it.

Change-Id: I4debe6d5c03c4765959158b97bc6da9b3cc817c8

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 520b8ad..8371686 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1006,7 +1006,12 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
 // Allocate a separate buffer for the alpha device.
 std::vector aAlpha(nCanvasWidth * nCanvasHeight);
 memset(aAlpha.data(), 0, nCanvasWidth * nCanvasHeight);
-boost::shared_array aAlphaBuffer(aAlpha.data(), 
NoDelete());
+boost::shared_array aAlphaBuffer;
+
+// No alpha buffer for Calc: it would result in misrendered hyperlinks with
+// pre-cairo headless codepath.
+if (doc_getDocumentType(pThis) != LOK_DOCTYPE_SPREADSHEET)
+aAlphaBuffer.reset(aAlpha.data(), NoDelete());
 
 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-5.0' - desktop/source

2016-02-16 Thread Henry Castro
 desktop/source/lib/init.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 4fff20024952c19b141f3c34c79ff9d116442fbc
Author: Henry Castro 
Date:   Tue Feb 16 21:21:24 2016 -0400

lok: add desktop terminate

When lokit is destroyed, the Desktop service
is still alive. So in order to avoid debug
assertion "Desktop disposed before terminating it",
terminate to quit application.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 16d0c13..520b8ad 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2010,14 +2010,26 @@ LibreOfficeKit *libreofficekit_hook(const char* 
install_path)
 
 static void lo_destroy(LibreOfficeKit* pThis)
 {
+bool bSuccess = false;
 LibLibreOffice_Impl* pLib = static_cast(pThis);
 gImpl = NULL;
 
 SAL_INFO("lok", "LO Destroy");
 
 comphelper::LibreOfficeKit::setStatusIndicatorCallback(0, 0);
+uno::Reference  xDesktop = frame::Desktop::create ( 
::comphelper::getProcessComponentContext() );
+bSuccess = xDesktop.is() && xDesktop->terminate();
+
+if (!bSuccess)
+{
+bSuccess = GetpApp() && GetpApp()->QueryExit();
+}
+
+if (!bSuccess)
+{
+Application::Quit();
+}
 
-Application::Quit();
 osl_joinWithThread(pLib->maThread);
 osl_destroyThread(pLib->maThread);
 
___
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-5.0' - desktop/source

2016-02-14 Thread Pranav Kant
 desktop/source/lib/init.cxx |   25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 3c84b0b032453a389a2606d67d1995d554468cad
Author: Pranav Kant 
Date:   Sun Feb 14 02:08:20 2016 +0530

lok: Expose DisplayName of styles, not internal ones

Change-Id: I2119713600703e3aa18f673979c7cd84c38177d7
Reviewed-on: https://gerrit.libreoffice.org/22349
Tested-by: Jenkins 
Reviewed-by: Andras Timar 
(cherry picked from commit b0111f494c1ee2d75ac4f1544c06c24d464cc416)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 27bf2a2..16d0c13 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1422,9 +1422,28 @@ static char* getStyles(LibreOfficeKitDocument* pThis, 
const char* pCommand)
 uno::Sequence aStyles = xStyleFamily->getElementNames();
 for (const OUString& rStyle: aStyles )
 {
-// Filter out the default styles - they are already at the top
-// of the list
-if (aDefaultStyleNames.find(rStyle) == aDefaultStyleNames.end())
+uno::Reference< beans::XPropertySet > xStyle 
(xStyleFamily->getByName(rStyle), uno::UNO_QUERY);
+bool bStyleInserted = false;
+// Its possible that the style does not implement XPropertySet.
+// For example, TableDesignFamily doesn't yet.
+if (xStyle.is())
+{
+// Filter out the default styles - they are already at the top
+// of the list
+OUString sName;
+xStyle->getPropertyValue("DisplayName") >>= sName;
+if (!sName.isEmpty() && aDefaultStyleNames.find(sName) == 
aDefaultStyleNames.end())
+{
+boost::property_tree::ptree aChild;
+aChild.put("", sName.toUtf8());
+aChildren.push_back(std::make_pair("", aChild));
+bStyleInserted = true;
+}
+}
+
+// If XPropertySet is not implemented or DisplayName is empty 
string,
+// fallback to LO internal names
+if (!bStyleInserted)
 {
 boost::property_tree::ptree aChild;
 aChild.put("", rStyle);
___
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-5.0' - desktop/source

2016-02-11 Thread Jan Holesovsky
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9e4e81a297b39e17ce6f2b80c3f0adbb7be31cd3
Author: Jan Holesovsky 
Date:   Thu Feb 11 10:35:37 2016 +0100

lok: Only add interaction handler when LOK fully initialized.

Necessary for unit testing.

Change-Id: I8db8b4c469864a915a00f8d8c4932634d74f11a7

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d5bec92..27bf2a2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1177,7 +1177,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 std::vector 
aPropertyValuesVector(jsonToPropertyValuesVector(pArguments));
 
 // handle potential interaction
-if (aCommand == ".uno:Save")
+if (gImpl && aCommand == ".uno:Save")
 {
 rtl::Reference const pInteraction(
 new 
LOKInteractionHandler(::comphelper::getProcessComponentContext(), "save", 
gImpl, pDocument));
___
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-5.0' - desktop/source sfx2/source

2016-02-08 Thread Henry Castro
 desktop/source/lib/init.cxx  |7 ++-
 sfx2/source/control/unoctitm.cxx |   11 +++
 2 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 6d5bbadfb69c1c6b2d3e82e79c97350af2135487
Author: Henry Castro 
Date:   Sun Feb 7 18:29:03 2016 -0400

lok: notify the states of undo and redo toolbar items

Also included .uno:InsertPage, .uno:DeletePage and
.uno:DuplicatePage

Change-Id: I91dd2609d6a48be75005a44490614bcf8bcf62e9
Reviewed-on: https://gerrit.libreoffice.org/22195
Reviewed-by: Henry Castro 
Tested-by: Henry Castro 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ccde8f6..2072fb3 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -720,7 +720,12 @@ static void doc_iniUnoCommands ()
 OUString(".uno:Strikeout"),
 OUString(".uno:StyleApply"),
 OUString(".uno:Underline"),
-OUString(".uno:ModifiedStatus")
+OUString(".uno:ModifiedStatus"),
+OUString(".uno:Undo"),
+OUString(".uno:Redo"),
+OUString(".uno:InsertPage"),
+OUString(".uno:DeletePage"),
+OUString(".uno:DuplicatePage")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 8a2a866..895e105 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1115,6 +1115,17 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 aEvent.State >>= nColor;
 aBuffer.append(nColor);
 }
+else if (aEvent.FeatureURL.Path == "Undo" ||
+ aEvent.FeatureURL.Path == "Redo")
+{
+aBuffer.append(aEvent.IsEnabled ? OUString("enabled") : 
OUString("disabled"));
+}
+else if (aEvent.FeatureURL.Path == "InsertPage" ||
+ aEvent.FeatureURL.Path == "DeletePage" ||
+ aEvent.FeatureURL.Path == "DuplicatePage")
+{
+aBuffer.append(OUString::boolean(aEvent.IsEnabled));
+}
 else
 {
 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-5.0' - desktop/source sfx2/source

2016-02-05 Thread Jan Holesovsky
 desktop/source/lib/init.cxx  |1 +
 sfx2/source/control/unoctitm.cxx |2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e6a2b10b7a01cbb1d7b2148c37e73cee2d78c10e
Author: Jan Holesovsky 
Date:   Fri Feb 5 12:20:11 2016 +0100

lok: Notify also about the states of .uno:CharBackgroundExt.

.uno:CharBackgroundExt is supplementary to .uno:BackColor.

When .uno:BackColor is set, Writer turns into a 'watercan' mode, where the
user directly marks parts of the text with the wanted background color.

.uno:CharBackgroundExt then controls this watercan mode - dispatching it
toggles the watercan mode on/off, and also the StateChanged events reflect 
the
on/off mode accordingly.

Change-Id: I6472eb39129d1b1517fba14bad584cbd125e826a

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 72fef83..ccde8f6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -700,6 +700,7 @@ static void doc_iniUnoCommands ()
 OUString(".uno:Bold"),
 OUString(".uno:CenterPara"),
 OUString(".uno:CharBackColor"),
+OUString(".uno:CharBackgroundExt"),
 OUString(".uno:CharFontName"),
 OUString(".uno:Color"),
 OUString(".uno:DecrementIndent"),
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index a189a5f..8a2a866 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1068,6 +1068,7 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 
 if (aEvent.FeatureURL.Path == "Bold" ||
 aEvent.FeatureURL.Path == "CenterPara" ||
+aEvent.FeatureURL.Path == "CharBackgroundExt" ||
 aEvent.FeatureURL.Path == "DefaultBullet" ||
 aEvent.FeatureURL.Path == "DefaultNumbering" ||
 aEvent.FeatureURL.Path == "Italic" ||
@@ -1085,7 +1086,6 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 bool bTemp = false;
 aEvent.State >>= bTemp;
 aBuffer.append(bTemp);
-
 }
 else if (aEvent.FeatureURL.Path == "CharFontName")
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-03 Thread Michael Stahl
 desktop/source/lib/lokinteractionhandler.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit d04cf314d44c0ae0cbb135d21436d119f936208c
Author: Michael Stahl 
Date:   Wed Feb 3 11:38:10 2016 +0100

libreofficekit: CppunitTest_libreofficekit_tiledrendering crashes

Need to check that a callback was actually set before calling it.

Change-Id: Icb2ca19aec0c74f6695d7286f046dadfe609d68c

diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index a4a60c2..e4c3ee5 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -115,9 +115,9 @@ void 
LOKInteractionHandler::postError(css::task::InteractionClassification class
 std::stringstream aStream;
 boost::property_tree::write_json(aStream, aTree);
 
-if (m_pLOKDocument)
+if (m_pLOKDocument && m_pLOKDocument->mpCallback)
 m_pLOKDocument->mpCallback(LOK_CALLBACK_ERROR, aStream.str().c_str(), 
m_pLOKDocument->mpCallbackData);
-else
+else if (m_pLOKit->mpCallback)
 m_pLOKit->mpCallback(LOK_CALLBACK_ERROR, aStream.str().c_str(), 
m_pLOKit->mpCallbackData);
 }
 
@@ -243,7 +243,8 @@ bool LOKInteractionHandler::handlePasswordRequest(const 
uno::Sequence>= passwordRequest))
 return false;
 
-if 
(m_pLOKit->hasOptionalFeature((passwordRequest.IsRequestPasswordToModify)
+if (m_pLOKit->mpCallback &&
+
m_pLOKit->hasOptionalFeature((passwordRequest.IsRequestPasswordToModify)
 ? LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY
 : LOK_FEATURE_DOCUMENT_PASSWORD))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-02 Thread Miklos Vajna
 desktop/source/lib/init.cxx   |   15 +++
 include/LibreOfficeKit/LibreOfficeKit.h   |2 ++
 include/LibreOfficeKit/LibreOfficeKit.hxx |   15 +++
 include/vcl/ITiledRenderable.hxx  |5 +
 sw/inc/unotxdoc.hxx   |2 ++
 sw/source/uibase/uno/unotxdoc.cxx |9 +
 6 files changed, 48 insertions(+)

New commits:
commit 1ae319aa81b7d42441886dd232256b0336308cf3
Author: Miklos Vajna 
Date:   Tue Feb 2 10:32:36 2016 +0100

LOK: add Document::setClientVisibleArea()

... and implement it in Writer.

Otherwise there is no way we can perform e.g. page down in an expected
way. Without this, the core visible area depends on the zoom in the
document, and the client visible area can be something entirely
different.

(cherry picked from commit bd8610ebafa9caf9f09a5aba9cca04c23691513d)

Conflicts:
libreofficekit/source/gtk/lokdocview.cxx
sw/inc/unotxdoc.hxx

Change-Id: Iadfb5a225da09a2551ffa41ddf503bb3d22b3eae

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5360309..0fbece0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -369,6 +369,7 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis,
 int nTilePixelHeight,
 int nTileTwipWidth,
 int nTileTwipHeight);
+static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, 
int nY, int nWidth, int nHeight);
 static int doc_createView(LibreOfficeKitDocument* pThis);
 static void doc_destroyView(LibreOfficeKitDocument* pThis, int nId);
 static void doc_setView(LibreOfficeKitDocument* pThis, int nId);
@@ -415,6 +416,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
resetSelection = doc_resetSelection;
 m_pDocumentClass->getCommandValues = doc_getCommandValues;
 m_pDocumentClass->setClientZoom = doc_setClientZoom;
+m_pDocumentClass->setClientVisibleArea = doc_setClientVisibleArea;
 
 m_pDocumentClass->createView = doc_createView;
 m_pDocumentClass->destroyView = doc_destroyView;
@@ -1543,6 +1545,19 @@ static void doc_setClientZoom(LibreOfficeKitDocument* 
pThis, int nTilePixelWidth
 pDoc->setClientZoom(nTilePixelWidth, nTilePixelHeight, nTileTwipWidth, 
nTileTwipHeight);
 }
 
+static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, 
int nY, int nWidth, int nHeight)
+{
+ITiledRenderable* pDoc = getTiledRenderable(pThis);
+if (!pDoc)
+{
+gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+return;
+}
+
+Rectangle aRectangle(Point(nX, nY), Size(nWidth, nHeight));
+pDoc->setClientVisibleArea(aRectangle);
+}
+
 static int doc_createView(LibreOfficeKitDocument* /*pThis*/)
 {
 SolarMutexGuard aGuard;
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index b3b61ba..4feaaf7 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -203,6 +203,8 @@ struct _LibreOfficeKitDocumentClass
 int nTilePixelHeight,
 int nTileTwipWidth,
 int nTileTwipHeight);
+/// @see lok::Document::setVisibleArea).
+void (*setClientVisibleArea) (LibreOfficeKitDocument* pThis, int nX, int 
nY, int nWidth, int nHeight);
 
 /// @see lok::Document::createView().
 int (*createView) (LibreOfficeKitDocument* pThis);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index df9e211..1f2311a 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -330,6 +330,21 @@ public:
 }
 
 /**
+ * Inform core about the currently visible area of the document on the
+ * client, so that it can perform e.g. page down (which depends on the
+ * visible height) in a sane way.
+ *
+ * @param nX - top left corner horizontal position
+ * @param nY - top left corner vertical position
+ * @param nWidth - area width
+ * @param nHeight - area height
+ */
+inline void setClientVisibleArea(int nX, int nY, int nWidth, int nHeight)
+{
+mpDoc->pClass->setClientVisibleArea(mpDoc, nX, nY, nWidth, nHeight);
+}
+
+/**
  * Create a new view for an existing document.
  * By default a loaded document has 1 view.
  * @return the ID of the new view.
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index e31fd70..34f5315 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -197,6 +197,11 @@ public:
int /*nTileTwipHeight*/)
 {
 }
+
+/// @see lok::Document::setClientVisibleArea().
+virtual void setClientVisibleArea(const 

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

2016-02-01 Thread Marco Cecchetti
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4dae4ed81b82ea3f5ae5f1097e5c75c3b1f0644e
Author: Marco Cecchetti 
Date:   Mon Feb 1 18:50:02 2016 +0100

lool - now the fill cursor type is mapped correctly

Change-Id: I6d89df49b9f740b7f8139493861f25a50dba

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ccb2e40..5360309 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -202,6 +202,7 @@ static const std::map  aPointerMap {
 { PointerStyle::Text, "text" },
 { PointerStyle::Help, "help" },
 { PointerStyle::Cross, "crosshair" },
+{ PointerStyle::Fill, "fill" },
 { PointerStyle::Move, "move" },
 { PointerStyle::NSize, "n-resize" },
 { PointerStyle::SSize, "s-resize" },
@@ -1156,7 +1157,6 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* 
pThis, int nType, int nX,
 pDoc->postMouseEvent(nType, nX, nY, nCount, nButtons, nModifier);
 
 Pointer aPointer = pDoc->getPointer();
-
 // We don't map all possible pointers hence we need a default
 OString aPointerString = "default";
 auto aIt = aPointerMap.find(aPointer.GetStyle());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-01-21 Thread Miklos Vajna
 desktop/source/lib/lokclipboard.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 11f71656025763073c2167bce0e86b727704990e
Author: Miklos Vajna 
Date:   Mon Oct 26 14:25:26 2015 +0100

gtktiledviwer: try to paste as html, then as plain text

This commit (as a side effect) fixes LOKTransferable::getTransferData()
to not assume that the string is null-terminated, so it makes sense to
backport it even without gtktiledviewer. Otherwise rtl_str_getLength()
will read memory up till it finds a 0 byte, so it might read
uninitialized memory -> garbage at the end of the string.

(cherry picked from commit 080bd44f0b0300075ff18d377f31deebbc4009ed)

Conflicts:
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx

Change-Id: I8e1c93fd36fb903c0625b29f9f73825438c9e113

diff --git a/desktop/source/lib/lokclipboard.cxx 
b/desktop/source/lib/lokclipboard.cxx
index 50d5705..376bcd7 100644
--- a/desktop/source/lib/lokclipboard.cxx
+++ b/desktop/source/lib/lokclipboard.cxx
@@ -43,7 +43,7 @@ throw(datatransfer::UnsupportedFlavorException, 
io::IOException, uno::RuntimeExc
 if (rFlavor.DataType == cppu::UnoType::get())
 {
 sal_Char* pText = reinterpret_cast(m_aSequence.getArray());
-aRet <<= OUString(pText, rtl_str_getLength(pText), 
RTL_TEXTENCODING_UTF8);
+aRet <<= OUString(pText, m_aSequence.getLength(), 
RTL_TEXTENCODING_UTF8);
 }
 else
 aRet <<= m_aSequence;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-01-19 Thread Miklos Vajna
 desktop/source/lib/init.cxx  |3 ++-
 sfx2/source/control/unoctitm.cxx |3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 3bdc59bcde10bb4cc676bf7ed13bab2738ad41dc
Author: Miklos Vajna 
Date:   Tue Jan 19 15:18:52 2016 +0100

LOK: include ModifiedStatus in CALLBACK_STATE_CHANGED

Change-Id: Ic44a9266a67bfad8b0490a8acb4a419af99ea42c
(cherry picked from commit abbfbb4d35d6fa9edbb8f331a9d9503183eb0356)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f8d37ef..cbce5cc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -692,7 +692,8 @@ static void doc_iniUnoCommands ()
 OUString(".uno:SuperScript"),
 OUString(".uno:Strikeout"),
 OUString(".uno:StyleApply"),
-OUString(".uno:Underline")
+OUString(".uno:Underline"),
+OUString(".uno:ModifiedStatus")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index ddc1596..a189a5f 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1079,7 +1079,8 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 aEvent.FeatureURL.Path == "SubScript" ||
 aEvent.FeatureURL.Path == "SuperScript" ||
 aEvent.FeatureURL.Path == "Strikeout" ||
-aEvent.FeatureURL.Path == "Underline")
+aEvent.FeatureURL.Path == "Underline" ||
+aEvent.FeatureURL.Path == "ModifiedStatus")
 {
 bool bTemp = false;
 aEvent.State >>= bTemp;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-12-18 Thread Mihai Varga
 desktop/source/lib/init.cxx  |3 +++
 sfx2/source/control/unoctitm.cxx |7 +--
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 3efce450f669417f14cee5610f1e9614f1315d0f
Author: Mihai Varga 
Date:   Fri Dec 18 16:55:25 2015 +0200

LOK: get feedback for all of the font/back color commands

Change-Id: Id4aac707666420752b985bcfd03b5b9bb99f79f1

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index efd5d10..f8d37ef 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -670,9 +670,12 @@ static void doc_iniUnoCommands ()
 OUString sUnoCommands[] =
 {
 OUString(".uno:BackColor"),
+OUString(".uno:BackgroundColor"),
 OUString(".uno:Bold"),
 OUString(".uno:CenterPara"),
+OUString(".uno:CharBackColor"),
 OUString(".uno:CharFontName"),
+OUString(".uno:Color"),
 OUString(".uno:DecrementIndent"),
 OUString(".uno:DefaultBullet"),
 OUString(".uno:DefaultNumbering"),
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index f0e9bc1..ddc1596 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1104,8 +1104,11 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 aEvent.State >>= aTemplate;
 aBuffer.append(aTemplate.StyleName);
 }
-else if (aEvent.FeatureURL.Path == "FontColor" ||
- aEvent.FeatureURL.Path == "BackColor")
+else if (aEvent.FeatureURL.Path == "BackColor" ||
+ aEvent.FeatureURL.Path == "BackgroundColor" ||
+ aEvent.FeatureURL.Path == "CharBackColor" ||
+ aEvent.FeatureURL.Path == "Color" ||
+ aEvent.FeatureURL.Path == "FontColor")
 {
 sal_Int32 nColor = -1;
 aEvent.State >>= nColor;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-12-13 Thread Andras Timar
 desktop/source/lib/init.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 6b4cffc4593f8137f1820069296e882df357fb51
Author: Andras Timar 
Date:   Sun Dec 13 19:50:54 2015 +0100

build fix

Change-Id: I4be6445ff49d04e9e2f4146b4f5536770249fb84

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 48881e1..efd5d10 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1573,7 +1573,7 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* 
/*pThis*/,
 if (!aSearchedFontName.equals(aFontName.toUtf8().getStr()))
 continue;
 
-VirtualDevice aDevice(nullptr, Size(1, 1), DeviceFormat::DEFAULT);
+VirtualDevice aDevice(nullptr, Size(1, 1), 0);
 ::Rectangle aRect;
 vcl::Font aFont(rInfo);
 aFont.SetSize(Size(0, 25));
@@ -1587,11 +1587,12 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* 
/*pThis*/,
 unsigned char* pBuffer = static_cast(malloc(4 * 
nFontWidth * nFontHeight));
 memset(pBuffer, 0, nFontWidth * nFontHeight * 4);
 boost::shared_array aBuffer(pBuffer, NoDelete< 
sal_uInt8 >());
+boost::shared_array aAlphaBuffer;
 
 aDevice.SetBackground(Wallpaper(COL_TRANSPARENT));
 aDevice.SetOutputSizePixelScaleOffsetAndBuffer(
 Size(nFontWidth, nFontHeight), Fraction(1.0), Point(),
-aBuffer, nullptr);
+aBuffer, aAlphaBuffer);
 aDevice.DrawText(Point(0,0), aFontName);
 
 return pBuffer;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-12-06 Thread Andras Timar
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7ccb4d356de521a4158e680cfb2a77102a78819b
Author: Andras Timar 
Date:   Sun Dec 6 14:25:56 2015 +0100

Revert "LOK_DEBUG=1 light red square transparency"

It does not work this way, VCL does not support true ARGB
output devices.

This reverts commit 79f97ee0135f632431531a07c71d07cd93c9e346.

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 620060c..d3fc402 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -950,7 +950,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
 Rectangle aRect(0, 0, 5, 5);
 aRect = pDevice->PixelToLogic(aRect);
 pDevice->Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR);
-pDevice->SetFillColor(TRGB_COLORDATA(0xC0,0xFF,0x00,0x00));
+pDevice->SetFillColor(COL_LIGHTRED);
 pDevice->SetLineColor();
 pDevice->DrawRect(aRect);
 pDevice->Pop();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-12-03 Thread Andras Timar
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 79f97ee0135f632431531a07c71d07cd93c9e346
Author: Andras Timar 
Date:   Thu Dec 3 12:41:59 2015 +0100

LOK_DEBUG=1 light red square transparency

Change-Id: I9782e9012abcde33994a9dde13703885f2ab4d42

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d3fc402..620060c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -950,7 +950,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
 Rectangle aRect(0, 0, 5, 5);
 aRect = pDevice->PixelToLogic(aRect);
 pDevice->Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR);
-pDevice->SetFillColor(COL_LIGHTRED);
+pDevice->SetFillColor(TRGB_COLORDATA(0xC0,0xFF,0x00,0x00));
 pDevice->SetLineColor();
 pDevice->DrawRect(aRect);
 pDevice->Pop();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-11-23 Thread Miklos Vajna
 desktop/source/lib/init.cxx  |7 +++
 include/LibreOfficeKit/LibreOfficeKit.h  |3 +++
 include/LibreOfficeKit/LibreOfficeKit.hxx|   10 ++
 include/LibreOfficeKit/LibreOfficeKitEnums.h |7 +++
 4 files changed, 27 insertions(+)

New commits:
commit 0cf8aa992cfec36afea1668f3f9297def03ad43e
Author: Miklos Vajna 
Date:   Mon Nov 23 09:32:37 2015 +0100

LOK: add Document::getTileMode()

So that clients can know if they get old-style RGBA or new-style ARGB
output in paintTile().

Change-Id: Icfde4b3259444b3524e64478ccd976664a3fe0ed
(cherry picked from commit fc06f801ee79fd49d54c27121ae9b2904d99f09c)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 26a64d9..d3fc402 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -321,6 +321,7 @@ voiddoc_paintTile(LibreOfficeKitDocument* pThis,
   const int nCanvasWidth, const int nCanvasHeight,
   const int nTilePosX, const int nTilePosY,
   const int nTileWidth, const int nTileHeight);
+static int doc_getTileMode(LibreOfficeKitDocument* pThis);
 static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
 long* pWidth,
 long* pHeight);
@@ -394,6 +395,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
getPartName = doc_getPartName;
 m_pDocumentClass->setPartMode = doc_setPartMode;
 m_pDocumentClass->paintTile = doc_paintTile;
+m_pDocumentClass->getTileMode = doc_getTileMode;
 m_pDocumentClass->getDocumentSize = doc_getDocumentSize;
 m_pDocumentClass->initializeForRendering = doc_initializeForRendering;
 m_pDocumentClass->registerCallback = doc_registerCallback;
@@ -965,6 +967,11 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
 #endif
 }
 
+static int doc_getTileMode(LibreOfficeKitDocument* /*pThis*/)
+{
+return LOK_TILEMODE_RGBA;
+}
+
 static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
 long* pWidth,
 long* pHeight)
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 93f7dca..5189cca 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -118,6 +118,9 @@ struct _LibreOfficeKitDocumentClass
const int nTileWidth,
const int nTileHeight);
 
+/// @see lok::Document::getTileMode().
+int (*getTileMode) (LibreOfficeKitDocument* pThis);
+
 /// @see lok::Document::getDocumentSize().
 void (*getDocumentSize) (LibreOfficeKitDocument* pThis,
  long* pWidth,
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 0eeb5be..f907f70 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -140,6 +140,16 @@ public:
 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
 }
 
+/**
+ * Gets the tile mode: the pixel format used for the pBuffer of 
paintTile().
+ *
+ * @return an element of the LibreOfficeKitTileMode enum.
+ */
+inline int getTileMode()
+{
+return mpDoc->pClass->getTileMode(mpDoc);
+}
+
 /// Get the document sizes in TWIPs.
 inline void getDocumentSize(long* pWidth, long* pHeight)
 {
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 7b23fcb..b713f0e 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -35,6 +35,13 @@ LibreOfficeKitPartMode;
 
 typedef enum
 {
+LOK_TILEMODE_RGBA,
+LOK_TILEMODE_ARGB
+}
+LibreOfficeKitTileMode;
+
+typedef enum
+{
 /**
  * Any tiles which are over the rectangle described in the payload are no
  * longer valid.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-11-10 Thread Jan Holesovsky
 desktop/source/app/app.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7788175562494b0a907c87c1238bb3703bed2598
Author: Jan Holesovsky 
Date:   Tue Nov 10 12:42:47 2015 +0100

desktop: Make the --writer/--calc/--impress command line options work again.

Change-Id: I977d1fbedb1b784cb95273184ec5e5a7fa156eef

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 5042752..f204d20b 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -2272,7 +2272,7 @@ void Desktop::OpenClients()
 SAL_WARN( "desktop.app", "Error during recovery" << e.Message);
 }
 }
-else if (bExistsRecoveryData && bDisableRecovery)
+else if (bExistsRecoveryData && bDisableRecovery && 
!rArgs.HasModuleParam())
 // prevent new Writer doc
 bRecovery = true;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-10-29 Thread Mihai Varga
 desktop/source/lib/init.cxx  |4 +++-
 sfx2/source/control/unoctitm.cxx |7 +++
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 3d2b18294495a83b2b60764ee84595d6df74c6c5
Author: Mihai Varga 
Date:   Thu Oct 29 16:28:37 2015 +0200

LOK: font/back color feedback

This is used to know the current font/back color

Change-Id: Ic524fcb5c26e1c15ec9c50b2879465152ac8ee34

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 525ea43..2217992 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -575,7 +575,9 @@ static void doc_iniUnoCommands ()
 OUString(".uno:DecrementIndent"),
 OUString(".uno:CharFontName"),
 OUString(".uno:FontHeight"),
-OUString(".uno:StyleApply")
+OUString(".uno:StyleApply"),
+OUString(".uno:FontColor"),
+OUString(".uno:BackColor")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index bb5d672..843e93d 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1100,6 +1100,13 @@ void 
SfxDispatchController_Impl::InterceptLOKStateChangeEvent(const SfxObjectShe
 aEvent.State >>= aTemplate;
 aBuffer.append(aTemplate.StyleName);
 }
+else if (aEvent.FeatureURL.Path == "FontColor" ||
+ aEvent.FeatureURL.Path == "BackColor")
+{
+long nColor;
+aEvent.State >>= nColor;
+aBuffer.append(nColor);
+}
 else
 {
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-01 Thread Henry Castro
 desktop/source/lib/init.cxx |   21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

New commits:
commit 5032455fe1ecdca9ee6eb96b5d539a66733bfb9e
Author: Henry Castro 
Date:   Tue Sep 1 22:06:09 2015 -0400

lok: rework use preInitBootstrap

Change-Id: Ifdba1eaf4cec448fe3284015c36ea7fd1b3440b0

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 32f0aac..9e1f1b4 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -894,7 +894,7 @@ static void aBasicErrorFunc(const OUString& rError, const 
OUString& rAction)
 fprintf(stderr, "Unexpected basic error dialog '%s'\n", aBuffer.getStr());
 }
 
-static bool initialize_uno(const OUString& aAppProgramURL)
+static bool initialize_uno(const OUString& aAppProgramURL, bool bPreInit)
 {
 #ifdef IOS
 // For iOS we already hardocde the inifile as "rc" in the .app directory.
@@ -903,6 +903,13 @@ static bool initialize_uno(const OUString& aAppProgramURL)
 rtl::Bootstrap::setIniFilename(aAppProgramURL + "/" 
SAL_CONFIGFILE("soffice"));
 #endif
 
+if (bPreInit)
+{
+// pre-load all component libraries.
+cppu::preInitBootstrap();
+return true;
+}
+
 xContext = cppu::defaultBootstrap_InitialComponentContext();
 if (!xContext.is())
 {
@@ -966,11 +973,6 @@ static void lo_status_indicator_callback(void *data, 
comphelper::LibreOfficeKit:
 }
 }
 
-/// pre-load all C++ component factories and leak references to them.
-static void forceLoadAllNativeComponents()
-{
-}
-
 /// pre-load and parse all filter XML
 static void forceLoadFilterXML()
 {
@@ -1032,9 +1034,11 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 {
 SAL_INFO("lok", "Attempting to initalize UNO");
 
-if (!initialize_uno(aAppURL))
+if (!initialize_uno(aAppURL, (eStage == PRE_INIT)))
 return false;
-force_c_locale();
+
+if (eStage != PRE_INIT)
+force_c_locale();
 
 // Force headless -- this is only for bitmap rendering.
 rtl::Bootstrap::set("SAL_USE_VCLPLUGIN", "svp");
@@ -1049,7 +1053,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 
 if (eStage == PRE_INIT)
 {
-forceLoadAllNativeComponents();
 forceLoadFilterXML();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-01 Thread Henry Castro
 desktop/source/lib/init.cxx |   40 
 1 file changed, 12 insertions(+), 28 deletions(-)

New commits:
commit 1bea5bf90187f0dac06d0c438b96def4bcd746f8
Author: Henry Castro 
Date:   Tue Sep 1 20:10:09 2015 -0400

Revert lok: use preInitBootstrap

Change-Id: I4030781b76ba4954174b3fab2ffb8e8e93a02bcd

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f448a30..32f0aac 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -966,6 +966,11 @@ static void lo_status_indicator_callback(void *data, 
comphelper::LibreOfficeKit:
 }
 }
 
+/// pre-load all C++ component factories and leak references to them.
+static void forceLoadAllNativeComponents()
+{
+}
+
 /// pre-load and parse all filter XML
 static void forceLoadFilterXML()
 {
@@ -1042,6 +1047,12 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 Application::EnableHeadlessMode(true);
 }
 
+if (eStage == PRE_INIT)
+{
+forceLoadAllNativeComponents();
+forceLoadFilterXML();
+}
+
 // This is horrible crack. I really would want to go back to simply 
just call
 // InitVCL() here. The OfficeIPCThread thing is just horrible.
 
@@ -1125,34 +1136,7 @@ LibreOfficeKit *libreofficekit_hook(const char* 
install_path)
 SAL_JNI_EXPORT
 int lok_preinit(const char* install_path, const char* user_profile_path)
 {
-rtl::Bootstrap::set(OUString("UserInstallation"), 
OUString(user_profile_path, strlen(user_profile_path), RTL_TEXTENCODING_UTF8));
-
-OUString aAppPath;
-if (install_path)
-{
-aAppPath = OUString(install_path, strlen(install_path), 
RTL_TEXTENCODING_UTF8);
-}
-else
-{
-// Fun conversion dance back and forth between URLs and system paths...
-OUString aAppURL;
-::osl::Module::getUrlFromAddress( reinterpret_cast< oslGenericFunction 
>(lo_initialize),
-  aAppURL);
-osl::FileBase::getSystemPathFromFileURL( aAppURL, aAppPath );
-}
-
-OUString aAppURL;
-if (osl::FileBase::getFileURLFromSystemPath(aAppPath, aAppURL) != 
osl::FileBase::E_None)
-return -1;
-
-
-rtl::Bootstrap::setIniFilename(aAppURL + "/" SAL_CONFIGFILE("soffice"));
-
-// pre-load all C++ component factories and leak references to them.
-cppu::preInitBootstrap();
-forceLoadFilterXML();
-
-return 0;
+return lo_initialize(NULL, install_path, user_profile_path);
 }
 
 static void lo_destroy(LibreOfficeKit* pThis)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-31 Thread Henry Castro
 desktop/source/lib/init.cxx |  159 +++-
 1 file changed, 28 insertions(+), 131 deletions(-)

New commits:
commit 718815a1a5d4f12e9d259bf4c605cc9ed89c625f
Author: Henry Castro 
Date:   Mon Aug 31 23:43:47 2015 -0400

lok: use preInitBootstrap

Change-Id: I0e3d7340f664e7d34ae3161d57430250933d6ff1

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3bc5824..f448a30 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -57,7 +57,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -967,128 +966,6 @@ static void lo_status_indicator_callback(void *data, 
comphelper::LibreOfficeKit:
 }
 }
 
-static void loadSharedLibrary(const OUString & aUriRdb)
-{
-int nsId;
-int nUcNsId;
-
-OUString sAttrUri;
-OUString sAttrLoader;
-
-xmlreader::Span aName;
-xmlreader::XmlReader::Result aItem = xmlreader::XmlReader::RESULT_BEGIN;
-
-xmlreader::XmlReader aRdbReader(aUriRdb);
-nUcNsId = 
aRdbReader.registerNamespaceIri(xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("http://openoffice.org/2010/uno-components;)));
-
-while( aItem != xmlreader::XmlReader::RESULT_DONE )
-{
-aItem = aRdbReader.nextItem(xmlreader::XmlReader::TEXT_NONE, , 
 );
-if (nsId == nUcNsId &&
-aName.equals(RTL_CONSTASCII_STRINGPARAM("component")))
-{
-sAttrLoader = OUString();
-sAttrUri = OUString();
-
-while (aRdbReader.nextAttribute(, ))
-{
-if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
-aName.equals(RTL_CONSTASCII_STRINGPARAM("loader")))
-sAttrLoader = 
aRdbReader.getAttributeValue(false).convertFromUtf8();
-else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
-aName.equals(RTL_CONSTASCII_STRINGPARAM("uri")))
-sAttrUri = 
aRdbReader.getAttributeValue(false).convertFromUtf8();
-}
-
-try
-{
-sAttrUri = cppu::bootstrap_expandUri(sAttrUri);
-}
-catch(css::lang::IllegalArgumentException)
-{
-fprintf(stderr, "Cannot expand URI '%s'\n",
-OUStringToOString(sAttrUri, 
RTL_TEXTENCODING_UTF8).getStr());
-}
-
-if (sAttrLoader == "com.sun.star.loader.SharedLibrary")
-{
-oslModule aModule = osl_loadModule( sAttrUri.pData, 
SAL_LOADMODULE_NOW | SAL_LOADMODULE_GLOBAL );
-SAL_INFO("lok", "loaded component library " << sAttrUri << ( 
aModule ? " ok" : " no"));
-
-// leak aModule
-// osl_unloadModule(aModule);
-aModule = 0;
-}
-}
-}
-}
-
-/// pre-load all C++ component factories and leak references to them.
-static void forceLoadAllNativeComponents(const OUString & aAppURL)
-{
-sal_Int32 nIndex = 0;
-
-rtl::Bootstrap bs(aAppURL + "/" + SAL_CONFIGFILE("uno"));
-if (bs.getHandle() == 0)
-{
-fprintf(stderr, "Cannot open uno ini '%s'\n",
- OUStringToOString(aAppURL + "/" + SAL_CONFIGFILE("uno"), 
RTL_TEXTENCODING_UTF8).getStr());
-return;
-}
-
-OUString aRdbFiles;
-if (!bs.getFrom("UNO_SERVICES", aRdbFiles))
-{
-fprintf(stderr, "Cannot obtain UNO_SERVICES from uno ini\n");
-return;
-}
-
-while (nIndex != -1)
-{
-OUString aUriRdb(aRdbFiles.getToken(0, ' ', nIndex));
-
-if (aUriRdb.isEmpty())
-continue;
-
-if (aUriRdb[0] == '?')
-aUriRdb = aUriRdb.copy(1);
-
-if (aUriRdb.startsWith("<") && aUriRdb.endsWith(">*"))
-{
-aUriRdb = aUriRdb.copy(1, aUriRdb.getLength() - 3);
-osl::Directory aDir(aUriRdb);
-
-if ( aDir.open() == osl::FileBase::E_None )
-{
-while(true)
-{
-osl::DirectoryItem aDirItem;
-
-if ( aDir.getNextItem(aDirItem, SAL_MAX_UINT32) != 
osl::FileBase::E_None)
-break;
-
-osl::FileStatus stat(osl_FileStatus_Mask_Type |
- osl_FileStatus_Mask_FileName |
- osl_FileStatus_Mask_FileURL);
-
-if (aDirItem.getFileStatus(stat) == osl::FileBase::E_None)
-loadSharedLibrary(stat.getFileURL());
-}
-}
-else
-{
-fprintf(stderr, "Cannot open directory '%s'\n",
-OUStringToOString(aUriRdb, 
RTL_TEXTENCODING_UTF8).getStr());
-}
-
-}
-else
-{
-loadSharedLibrary(aUriRdb);
-}
-}
-}
-
 /// pre-load and parse all filter XML
 static void forceLoadFilterXML()
 {
@@ -1165,12 +1042,6 

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

2015-08-18 Thread Michael Meeks
 desktop/source/lib/init.cxx |   28 +---
 1 file changed, 5 insertions(+), 23 deletions(-)

New commits:
commit 4a3484af6d6b259d4a5b0fa93c7d83ece6f175b7
Author: Michael Meeks michael.me...@collabora.com
Date:   Tue Aug 18 10:58:01 2015 +0100

Cleanup symbol export conditionals.

Change-Id: Ic25500637f1748bf117bafd7483d589729a2e658

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a33922f..88a2f06 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1063,19 +1063,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 return bInitialized;
 }
 
-// Undo our clever trick of having SAL_DLLPUBLIC_EXPORT actually not
-// meaning what is says in for the DISABLE_DYNLOADING case. See
-// sal/types.h. Normally, when building just one big dylib (Android)
-// or executable (iOS), most of our public symbols don't need to be
-// visible outside that resulting dylib/executable. But
-// libreofficekit_hook must be exported for dlsym() to find it,
-// though, at least on iOS.
-
-#if defined(__GNUC__)  defined(HAVE_GCC_VISIBILITY_FEATURE)  
defined(DISABLE_DYNLOADING)
-__attribute__ ((visibility(default)))
-#else
-SAL_DLLPUBLIC_EXPORT
-#endif
+// SAL_JNI_EXPORT to handle DISABLE_DYNLOADING case.
+
+SAL_JNI_EXPORT
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* 
user_profile_path)
 {
 if (!gImpl)
@@ -1091,21 +1081,13 @@ LibreOfficeKit *libreofficekit_hook_2(const char* 
install_path, const char* user
 return static_castLibreOfficeKit*(gImpl);
 }
 
-#if defined(__GNUC__)  defined(HAVE_GCC_VISIBILITY_FEATURE)  
defined(DISABLE_DYNLOADING)
-__attribute__ ((visibility(default)))
-#else
-SAL_DLLPUBLIC_EXPORT
-#endif
+SAL_JNI_EXPORT
 LibreOfficeKit *libreofficekit_hook(const char* install_path)
 {
 return libreofficekit_hook_2(install_path, NULL);
 }
 
-#if defined(__GNUC__)  defined(HAVE_GCC_VISIBILITY_FEATURE)  
defined(DISABLE_DYNLOADING)
-__attribute__ ((visibility(default)))
-#else
-SAL_DLLPUBLIC_EXPORT
-#endif
+SAL_JNI_EXPORT
 int lok_preinit()
 {
 SAL_INFO(lok, Hello World);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-17 Thread Henry Castro
 desktop/source/lib/init.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 3b569f60259e81019b837c23b0327d997c26bc0c
Author: Henry Castro hcas...@collabora.com
Date:   Mon Aug 17 22:17:13 2015 -0400

LOK: add lok_preinit symbol

Change-Id: I9f23a6077046809083e254d4c79590b67b071fb3

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 48727d3..a33922f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1101,6 +1101,17 @@ LibreOfficeKit *libreofficekit_hook(const char* 
install_path)
 return libreofficekit_hook_2(install_path, NULL);
 }
 
+#if defined(__GNUC__)  defined(HAVE_GCC_VISIBILITY_FEATURE)  
defined(DISABLE_DYNLOADING)
+__attribute__ ((visibility(default)))
+#else
+SAL_DLLPUBLIC_EXPORT
+#endif
+int lok_preinit()
+{
+SAL_INFO(lok, Hello World);
+return 0;
+}
+
 static void lo_destroy(LibreOfficeKit* pThis)
 {
 LibLibreOffice_Impl* pLib = static_castLibLibreOffice_Impl*(pThis);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-03 Thread Jan Holesovsky
 desktop/source/lib/init.cxx |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 3e75aa0f9275df05afdf1de3c00c51944245fe2c
Author: Jan Holesovsky ke...@collabora.com
Date:   Fri Jul 3 18:14:31 2015 +0200

LOK: Don't try to absolutize URL's.

Change-Id: Ia7aca20feb8f6095adf7dfe510ed78b1e9882740

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0299431..1457e0f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -161,13 +161,18 @@ static OUString getUString(const char* pString)
 return OStringToOUString(sString, RTL_TEXTENCODING_UTF8);
 }
 
-// Try to convert a relative URL to an absolute one
+/// Try to convert a relative URL to an absolute one, unless it already looks 
like an URL.
 static OUString getAbsoluteURL(const char* pURL)
 {
-OUString aURL( getUString( pURL ) );
+OUString aURL(getUString(pURL));
+
+// return unchanged if it likely is an URL already
+if (aURL.indexOf(://)  0)
+return aURL;
+
 OUString sAbsoluteDocUrl, sWorkingDir, sDocPathUrl;
 
-// FIXME: this would appear to kill non-file URLs.
+// convert relative paths to absolute ones
 osl_getProcessWorkingDir(sWorkingDir.pData);
 osl::FileBase::getFileURLFromSystemPath( aURL, sDocPathUrl );
 osl::FileBase::getAbsoluteFileURL(sWorkingDir, sDocPathUrl, 
sAbsoluteDocUrl);
@@ -343,7 +348,7 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
 
 SolarMutexGuard aGuard;
 
-OUString aURL = getAbsoluteURL(pURL);
+OUString aURL(getAbsoluteURL(pURL));
 
 pLib-maLastExceptionMsg.clear();
 
@@ -409,7 +414,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const 
char* sUrl, const cha
 LibLODocument_Impl* pDocument = static_castLibLODocument_Impl*(pThis);
 
 OUString sFormat = getUString(pFormat);
-OUString aURL = getAbsoluteURL(sUrl);
+OUString aURL(getAbsoluteURL(sUrl));
 
 try
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits