[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 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 3c9e5743bcad46d6a63906bdac7cc335d37039ee
Author: Tomaž Vajngerl 
AuthorDate: Wed Aug 14 18:08:18 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 15 09:45:03 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/77484
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f3f3fd0f6f49..884e0d6fd9dd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -363,9 +363,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 ddcb9003853d..2746e1c56a57 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -665,6 +665,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 c725951cf118..2e14517ad272 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -550,6 +550,9 @@
 #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 b3ed3911ac36..d422205b5d9c 100644
--- 

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

2019-07-07 Thread Tomaž Vajngerl (via logerrit)
 desktop/source/lib/init.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 56edc43f2e7e3f560d2ba1873441222942bd2bf7
Author: Tomaž Vajngerl 
AuthorDate: Tue Jul 2 14:48:31 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jul 8 02:01:07 2019 +0200

tdf#125655 disbale quick edit mode for iOS and Android

When clicking (tapping) on text in text based objects (shape with
text or a text frame), it automatically enters editing mode,
which is not a desired behaviour in a touch based environment.
This behaviour comes from a quick edit mode, which is enabled by
default on the desktop. For Andorid and iOS this is now disabled
when LOK is initialized.
For online this change might also make sense (if the user would
use a mobile device), however this is not implemented now as this
would require more than just changing the global configuration,
as it needs to behave differently depending on the view/user.

Change-Id: Ib4a71cba0aeb4238a5d5b708801a07b39fb5f316
Reviewed-on: https://gerrit.libreoffice.org/74986
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 7d32994ad9dc45c7846664ec5ccb03bb796bb071)
Reviewed-on: https://gerrit.libreoffice.org/74987
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6abda3e775a5..f3f3fd0f6f49 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -155,6 +155,7 @@
 
 #include "lokinteractionhandler.hxx"
 #include "lokclipboard.hxx"
+#include 
 
 using namespace css;
 using namespace vcl;
@@ -5264,6 +5265,16 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 rtl_alloc_preInit(rtlAllocPostInit);
 }
 
+// Turn off quick editing on IOS and ANDROID
+#if defined IOS || defined ANDROID
+if (officecfg::Office::Impress::Misc::TextObject::QuickEditing::get())
+{
+std::shared_ptr 
batch(comphelper::ConfigurationChanges::create());
+officecfg::Office::Impress::Misc::TextObject::QuickEditing::set(false, 
batch);
+batch->commit();
+}
+#endif
+
 return bInitialized;
 }
 
___
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.0' - 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 b90733fceb9d831a2c796f8ce6b3fffc309f4153
Author: Miklos Vajna 
AuthorDate: Thu Jul 4 11:57:27 2019 +0200
Commit: Michael Meeks 
CommitDate: Thu Jul 4 13:03:00 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).

Conflicts:
vcl/source/filter/graphicfilter.cxx

Change-Id: Ib095191ee690d9da6269878a82b1c6995df50dfa
Reviewed-on: https://gerrit.libreoffice.org/75078
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8cfa28881d90..6abda3e775a5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5171,6 +5171,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 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 d84ae3f0a9fa..bb4584e4bf8a 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -304,6 +304,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 bef80fb94b24..7448826a8a33 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -66,6 +66,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -1441,6 +1443,30 @@ void GraphicFilter::ImportGraphics(std::vector< 
std::shared_ptr >& rGra
 }
 }
 
+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.0' - desktop/source

2019-06-16 Thread Jan Holesovsky (via logerrit)
 desktop/source/lib/init.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 38f614746318913305fcce5a678d9cd26e52013c
Author: Jan Holesovsky 
AuthorDate: Fri Jun 14 18:38:51 2019 +0200
Commit: Jan Holesovsky 
CommitDate: Mon Jun 17 07:00:33 2019 +0200

android: Unregistering in runLoop() is important even on Android.

Otherwise we get crashes in online Kit when attempting to shutdown
reasonably cleanly and the poll kicks in.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 4ab1f67d7e68..8cfa28881d90 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4825,7 +4825,7 @@ static void lo_runLoop(LibreOfficeKit* /*pThis*/,
LibreOfficeKitWakeCallback pWakeCallback,
void* pData)
 {
-#ifdef IOS // Maybe ANDROID, too?
+#if defined(IOS) || defined(ANDROID)
 Application::GetSolarMutex().acquire();
 #endif
 
@@ -4836,7 +4836,7 @@ static void lo_runLoop(LibreOfficeKit* /*pThis*/,
 Application::UpdateMainThread();
 soffice_main();
 }
-#ifdef IOS // ANDROID, too?
+#if defined(IOS) || defined(ANDROID)
 vcl::lok::unregisterPollCallbacks();
 Application::ReleaseSolarMutex();
 #endif
___
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.0' - desktop/source include/test include/vcl sc/inc sc/qa sc/source sd/qa sd/source sw/inc sw/qa sw/source test/Library_test.mk test/sourc

2019-06-07 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx|   96 +++--
 include/test/helper/transferable.hxx   |   30 +++
 include/vcl/ITiledRenderable.hxx   |7 -
 sc/inc/docuno.hxx  |4 -
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   18 ++--
 sc/source/ui/unoobj/docuno.cxx |   61 ---
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |   12 +--
 sd/source/ui/inc/ViewShell.hxx |4 -
 sd/source/ui/inc/unomodel.hxx  |4 -
 sd/source/ui/unoidl/unomodel.cxx   |6 -
 sd/source/ui/view/viewshel.cxx |   53 +
 sw/inc/unotxdoc.hxx|4 -
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   10 +-
 sw/source/uibase/uno/unotxdoc.cxx  |   47 
 test/Library_test.mk   |1 
 test/source/helper/transferable.cxx|   87 ++
 16 files changed, 247 insertions(+), 197 deletions(-)

New commits:
commit 6804b001d4255a38f680182099c6d23d7e53a976
Author: Michael Meeks 
AuthorDate: Thu Jun 6 22:20:33 2019 +0100
Commit: Michael Meeks 
CommitDate: Fri Jun 7 12:44:44 2019 +0100

lok: re-factor getTextSelection.

Change-Id: I2c27c213ee980e19d6020e9599b2b72115e7f28e

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2bafd7dc62e4..4ab1f67d7e68 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -76,6 +76,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3366,6 +3367,71 @@ static void doc_setTextSelection(LibreOfficeKitDocument* 
pThis, int nType, int n
 pDoc->setTextSelection(nType, nX, nY);
 }
 
+static bool getFromTransferrable(
+const css::uno::Reference ,
+const char *pMimeType, OString )
+{
+// Take care of UTF-8 text here.
+OString aMimeType(pMimeType);
+bool bConvert = false;
+sal_Int32 nIndex = 0;
+if (aMimeType.getToken(0, ';', nIndex) == "text/plain")
+{
+if (aMimeType.getToken(0, ';', nIndex) == "charset=utf-8")
+{
+aMimeType = "text/plain;charset=utf-16";
+bConvert = true;
+}
+}
+
+datatransfer::DataFlavor aFlavor;
+aFlavor.MimeType = OUString::fromUtf8(aMimeType.getStr());
+if (aMimeType == "text/plain;charset=utf-16")
+aFlavor.DataType = cppu::UnoType::get();
+else
+aFlavor.DataType = cppu::UnoType< uno::Sequence >::get();
+
+if (!xTransferable->isDataFlavorSupported(aFlavor))
+{
+SetLastExceptionMsg("Flavor " + aFlavor.MimeType + " is not 
supported");
+return false;
+}
+
+uno::Any aAny;
+try
+{
+aAny = xTransferable->getTransferData(aFlavor);
+}
+catch (const css::datatransfer::UnsupportedFlavorException& e)
+{
+SetLastExceptionMsg("Unsupported flavor " + aFlavor.MimeType + " 
exception " + e.Message);
+return false;
+}
+catch (const css::uno::Exception& e)
+{
+SetLastExceptionMsg("Exception getting " + aFlavor.MimeType + " 
exception " + e.Message);
+return false;
+}
+
+if (aFlavor.DataType == cppu::UnoType::get())
+{
+OUString aString;
+aAny >>= aString;
+if (bConvert)
+aRet = OUStringToOString(aString, RTL_TEXTENCODING_UTF8);
+else
+aRet = OString(reinterpret_cast(aString.getStr()), aString.getLength() * sizeof(sal_Unicode));
+}
+else
+{
+uno::Sequence aSequence;
+aAny >>= aSequence;
+aRet = OString(reinterpret_cast(aSequence.getArray()), 
aSequence.getLength());
+}
+
+return true;;
+}
+
 static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* 
pMimeType, char** pUsedMimeType)
 {
 comphelper::ProfileZone aZone("doc_getTextSelection");
@@ -3380,18 +3446,34 @@ static char* 
doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMi
 return nullptr;
 }
 
-OString aUsedMimeType;
-OString aRet = pDoc->getTextSelection(pMimeType, aUsedMimeType);
-if (aUsedMimeType.isEmpty())
-aRet = pDoc->getTextSelection("text/plain;charset=utf-8", 
aUsedMimeType);
+css::uno::Reference xTransferable = 
pDoc->getSelection();
+if (!xTransferable)
+{
+SetLastExceptionMsg("No selection available");
+return nullptr;
+}
+
+const char *pType = pMimeType;
+if (!pType || pType[0] == '\0')
+pType = "text/plain;charset=utf-8";
+
+OString aRet;
+bool bSuccess = getFromTransferrable(xTransferable, pType, aRet);
+if (!bSuccess)
+return nullptr;
 
 char* pMemory = static_cast(malloc(aRet.getLength() + 1));
 strcpy(pMemory, aRet.getStr());
 
-if (pUsedMimeType)
+if (pUsedMimeType) // legacy
 {
-*pUsedMimeType = static_cast(malloc(aUsedMimeType.getLength() + 
1));
-

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

2019-06-03 Thread Tomaž Vajngerl (via logerrit)
 desktop/source/lib/init.cxx |   71 +++-
 1 file changed, 44 insertions(+), 27 deletions(-)

New commits:
commit b85aa20fc2d5037dcbcd687673f194167405b671
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 3 12:50:47 2019 +0900
Commit: Tor Lillqvist 
CommitDate: Mon Jun 3 13:38:01 2019 +0200

LOK: Factor out iOS painting code

Change-Id: Ica706842003fe60ba864e013614eb535580446bb
Reviewed-on: https://gerrit.libreoffice.org/73365
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bd17b54eea8d..2342d6a8f10a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1673,6 +1673,45 @@ ITiledRenderable* 
getTiledRenderable(LibreOfficeKitDocument* pThis)
 return dynamic_cast(pDocument->mxComponent.get());
 }
 
+#ifdef IOS
+void paintTileToCGContext(ITiledRenderable* pDocument,
+  void* rCGContext, const Size nCanvasSize,
+  const int nTilePosX, const int nTilePosY,
+  const int nTileWidth, const int nTileHeight)
+{
+SystemGraphicsData aData;
+aData.rCGContext = reinterpret_cast(rCGContext);
+
+ScopedVclPtrInstance pDevice(, Size(1, 1), 
DeviceFormat::DEFAULT);
+pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+pDevice->SetOutputSizePixel(nCanvasSize);
+pDocument->paintTile(*pDevice.get(), nCanvasSize.Width(), 
nCanvasSize.Height(),
+nTilePosX, nTilePosY, nTileWidth, nTileHeight);
+}
+
+void paintTileIOS(LibreOfficeKitDocument* pThis,
+ unsigned char* pBuffer,
+ const int nCanvasWidth, const int nCanvasHeight, const double 
fDPIScale,
+ const int nTilePosX, const int nTilePosY,
+ const int nTileWidth, const int nTileHeight)
+{
+CGContextRef pCGContext = CGBitmapContextCreate(pBuffer, nCanvasWidth, 
nCanvasHeight, 8,
+nCanvasWidth * 4, 
CGColorSpaceCreateDeviceRGB(),
+
kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little);
+
+// Use the vcl.cg tag even if this code is not in vcl, to match all other 
SAL_INFO logging about Core Graphics, in vcl.
+SAL_INFO("vcl.cg", "CGBitmapContextCreate(" << nCanvasWidth << "x" << 
nCanvasHeight << "x32) = " << pCGContext);
+
+CGContextTranslateCTM(pCGContext, 0, nCanvasHeight);
+CGContextScaleCTM(pCGContext, fDPIScale, -fDPIScale);
+
+doc_paintTileToCGContext(pThis, (void*) pCGContext, nCanvasWidth, 
nCanvasHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight);
+
+SAL_INFO("vcl.cg", "CGContextRelease(" << pCGContext << ")");
+CGContextRelease(pCGContext);
+}
+#endif
+
 } // anonymous namespace
 
 // Wonder global state ...
@@ -2548,7 +2587,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 // what Calc's internal scaling would do - because that one is trying to
 // fit the lines between cells to integer multiples of pixels.
 comphelper::ScopeGuard dpiScaleGuard([]() { 
comphelper::LibreOfficeKit::setDPIScale(1.0); });
-double fDPIScaleX = 1;
+double fDPIScaleX = 1.0;
 if (doc_getDocumentType(pThis) == LOK_DOCTYPE_SPREADSHEET)
 {
 fDPIScaleX = (nCanvasWidth * 3840.0) / (256.0 * nTileWidth);
@@ -2559,18 +2598,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 #if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS)
 
 #if defined(IOS)
-CGContextRef cgc = CGBitmapContextCreate(pBuffer, nCanvasWidth, 
nCanvasHeight, 8, nCanvasWidth*4, CGColorSpaceCreateDeviceRGB(), 
kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little);
-
-// Use the vcl.cg tag even if this code is not in vcl, to match all other 
SAL_INFO logging about Core Graphics, in vcl.
-SAL_INFO( "vcl.cg", "CGBitmapContextCreate(" << nCanvasWidth << "x" << 
nCanvasHeight << "x32) = " << cgc );
-
-CGContextTranslateCTM(cgc, 0, nCanvasHeight);
-CGContextScaleCTM(cgc, fDPIScaleX, -fDPIScaleX);
-
-doc_paintTileToCGContext(pThis, (void*) cgc, nCanvasWidth, nCanvasHeight, 
nTilePosX, nTilePosY, nTileWidth, nTileHeight);
-
-SAL_INFO( "vcl.cg", "CGContextRelease(" << cgc << ")" );
-CGContextRelease(cgc);
+paintTileIOS(pThis, pBuffer, nCanvasWidth, nCanvasHeight, fDPIScaleX, 
nTilePosX, nTilePosY, nTileWidth, nTileHeight);
 #else
 ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), 
DeviceFormat::DEFAULT) ;
 
@@ -2608,8 +2636,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 #ifdef IOS
 
 // This function is separate only to be used by LibreOfficeLight. If that app 
can be retired, this
-// function's code can be inlined into the iOS part of doc_paintTile().
-
+// function's code can be inlined.
 static void doc_paintTileToCGContext(LibreOfficeKitDocument* pThis,
  void* rCGContext,
  

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

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

New commits:
commit 4d02d0dd5007c0f1135f3b362829487703dd02b6
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 3 13:15:35 2019 +0900
Commit: Tor Lillqvist 
CommitDate: Mon Jun 3 13:30:00 2019 +0200

tdf#123697 we need to create a bitmap context with alpha

Change-Id: Ib934314e56163983e70a0b04eb667e6b8527c783
Reviewed-on: https://gerrit.libreoffice.org/73364
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3d30f5d637ea..bd17b54eea8d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2559,7 +2559,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 #if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS)
 
 #if defined(IOS)
-CGContextRef cgc = CGBitmapContextCreate(pBuffer, nCanvasWidth, 
nCanvasHeight, 8, nCanvasWidth*4, CGColorSpaceCreateDeviceRGB(), 
kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little);
+CGContextRef cgc = CGBitmapContextCreate(pBuffer, nCanvasWidth, 
nCanvasHeight, 8, nCanvasWidth*4, CGColorSpaceCreateDeviceRGB(), 
kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little);
 
 // Use the vcl.cg tag even if this code is not in vcl, to match all other 
SAL_INFO logging about Core Graphics, in vcl.
 SAL_INFO( "vcl.cg", "CGBitmapContextCreate(" << nCanvasWidth << "x" << 
nCanvasHeight << "x32) = " << cgc );
___
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.0' - desktop/source

2019-05-14 Thread Tor Lillqvist (via logerrit)
 desktop/source/lib/init.cxx |   15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 3f329e4a3cb7c43927e75b8c359e58d16716a8dd
Author: Tor Lillqvist 
AuthorDate: Tue May 14 10:20:50 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Tue May 14 14:13:28 2019 +0300

We apparently need to drop the Solar Mutex when exiting lo_runLoop() on iOS

It seems to be held after soffice_main() returns for the first
document opened, but not subsequent ones, for some reason. So acquire
it an extra time to be able to use Application::ReleaseSolarMutex()...

Without this, when opening a subsequent document, the loleaflet
loading progress bar just hangs.

Change-Id: I4e4e7b814f0dba836b790b6f68470aab54f8bbb9

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 902dceb64f31..b4d93861b0bd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4711,13 +4711,20 @@ static void lo_runLoop(LibreOfficeKit* /*pThis*/,
 {
 #ifdef IOS // Maybe ANDROID, too?
 InitVCL();
+Application::GetSolarMutex().acquire();
 #endif
 
-SolarMutexGuard aGuard;
+{
+SolarMutexGuard aGuard;
 
-vcl::lok::registerPollCallbacks(pPollCallback, pWakeCallback, pData);
-Application::UpdateMainThread();
-soffice_main();
+vcl::lok::registerPollCallbacks(pPollCallback, pWakeCallback, pData);
+Application::UpdateMainThread();
+soffice_main();
+}
+#ifdef IOS // ANDROID, too?
+vcl::lok::unregisterPollCallbacks();
+Application::ReleaseSolarMutex();
+#endif
 }
 
 static bool bInitialized = 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.0' - desktop/source

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

New commits:
commit f71c1124d0e963872db39c1724d61e9b9f02820b
Author: Tor Lillqvist 
AuthorDate: Mon May 13 18:06:13 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Mon May 13 18:45:25 2019 +0300

Fix comment to match reality

lo_runLoop() *is* used in the "Unipoll" case (i.e. current Online and
mobile apps).

Change-Id: I01ef3d8bc8140531f697952ef142150fc905a8d4

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f0453fefcad1..93e49ec4447d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4621,7 +4621,7 @@ static void lo_startmain(void*)
 Application::ReleaseSolarMutex();
 }
 
-// pre-unipoll version.
+// unipoll version.
 static void lo_runLoop(LibreOfficeKit* /*pThis*/,
LibreOfficeKitPollCallback pPollCallback,
LibreOfficeKitWakeCallback pWakeCallback,
___
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.0' - desktop/source vcl/source

2019-05-10 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |   27 +--
 vcl/source/app/svmain.cxx   |6 ++
 2 files changed, 15 insertions(+), 18 deletions(-)

New commits:
commit d48b54144b464a41bdc9cca8a8d766cc6aa525c2
Author: Michael Meeks 
AuthorDate: Thu May 9 18:24:18 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Fri May 10 16:35:45 2019 +0200

unipoll: let InitVCL tolerate double init.

We need to get VCL initialized early in UniPoll mode, since the main
setup doesn't occur until runPoll is invoked, and we want to call lots
of virtual methods that take the SolarMutex before then - which requires
VCL to be initialized.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 626e37b87a1f..ba8ebed87b04 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4974,24 +4974,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 force_c_locale();
 }
 
-// We could use InitVCL() here -- and used to before using 
soffice_main,
-// however that now deals with the initialisation for us (and it's not
-// possible to try to set up VCL twice.
-
-// Instead VCL init is done for us by soffice_main in a separate 
thread,
-// however we specifically can't proceed until this setup is complete
-// (or you get segfaults trying to use VCL and/or deadlocks due to 
other
-//  setup within soffice_main). Specifically the various Application::
-// functions depend on VCL being ready -- the deadlocks would happen
-// if you try to use loadDocument too early.
-
-// The RequestHandler is specifically set to be ready when all the 
other
-// init in Desktop::Main (run from soffice_main) is done. We can enable
-// the RequestHandler here (without starting any IPC thread;
-// shortcutting the invocation in Desktop::Main that would start the 
IPC
-// thread), and can then use it to wait until we're definitely ready to
-// continue.
-
 if (eStage != PRE_INIT)
 {
 SAL_INFO("lok", "Re-initialize temp paths");
@@ -5001,6 +4983,13 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 aOptions.SetTempPath(aNewTemp);
 desktop::Desktop::CreateTemporaryDirectory();
 
+// The RequestHandler is specifically set to be ready when all the 
other
+// init in Desktop::Main (run from soffice_main) is done. We can 
enable
+// the RequestHandler here (without starting any IPC thread;
+// shortcutting the invocation in Desktop::Main that would start 
the IPC
+// thread), and can then use it to wait until we're definitely 
ready to
+// continue.
+
 SAL_INFO("lok", "Enabling RequestHandler");
 RequestHandler::Enable(false);
 SAL_INFO("lok", "Starting soffice_main");
@@ -5013,6 +5002,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 RequestHandler::WaitForReady();
 SAL_INFO("lok", "RequestHandler ready -- continuing");
 }
+else
+InitVCL();
 }
 
 if (eStage != SECOND_INIT)
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index cbf2f6b63054..e67197a0e0c8 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -376,6 +376,12 @@ namespace vclmain
 
 bool InitVCL()
 {
+if (isInitVCL())
+{
+SAL_INFO("vcl.app", "Double initialization of vcl");
+return true;
+}
+
 if( pExceptionHandler != nullptr )
 return 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.0' - desktop/source

2019-05-06 Thread Ashod Nakashian (via logerrit)
 desktop/source/lib/init.cxx |   17 -
 1 file changed, 4 insertions(+), 13 deletions(-)

New commits:
commit 8e9c36dfc346387abfbbaefbc15a518cbe3e257c
Author: Ashod Nakashian 
AuthorDate: Sun May 5 12:36:09 2019 -0400
Commit: Jan Holesovsky 
CommitDate: Mon May 6 15:25:36 2019 +0200

LOK: remove duplicate cursor invalidations for same view only

This limits duplicate cursor invalidation removal to same
view only, which seems to have been left in error.

We should now remove any old cursor invalidations (for
the same view) and only keep the latest (current) one.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c5bf038e14a3..626e37b87a1f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -929,8 +929,8 @@ 
CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li
 {
 SetPriority(TaskPriority::POST_PAINT);
 
-// Add the states that are safe to skip duplicates on,
-// even when not consequent.
+// Add the states that are safe to skip duplicates on, even when
+// not consequent (i.e. do no emmit them if unchanged from last).
 m_states.emplace(LOK_CALLBACK_TEXT_SELECTION, "NIL");
 m_states.emplace(LOK_CALLBACK_GRAPHIC_SELECTION, "NIL");
 m_states.emplace(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, "NIL");
@@ -1022,7 +1022,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_GRAPHIC_SELECTION:
 case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION:
 case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
-case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR :
+case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR:
 case LOK_CALLBACK_STATE_CHANGED:
 case LOK_CALLBACK_MOUSE_POINTER:
 case LOK_CALLBACK_CELL_CURSOR:
@@ -1106,6 +1106,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_CELL_VIEW_CURSOR:
 case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION:
 case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR:
+case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
 case LOK_CALLBACK_TEXT_VIEW_SELECTION:
 case LOK_CALLBACK_VIEW_CURSOR_VISIBLE:
 {
@@ -1118,16 +1119,6 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 }
 break;
 
-case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
-{
-removeAll(
-[type, ] (const queue_type::value_type& elem) {
-return (elem.Type == type && elem.PayloadString == 
payload);
-}
-);
-}
-break;
-
 case LOK_CALLBACK_INVALIDATE_TILES:
 {
 RectangleAndPart& rcNew = 
aCallbackData.setRectangleAndPart(payload);
___
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.0' - desktop/source

2019-05-06 Thread Ashod Nakashian (via logerrit)
 desktop/source/lib/init.cxx |   32 
 1 file changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 79dbfbec29714ec50a8741b6e8065073fd30d075
Author: Ashod Nakashian 
AuthorDate: Sun May 5 12:35:42 2019 -0400
Commit: Jan Holesovsky 
CommitDate: Mon May 6 15:22:32 2019 +0200

LOK: trace queue only when it is changed

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 52b7f399c38b..c5bf038e14a3 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -965,22 +965,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 
 CallbackData aCallbackData(type, (data ? data : "(nil)"));
 const std::string& payload = aCallbackData.PayloadString;
-SAL_INFO("lok", "Queue: " << type << " : " << payload);
-
-#ifdef DBG_UTIL
-{
-// Dump the queue state and validate cached data.
-int i = 1;
-std::ostringstream oss;
-oss << '\n';
-for (const CallbackData& c : m_queue)
-oss << i++ << ": [" << c.Type << "] [" << c.PayloadString << 
"].\n";
-const std::string aQueued = oss.str();
-SAL_INFO("lok", "Current Queue: " << (aQueued.empty() ? "Empty" : 
aQueued));
-for (const CallbackData& c : m_queue)
-assert(c.validate());
-}
-#endif
+SAL_INFO("lok", "Queue: [" << type << "]: [" << payload << "] on " << 
m_queue.size() << " entries.");
 
 bool bIsChartActive = false;
 if (type == LOK_CALLBACK_GRAPHIC_SELECTION)
@@ -1414,6 +1399,21 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 SAL_INFO("lok", "Queued #" << (m_queue.size() - 1) <<
  " [" << type << "]: [" << payload << "] to have " << 
m_queue.size() << " entries.");
 
+#ifdef DBG_UTIL
+{
+// Dump the queue state and validate cached data.
+int i = 1;
+std::ostringstream oss;
+oss << '\n';
+for (const CallbackData& c : m_queue)
+oss << i++ << ": [" << c.Type << "] [" << c.PayloadString << 
"].\n";
+const std::string aQueued = oss.str();
+SAL_INFO("lok", "Current Queue: " << (aQueued.empty() ? "Empty" : 
aQueued));
+for (const CallbackData& c : m_queue)
+assert(c.validate());
+}
+#endif
+
 lock.unlock();
 if (!IsActive())
 {
___
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.0' - desktop/source include/vcl sfx2/source vcl/source

2019-05-06 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx|   11 +++
 include/vcl/lok.hxx|1 +
 sfx2/source/view/lokhelper.cxx |   10 +-
 vcl/source/app/svapp.cxx   |6 ++
 4 files changed, 23 insertions(+), 5 deletions(-)

New commits:
commit 33bfff357d68a521186a493b31b795b85bde897c
Author: Michael Meeks 
AuthorDate: Sat Apr 27 13:37:52 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Mon May 6 11:19:33 2019 +0200

unipoll: emit user input-events & uno commands directly when in unipoll 
mode.

Rather than emitting asynchronously at idle.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index da88ae1b28f8..52b7f399c38b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3004,10 +3004,13 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 
 std::vector 
aPropertyValuesVector(jsonToPropertyValuesVector(pArguments));
 
-beans::PropertyValue aSynchronMode;
-aSynchronMode.Name = "SynchronMode";
-aSynchronMode.Value <<= false;
-aPropertyValuesVector.push_back(aSynchronMode);
+if (!vcl::lok::isUnipoll())
+{
+beans::PropertyValue aSynchronMode;
+aSynchronMode.Name = "SynchronMode";
+aSynchronMode.Value <<= false;
+aPropertyValuesVector.push_back(aSynchronMode);
+}
 
 int nView = SfxLokHelper::getView();
 if (nView < 0)
diff --git a/include/vcl/lok.hxx b/include/vcl/lok.hxx
index 5c30b6290221..2dbc0443d7b7 100644
--- a/include/vcl/lok.hxx
+++ b/include/vcl/lok.hxx
@@ -18,6 +18,7 @@ namespace vcl
 {
 namespace lok
 {
+bool VCL_DLLPUBLIC isUnipoll();
 void VCL_DLLPUBLIC registerPollCallbacks(LibreOfficeKitPollCallback 
pPollCallback,
  LibreOfficeKitWakeCallback 
pWakeCallback, void* pData);
 }
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 85834534316c..98b76d43514c 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -12,6 +12,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -308,7 +309,14 @@ namespace
 }
 
 pEvent->mnView = SfxLokHelper::getView(nullptr);
-Application::PostUserEvent(Link(pEvent, 
LOKPostAsyncEvent));
+if (vcl::lok::isUnipoll())
+{
+if (Application::GetMainThreadIdentifier() != 
::osl::Thread::getCurrentIdentifier())
+SAL_WARN("lok", "Posting event directly but not called from 
main thread!");
+LOKPostAsyncEvent(pEvent, nullptr);
+}
+else
+Application::PostUserEvent(Link(pEvent, 
LOKPostAsyncEvent));
 }
 }
 
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 5e97a2629641..70cc7287acec 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1722,6 +1722,12 @@ void registerPollCallbacks(
 }
 }
 
+bool isUnipoll()
+{
+ImplSVData * pSVData = ImplGetSVData();
+return pSVData && pSVData->mpPollClosure != nullptr;
+}
+
 } } // namespace lok, namespace vcl
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
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.0' - desktop/source

2019-05-03 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 4eef543e27baacffb23225af1a4d5adcb79cb9a1
Author: Michael Meeks 
AuthorDate: Fri May 3 17:24:13 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Fri May 3 18:32:48 2019 +0200

unipoll: cleanup runPoll.

Setting a custom thread name is a terrible idea for online unit tests.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1311a014bdc8..da88ae1b28f8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4604,6 +4604,7 @@ static bool initialize_uno(const OUString& aAppProgramURL)
 return true;
 }
 
+// pre-unipoll version.
 static void lo_startmain(void*)
 {
 osl_setThreadName("lo_startmain");
@@ -4618,15 +4619,17 @@ static void lo_startmain(void*)
 Application::ReleaseSolarMutex();
 }
 
+// pre-unipoll version.
 static void lo_runLoop(LibreOfficeKit* /*pThis*/,
LibreOfficeKitPollCallback pPollCallback,
LibreOfficeKitWakeCallback pWakeCallback,
void* pData)
 {
 SolarMutexGuard aGuard;
+
 vcl::lok::registerPollCallbacks(pPollCallback, pWakeCallback, pData);
-lo_startmain(nullptr);
-Application::AcquireSolarMutex(1); // startmain releases it.
+Application::UpdateMainThread();
+soffice_main();
 }
 
 static bool bInitialized = 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.0' - desktop/source

2019-05-03 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 283d7235c8e38d391f450cd725c1e74a35b5a29d
Author: Michael Meeks 
AuthorDate: Fri May 3 13:36:56 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Fri May 3 16:44:52 2019 +0200

unipoll: get SolarMutex lock counting right.

lo_startmain drops the SolarMutex without taking it, interestingly.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d4a532f3f33e..1311a014bdc8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4626,6 +4626,7 @@ static void lo_runLoop(LibreOfficeKit* /*pThis*/,
 SolarMutexGuard aGuard;
 vcl::lok::registerPollCallbacks(pPollCallback, pWakeCallback, pData);
 lo_startmain(nullptr);
+Application::AcquireSolarMutex(1); // startmain releases it.
 }
 
 static bool bInitialized = 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.0' - desktop/source

2019-05-02 Thread Mike Kaganski (via logerrit)
 desktop/source/lib/init.cxx |  268 ++--
 1 file changed, 110 insertions(+), 158 deletions(-)

New commits:
commit fef1c9ba0cabe767d8c15c10903c5869dd113503
Author: Mike Kaganski 
AuthorDate: Sun Apr 28 23:29:49 2019 +0300
Commit: Michael Meeks 
CommitDate: Thu May 2 11:50:11 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/71528
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 089f95b91996..d4a532f3f33e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -159,6 +159,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;
@@ -1891,8 +1897,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 comphelper::ProfileZone aZone("doc_saveAs");
 
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();
 
 LibLODocument_Impl* pDocument = static_cast(pThis);
 
@@ -1900,7 +1905,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;
 }
@@ -1939,7 +1944,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;
 }
 }
@@ -1955,7 +1960,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;
 }
 
@@ -2038,7 +2043,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;
 }
@@ -2046,8 +2051,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[] =
 {
@@ -2194,8 +2198,7 @@ static int doc_getDocumentType (LibreOfficeKitDocument* 
pThis)
 comphelper::ProfileZone aZone("doc_getDocumentType");
 
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();
 
 LibLODocument_Impl* pDocument = static_cast(pThis);
 
@@ -2221,12 +2224,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;
 }
@@ -2240,7 +2243,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;
 }
 
@@ -2252,13 +2255,12 @@ static int doc_getPart (LibreOfficeKitDocument* pThis)
 comphelper::ProfileZone aZone("doc_getPart");
 
 SolarMutexGuard aGuard;
-if (gImpl)
-gImpl->maLastExceptionMsg.clear();
+SetLastExceptionMsg();
 
 ITiledRenderable* pDoc = 

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

2019-04-26 Thread Ashod Nakashian (via logerrit)
 desktop/source/lib/init.cxx  |   48 ---
 include/LibreOfficeKit/LibreOfficeKit.h  |6 +++
 include/LibreOfficeKit/LibreOfficeKit.hxx|   18 ++
 include/LibreOfficeKit/LibreOfficeKitTypes.h |6 +++
 include/vcl/lok.hxx  |   28 +++
 vcl/headless/svpinst.cxx |   32 --
 vcl/inc/headless/svpinst.hxx |3 -
 vcl/inc/svdata.hxx   |6 +++
 vcl/source/app/svapp.cxx |   19 ++
 9 files changed, 150 insertions(+), 16 deletions(-)

New commits:
commit ce540b296cc76d7dd48d6cdbf40c01e9103a3d4f
Author: Ashod Nakashian 
AuthorDate: Wed Apr 17 16:23:39 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Fri Apr 26 22:23:09 2019 +0200

Unipoll: add LibreOfficeKit API for polling, and an option to use it.

Change-Id: Iee7556ee52541ddbf1ef8f31e1ed4697f805a2ac
Reviewed-on: https://gerrit.libreoffice.org/70898
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 
Reviewed-on: https://gerrit.libreoffice.org/71164
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 35943999d12b..8c4fdb7b4494 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -35,6 +35,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1516,6 +1517,11 @@ static bool lo_signDocument(LibreOfficeKit* pThis,
const unsigned char* pPrivateKeyBinary,
const int nPrivateKeyBinarySize);
 
+static void lo_runLoop(LibreOfficeKit* pThis,
+   LibreOfficeKitPollCallback pPollCallback,
+   LibreOfficeKitWakeCallback pWakeCallback,
+   void* pData);
+
 LibLibreOffice_Impl::LibLibreOffice_Impl()
 : m_pOfficeClass( gOfficeClass.lock() )
 , maThread(nullptr)
@@ -1539,6 +1545,7 @@ LibLibreOffice_Impl::LibLibreOffice_Impl()
 m_pOfficeClass->getVersionInfo = lo_getVersionInfo;
 m_pOfficeClass->runMacro = lo_runMacro;
 m_pOfficeClass->signDocument = lo_signDocument;
+m_pOfficeClass->runLoop = lo_runLoop;
 
 gOfficeClass = m_pOfficeClass;
 }
@@ -4562,6 +4569,16 @@ static void lo_startmain(void*)
 Application::ReleaseSolarMutex();
 }
 
+static void lo_runLoop(LibreOfficeKit* /*pThis*/,
+   LibreOfficeKitPollCallback pPollCallback,
+   LibreOfficeKitWakeCallback pWakeCallback,
+   void* pData)
+{
+SolarMutexGuard aGuard;
+vcl::lok::registerPollCallbacks(pPollCallback, pWakeCallback, pData);
+lo_startmain(nullptr);
+}
+
 static bool bInitialized = false;
 
 static void lo_status_indicator_callback(void *data, 
comphelper::LibreOfficeKit::statusIndicatorCallbackType type, int percent)
@@ -4711,7 +4728,24 @@ 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_EVENTS") != nullptr;
+static bool bUnipoll = false;
+static bool bProfileZones = false;
+
+{ // cf. string lifetime for preinit
+std::vector aOpts;
+
+// ':' delimited options - avoiding ABI change for new parameters
+const char *pOptions = getenv("SAL_LOK_OPTIONS");
+if (pOptions)
+aOpts = comphelper::string::split(OUString(pOptions, 
strlen(pOptions), RTL_TEXTENCODING_UTF8), ':');
+for (auto  : aOpts)
+{
+if (it == "unipoll")
+bUnipoll = true;
+else if (it == "profile_events")
+bProfileZones = true;
+}
+}
 
 // What stage are we at ?
 if (pThis == nullptr)
@@ -4924,10 +4958,14 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 RequestHandler::Enable(false);
 SAL_INFO("lok", "Starting soffice_main");
 RequestHandler::SetReady(false);
-pLib->maThread = osl_createThread(lo_startmain, nullptr);
-SAL_INFO("lok", "Waiting for RequestHandler");
-RequestHandler::WaitForReady();
-SAL_INFO("lok", "RequestHandler ready -- continuing");
+if (!bUnipoll)
+{
+// Start the main thread only in non-unipoll mode (i.e. 
multithreaded).
+pLib->maThread = osl_createThread(lo_startmain, nullptr);
+SAL_INFO("lok", "Waiting for RequestHandler");
+RequestHandler::WaitForReady();
+SAL_INFO("lok", "RequestHandler ready -- continuing");
+}
 }
 
 if (eStage != SECOND_INIT)
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 

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

2019-04-25 Thread Henry Castro (via logerrit)
 desktop/source/lib/init.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 33191f604756bbfde04eea9a85fd7ac283c6eceb
Author: Henry Castro 
AuthorDate: Thu Apr 11 14:22:15 2019 -0400
Commit: Jan Holesovsky 
CommitDate: Thu Apr 25 21:37:59 2019 +0200

lok: add missing parameter to PostExtTextInputEvent function

Change-Id: I91fbfd97da0c4ad1ad90710ab781c71ca99367e5
Reviewed-on: https://gerrit.libreoffice.org/70609
Tested-by: Jenkins
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/70665
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ece913b25e80..35943999d12b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2839,7 +2839,8 @@ static void 
doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig
OUString::fromUtf8(OString(pText, 
strlen(pText;
 break;
 case LOK_EXT_TEXTINPUT_END:
-pWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+pWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput,
+   OUString::fromUtf8(OString(pText, 
strlen(pText;
 break;
 default:
 assert(false && "Unhandled External Text input event!");
___
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.0' - desktop/source include/LibreOfficeKit libreofficekit/source

2019-04-24 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 c96b9c9fbed5d8b82dc90f6330256c1991b289cc
Author: Michael Meeks 
AuthorDate: Fri Apr 12 21:16:38 2019 +0100
Commit: Tor Lillqvist 
CommitDate: Wed Apr 24 22:21:37 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/70766
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5010fe406c1e..a3577809aa45 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -4567,6 +4568,31 @@ static void preloadData()
 rtl::Bootstrap::set("UserInstallation", sUserPath);
 }
 
+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 {
@@ -4577,6 +4603,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)
@@ -4591,6 +4618,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(rtlAllocPreInitStart);
 else if (eStage == SECOND_INIT)
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 992f64a9065b..9639aaf9348e 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -610,6 +610,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 c64e7cba0c69..1dd109375481 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -447,6 +447,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.0' - desktop/source

2019-04-17 Thread Noel Grandin (via logerrit)
 desktop/source/app/officeipcthread.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1fb3a433264e34fc48e351d21d93a7bb4f431113
Author: Noel Grandin 
AuthorDate: Sat Sep 8 09:26:12 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Apr 17 11:59:46 2019 +0300

clang-tidy bugprone-unused-raii in RequestHandler

The message from clang-tidy is:
warning: object destroyed immediately after creation; did you mean
to name the object?

The guard in
RequestHandler::ExecuteCmdLineRequests
comes from
commit cf333a878ceed18d0343520a2c65be69fc433b1f
Date:   Sun Jan 21 22:10:09 2018 +0300
tdf#38915: set cProcessed condition on any process outcome
and I'm sure it's intention was to set the flag on exit from the
function, not immediately.

Reviewed-on: https://gerrit.libreoffice.org/60183
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins
(cherry picked from commit 867ee21fe4c0c9216aea57850efec4de3c3fc554)

Change-Id: Ibf874a5774770df00b9db7f673554e7ffda55072
Reviewed-on: https://gerrit.libreoffice.org/66168
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/app/officeipcthread.cxx 
b/desktop/source/app/officeipcthread.cxx
index a128a073ea0b..64098a758058 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -1324,7 +1324,7 @@ bool RequestHandler::ExecuteCmdLineRequests(
 osl::ClearableMutexGuard aGuard( GetMutex() );
 
 // ensure that Processed flag (if exists) is signaled in any outcome
-ConditionSetGuard(aRequest.pcProcessed);
+ConditionSetGuard aSetGuard(aRequest.pcProcessed);
 
 static std::vector aDispatchList;
 
___
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.0' - desktop/source sd/source

2019-04-14 Thread Ashod Nakashian (via logerrit)
 desktop/source/lib/init.cxx  |2 --
 sd/source/ui/unoidl/unomodel.cxx |   11 +++
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 0446a69570ae8dc15b9f7a8f8325790953640140
Author: Ashod Nakashian 
AuthorDate: Sun Nov 11 23:37:24 2018 -0500
Commit: Ashod Nakashian 
CommitDate: Mon Apr 15 02:33:36 2019 +0200

LOK: sd: initialize slide-sorter in sd

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 26f3f585ade9..5010fe406c1e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2640,8 +2640,6 @@ static void 
doc_initializeForRendering(LibreOfficeKitDocument* pThis,
 if (pDoc)
 {
 doc_iniUnoCommands();
-// Create the SlideSorter which is used for multiselection and 
reordering.
-doc_postUnoCommand(pThis, ".uno:LeftPaneImpress", nullptr, false);
 pDoc->initializeForTiledRendering(
 
comphelper::containerToSequence(jsonToPropertyValuesVector(pArguments)));
 }
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index fe0c82d9309a..96ba362c3c7b 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -32,6 +32,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -2511,6 +2512,16 @@ void 
SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence 
aPropertyValuesVector({aSynchronMode});
+
+// Create the SlideSorter which is used for multiselection and reordering.
+static const OUString aLeftPaneCommand(".uno:LeftPaneImpress");
+comphelper::dispatchCommand(aLeftPaneCommand, 
comphelper::containerToSequence(aPropertyValuesVector));
 }
 
 void SdXImpressDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode)
___
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.0' - desktop/source

2019-03-21 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 3526a576cd74ae33e6cc0722c91a5178f8886caf
Author: Jan Holesovsky 
AuthorDate: Thu Mar 21 14:18:35 2019 +0100
Commit: Andras Timar 
CommitDate: Thu Mar 21 14:27:39 2019 +0100

lok: Keep the temporary user profile set during the entire preload.

Otherwise the core likes to crash due to the keyboard accellerators
being read, but the configuration is missing.

Change-Id: I94193f47462227b5975a49ce11709d7bf415a519
Reviewed-on: https://gerrit.libreoffice.org/69507
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d79d086b66f9..ee34831af726 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4442,9 +4442,6 @@ static void preloadData()
 }
 std::cerr << "\n";
 
-// Set user profile's path back to the original one
-rtl::Bootstrap::set("UserInstallation", sUserPath);
-
 css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg;
 xGlobalCfg = css::ui::GlobalAcceleratorConfiguration::create(
 comphelper::getProcessComponentContext());
@@ -4484,6 +4481,9 @@ static void preloadData()
 nLang = 
MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale,
 false), COMPLEX);
 OutputDevice::GetDefaultFont(DefaultFontType::CTL_SPREADSHEET, nLang, 
GetDefaultFontFlags::OnlyOne);
 }
+
+// Set user profile's path back to the original one
+rtl::Bootstrap::set("UserInstallation", sUserPath);
 }
 
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const 
char* pUserProfileUrl)
___
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.0' - desktop/source

2019-03-15 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 9da36e5362324509e47bc9ae93d31fc3250f96c0
Author: Tor Lillqvist 
AuthorDate: Fri Mar 15 12:13:41 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Mar 15 12:22:26 2019 +0200

Don't return an empty C string, the caller is not prepared for that

If the called gets a pointer to an empty C string, it will send the
message "commandvalues: " to the JavaScript bits. That will cause an
exception as it expects JSON after the commandvalues: keyword.

Instead return a nullptr. The called is prepared to handle that.

Change-Id: Ia1efa967668ba518993edb7945f064758b660b96

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 54948cf3511d..88970631ce48 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3630,6 +3630,9 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* 
pThis, const char* pCo
 }
 
 OUString aHeaders = pDoc->getRowColumnHeaders(aRectangle);
+if (aHeaders == "")
+return nullptr;
+
 OString aString = OUStringToOString(aHeaders, RTL_TEXTENCODING_UTF8);
 
 char* pMemory = static_cast(malloc(aString.getLength() + 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.0' - desktop/source sfx2/source

2019-03-15 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx  |3 ++-
 sfx2/source/control/unoctitm.cxx |3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 7a758da47cdcf4017f41e1e16dc1f643148d2f9b
Author: Henry Castro 
AuthorDate: Thu Mar 14 09:16:59 2019 -0400
Commit: Jan Holesovsky 
CommitDate: Fri Mar 15 09:20:29 2019 +0100

lok: intercept the UNO command ".uno:ThesaurusDialog"

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d2eee1b79866..54948cf3511d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2091,7 +2091,8 @@ static void doc_iniUnoCommands ()
 OUString(".uno:InsertPageFooter"),
 OUString(".uno:OnlineAutoFormat"),
 OUString(".uno:InsertSymbol"),
-OUString(".uno:EditRegion")
+OUString(".uno:EditRegion"),
+OUString(".uno:ThesaurusDialog")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index c128bc5da518..357fd4be74a2 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1096,7 +1096,8 @@ static void InterceptLOKStateChangeEvent(const 
SfxViewFrame* pViewFrame, const c
  aEvent.FeatureURL.Path == "OutlineBullet" ||
  aEvent.FeatureURL.Path == "InsertIndexesEntry" ||
  aEvent.FeatureURL.Path == "TransformDialog" ||
- aEvent.FeatureURL.Path == "EditRegion")
+ aEvent.FeatureURL.Path == "EditRegion" ||
+ aEvent.FeatureURL.Path == "ThesaurusDialog")
 
 {
 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.0' - desktop/source

2019-03-12 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9fa568dced78011072390320f64eae28dd06d2b9
Author: Ashod Nakashian 
AuthorDate: Sun Mar 10 12:21:33 2019 -0400
Commit: Andras Timar 
CommitDate: Tue Mar 12 13:57:24 2019 +0100

LOK: don't segfault when reporting error

Change-Id: Ia6d614eb15b15f43ddd3e0b5742b888060dfd581
Reviewed-on: https://gerrit.libreoffice.org/69069
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 262b722ece7f..d2eee1b79866 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2988,7 +2988,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* 
pThis, const char* pComma
 else
 bResult = comphelper::dispatchCommand(aCommand, 
comphelper::containerToSequence(aPropertyValuesVector));
 
-if (!bResult)
+if (!bResult && gImpl)
 {
 gImpl->maLastExceptionMsg = "Failed to dispatch the .uno: command";
 }
___
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.0' - desktop/source

2019-03-04 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit d5e8de3c1e4a8bf6fb9cf7676bca13a9cb348633
Author: Ashod Nakashian 
AuthorDate: Wed Jan 23 21:29:42 2019 -0500
Commit: Andras Timar 
CommitDate: Mon Mar 4 15:19:45 2019 +0100

LOK: set the language for LOK before document loading

So default dialogs will be created in the correct
language, as requested by the client.

Change-Id: I12ebf7443b7f19e733f66b88b5fadfb01cd5e75e
Reviewed-on: https://gerrit.libreoffice.org/68260
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e3d9259ba0ea..2fa9a3b7ce2b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1534,6 +1534,8 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
 SvtSysLocaleOptions aSysLocaleOptions;
 aSysLocaleOptions.SetLocaleConfigString(aLanguage);
 aSysLocaleOptions.SetUILocaleConfigString(aLanguage);
+// Set the LOK language tag, used for dialog tunneling.
+
comphelper::LibreOfficeKit::setLanguageTag(aSysLocaleOptions.GetLanguageTag());
 }
 
 uno::Sequence aFilterOptions(2);
___
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.0' - desktop/source

2019-03-01 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 74fbe07431f1d53997cbbe24acb91cde25622133
Author: Ashod Nakashian 
AuthorDate: Tue Nov 13 00:14:40 2018 -0500
Commit: Andras Timar 
CommitDate: Fri Mar 1 17:23:02 2019 +0100

LOK: desktop: use correct size when initializing LibreOfficeKitDocument

Change-Id: I0aecc459cf448c03dd8c17a486cc66f541f6868d
Reviewed-on: https://gerrit.libreoffice.org/68257
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8c79f36484a2..e3d9259ba0ea 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -763,7 +763,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
nSize = sizeof(LibreOfficeKitDocument);
+m_pDocumentClass->nSize = sizeof(LibreOfficeKitDocumentClass);
 
 m_pDocumentClass->destroy = doc_destroy;
 m_pDocumentClass->saveAs = doc_saveAs;
___
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.0' - desktop/source

2019-02-26 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit c16a6581a2f29feda36948e7d2bd0d0a28015806
Author: Marco Cecchetti 
AuthorDate: Mon Feb 25 14:36:05 2019 +0100
Commit: Szymon Kłos 
CommitDate: Tue Feb 26 09:19:25 2019 +0100

lok: sc: clicking on individual chart elements doesn't select object

Exporting to svg a selected object of a chart does not work.
In the chart case the selected object for the current document is
always the chart itself, not an internal chart object.
Moreover the exporting action cause the exported object to be selected
again. So you try to selected the chart legend and you end up with the
whole chart selected again.

Change-Id: Ib4aa91afd592909ad354ca373dc03298547f9fb5
Reviewed-on: https://gerrit.libreoffice.org/68348
Reviewed-by: Szymon Kłos 
Tested-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a1f4dea54c41..8c79f36484a2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -92,6 +92,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2719,6 +2720,11 @@ static size_t 
doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOu
 if (gImpl)
 gImpl->maLastExceptionMsg.clear();
 
+LokChartHelper aChartHelper(SfxViewShell::Current());
+
+if (aChartHelper.GetWindow())
+return 0;
+
 try
 {
 LibLODocument_Impl* pDocument = 
static_cast(pThis);
___
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.0' - desktop/source filter/source

2019-02-08 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |   26 ++
 filter/source/pdf/pdfexport.cxx |   74 
 filter/source/pdf/pdfexport.hxx |2 +
 3 files changed, 102 insertions(+)

New commits:
commit 41a22ef27df7242ab074a3fd83720c739362263d
Author: merttumer 
AuthorDate: Fri Feb 8 20:26:46 2019 +0300
Commit: Andras Timar 
CommitDate: Fri Feb 8 22:27:24 2019 +0100

Added Tiled Watermark Feature for pdf export

Change-Id: I1f01e16e6958b0be4f82b13c2f3c5a91a8f05558
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/67551
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 739b21dbaf11..a1f4dea54c41 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1839,6 +1839,25 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 
 OUString aFilterOptions = getUString(pFilterOptions);
 
+// Check if watermark for pdf is passed by filteroptions..
+// It is not a real filter option so it must be filtered out.
+OUString watermarkText;
+int aIndex = -1;
+if ((aIndex = aFilterOptions.indexOf(",Watermark=")) >= 0)
+{
+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();
+}
+}
+
 // '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
@@ -1867,6 +1886,13 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, 
const char* sUrl, const cha
 aSaveMediaDescriptor["Overwrite"] <<= true;
 aSaveMediaDescriptor["FilterName"] <<= aFilterName;
 aSaveMediaDescriptor[MediaDescriptor::PROP_FILTEROPTIONS()] <<= 
aFilterOptions;
+if(!watermarkText.isEmpty())
+{
+uno::Sequence< beans::PropertyValue > aFilterData( 1 );
+aFilterData[ 0 ].Name = "TiledWatermark";
+aFilterData[ 0 ].Value <<= watermarkText;
+aSaveMediaDescriptor["FilterData"] <<= aFilterData;
+}
 
 // add interaction handler too
 if (gImpl)
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index ca454bbd65f7..6c9e7b90320c 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -499,6 +499,8 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 rFilterData[ nData ].Value >>= mbAddStream;
 else if ( rFilterData[ nData ].Name == "Watermark" )
 rFilterData[ nData ].Value >>= msWatermark;
+else if ( rFilterData[ nData ].Name == "TiledWatermark" )
+rFilterData[ nData ].Value >>= msTiledWatermark;
 // now all the security related properties...
 else if ( rFilterData[ nData ].Name == "EncryptFile" )
 rFilterData[ nData ].Value >>= mbEncrypt;
@@ -1038,7 +1040,13 @@ bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, 
vcl::PDFExtOutDevData&
 rPDFExtOutDevData.ResetSyncData();
 
 if (!msWatermark.isEmpty())
+{
 ImplWriteWatermark( rWriter, Size(aRangePDF.getWidth(), 
aRangePDF.getHeight()) );
+}
+else if (!msTiledWatermark.isEmpty())
+{
+ImplWriteTiledWatermark( rWriter, Size(aRangePDF.getWidth(), 
aRangePDF.getHeight()) );
+}
 
 return true;
 }
@@ -,4 +1119,70 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& 
rWriter, const Size& rPageSi
 rWriter.Pop();
 }
 
+void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& 
rPageSize )
+{
+vcl::Font aFont( OUString( "Helvetica" ), Size( 0, 40 ) );
+aFont.SetItalic( ITALIC_NONE );
+aFont.SetWidthType( WIDTH_NORMAL );
+aFont.SetWeight( WEIGHT_BOLD );
+aFont.SetAlignment( ALIGN_BOTTOM );
+aFont.SetFontHeight(40);
+
+OutputDevice* pDev = rWriter.GetReferenceDevice();
+pDev->SetFont(aFont);
+pDev->Push();
+pDev->SetFont(aFont);
+pDev->SetMapMode( MapMode( MapUnit::MapPoint ) );
+int w = 0;
+long nTextWidth = (rPageSize.Width()-60) / 4;
+while((w = pDev->GetTextWidth(msTiledWatermark)) > nTextWidth)
+{
+if(w==0)
+break;
+
+long nNewHeight = aFont.GetFontHeight() * nTextWidth / w;
+aFont.SetFontHeight(nNewHeight);
+pDev->SetFont( aFont );
+}
+pDev->Pop();
+
+rWriter.Push();
+rWriter.SetMapMode( 

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

2019-02-08 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit b79fe36b37cd02dfa992e26a30a2956d02a77ef9
Author: Michael Meeks 
AuthorDate: Fri Jan 25 17:47:15 2019 +
Commit: Andras Timar 
CommitDate: Fri Feb 8 22:15:40 2019 +0100

lok: don't crash in simple LOK use-case with no callback.

Change-Id: I7bceba10f002ad5751e3d810f9a9767ad2e875bc
Reviewed-on: https://gerrit.libreoffice.org/66924
Tested-by: Jenkins
Reviewed-by: Michael Meeks 
(cherry picked from commit 175274a6bca20451ccd6b5574e118265449f7642)
Reviewed-on: https://gerrit.libreoffice.org/66930
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index dae96c2e62b6..739b21dbaf11 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1579,8 +1579,11 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
 }
 
 LibLODocument_Impl* pDocument = new LibLODocument_Impl(xComponent);
-int nState = doc_getSignatureState(pDocument);
-pLib->mpCallback(LOK_CALLBACK_SIGNATURE_STATUS, 
OString::number(nState).getStr(), pLib->mpCallbackData);
+if (pLib->mpCallback)
+{
+int nState = doc_getSignatureState(pDocument);
+pLib->mpCallback(LOK_CALLBACK_SIGNATURE_STATUS, 
OString::number(nState).getStr(), pLib->mpCallbackData);
+}
 return pDocument;
 }
 catch (const uno::Exception& exception)
___
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.0' - desktop/source sfx2/source

2019-02-06 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx  |3 ++-
 sfx2/source/control/unoctitm.cxx |3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 32555d9b5c9ef37276984eaa9d9b84007fd02038
Author: Henry Castro 
AuthorDate: Wed Feb 6 17:38:35 2019 -0400
Commit: Jan Holesovsky 
CommitDate: Thu Feb 7 08:36:50 2019 +0100

lok: intercept the UNO command ".uno:EditRegion"

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index be692a89ec96..dae96c2e62b6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1993,7 +1993,8 @@ static void doc_iniUnoCommands ()
 OUString(".uno:InsertPageHeader"),
 OUString(".uno:InsertPageFooter"),
 OUString(".uno:OnlineAutoFormat"),
-OUString(".uno:InsertSymbol")
+OUString(".uno:InsertSymbol"),
+OUString(".uno:EditRegion")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 76c2745b4ff6..c128bc5da518 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1095,7 +1095,8 @@ static void InterceptLOKStateChangeEvent(const 
SfxViewFrame* pViewFrame, const c
  aEvent.FeatureURL.Path == "ParagraphDialog" ||
  aEvent.FeatureURL.Path == "OutlineBullet" ||
  aEvent.FeatureURL.Path == "InsertIndexesEntry" ||
- aEvent.FeatureURL.Path == "TransformDialog")
+ aEvent.FeatureURL.Path == "TransformDialog" ||
+ aEvent.FeatureURL.Path == "EditRegion")
 
 {
 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.0' - desktop/source sfx2/source

2018-12-15 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx  |3 ++-
 sfx2/source/control/unoctitm.cxx |1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit bd5f75d44a55c0608dc328ca74b19302955bf67f
Author: Tamás Zolnai 
AuthorDate: Fri Dec 14 17:36:41 2018 +0100
Commit: Andras Timar 
CommitDate: Sat Dec 15 17:08:43 2018 +0100

lok: Handle Special character menu item's state correctly in online

Change-Id: Iaa962fe5a590ef16e710fdd49d02d564f10f0f9f
Reviewed-on: https://gerrit.libreoffice.org/65188
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 13998b050f445bac3593a8bb77b7320d1be9990d)
Reviewed-on: https://gerrit.libreoffice.org/65202
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 33bac792668f..f534d9a9b23a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1916,7 +1916,8 @@ static void doc_iniUnoCommands ()
 OUString(".uno:TransformDialog"),
 OUString(".uno:InsertPageHeader"),
 OUString(".uno:InsertPageFooter"),
-OUString(".uno:OnlineAutoFormat")
+OUString(".uno:OnlineAutoFormat"),
+OUString(".uno:InsertSymbol")
 };
 
 util::URL aCommandURL;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index b831af5521d2..76c2745b4ff6 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1077,6 +1077,7 @@ static void InterceptLOKStateChangeEvent(const 
SfxViewFrame* pViewFrame, const c
  aEvent.FeatureURL.Path == "InsertRowsAfter" ||
  aEvent.FeatureURL.Path == "InsertColumnsBefore" ||
  aEvent.FeatureURL.Path == "InsertColumnsAfter" ||
+ aEvent.FeatureURL.Path == "InsertSymbol" ||
  aEvent.FeatureURL.Path == "DeleteRows" ||
  aEvent.FeatureURL.Path == "DeleteColumns" ||
  aEvent.FeatureURL.Path == "DeleteTable" ||
___
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.0' - desktop/source

2018-11-23 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit e514e19274919c522c1b53e035c99713e37232aa
Author: Tor Lillqvist 
AuthorDate: Fri Nov 23 17:36:33 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Nov 23 17:56:32 2018 +0200

Use the correct DPI scaling factor in LibreOfficeKit for iOS, too

Fixes the rendering of spreadsheets in the iOS app. (The cell area was
rendered at half the scale of the row and column headers.)

(In this branch I don't bother updating the comments to mention
CoreGraphics in addition to cairo.)

Change-Id: Ife99c6a2d58e592cfea3b4ed1ab09c19fba77e72

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2db450c19acf..13c9e4a0d591 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2142,9 +2142,10 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 // what Calc's internal scaling would do - because that one is trying to
 // fit the lines between cells to integer multiples of pixels.
 comphelper::ScopeGuard dpiScaleGuard([]() { 
comphelper::LibreOfficeKit::setDPIScale(1.0); });
+double fDPIScaleX = 1;
 if (doc_getDocumentType(pThis) == LOK_DOCTYPE_SPREADSHEET)
 {
-double fDPIScaleX = (nCanvasWidth * 3840.0) / (256.0 * nTileWidth);
+fDPIScaleX = (nCanvasWidth * 3840.0) / (256.0 * nTileWidth);
 assert(fabs(fDPIScaleX - ((nCanvasHeight * 3840.0) / (256.0 * 
nTileHeight))) < 0.0001);
 comphelper::LibreOfficeKit::setDPIScale(fDPIScaleX);
 }
@@ -2155,7 +2156,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 CGContextRef cgc = CGBitmapContextCreate(pBuffer, nCanvasWidth, 
nCanvasHeight, 8, nCanvasWidth*4, CGColorSpaceCreateDeviceRGB(), 
kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little);
 
 CGContextTranslateCTM(cgc, 0, nCanvasHeight);
-CGContextScaleCTM(cgc, 1, -1);
+CGContextScaleCTM(cgc, fDPIScaleX, -fDPIScaleX);
 
 doc_paintTileToCGContext(pThis, (void*) cgc, nCanvasWidth, nCanvasHeight, 
nTilePosX, nTilePosY, nTileWidth, nTileHeight);
 
@@ -3633,7 +3634,7 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* 
/*pThis*/, unsigned nLOKW
 CGContextRef cgc = CGBitmapContextCreate(pBuffer, nWidth, nHeight, 8, 
nWidth*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst | 
kCGImageByteOrder32Little);
 
 CGContextTranslateCTM(cgc, 0, nHeight);
-CGContextScaleCTM(cgc, 1, -1);
+CGContextScaleCTM(cgc, fDPIScale, -fDPIScale);
 
 SystemGraphicsData aData;
 aData.rCGContext = cgc;
@@ -3644,7 +3645,7 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* 
/*pThis*/, unsigned nLOKW
 pDevice->SetOutputSizePixel(Size(nWidth, nHeight));
 
 MapMode aMapMode(pDevice->GetMapMode());
-aMapMode.SetOrigin(Point(-nX, -nY));
+aMapMode.SetOrigin(Point(-(nX / fDPIScale), -(nY / fDPIScale)));
 pDevice->SetMapMode(aMapMode);
 
 comphelper::LibreOfficeKit::setDialogPainting(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.0' - desktop/source

2018-11-05 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |   32 
 1 file changed, 32 insertions(+)

New commits:
commit 1100b05c15591d2c47e092835c354b6edd5a9598
Author: Tor Lillqvist 
AuthorDate: Sat Nov 3 01:44:16 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Nov 5 13:19:30 2018 +0100

Create a CG bitmap context in doc_paintWindow(), too, for iOS

Just like in doc_paintTile().

Now at least some of the dialogs work in the iOS app, yay.

Change-Id: I10c7eeb1f121ba68a1af723d45575890b1d598da
Reviewed-on: https://gerrit.libreoffice.org/62871
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8c540eff4923..376caead288d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2138,6 +2138,9 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 
 #ifdef IOS
 
+// This function is separate only to be used by LibreOfficeLight. If that app 
can be retired, this
+// function's code can be inlined into the iOS part of doc_paintTile().
+
 static void doc_paintTileToCGContext(LibreOfficeKitDocument* pThis,
  void* rCGContext,
  const int nCanvasWidth, const int 
nCanvasHeight,
@@ -3553,6 +3556,33 @@ static void doc_paintWindow(LibreOfficeKitDocument* 
/*pThis*/, unsigned nLOKWind
 return;
 }
 
+#if defined(IOS)
+
+CGContextRef cgc = CGBitmapContextCreate(pBuffer, nWidth, nHeight, 8, 
nWidth*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst | 
kCGImageByteOrder32Little);
+
+CGContextTranslateCTM(cgc, 0, nHeight);
+CGContextScaleCTM(cgc, 1, -1);
+
+SystemGraphicsData aData;
+aData.rCGContext = cgc;
+
+ScopedVclPtrInstance pDevice(, Size(1, 1), 
DeviceFormat::DEFAULT);
+pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+
+pDevice->SetOutputSizePixel(Size(nWidth, nHeight));
+
+MapMode aMapMode(pDevice->GetMapMode());
+aMapMode.SetOrigin(Point(-nX, -nY));
+pDevice->SetMapMode(aMapMode);
+
+comphelper::LibreOfficeKit::setDialogPainting(true);
+pWindow->PaintToDevice(pDevice.get(), Point(0, 0), Size());
+comphelper::LibreOfficeKit::setDialogPainting(false);
+
+CGContextRelease(cgc);
+
+#else
+
 ScopedVclPtrInstance pDevice(nullptr, Size(1, 1), 
DeviceFormat::DEFAULT);
 pDevice->SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
 
@@ -3565,6 +3595,8 @@ static void doc_paintWindow(LibreOfficeKitDocument* 
/*pThis*/, unsigned nLOKWind
 comphelper::LibreOfficeKit::setDialogPainting(true);
 pWindow->PaintToDevice(pDevice.get(), Point(0, 0), Size());
 comphelper::LibreOfficeKit::setDialogPainting(false);
+
+#endif
 }
 
 static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned 
nLOKWindowId, int nAction)
___
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.0' - desktop/source

2018-11-05 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |   16 
 1 file changed, 16 deletions(-)

New commits:
commit d04f9d0a73f167e741c29ad68320e2f49570ccfe
Author: Tor Lillqvist 
AuthorDate: Fri Nov 2 23:39:44 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Nov 5 12:58:20 2018 +0100

On iOS, lok_init_2() links directly to libreofficekit_hook_2()

Thus no need for any special __attribute__ ((visibility("default")))
dance.

Change-Id: I398d588a0165fd616ea0d259bbf2cab1e1a07ccb
Reviewed-on: https://gerrit.libreoffice.org/62867
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5269e090979e..8c540eff4923 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4118,19 +4118,7 @@ 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
-// . 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(DISABLE_DYNLOADING)
-__attribute__ ((visibility("default")))
-#else
 SAL_DLLPUBLIC_EXPORT
-#endif
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* 
user_profile_path)
 {
 if (!gImpl)
@@ -4146,11 +4134,7 @@ LibreOfficeKit *libreofficekit_hook_2(const char* 
install_path, const char* user
 return static_cast(gImpl);
 }
 
-#if defined(__GNUC__) && defined(DISABLE_DYNLOADING)
-__attribute__ ((visibility("default")))
-#else
 SAL_DLLPUBLIC_EXPORT
-#endif
 LibreOfficeKit *libreofficekit_hook(const char* install_path)
 {
 return libreofficekit_hook_2(install_path, 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.0' - desktop/source

2018-11-02 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fd535a0503b022a7b9f7229a0a70e2427c164dcc
Author: Tor Lillqvist 
AuthorDate: Thu Nov 1 23:28:03 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Nov 2 13:00:14 2018 +0100

We now use a fixed name ICU.dat for the ICU data file in the iOS app

That makes it much easier to use the same Xcode project file when
building against different versions of LibreOffice, with different ICU
data files. The configure script in the "online" directory creates a
ICU.dat symlink to the ICU data file in the LibreOffice build
directory, and that is what gets copied into the app bundle.

Change-Id: Ibe2ca85f66e2d4973d6ba3c52fc4d60e113d8f9a
Reviewed-on: https://gerrit.libreoffice.org/62780
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 63893a4ee976..5269e090979e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3969,9 +3969,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 // to use that.
 NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
 
-int fd = open([[bundlePath 
stringByAppendingPathComponent:@U_ICUDATA_NAME".dat"] UTF8String], O_RDONLY);
+int fd = open([[bundlePath stringByAppendingPathComponent:@"ICU.dat"] 
UTF8String], O_RDONLY);
 if (fd == -1)
-NSLog(@"Could not open ICU data file %s", [[bundlePath 
stringByAppendingPathComponent:@U_ICUDATA_NAME".dat"] UTF8String]);
+NSLog(@"Could not open ICU data file %s", [[bundlePath 
stringByAppendingPathComponent:@"ICU.dat"] UTF8String]);
 else
 {
 struct stat st;
___
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.0' - desktop/source

2018-10-30 Thread Libreoffice Gerrit user
 desktop/source/app/app.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e2e7cf25f6fc89807a82e3a51abdd41c68c6c314
Author: Tor Lillqvist 
AuthorDate: Mon Oct 22 18:39:09 2018 +0300
Commit: Michael Meeks 
CommitDate: Tue Oct 30 14:52:42 2018 +0100

If we have encountered a "FATAL ERROR" we can afford writing a line to 
stderr

There is no guarantee that if something is wrong, the
Application::ShowNativeErrorBox() will manage to show anything, is
there? And this code might be invoked in a program that doesn't even
have any GUI. So at least try to show the message on stderr, too.

Change-Id: Ieb11a6f490c26c773af646ed7e9c3cf6ccb4a669
Reviewed-on: https://gerrit.libreoffice.org/62550
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 7f0ace481270..bd25d275541e 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -376,6 +376,7 @@ void FatalError(const OUString& sMessage)
 
 OUString sTitle = sProductKey + " - Fatal Error";
 Application::ShowNativeErrorBox (sTitle, sMessage);
+std::cerr << sTitle << ": " << sMessage << std::endl;
 _exit(EXITHELPER_FATAL_ERROR);
 }
 
___
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.0' - desktop/source sc/inc sc/sdi sc/source

2018-10-12 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx|2 
 sc/inc/colorscale.hxx  |6 +-
 sc/sdi/scalc.sdi   |2 
 sc/source/core/data/colorscale.cxx |4 -
 sc/source/ui/view/cellsh1.cxx  |   92 ++---
 5 files changed, 73 insertions(+), 33 deletions(-)

New commits:
commit 9c20b03783ae07f40891422c1e8a943384b6f96d
Author: Jan Holesovsky 
AuthorDate: Mon Jun 25 22:58:30 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Oct 12 09:51:33 2018 +0200

Conditional formatting: Allow to set the icon set CF via .uno: command.

When .uno:IconSetFormatDialog gets a parameter, it directly creates the
icon set conditional formatting with pre-selected values.

Change-Id: I75dda90e5ea9c191254acc24c564cda7b27243a5
Reviewed-on: https://gerrit.libreoffice.org/56429
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/61660

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9d5f43108672..a7c2790150ee 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -322,6 +322,8 @@ std::vector 
desktop::jsonToPropertyValuesVector(const char
 aValue.Value <<= OString(rValue.c_str()).toFloat();
 else if (rType == "long")
 aValue.Value <<= OString(rValue.c_str()).toInt32();
+else if (rType == "short")
+aValue.Value <<= 
static_cast(OString(rValue.c_str()).toInt32());
 else if (rType == "unsigned short")
 aValue.Value <<= 
static_cast(OString(rValue.c_str()).toUInt32());
 else if (rType == "[]any")
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index 19f00d7087e8..0adde0e30585 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -52,7 +52,7 @@ private:
 ScConditionalFormat* mpFormat;
 
 public:
-ScColorScaleEntry(double nVal, const Color& rCol);
+ScColorScaleEntry(double nVal, const Color& rCol, ScColorScaleEntryType 
eType = COLORSCALE_VALUE);
 ScColorScaleEntry();
 ScColorScaleEntry(const ScColorScaleEntry& rEntry);
 ScColorScaleEntry(ScDocument* pDoc, const ScColorScaleEntry& rEntry);
@@ -343,8 +343,8 @@ struct ScIconSetFormatData
 // std..pair::second == -1 means no image
 std::vector > maCustomVector;
 
-ScIconSetFormatData():
-eIconSetType(IconSet_3Arrows),
+ScIconSetFormatData(ScIconSetType eType = IconSet_3Arrows):
+eIconSetType(eType),
 mbShowValue(true),
 mbReverse(false),
 mbCustom(false)
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 3fc0f38cc92d..a1d176603e8b 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -739,7 +739,7 @@ SfxVoidItem DataBarFormatDialog SID_OPENDLG_DATABAR
 
 
 SfxVoidItem IconSetFormatDialog SID_OPENDLG_ICONSET
-()
+(SfxInt16Item IconSet FN_PARAM_1)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
diff --git a/sc/source/core/data/colorscale.cxx 
b/sc/source/core/data/colorscale.cxx
index df484f328c58..fedbb4230dc8 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -136,10 +136,10 @@ ScColorScaleEntry::ScColorScaleEntry():
 {
 }
 
-ScColorScaleEntry::ScColorScaleEntry(double nVal, const Color& rCol):
+ScColorScaleEntry::ScColorScaleEntry(double nVal, const Color& rCol, 
ScColorScaleEntryType eType):
 mnVal(nVal),
 maColor(rCol),
-meType(COLORSCALE_VALUE),
+meType(eType),
 mpFormat(nullptr)
 {
 }
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 7a8710634b3b..622db89acb67 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -51,6 +51,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -80,6 +81,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -101,6 +103,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -2007,15 +2010,16 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 aRangeList.push_back(pRange);
 }
 
+// try to find an existing conditional format
 const ScConditionalFormat* pCondFormat = nullptr;
 const ScPatternAttr* pPattern = pDoc->GetPattern(aPos.Col(), 
aPos.Row(), aPos.Tab());
+ScConditionalFormatList* pList = 
pDoc->GetCondFormList(aPos.Tab());
 const std::vector& rCondFormats = 
pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData();
 bool bContainsCondFormat = !rCondFormats.empty();
 bool bCondFormatDlg = false;
+bool bContainsExistingCondFormat = false;
 if(bContainsCondFormat)
 {
-bool bContainsExistingCondFormat = false;
-ScConditionalFormatList* pList = 
pDoc->GetCondFormList(aPos.Tab());
 for 

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

2018-06-20 Thread Henry Castro
 desktop/source/lib/init.cxx |   81 ++--
 1 file changed, 78 insertions(+), 3 deletions(-)

New commits:
commit 705b6b1129d3595251ffcc5cbc003e0799a4edf6
Author: Henry Castro 
Date:   Mon Jun 18 08:28:40 2018 -0400

lokit: add jsonToUnoAny

Change-Id: I79c2fe22fe7f3a8daa121ecaa529b6bca3216bf3
Reviewed-on: https://gerrit.libreoffice.org/56032
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit 87674a28893520eb8bb528c7e774a7ed926976cb)
Reviewed-on: https://gerrit.libreoffice.org/56203

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 34bb568b8a8e..df318560aacd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -48,6 +48,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -232,19 +235,79 @@ static OUString getAbsoluteURL(const char* pURL)
 return OUString();
 }
 
+static uno::Any jsonToUnoAny(const boost::property_tree::ptree& aTree)
+{
+uno::Any aAny;
+uno::Any aValue;
+sal_Int32 nFields;
+uno::TypeClass aTypeClass;
+uno::Reference< reflection::XIdlField > aField;
+boost::property_tree::ptree aNodeNull, aNodeValue, aNodeField;
+const std::string& rType = aTree.get("type", "");
+const std::string& rValue = aTree.get("value", "");
+uno::Sequence< uno::Reference< reflection::XIdlField > > aFields;
+uno::Reference< reflection:: XIdlClass > xIdlClass =
+
css::reflection::theCoreReflection::get(comphelper::getProcessComponentContext())->forName(OUString::fromUtf8(rType.c_str()));
+if (xIdlClass.is())
+{
+aTypeClass = xIdlClass->getTypeClass();
+xIdlClass->createObject(aAny);
+aFields = xIdlClass->getFields();
+nFields = aFields.getLength();
+aNodeValue = aTree.get_child("value", aNodeNull);
+if (nFields > 0 && aNodeValue != aNodeNull)
+{
+for (sal_Int32 itField = 0; itField < nFields; ++itField)
+{
+aField = aFields[itField];
+aNodeField = 
aNodeValue.get_child(aField->getName().toUtf8().getStr(), aNodeNull);
+if (aNodeField != aNodeNull)
+{
+aValue = jsonToUnoAny(aNodeField);
+aField->set(aAny, aValue);
+}
+}
+}
+else if (!rValue.empty())
+{
+if (aTypeClass == uno::TypeClass_VOID)
+aAny.clear();
+else if (aTypeClass == uno::TypeClass_BYTE)
+aAny <<= 
static_cast(OString(rValue.c_str()).toInt32());
+else if (aTypeClass == uno::TypeClass_BOOLEAN)
+aAny <<= OString(rValue.c_str()).toBoolean();
+else if (aTypeClass == uno::TypeClass_SHORT)
+aAny <<= 
static_cast(OString(rValue.c_str()).toInt32());
+else if (aTypeClass == uno::TypeClass_UNSIGNED_SHORT)
+aAny <<= 
static_cast(OString(rValue.c_str()).toUInt32());
+else if (aTypeClass == uno::TypeClass_LONG)
+aAny <<= OString(rValue.c_str()).toInt32();
+else if (aTypeClass == uno::TypeClass_UNSIGNED_LONG)
+aAny <<= 
static_cast(OString(rValue.c_str()).toInt32());
+else if (aTypeClass == uno::TypeClass_FLOAT)
+aAny <<= OString(rValue.c_str()).toFloat();
+else if (aTypeClass == uno::TypeClass_DOUBLE)
+aAny <<= OString(rValue.c_str()).toDouble();
+else if (aTypeClass == uno::TypeClass_STRING)
+aAny <<= OUString::fromUtf8(rValue.c_str());
+}
+}
+return aAny;
+}
+
 static std::vector jsonToPropertyValuesVector(const 
char* pJSON)
 {
 std::vector aArguments;
 if (pJSON && pJSON[0] != '\0')
 {
-boost::property_tree::ptree aTree;
+boost::property_tree::ptree aTree, aNodeNull, aNodeValue;
 std::stringstream aStream(pJSON);
 boost::property_tree::read_json(aStream, aTree);
 
 for (const auto& rPair : aTree)
 {
-const std::string& rType = rPair.second.get("type");
-const std::string& rValue = rPair.second.get("value");
+const std::string& rType = rPair.second.get("type", 
"");
+const std::string& rValue = rPair.second.get("value", 
"");
 
 beans::PropertyValue aValue;
 aValue.Name = OUString::fromUtf8(rPair.first.c_str());
@@ -258,6 +321,18 @@ static std::vector 
jsonToPropertyValuesVector(const char*
 aValue.Value <<= OString(rValue.c_str()).toInt32();
 else if (rType == "unsigned short")
 aValue.Value <<= 
static_cast(OString(rValue.c_str()).toUInt32());
+else if (rType == "[]any")
+{
+aNodeValue = rPair.second.get_child("value", aNodeNull);
+if (aNodeValue != 

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

2018-06-04 Thread Aron Budea
 desktop/source/app/app.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 68f54670d13ce4d2a93ec59b8760e20669064781
Author: Aron Budea 
Date:   Mon Jun 4 20:35:34 2018 +0200

Disable profile locking

Change-Id: Id64e183eff78e90237c4d1cff224aac302bfbe04
Reviewed-on: https://gerrit.libreoffice.org/55294
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index ec1b6531316c..7f0ace481270 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1318,7 +1318,8 @@ int Desktop::Main()
 // check user installation directory for lockfile so we can be sure
 // there is no other instance using our data files from a remote host
 
-bool bMustLockProfile = ( getenv( "SAL_NOLOCK_PROFILE" ) == nullptr );
+// bool bMustLockProfile = ( getenv( "SAL_NOLOCK_PROFILE" ) == nullptr 
);
+bool bMustLockProfile = false;
 if ( bMustLockProfile )
 {
 m_xLockfile.reset(new Lockfile);
___
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.0' - desktop/source

2018-04-11 Thread Marco Cecchetti
 desktop/source/lib/init.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 4a40e55e4d37f1f67ab38990f193ce29a3ebb4dc
Author: Marco Cecchetti 
Date:   Sun Apr 8 12:12:27 2018 +0200

lok: sc: clicking outside a pop-up or context menu doesn't close it

Change-Id: Iecf0659467264d921c7c9faddc98fd5519e7db93
Reviewed-on: https://gerrit.libreoffice.org/52617
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit 1cd76097043a5ece899dd7c9468755dcd961b0eb)
Reviewed-on: https://gerrit.libreoffice.org/52737

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9c337990aebe..47d4a0ad0ca8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -80,6 +80,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3419,10 +3420,12 @@ static void doc_postWindow(LibreOfficeKitDocument* 
/*pThis*/, unsigned nLOKWindo
 return;
 }
 
-if (Dialog* pDialog = dynamic_cast(pWindow.get()))
+if (nAction == LOK_WINDOW_CLOSE)
 {
-if (nAction == LOK_WINDOW_CLOSE)
+if (Dialog* pDialog = dynamic_cast(pWindow.get()))
 pDialog->Close();
+else if (FloatingWindow* pFloatWin = 
dynamic_cast(pWindow.get()))
+pFloatWin->EndPopupMode(FloatWinPopupEndFlags::Cancel | 
FloatWinPopupEndFlags::CloseAll);
 }
 }
 
___
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.0' - desktop/source include/vcl vcl/source

2018-03-26 Thread Michael Meeks
 desktop/source/lib/init.cxx   |6 ++-
 include/vcl/builder.hxx   |   10 +
 vcl/source/window/builder.cxx |   73 --
 3 files changed, 64 insertions(+), 25 deletions(-)

New commits:
commit 5483721115884ac41778d9fc5c0f0461456f4dc7
Author: Michael Meeks 
Date:   Mon Mar 26 16:27:34 2018 +0100

lok: enable pre-loading with Vcl's builder

Cache vclbuilder's loaded modules globally & simplify logic.

Pre-populate that cache on preload for LOK vs. a somewhat
inelegant pre-canned list of dialog libraries.

Change-Id: I86d936862a41495fd37908f3ee7eb2e0c363d651

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 4cb032500484..a9534de375e0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -99,6 +99,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 
 #include 
@@ -3780,7 +3782,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 // 2) comphelper::setProcessServiceFactory(xSFactory);
 // 3) InitVCL()
 aService->initialize({css::uno::makeAny("preload")});
-
+// Force load some modules
+VclBuilder::preload();
+VclAbstractDialogFactory::Create();
 preloadData();
 
 // Release Solar Mutex, lo_startmain thread should acquire it.
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index e696c1dc04d8..12969fc2eac1 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -94,17 +94,13 @@ public:
 return m_sHelpRoot;
 }
 
+/// Pre-loads all modules containing UI information
+static void preload();
+
 private:
 VclBuilder(const VclBuilder&) = delete;
 VclBuilder& operator=(const VclBuilder&) = delete;
 
-typedef std::map ModuleMap;
-
-//We store these until the builder is deleted, that way we can use the
-//ui-previewer on custom widgets and guarantee the modules they are from
-//exist for the duration of the dialog
-ModuleMap   m_aModuleMap;
-
 //If the toplevel window has any properties which need to be set on it,
 //but the toplevel is the owner of the builder, then its ctor
 //has not been completed during the building, so properties for it
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index da1e806d3a4d..cb3c5ae10152 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1130,6 +1131,49 @@ void VclBuilder::cleanupWidgetOwnScrolling(vcl::Window 
*pScrollParent, vcl::Wind
 extern "C" { static void SAL_CALL thisModule() {} }
 #endif
 
+// We store these forever, closing modules is non-ideal from a performance
+// perspective, code pages will be freed up by the OS anyway if unused for
+// a while in many cases, and this helps us pre-init.
+typedef std::map ModuleMap;
+static ModuleMap g_aModuleMap;
+static osl::Module g_aMergedLib;
+
+#ifndef SAL_DLLPREFIX
+#  define SAL_DLLPREFIX ""
+#endif
+
+void VclBuilder::preload()
+{
+#ifndef DISABLE_DYNLOADING
+
+#if ENABLE_MERGELIBS
+g_aMergedLibs->loadRelative(, SVLIBRARY("merged"));
+#endif
+// find -name '*ui*' | xargs grep 'class=".*lo-' |
+// sed 's/.*class="//' | sed 's/-.*$//' | sort | uniq
+static const char *aWidgetLibs[] = {
+"sfxlo",  "svtlo", "svxcorelo", "foruilo",
+"vcllo",  "svxlo", "cuilo", "swlo",
+"swuilo", "sclo",  "sdlo",  "chartcontrollerlo",
+"smlo",   "scuilo","basctllo",  "sduilo",
+"scnlo",  "xsltdlglo", "pcrlo" // "dbulo"
+};
+for (auto & lib : aWidgetLibs)
+{
+OUStringBuffer sModuleBuf;
+sModuleBuf.append(SAL_DLLPREFIX);
+sModuleBuf.append(OUString::createFromAscii(lib));
+sModuleBuf.append(SAL_DLLEXTENSION);
+osl::Module* pModule = new osl::Module;
+OUString sModule = sModuleBuf.makeStringAndClear();
+if (pModule->loadRelative(, sModule))
+g_aModuleMap.insert(std::make_pair(sModule, 
std::unique_ptr(pModule)));
+else
+delete pModule;
+}
+#endif // DISABLE_DYNLOADING
+}
+
 VclPtr VclBuilder::makeObject(vcl::Window *pParent, const OString 
, const OString ,
 stringmap )
 {
@@ -1618,33 +1662,28 @@ VclPtr VclBuilder::makeObject(vcl::Window 
*pParent, const OString &
 sal_Int32 nDelim = name.indexOf('-');
 if (nDelim != -1)
 {
+OUString sFunction(OStringToOUString(OString("make") + 
name.copy(nDelim+1), RTL_TEXTENCODING_UTF8));
 #ifndef DISABLE_DYNLOADING
 OUStringBuffer sModuleBuf;
 sModuleBuf.append(SAL_DLLPREFIX);
 sModuleBuf.append(OStringToOUString(name.copy(0, nDelim),