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

2023-12-05 Thread Stephan Bergmann (via logerrit)
 desktop/source/app/app.cxx |1 +
 desktop/source/app/updater.cxx |   22 +++---
 2 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 8686b480ba1d79463f33fe931a454d9d92c3d739
Author: Stephan Bergmann 
AuthorDate: Tue Dec 5 14:05:36 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Dec 5 18:07:06 2023 +0100

Fix apparent copy/paste typo

...present ever since the code got introduced in
569269078576fa832143ec4f0bf03283ff358f48 "improve the update checker"

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

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 1af82cf85fc9..0cd95da8d4e7 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -477,7 +477,7 @@ update_info parse_response(const std::string& rResponse)
 }
 
 orcus::json::node aLanguageNode = aDocumentRoot.child("languages");
-if (aUpdateNode.type() != orcus::json::node_t::object)
+if (aLanguageNode.type() != orcus::json::node_t::object)
 {
 throw invalid_update_info();
 }
commit 7f49fa220225d2afbefac756a03586212d8ce1c6
Author: Stephan Bergmann 
AuthorDate: Tue Dec 5 12:35:08 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Dec 5 18:06:51 2023 +0100

Make --enable-online-update=mar at least compile again, on Linux

Seen it build (but no idea yet whether it actually would work) with
autogen.input including

> --enable-online-update=mar
> --with-update-config=/home/sberg/lo/update.ini

and ~/lo/update.ini containing

> [Updater]
> ServerURL=TODO
> base-url=TODO
> certificate-der=/home/sberg/lo/certificate.der
> certificate-name=TODO
> certificate-path=TODO
> channel=TODO
> upload-url=TODO

and ~/lo/certificate.der containing

> TODO

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

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index cd1d1de0d6ea..4c13a2a8e716 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -118,6 +118,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index edac2cb38350..1af82cf85fc9 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -36,7 +36,6 @@
 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -48,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace {
 
@@ -391,9 +391,9 @@ public:
 }
 };
 
-OUString toOUString(const std::string& rStr)
+OUString toOUString(const std::string_view& rStr)
 {
-return OUString::fromUtf8(rStr.c_str());
+return OUString::fromUtf8(rStr);
 }
 
 update_file parse_update_file(orcus::json::node& rNode)
@@ -422,12 +422,12 @@ update_file parse_update_file(orcus::json::node& rNode)
 }
 
 update_file aUpdateFile;
-aUpdateFile.aURL = toOUString(aURLNode.string_value().str());
+aUpdateFile.aURL = toOUString(aURLNode.string_value());
 
 if (aUpdateFile.aURL.isEmpty())
 throw invalid_update_info();
 
-aUpdateFile.aHash = toOUString(aHashNode.string_value().str());
+aUpdateFile.aHash = toOUString(aHashNode.string_value());
 aUpdateFile.nSize = static_cast(aSizeNode.numeric_value());
 return aUpdateFile;
 }
@@ -454,7 +454,7 @@ update_info parse_response(const std::string& rResponse)
 {
 update_info aUpdateInfo;
 auto aMsgNode = aDocumentRoot.child("response");
-aUpdateInfo.aMessage = toOUString(aMsgNode.string_value().str());
+aUpdateInfo.aMessage = toOUString(aMsgNode.string_value());
 return aUpdateInfo;
 }
 
@@ -483,17 +483,17 @@ update_info parse_response(const std::string& rResponse)
 }
 
 update_info aUpdateInfo;
-aUpdateInfo.aFromBuildID = toOUString(aFromNode.string_value().str());
-aUpdateInfo.aSeeAlsoURL = toOUString(aSeeAlsoNode.string_value().str());
+aUpdateInfo.aFromBuildID = toOUString(aFromNode.string_value());
+aUpdateInfo.aSeeAlsoURL = toOUString(aSeeAlsoNode.string_value());
 
 aUpdateInfo.aUpdateFile = parse_update_file(aUpdateNode);
 
-std::vector aLanguages = aLanguageNode.keys();
+std::vector aLanguages = aLanguageNode.keys();
 for (auto const& language : aLanguages)
 {
 language_file aLanguageFile;
 auto aLangEntry = aLanguageNode.child(language);
-aLanguageFile.aLangCode = toOUString(language.str());
+aLanguageFile.aLangCode = toOUString(language);
 aLanguageFile.aUpdateFile = parse_update_file(aLangEntry);
 aUpdateInfo.aLanguageFiles.push_back(aLanguageFile);
 }


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

2023-10-11 Thread Marco Cecchetti (via logerrit)
 desktop/source/lib/init.cxx |   31 ++-
 1 file changed, 10 insertions(+), 21 deletions(-)

New commits:
commit bf9897bc11a5ee06197ce566214456f796f68a34
Author: Marco Cecchetti 
AuthorDate: Fri Jun 2 16:02:07 2023 +0200
Commit: Caolán McNamara 
CommitDate: Wed Oct 11 15:21:11 2023 +0200

Removing unused variable in preLoadShortCutAccelerators

When all warnings are treated as errors the following error was
reported:

desktop/source/lib/init.cxx:
OUString language =
LanguageTag(installedLocales[i]).getLocale().Language;

The problem started after commit
1cd46ba9140b7f5f077d8e9da405b180857f008d.
Remove the allowed language check from UI languages.

Change-Id: Id1f4269fe262b61b4fb05d61bf9c64a747275c28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152561
Reviewed-by: Gökay ŞATIR 
Tested-by: Aron Budea 
(cherry picked from commit b0fa2ea7decadae61ad10e340698a8dd4af45e6e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157813
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 387eb95e0fa7..fc57d748d5d4 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7521,8 +7521,6 @@ static void preLoadShortCutAccelerators()
 
 for (sal_Int32 i = 0; i < installedLocales.getLength(); i++)
 {
-OUString language = 
LanguageTag(installedLocales[i]).getLocale().Language;
-
 // Set the UI language to current one, before creating the accelerator.
 std::shared_ptr 
batch(comphelper::ConfigurationChanges::create());
 officecfg::Setup::L10N::ooLocale::set(installedLocales[i], batch);
commit 7c36e6ec7b00fa6be8ef5adbc7fd38b90a2c64e3
Author: Gökay Şatır 
AuthorDate: Wed May 31 11:58:09 2023 +0300
Commit: Caolán McNamara 
CommitDate: Wed Oct 11 15:20:57 2023 +0200

Remove the allowed language check from UI languages.

Allowed langauges list is for spell checking algorithms. No need to use it 
for UI shortcuts.

Signed-off-by: Gökay Şatır 
Change-Id: I996861b79247269e9b788b008fe6fc26e5ef44c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152416
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 
(cherry picked from commit 1cd46ba9140b7f5f077d8e9da405b180857f008d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157812
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 40c11e54d080..387eb95e0fa7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7523,27 +7523,18 @@ static void preLoadShortCutAccelerators()
 {
 OUString language = 
LanguageTag(installedLocales[i]).getLocale().Language;
 
-if (!comphelper::LibreOfficeKit::isAllowlistedLanguage(language))
-{
-// Language is listed by COOL and also installed in core. We can 
create the short cut accelerator.
-
-// Set the UI language to current one, before creating the 
accelerator.
-std::shared_ptr 
batch(comphelper::ConfigurationChanges::create());
-officecfg::Setup::L10N::ooLocale::set(installedLocales[i], batch);
-batch->commit();
+// Set the UI language to current one, before creating the accelerator.
+std::shared_ptr 
batch(comphelper::ConfigurationChanges::create());
+officecfg::Setup::L10N::ooLocale::set(installedLocales[i], batch);
+batch->commit();
 
-// Supported module names: Writer, Calc, Draw, Impress
-std::vector supportedModuleNames = { 
"com.sun.star.text.TextDocument", "com.sun.star.sheet.SpreadsheetDocument", 
"com.sun.star.drawing.DrawingDocument", 
"com.sun.star.presentation.PresentationDocument" };
-// Create the accelerators.
-for (std::size_t j = 0; j < supportedModuleNames.size(); j++)
-{
-OUString key = supportedModuleNames[j] + installedLocales[i];
-acceleratorConfs[key] = 
svt::AcceleratorExecute::lok_createNewAcceleratorConfiguration(::comphelper::getProcessComponentContext(),
 supportedModuleNames[j]);
-}
-}
-else
+// Supported module names: Writer, Calc, Draw, Impress
+std::vector supportedModuleNames = { 
"com.sun.star.text.TextDocument", "com.sun.star.sheet.SpreadsheetDocument", 
"com.sun.star.drawing.DrawingDocument", 
"com.sun.star.presentation.PresentationDocument" };
+// Create the accelerators.
+for (std::size_t j = 0; j < supportedModuleNames.size(); j++)
 {
-std::cerr << "Language is installed in core but not in the list of 
COOL languages: " << language << "\n";
+OUString key = supportedModuleNames[j] + installedLocales[i];
+acceleratorConfs[key] = 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit ridljar/com

2023-09-29 Thread Caolán McNamara (via logerrit)
 desktop/source/lib/init.cxx |  111 
+++---
 include/LibreOfficeKit/LibreOfficeKit.h |6 
 include/LibreOfficeKit/LibreOfficeKit.hxx   |   20 
-
 ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java |6 
 4 files changed, 52 insertions(+), 91 deletions(-)

New commits:
commit ef5cb6cdcd50942aea56ffb322bc89a4c7069bc6
Author: Caolán McNamara 
AuthorDate: Fri Sep 29 12:12:10 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Sep 29 14:14:39 2023 +0200

make FunctionBasedURPConnection simpler

and leave it to the client how it wants to read/provide the data

Change-Id: Ibd4d967b79a699c96d1ea8529544b585a97cc0c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157405
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 434b65319776..d0c3e5fe939b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2576,10 +2576,10 @@ static char* lo_extractRequest(LibreOfficeKit* pThis,
 
 static void lo_trimMemory(LibreOfficeKit* pThis, int nTarget);
 
-static int
-lo_startURP(LibreOfficeKit* pThis, void* pReceiveURPFromLOContext, void** 
pSendURPToLOContext,
+static void*
+lo_startURP(LibreOfficeKit* pThis, void* pReceiveURPFromLOContext, void* 
pSendURPToLOContext,
 int (*fnReceiveURPFromLO)(void* pContext, const signed char* 
pBuffer, int nLen),
-int (**pfnSendURPToLO)(void* pContext, const signed char* pBuffer, 
int nLen));
+int (*fnSendURPToLO)(void* pContext, signed char* pBuffer, int 
nLen));
 
 static void lo_stopURP(LibreOfficeKit* pThis, void* pSendURPToLOContext);
 
@@ -3234,39 +3234,39 @@ Reference 
FunctionBasedURPInstanceProvider::getInstance(const OUStri
 class FunctionBasedURPConnection : public 
cppu::WeakImplHelper
 {
 public:
-explicit FunctionBasedURPConnection(void*, int (*)(void* pContext, const 
signed char* pBuffer,
-   int nLen));
+explicit FunctionBasedURPConnection(void*, int (*)(void* pContext, const 
signed char* pBuffer, int nLen),
+void*, int (*)(void* pContext, signed 
char* pBuffer, int nLen));
 ~FunctionBasedURPConnection();
 
 // These overridden member functions use "read" and "write" from the point 
of view of LO,
 // i.e. the opposite to how startURP() uses them.
-virtual sal_Int32 SAL_CALL read(Sequence& aReadBytes,
+virtual sal_Int32 SAL_CALL read(Sequence& rReadBytes,
 sal_Int32 nBytesToRead) override;
 virtual void SAL_CALL write(const Sequence& aData) override;
 virtual void SAL_CALL flush() override;
 virtual void SAL_CALL close() override;
 virtual OUString SAL_CALL getDescription() override;
 void setBridge(Reference);
-int addClientURPToBuffer(const signed char* pBuffer, int nLen);
 void* getContext();
 inline static int g_connectionCount = 0;
 
 private:
-std::shared_ptr> m_pBuffer;
 void* m_pRecieveFromLOContext;
+void* m_pSendURPToLOContext;
 int (*m_fnReceiveURPFromLO)(void* pContext, const signed char* pBuffer, 
int nLen);
+int (*m_fnSendURPToLO)(void* pContext, signed char* pBuffer, int nLen);
 Reference m_URPBridge;
-std::atomic m_closed = false;
-std::condition_variable m_URPInBuffer;
-std::mutex m_bufferMutex;
 };
 
 FunctionBasedURPConnection::FunctionBasedURPConnection(
 void* pRecieveFromLOContext,
-int (*fnRecieveFromLO)(void* pContext, const signed char* pBuffer, int 
nLen))
-: m_pBuffer(std::make_shared>())
-, m_pRecieveFromLOContext(pRecieveFromLOContext)
-, m_fnReceiveURPFromLO(fnRecieveFromLO)
+int (*fnReceiveURPFromLO)(void* pContext, const signed char* pBuffer, int 
nLen),
+void* pSendURPToLOContext,
+int (*fnSendURPToLO)(void* pContext, signed char* pBuffer, int nLen))
+: m_pRecieveFromLOContext(pRecieveFromLOContext)
+, m_pSendURPToLOContext(pSendURPToLOContext)
+, m_fnReceiveURPFromLO(fnReceiveURPFromLO)
+, m_fnSendURPToLO(fnSendURPToLO)
 {
 g_connectionCount++;
 }
@@ -3277,62 +3277,23 @@ 
FunctionBasedURPConnection::~FunctionBasedURPConnection()
 xComp->dispose(); // TODO: check this doesn't deadlock
 }
 
-int sendURPToLO(void* pContext /* FunctionBasedURPConnection* */, const signed 
char* pBuffer,
-int nLen)
-{
-return 
static_cast(pContext)->addClientURPToBuffer(pBuffer,
 nLen);
-}
-
-int FunctionBasedURPConnection::addClientURPToBuffer(const signed char* 
pBuffer, int nLen)
-{
-{
-std::scoped_lock lock(m_bufferMutex);
-
-if (m_closed)
-{
-// We can't write URP to a closed connection
-SAL_WARN("lok.urp", "A client attempted to write URP to a closed "
-

[Libreoffice-commits] core.git: 2 commits - desktop/source include/ucbhelper ucbhelper/source ucb/source

2023-08-18 Thread Michael Stahl (via logerrit)
 desktop/source/app/crashreport.cxx |6 ++---
 include/ucbhelper/proxydecider.hxx |6 ++---
 ucb/source/ucp/cmis/cmis_content.cxx   |5 
 ucb/source/ucp/cmis/cmis_repo_content.cxx  |5 
 ucb/source/ucp/webdav-curl/CurlSession.cxx |   34 +++--
 ucb/source/ucp/webdav-curl/CurlSession.hxx |4 +--
 ucbhelper/source/client/proxydecider.cxx   |   17 ++
 7 files changed, 40 insertions(+), 37 deletions(-)

New commits:
commit f88af95552f9b46e1714964d84c447327b50ed40
Author: Michael Stahl 
AuthorDate: Fri Aug 18 15:09:43 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 18 18:33:27 2023 +0200

ucbhelper,ucb,desktop: InternetProxyServer is problematic

It turns out that every single client of InternetProxyDecider simply
concatenates the 2 members of InternetProxyServer into a single string
and passes it on to curl_easy_setopt(CURLOPT_PROXY), which will happily
take a URL including scheme and everything.

It turns out that the awful GetUnixSystemProxy() tries to cut off the
scheme in a terrible way, but GetPACProxy() does no such thing and
WINHTTP_PROXY_INFO::lpszProxy may or may not contain scheme in its
entries; fix this to only separate the port and leave the rest alone.

So why do we need a InternetProxyServer struct?  Because officecfg has
separate entries that correspond to its members, and so
InternetProxyDecider gets separate events on its listener interface when
any of them changes, which is easiest to handle if it stores these
separately.

So just return a concatenated URL with or without scheme in getProxy().

Change-Id: I43c696471c8bec90667b5930fa00975adb432fe1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155840
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/app/crashreport.cxx 
b/desktop/source/app/crashreport.cxx
index 59a2aa771b32..680492b3b80a 100644
--- a/desktop/source/app/crashreport.cxx
+++ b/desktop/source/app/crashreport.cxx
@@ -139,7 +139,7 @@ void CrashReporter::writeCommonInfo()
 static constexpr OUStringLiteral url = u"crashreport.libreoffice.org";
 const sal_Int32 port = 443;
 
-const ucbhelper::InternetProxyServer proxy_server = 
proxy_decider.getProxy(protocol, url, port);
+const OUString proxy_server = proxy_decider.getProxy(protocol, url, port);
 
 // save the new Keys
 vmaKeyValues atlast = maKeyValues;
@@ -152,9 +152,9 @@ void CrashReporter::writeCommonInfo()
 addKeyValue("BuildID", utl::Bootstrap::getBuildIdData(""), AddItem);
 addKeyValue("URL", protocol + "://" + url + "/submit/", AddItem);
 
-if (!proxy_server.aName.isEmpty())
+if (!proxy_server.isEmpty())
 {
-addKeyValue("Proxy", proxy_server.aName + ":" + 
OUString::number(proxy_server.nPort), AddItem);
+addKeyValue("Proxy", proxy_server, AddItem);
 }
 
 // write the new keys at the end
diff --git a/include/ucbhelper/proxydecider.hxx 
b/include/ucbhelper/proxydecider.hxx
index 9a1abad3264a..3fe3025833ce 100644
--- a/include/ucbhelper/proxydecider.hxx
+++ b/include/ucbhelper/proxydecider.hxx
@@ -116,10 +116,10 @@ public:
   * If host is not empty this parameter must always contain a valid
   * port number, for instance the default port for the requested
   * protocol(i.e. 80 or http).
-  * @return a InternetProxyServer struct. If member aName of the
-  * InternetProxyServer is empty no proxy server is to be used.
+  * @return an URL, with or without scheme.
+  * If empty no proxy server is to be used.
   */
-InternetProxyServer
+OUString
 getProxy( const OUString & rProtocol,
   const OUString & rHost,
   sal_Int32 nPort ) const;
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx 
b/ucb/source/ucp/cmis/cmis_content.cxx
index 815d89502f2c..b5ad2cb738ce 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -304,11 +304,8 @@ namespace cmis
 // Set the proxy if needed. We are doing that all times as the proxy 
data shouldn't be cached.
 ucbhelper::InternetProxyDecider aProxyDecider( m_xContext );
 INetURLObject aBindingUrl( m_aURL.getBindingUrl( ) );
-const ucbhelper::InternetProxyServer& rProxy = aProxyDecider.getProxy(
+const OUString sProxy = aProxyDecider.getProxy(
 INetURLObject::GetScheme( aBindingUrl.GetProtocol( ) ), 
aBindingUrl.GetHost(), aBindingUrl.GetPort() );
-OUString sProxy = rProxy.aName;
-if ( rProxy.nPort > 0 )
-sProxy += ":" + OUString::number( rProxy.nPort );
 libcmis::SessionFactory::setProxySettings( OUSTR_TO_STDSTR( sProxy ), 
std::string(), std::string(), std::string() );
 
 // Look for a cached session, key is binding url + repo id
diff --git 

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

2023-08-18 Thread Caolán McNamara (via logerrit)
 desktop/source/lib/init.cxx|   27 ++-
 vcl/source/graphic/BinaryDataContainer.cxx |1 -
 2 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit a43a9dd8205f089c92737cb5519ed2a96a8d8ff2
Author: Caolán McNamara 
AuthorDate: Thu Aug 17 15:57:28 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 18 09:58:08 2023 +0200

logs full of "OConfigurationNode::hasByName: object is invalid"

warn:legacy.osl:3509:3314:unotools/source/config/confignode.cxx:408: 
OConfigurationNode::hasByName: object is invalid!
warn:legacy.osl:3509:3314:unotools/source/config/confignode.cxx:409: 
OConfigurationNode::hasByName: object is invalid!
warn:legacy.osl:3509:3314:comphelper/source/misc/types.cxx:90: 
comphelper::getBOOL : invalid argument !

in cool, open a document, switch from light to dark with sidebar open,
click on a paragraph and then on another with different properties, e.g.
normal vs heading and each change of a sidebar context triggers the
warning over and over again.

The config has no mention of notebookbar_online.ui but we set
notebookbar_online.ui as the default to use for a notebookbar
so replace mentions in the config of notebookbar.ui with
notebookbar_online.ui for consistency when we do that and we
can drop the constant log spam.

Change-Id: I41860f5422d4426d8e3786b38c967e52bc803ae3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155804
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6d5295222f74..86a32708e59b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -82,6 +82,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -202,6 +203,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -7427,7 +7429,23 @@ static void activateNotebookbar(std::u16string_view rApp)
 
 if (aAppNode.isValid())
 {
-aAppNode.setNodeValue("Active", 
Any(OUString("notebookbar_online.ui")));
+OUString sNoteBookbarName("notebookbar_online.ui");
+aAppNode.setNodeValue("Active", Any(sNoteBookbarName));
+
+const utl::OConfigurationNode aImplsNode = aAppNode.openNode("Modes");
+const Sequence aModeNodeNames( aImplsNode.getNodeNames() );
+
+for (const auto& rModeNodeName : aModeNodeNames)
+{
+const utl::OConfigurationNode 
aImplNode(aImplsNode.openNode(rModeNodeName));
+if (!aImplNode.isValid())
+continue;
+
+OUString aCommandArg = 
comphelper::getString(aImplNode.getNodeValue("CommandArg"));
+if (aCommandArg == "notebookbar.ui")
+aImplNode.setNodeValue("CommandArg", Any(sNoteBookbarName));
+}
+
 aAppNode.commit();
 }
 }
@@ -7866,6 +7884,13 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 
 if (bNotebookbar)
 {
+std::shared_ptr 
batch(comphelper::ConfigurationChanges::create());
+
officecfg::Office::UI::ToolbarMode::ActiveWriter::set("notebookbar_online.ui", 
batch);
+
officecfg::Office::UI::ToolbarMode::ActiveCalc::set("notebookbar_online.ui", 
batch);
+
officecfg::Office::UI::ToolbarMode::ActiveImpress::set("notebookbar_online.ui", 
batch);
+
officecfg::Office::UI::ToolbarMode::ActiveDraw::set("notebookbar_online.ui", 
batch);
+batch->commit();
+
 activateNotebookbar(u"Writer");
 activateNotebookbar(u"Calc");
 activateNotebookbar(u"Impress");
commit 60d91bed3fdfb0a3d89c51831b27d2187bd24c40
Author: Caolán McNamara 
AuthorDate: Wed Aug 16 16:31:54 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 18 09:58:00 2023 +0200

SAL_DEBUG "is never meant to remain in the code"

Change-Id: I8c0e513d36c087e9ea8019325cdb3122bec744be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155743
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/graphic/BinaryDataContainer.cxx 
b/vcl/source/graphic/BinaryDataContainer.cxx
index 83cacb491ac2..c9e75bc4ef77 100644
--- a/vcl/source/graphic/BinaryDataContainer.cxx
+++ b/vcl/source/graphic/BinaryDataContainer.cxx
@@ -45,7 +45,6 @@ struct BinaryDataContainer::Impl
 // Horrifying data loss ...
 SAL_WARN_IF(pStream->GetError(), "vcl",
 "Inconsistent system - failed to swap image back in");
-SAL_DEBUG("Swap in: " << pStream->GetError());
 }
 
 void swapOut()


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

2023-07-04 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx   |4 +++-
 tools/source/misc/json_writer.cxx |9 +
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 16b0da38515467bf1819ccd88027934481cc5727
Author: Szymon Kłos 
AuthorDate: Thu May 25 09:38:12 2023 +0200
Commit: Szymon Kłos 
CommitDate: Tue Jul 4 20:46:50 2023 +0200

jsdialog: encode properly control characters

according to https://www.rfc-editor.org/rfc/rfc7159#section-7
strings in JSON should contain control characters (0x00-0x1f)
encoded as \u

Signed-off-by: Szymon Kłos 
Change-Id: I1f828f64e57328b5fa2dcf5853afe0d6ea643081
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152262
Reviewed-by: Attila Szűcs 
Tested-by: Attila Szűcs 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153946
Tested-by: Jenkins

diff --git a/tools/source/misc/json_writer.cxx 
b/tools/source/misc/json_writer.cxx
index 3111cac2f816..8303e4c2973e 100644
--- a/tools/source/misc/json_writer.cxx
+++ b/tools/source/misc/json_writer.cxx
@@ -135,6 +135,15 @@ static char getEscapementChar(char ch)
 
 static bool writeEscapedSequence(sal_uInt32 ch, char*& pos)
 {
+// control characters
+if (ch <= 0x1f)
+{
+int written = snprintf(pos, 7, "\\u%.4x", static_cast(ch));
+if (written > 0)
+pos += written;
+return true;
+}
+
 switch (ch)
 {
 case '\b':
commit 8fc7ac5569592d5cd026d292202e8c51d670c241
Author: Szymon Kłos 
AuthorDate: Wed May 17 16:09:06 2023 +0200
Commit: Szymon Kłos 
CommitDate: Tue Jul 4 20:46:42 2023 +0200

lok: linking-api: export correct target string

export target string instead of boolean so user
can jump into the target using that.

this is fix for:
https://github.com/CollaboraOnline/online/issues/6230

Signed-off-by: Szymon Kłos 
Change-Id: Id4b1a1c65ddcb6f4d94d3939dda9124f2d10e9d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151884
Reviewed-by: Gülşah Köse 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153944

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bef06bcd4f98..dbd236858ce8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -480,7 +480,9 @@ static bool extractLinks(const uno::Reference< 
container::XNameAccess >& xLinks,
 
 if (bIsTarget)
 {
-jsonText.append("true");
+jsonText.append("\"");
+jsonText.append(aLink);
+jsonText.append("\"");
 continue;
 }
 jsonText.append("{");


[Libreoffice-commits] core.git: 2 commits - desktop/source drawinglayer/source forms/source slideshow/source vcl/source

2023-05-07 Thread Noel Grandin (via logerrit)
 desktop/source/lib/init.cxx  |2 -
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx |4 +-
 forms/source/component/imgprod.cxx   |4 +-
 slideshow/source/engine/shapes/gdimtftools.cxx   |2 -
 vcl/source/bitmap/dibtools.cxx   |   22 +--
 vcl/source/filter/egif/egif.cxx  |2 -
 vcl/source/filter/eps/eps.cxx|8 ++--
 vcl/source/filter/wmf/emfwr.cxx  |6 +--
 vcl/source/filter/wmf/wmfwr.cxx  |6 +--
 9 files changed, 20 insertions(+), 36 deletions(-)

New commits:
commit 1c7cbd685633d44eac554629572f3401c450f855
Author: Noel Grandin 
AuthorDate: Sun May 7 16:56:21 2023 +0200
Commit: Noel Grandin 
CommitDate: Sun May 7 20:17:16 2023 +0200

use AlphaMask for variables when calling GetAlphaMask

Right now this doesn't make any difference, since Bitmap is the
superclass of AlphaMask.
But when I switch to using alpha instead of transparency, passing
AlphaMask around is going to mean something different to passing plain
Bitmap around.

Change-Id: Ic1541e5f0a3b97331793cd23e23115faa7f382b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151463
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d6ce62b38be4..7cd3304a2185 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3944,7 +3944,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 pDevice->EnableMapMode(false);
 BitmapEx aBmpEx = pDevice->GetBitmapEx({ 0, 0 }, { nCanvasWidth, 
nCanvasHeight });
 Bitmap aBmp = aBmpEx.GetBitmap();
-Bitmap aAlpha = aBmpEx.GetAlphaMask();
+AlphaMask aAlpha = aBmpEx.GetAlphaMask();
 Bitmap::ScopedReadAccess sraBmp(aBmp);
 Bitmap::ScopedReadAccess sraAlpha(aAlpha);
 
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx 
b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index 8e0c8a980f33..a95df2474744 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -257,7 +257,7 @@ namespace drawinglayer::primitive2d
 case Disposal::Not:
 {
 
maVirtualDevice->DrawBitmapEx(rAnimationFrame.maPositionPixel, 
rAnimationFrame.maBitmapEx);
-Bitmap aAlphaMask = 
rAnimationFrame.maBitmapEx.GetAlphaMask();
+AlphaMask aAlphaMask = 
rAnimationFrame.maBitmapEx.GetAlphaMask();
 
 if (aAlphaMask.IsEmpty())
 {
@@ -277,7 +277,7 @@ namespace drawinglayer::primitive2d
 case Disposal::Back:
 {
 // #i70772# react on no mask, for primitives, too.
-const Bitmap & 
rMask(rAnimationFrame.maBitmapEx.GetAlphaMask());
+const AlphaMask & 
rMask(rAnimationFrame.maBitmapEx.GetAlphaMask());
 const Bitmap & 
rContent(rAnimationFrame.maBitmapEx.GetBitmap());
 
 maVirtualDeviceMask->Erase();
diff --git a/forms/source/component/imgprod.cxx 
b/forms/source/component/imgprod.cxx
index faa8663a2461..46439682519f 100644
--- a/forms/source/component/imgprod.cxx
+++ b/forms/source/component/imgprod.cxx
@@ -366,7 +366,7 @@ void ImageProducer::ImplUpdateConsumer( const Graphic& 
rGraphic )
 if( !pBmpAcc )
 return;
 
-Bitmap  aMask( aBmpEx.GetAlphaMask() );
+AlphaMask  aMask( aBmpEx.GetAlphaMask() );
 BitmapReadAccess*   pMskAcc = !aMask.IsEmpty() ? aMask.AcquireReadAccess() 
: nullptr;
 const tools::Long  nWidth = pBmpAcc->Width();
 const tools::Long  nHeight = pBmpAcc->Height();
@@ -380,7 +380,7 @@ void ImageProducer::ImplUpdateConsumer( const Graphic& 
rGraphic )
 if( !pMskAcc )
 {
 aMask = Bitmap(aBmp.GetSizePixel(), vcl::PixelFormat::N8_BPP, 
::GetGreyPalette(256));
-aMask.Erase( COL_BLACK );
+aMask.Erase( 0 );
 pMskAcc = aMask.AcquireReadAccess();
 }
 
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx 
b/slideshow/source/engine/shapes/gdimtftools.cxx
index 0c9e432850c6..990d9d26caac 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -283,7 +283,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames&   
o_rFrames,
 {
 pVDev->DrawBitmapEx(rAnimationFrame.maPositionPixel,
 rAnimationFrame.maBitmapEx);
-Bitmap aMask = rAnimationFrame.maBitmapEx.GetAlphaMask();
+   

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

2023-04-26 Thread Miklos Vajna (via logerrit)
 desktop/source/lib/init.cxx   |   20 --
 sw/qa/core/layout/data/floattable-deleted-anchor.docx |binary
 sw/qa/core/layout/flycnt.cxx  |   25 ++
 sw/source/core/text/frmform.cxx   |   13 -
 4 files changed, 37 insertions(+), 21 deletions(-)

New commits:
commit 73bada774ef37efd5a4498ccc083b1358314557d
Author: Miklos Vajna 
AuthorDate: Wed Apr 26 11:44:43 2023 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 26 14:58:51 2023 +0200

sw floattable, crashtesting: fix PDF export of fdo72790-1.docx, part 3

Converting the bugdoc to PDF crashed Writer layout since commit
ce3308a926f036b87515b8cd97d2b197063dc77a (tdf#61594 sw floattable:
import floating tables as split flys by default, 2023-04-12).

Part 1 already fixed the crash, but a layout loop remains. The current
problem is that we could have a document of 3 pages where the last page
had no anchor for the fly frame, so it took the anchor from the previous
page, but this lead to negative frame heights and at the end an empty
3rd page.

To fix the problem:

1) Make sure SwTextFrame::FormatAdjust() doesn't break the invariant
   that only the last frame of a floattable anchor has text content.

2) Make sure SwTextFrame::AdjustFollow_() doesn't join a frame that
   still hosts non-last split flys.

With this, we have exactly 3 anchor frames (in a flow frame chain) for
the 3 pages and the 3rd page looks correct. The original document still
needs more work to fix the layout loop, though.

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

diff --git a/sw/qa/core/layout/data/floattable-deleted-anchor.docx 
b/sw/qa/core/layout/data/floattable-deleted-anchor.docx
new file mode 100644
index ..cab5b68ff94d
Binary files /dev/null and 
b/sw/qa/core/layout/data/floattable-deleted-anchor.docx differ
diff --git a/sw/qa/core/layout/flycnt.cxx b/sw/qa/core/layout/flycnt.cxx
index bd3e98a38a62..1ad1443dd392 100644
--- a/sw/qa/core/layout/flycnt.cxx
+++ b/sw/qa/core/layout/flycnt.cxx
@@ -737,6 +737,31 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyTableRowKeep)
 auto pCell3 = dynamic_cast(pRow3->GetLower());
 CPPUNIT_ASSERT(pCell3->GetFollowCell());
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testSplitFlyDeletedAnchor)
+{
+// Given a document with a floating table that spans over 3 pages:
+createSwDoc("floattable-deleted-anchor.docx");
+
+// When laying out that document:
+calcLayout();
+
+// Then make sure that there are 3 anchors for the 3 pages:
+SwDoc* pDoc = getSwDoc();
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+auto pPage1 = dynamic_cast(pLayout->Lower());
+CPPUNIT_ASSERT(pPage1);
+SwFrame* pBody1 = pPage1->GetLower();
+CPPUNIT_ASSERT(pBody1);
+auto pAnchor1 = dynamic_cast(pBody1->GetLower()->GetNext());
+CPPUNIT_ASSERT(pAnchor1);
+SwTextFrame* pAnchor2 = pAnchor1->GetFollow();
+CPPUNIT_ASSERT(pAnchor2);
+SwTextFrame* pAnchor3 = pAnchor2->GetFollow();
+// Without the accompanying fix in place, this test would have failed, the 
fly frame on the 3rd
+// page was anchored to a text frame on the 2nd page, leading to a 
negative frame height.
+CPPUNIT_ASSERT(pAnchor3);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 2f3024f1bb0a..912047487a64 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -633,6 +633,13 @@ void SwTextFrame::AdjustFollow_( SwTextFormatter ,
 while( GetFollow() && GetFollow()->GetFollow() &&
nNewOfst >= GetFollow()->GetFollow()->GetOffset() )
 {
+if (HasNonLastSplitFlyDrawObj())
+{
+// A non-last split fly is anchored to us, don't move content 
from the last frame to
+// this one and don't join.
+return;
+}
+
 JoinFrame();
 }
 }
@@ -1109,7 +1116,11 @@ void SwTextFrame::FormatAdjust( SwTextFormatter ,
 // AdjustFollow might execute JoinFrame() because of this.
 // Else, nEnd is the end of the last line in the Master.
 TextFrameIndex nOld = nEnd;
-nEnd = rLine.GetEnd();
+// Make sure content from the last floating table anchor is not 
shifted to previous anchors.
+if (!HasNonLastSplitFlyDrawObj())
+{
+nEnd = rLine.GetEnd();
+}
 if( GetFollow() )
 {
 if( nNew && nOld < nEnd )
commit 4348f878284b53fa4e8ca670a8461a30ad0cba70
Author: Tor Lillqvist 
AuthorDate: Wed Apr 26 13:03:16 2023 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 26 14:58:48 

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

2023-04-25 Thread Stephan Bergmann (via logerrit)
 desktop/source/app/crashreport.cxx   |4 
 include/oox/export/ThemeExport.hxx   |   37 +++
 oox/source/export/ThemeExport.cxx|  356 +--
 svx/source/dialog/crashreportdlg.cxx |2 
 4 files changed, 208 insertions(+), 191 deletions(-)

New commits:
commit 1dec9d7f1a421af0dc4534204f2af550850cb60d
Author: Stephan Bergmann 
AuthorDate: Tue Apr 25 09:56:25 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Apr 25 10:59:19 2023 +0200

loplugin:unnecessarygetstr

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

diff --git a/desktop/source/app/crashreport.cxx 
b/desktop/source/app/crashreport.cxx
index e5ed070a2f44..ae6b9030f17f 100644
--- a/desktop/source/app/crashreport.cxx
+++ b/desktop/source/app/crashreport.cxx
@@ -234,7 +234,7 @@ void CrashReporter::updateMinidumpLocation()
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
 OUString aURL = getCrashDirectory();
 OString aOStringUrl = OUStringToOString(aURL, RTL_TEXTENCODING_UTF8);
-google_breakpad::MinidumpDescriptor descriptor(aOStringUrl.getStr());
+google_breakpad::MinidumpDescriptor descriptor(std::string{aOStringUrl});
 mpExceptionHandler->set_minidump_descriptor(descriptor);
 #elif defined _WIN32
 OUString aURL = getCrashDirectory();
@@ -292,7 +292,7 @@ std::string CrashReporter::getIniFileName()
 {
 OUString url = getCrashDirectory() + "dump.ini";
 OString aUrl = OUStringToOString(url, RTL_TEXTENCODING_UTF8);
-std::string aRet(aUrl.getStr());
+std::string aRet(aUrl);
 return aRet;
 }
 
diff --git a/svx/source/dialog/crashreportdlg.cxx 
b/svx/source/dialog/crashreportdlg.cxx
index bd07ddcb1c3d..aad28436eea3 100644
--- a/svx/source/dialog/crashreportdlg.cxx
+++ b/svx/source/dialog/crashreportdlg.cxx
@@ -80,7 +80,7 @@ IMPL_LINK(CrashReportDialog, BtnHdl, weld::Button&, rBtn, 
void)
 std::string response;
 bool bSuccess = CrashReporter::readSendConfig(response);
 
-OUString aCrashID = OUString::createFromAscii(response.c_str());
+OUString aCrashID = OUString::createFromAscii(response);
 
 if (bSuccess)
 {
commit 78cf9c05db01e2177d28eb08b3389e487d84060f
Author: Tomaž Vajngerl 
AuthorDate: Tue Apr 11 13:14:37 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Apr 25 10:59:17 2023 +0200

oox: refactor ThemeExport to use member FSHelperPtr instance

This refactors ThemeExport to use the member variable FSHelperPtr
instead of passign it through functions as a parameter. This also
forces many functions that were in anonymous namespace to become
members of the ThemeExport class. This is needed because in some
instances we will need access to FSHelperPtr instance as well as
access to XmlFilterBase.

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

diff --git a/include/oox/export/ThemeExport.hxx 
b/include/oox/export/ThemeExport.hxx
index 8e35b80ca09a..50eb9f47cf81 100644
--- a/include/oox/export/ThemeExport.hxx
+++ b/include/oox/export/ThemeExport.hxx
@@ -12,12 +12,22 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace model
 {
 class Theme;
 class FontScheme;
 class FormatScheme;
+class EffectStyle;
+class LineStyle;
+class FillStyle;
+class BlipFill;
+class PatternFill;
+class GradientFill;
+class SolidFill;
+struct ColorDefinition;
+struct Transformation;
 }
 
 namespace oox
@@ -26,6 +36,7 @@ class OOX_DLLPUBLIC ThemeExport
 {
 private:
 oox::core::XmlFilterBase* mpFilterBase;
+sax_fastparser::FSHelperPtr mpFS;
 
 public:
 ThemeExport(oox::core::XmlFilterBase* pFilterBase);
@@ -33,11 +44,27 @@ public:
 void write(OUString const& rPath, model::Theme const& rTheme);
 
 private:
-static bool writeColorSet(sax_fastparser::FSHelperPtr pFS, model::Theme 
const& rTheme);
-static bool writeFontScheme(sax_fastparser::FSHelperPtr pFS,
-model::FontScheme const& rFontScheme);
-static bool writeFormatScheme(sax_fastparser::FSHelperPtr pFS,
-  model::FormatScheme const& rFormatScheme);
+bool writeColorSet(model::Theme const& rTheme);
+bool writeFontScheme(model::FontScheme const& rFontScheme);
+bool writeFormatScheme(model::FormatScheme const& rFormatScheme);
+
+void writeEffectStyle(model::EffectStyle const& rEffectStyle);
+void writeLineStyle(model::LineStyle const& rLineStyle);
+void writeBackgroundFillStyle(model::FillStyle const& rFillStyle);
+void writeFillStyle(model::FillStyle const& rFillStyle);
+void writeBlipFill(model::BlipFill const& rBlipFill);
+static void writeBlip(model::BlipFill const& rBlipFil);
+void writePatternFill(model::PatternFill const& 

[Libreoffice-commits] core.git: 2 commits - desktop/source framework/source include/vcl postprocess/qa sfx2/source svtools/source vcl/inc vcl/source

2023-04-07 Thread Caolán McNamara (via logerrit)
 desktop/source/app/app.cxx|   25 ---
 desktop/source/app/appinit.cxx|4 -
 desktop/source/app/cmdlineargs.cxx|5 -
 desktop/source/app/cmdlineargs.hxx|4 -
 framework/source/services/desktop.cxx |3 
 include/vcl/svapp.hxx |   14 
 postprocess/qa/services.cxx   |8 --
 sfx2/source/appl/shutdownicon.cxx |   10 ++-
 svtools/source/uno/fpicker.cxx|   11 ++-
 vcl/inc/svdata.hxx|6 -
 vcl/source/app/svapp.cxx  |  108 --
 11 files changed, 22 insertions(+), 176 deletions(-)

New commits:
commit 9e786320a7d2609a9f997b32e31347f2eab0489e
Author: Caolán McNamara 
AuthorDate: Fri Apr 7 13:24:11 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 7 16:54:45 2023 +0200

move using the vcl file dialog in headless mode to the point of creation

instead of setting and unsetting the config option at start and exit
because a document that crashes in headless mode leaves my config
in an unwanted built-in file dialog state.

Change-Id: Ib5fcc5994a08c78bffdf57cb5b252dc469167ba2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150126
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 72674493a0fb..169330dab9f7 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1227,14 +1227,12 @@ struct ExecuteGlobals
 {
 Reference < css::document::XDocumentEventListener > xGlobalBroadcaster;
 bool bRestartRequested;
-bool bUseSystemFileDialog;
 std::unique_ptr pCTLLanguageOptions;
 std::unique_ptr pPathOptions;
 rtl::Reference< JVMloadThread > xJVMloadThread;
 
 ExecuteGlobals()
 : bRestartRequested( false )
-, bUseSystemFileDialog( true )
 {}
 };
 
@@ -1511,18 +1509,6 @@ int Desktop::Main()
 }
 }
 
-if ( rCmdLineArgs.IsHeadless() )
-{
-// Ensure that we use not the system file dialogs as
-// headless mode relies on Application::EnableHeadlessMode()
-// which does only work for VCL dialogs!!
-pExecGlobals->bUseSystemFileDialog = 
officecfg::Office::Common::Misc::UseSystemFileDialog::get();
-std::shared_ptr< comphelper::ConfigurationChanges > xChanges(
-comphelper::ConfigurationChanges::create());
-officecfg::Office::Common::Misc::UseSystemFileDialog::set( false, 
xChanges );
-xChanges->commit();
-}
-
 pExecGlobals->bRestartRequested = 
xRestartManager->isRestartRequested(true);
 if ( !pExecGlobals->bRestartRequested )
 {
@@ -1635,16 +1621,7 @@ int Desktop::doShutdown()
 if ( pExecGlobals->bRestartRequested )
 SetRestartState();
 
-// Restore old value
 const CommandLineArgs& rCmdLineArgs = GetCommandLineArgs();
-if ( rCmdLineArgs.IsHeadless() )
-{
-std::shared_ptr< comphelper::ConfigurationChanges > xChanges(
-comphelper::ConfigurationChanges::create());
-officecfg::Office::Common::Misc::UseSystemFileDialog::set( 
pExecGlobals->bUseSystemFileDialog, xChanges );
-xChanges->commit();
-}
-
 OUString pidfileName = rCmdLineArgs.GetPidfileName();
 if ( !pidfileName.isEmpty() )
 {
diff --git a/postprocess/qa/services.cxx b/postprocess/qa/services.cxx
index 94bd76031ff4..c332402e390d 100644
--- a/postprocess/qa/services.cxx
+++ b/postprocess/qa/services.cxx
@@ -365,14 +365,10 @@ void Test::createInstance(
 #endif
 } else if (name == "com.sun.star.ui.dialogs.FolderPicker") {
 // FolderPicker is a wrapper returning either a platform-specific or 
the
-// generic OfficeFolderPicker:
-#if defined(_WIN32)
-expImpl = "com.sun.star.ui.dialogs.Win32FolderPicker";
-expServs = {"com.sun.star.ui.dialogs.SystemFolderPicker"};
-#else
+// generic OfficeFolderPicker. In headless mode it is always the
+// generic one.
 expImpl = "com.sun.star.svtools.OfficeFolderPicker";
 expServs = {"com.sun.star.ui.dialogs.OfficeFolderPicker"};
-#endif
 } else if (expImpl == "com.sun.star.comp.Calc.SpreadsheetDocument") {
 expImpl = "ScModelObj";
 } else if (expImpl == "com.sun.star.comp.Draw.DrawingDocument"
diff --git a/sfx2/source/appl/shutdownicon.cxx 
b/sfx2/source/appl/shutdownicon.cxx
index ae214842f61f..fca7e56b3f3f 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -138,11 +138,15 @@ void ShutdownIcon::deInitSystray()
 m_bInitialized = false;
 }
 
+static bool UseSystemFileDialog()
+{
+return !Application::IsHeadlessModeEnabled() && 
officecfg::Office::Common::Misc::UseSystemFileDialog::get();
+}
 
 ShutdownIcon::ShutdownIcon( css::uno::Reference< XComponentContext > xContext 
) :
 m_bVeto ( false ),
 m_bListenForTermination ( false ),
-

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

2023-03-08 Thread Noel Grandin (via logerrit)
 desktop/source/deployment/gui/dp_gui_dialog2.cxx |8 
 desktop/source/deployment/gui/dp_gui_dialog2.hxx |2 +-
 desktop/source/deployment/manager/dp_manager.cxx |2 +-
 desktop/source/deployment/manager/dp_manager.h   |3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit cb9713daa1a2ce0d5551fa10d6cc12084730fa58
Author: Noel Grandin 
AuthorDate: Tue Mar 7 13:47:18 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 8 09:34:04 2023 +

osl::Mutex->std::mutex in ExtMgrDialog

Change-Id: I6e0997b1f4fb49459637ce82178c33460eed1188
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148437
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx 
b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 528d92fd5328..f0ad04cb3217 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -777,7 +777,7 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleCloseBtn, 
weld::Button&, void)
 
 IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface, void )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 bool bLockInterface = static_cast(_bLockInterface);
 
 if ( m_bStartProgress && !m_bHasProgress )
@@ -816,7 +816,7 @@ IMPL_LINK( ExtMgrDialog, startProgress, void*, 
_bLockInterface, void )
 
 void ExtMgrDialog::showProgress( bool _bStart )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 
 bool bStart = _bStart;
 
@@ -842,7 +842,7 @@ void ExtMgrDialog::updateProgress( const tools::Long 
nProgress )
 {
 if ( m_nProgress != nProgress )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 m_nProgress = nProgress;
 m_aIdle.Start();
 }
@@ -852,7 +852,7 @@ void ExtMgrDialog::updateProgress( const tools::Long 
nProgress )
 void ExtMgrDialog::updateProgress( const OUString ,
const uno::Reference< task::XAbortChannel > 
)
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::unique_lock aGuard( m_aMutex );
 
 m_xAbortChannel = xAbortChannel;
 m_sProgressText = rText;
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx 
b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index 8802997e2f20..b235aed18589 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -92,7 +92,7 @@ class ExtMgrDialog : public weld::GenericDialogController
 {
 const OUString   m_sAddPackages;
 OUString m_sProgressText;
-::osl::Mutex m_aMutex;
+std::mutex   m_aMutex;
 bool m_bHasProgress;
 bool m_bProgressChanged;
 bool m_bStartProgress;
commit 8521c5b4d61df2339e656c052853fce8d6b9c536
Author: Noel Grandin 
AuthorDate: Tue Mar 7 13:42:56 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 8 09:33:51 2023 +

osl::Mutex->std::mutex in PackageManagerImpl

Change-Id: I613a8846270f4b42125f24d9a7b99ecc12e2edb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148434
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/deployment/manager/dp_manager.cxx 
b/desktop/source/deployment/manager/dp_manager.cxx
index d4226aa6d4c4..570f8be23330 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -791,7 +791,7 @@ Reference 
PackageManagerImpl::addPackage(
 {
 OUString const id = dp_misc::getIdentifier( xPackage );
 
-::osl::MutexGuard g(m_addMutex);
+std::unique_lock g(m_addMutex);
 if (isInstalled(xPackage))
 {
 //Do not guard the complete function with the getMutex
diff --git a/desktop/source/deployment/manager/dp_manager.h 
b/desktop/source/deployment/manager/dp_manager.h
index a2079da23adc..dce57d418e3f 100644
--- a/desktop/source/deployment/manager/dp_manager.h
+++ b/desktop/source/deployment/manager/dp_manager.h
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -49,7 +50,7 @@ class PackageManagerImpl final : private cppu::BaseMutex, 
public t_pm_helper
 OUString m_activePackages_expanded;
 std::unique_ptr< ActivePackages > m_activePackagesDB;
 //This mutex is only used for synchronization in addPackage
-::osl::Mutex m_addMutex;
+std::mutex m_addMutex;
 css::uno::Reference m_xLogFile;
 inline void logIntern( css::uno::Any const & status );
 void fireModified();


[Libreoffice-commits] core.git: 2 commits - desktop/source sc/inc sc/source

2023-02-14 Thread Noel Grandin (via logerrit)
 desktop/source/app/dispatchwatcher.cxx |   18 --
 desktop/source/app/dispatchwatcher.hxx |5 ++---
 sc/inc/fielduno.hxx|5 +++--
 sc/source/ui/unoobj/fielduno.cxx   |   18 ++
 4 files changed, 19 insertions(+), 27 deletions(-)

New commits:
commit 7becce20b54973337d9803527fad0b957a56ab31
Author: Noel Grandin 
AuthorDate: Tue Feb 14 10:24:20 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 14 12:35:08 2023 +

osl::Mutex->std::mutex in ScHeaderFieldsObj

Change-Id: I9e308eee9534297b7257185d6b5f244d4fa86178
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146972
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/inc/fielduno.hxx b/sc/inc/fielduno.hxx
index 41a0eb6104f4..fc5ae6d15446 100644
--- a/sc/inc/fielduno.hxx
+++ b/sc/inc/fielduno.hxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -114,9 +115,9 @@ private:
 std::unique_ptr mpEditSource;
 
 /// List of refresh listeners.
-
std::unique_ptr>
 mpRefreshListeners;
+
std::unique_ptr>
 mpRefreshListeners;
 /// mutex to lock the InterfaceContainerHelper
-osl::Mutex  aMutex;
+std::mutex  aMutex;
 
 css::uno::Reference< css::text::XTextField>
 GetObjectByIndex_Impl(sal_Int32 Index) const;
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 96271342c06d..afc27560c1fe 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -423,14 +423,15 @@ ScHeaderFieldsObj::~ScHeaderFieldsObj()
 {
 mpEditSource.reset();
 
-// increment refcount to prevent double call off dtor
+// increment refcount to prevent double call of dtor
 osl_atomic_increment( _refCount );
 
+std::unique_lock g(aMutex);
 if (mpRefreshListeners)
 {
 lang::EventObject aEvent;
 aEvent.Source = static_cast(this);
-mpRefreshListeners->disposeAndClear(aEvent);
+mpRefreshListeners->disposeAndClear(g, aEvent);
 mpRefreshListeners.reset();
 }
 }
@@ -533,12 +534,13 @@ void SAL_CALL ScHeaderFieldsObj::removeContainerListener(
 // XRefreshable
 void SAL_CALL ScHeaderFieldsObj::refresh(  )
 {
+std::unique_lock g(aMutex);
 if (mpRefreshListeners)
 {
 //  Call all listeners.
 lang::EventObject aEvent;
 aEvent.Source.set(uno::Reference< util::XRefreshable >(this));
-mpRefreshListeners->notifyEach( ::XRefreshListener::refreshed, 
aEvent);
+mpRefreshListeners->notifyEach( g, ::XRefreshListener::refreshed, 
aEvent);
 }
 }
 
@@ -546,10 +548,10 @@ void SAL_CALL ScHeaderFieldsObj::addRefreshListener( 
const uno::Reference< util:
 {
 if (xListener.is())
 {
-SolarMutexGuard aGuard;
+std::unique_lock g(aMutex);
 if (!mpRefreshListeners)
-mpRefreshListeners.reset(new 
comphelper::OInterfaceContainerHelper3(aMutex));
-mpRefreshListeners->addInterface(xListener);
+mpRefreshListeners.reset(new 
comphelper::OInterfaceContainerHelper4());
+mpRefreshListeners->addInterface(g, xListener);
 }
 }
 
@@ -557,9 +559,9 @@ void SAL_CALL ScHeaderFieldsObj::removeRefreshListener( 
const uno::ReferenceremoveInterface(xListener);
+mpRefreshListeners->removeInterface(g, xListener);
 }
 }
 
commit 1f59cbe6f0d879275ddd82dd0eaf224cbd1dec21
Author: Noel Grandin 
AuthorDate: Tue Feb 14 09:39:21 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 14 12:34:58 2023 +

osl::Mutex->std::atomic in DispatchWatcher

Change-Id: I7cad64f9031dd05e08321110ec670d3c744f03c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146971
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 8ae45b40daa6..5b7fd944fee9 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -398,11 +398,8 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector");
 if( xDispatcher.is() )
 {
-{
-osl::MutexGuard aGuard(m_mutex);
-// Remember request so we can find it in statusChanged!
-m_nRequestCount++;
-}
+// Remember request so we can find it in statusChanged!
+m_nRequestCount++;
 
 // Use local vector to store dispatcher because we have to 
fill our request container before
 // we can dispatch. Otherwise it would be possible that 
statusChanged is called before we dispatched all requests!!
@@ -770,18 +767,13 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vectordispatchWithNotification( aDispatche.aURL, aArgs, this 
);
 else
 {
-{
-

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

2022-11-14 Thread Mike Kaganski (via logerrit)
 desktop/source/lib/init.cxx |4 ++--
 translations|2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit dbc307ef7c2351cd72e60ef46e647c908379db86
Author: Mike Kaganski 
AuthorDate: Mon Nov 14 17:34:55 2022 +0300
Commit: Mike Kaganski 
CommitDate: Mon Nov 14 19:22:04 2022 +0100

gtktiledviewer: Fix getting tiles on Windows

The "CanvasSize + 1" hack was implemented by myself in commit
ebb3a72ba0c4f070c9c254c439147beea8b2d93d (Paint tiles on Windows;
Oct 24 09:01:32 2022 +0200) to workaround a rounding error, where
converting pixels to logic and back resulted in 1 pixel smaller
size (when I worked in Writer). This hack breaks in Calc, because
the size then is 1 pixel larger than expected, failing the assert
below.

This fixes the problem by disabling the map mode, as everywhere
else in such cases.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f4aeaf2760cf..41f05517082f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3703,8 +3703,8 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 
 #ifdef _WIN32
 // pBuffer was not used there
-tools::Rectangle r(pDevice->PixelToLogic({ Point(0, 0), Size(nCanvasWidth 
+ 1, nCanvasHeight + 1) }));
-BitmapEx aBmpEx = pDevice->GetBitmapEx(r.TopLeft(), r.GetSize());
+pDevice->EnableMapMode(false);
+BitmapEx aBmpEx = pDevice->GetBitmapEx({ 0, 0 }, { nCanvasWidth, 
nCanvasHeight });
 Bitmap aBmp = aBmpEx.GetBitmap();
 Bitmap aAlpha = aBmpEx.GetAlpha();
 Bitmap::ScopedReadAccess sraBmp(aBmp);
commit 9c33b6772022333ca6651a400064154f8705788d
Author: Christian Lohmaier 
AuthorDate: Mon Nov 14 19:12:44 2022 +0100
Commit: Gerrit Code Review 
CommitDate: Mon Nov 14 19:12:44 2022 +0100

Update git submodules

* Update translations from branch 'master'
  to 3322d894ee938182ff6d5dec818deadd4fbf9010
  - update translations for master

and force-fix errors using pocheck

Change-Id: I7b8d6fb47b4c093ef48a731d629ed5c0d0ac29eb

diff --git a/translations b/translations
index b03d019e0d04..3322d894ee93 16
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit b03d019e0d04ae68a632bc052fc1ce7801736d7f
+Subproject commit 3322d894ee938182ff6d5dec818deadd4fbf9010


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

2022-08-24 Thread Christian Lohmaier (via logerrit)
 desktop/source/app/crashreport.cxx |2 ++
 sc/source/ui/docshell/olinefun.cxx |3 +++
 2 files changed, 5 insertions(+)

New commits:
commit de3fcf4bea142fa376b043862ef2bde1db32098f
Author: Christian Lohmaier 
AuthorDate: Tue Aug 16 20:19:21 2022 +0200
Commit: Christian Lohmaier 
CommitDate: Thu Aug 18 16:06:46 2022 +0200

crashreport: __cpuid/__cpuidex are not available on arm64

…and from a quick glance similar features are not exposed to userland
applications on arm64:

https://docs.kernel.org/arm64/cpu-feature-registers.html
"The ARM architecture defines a set of feature registers, which describe
the capabilities of the CPU/system. Access to these system registers is
restricted from EL0 and there is no reliable way for an application to
extract this information to make better decisions at runtime.[…]"

Thus the CPU information would have to be gathered from the OS, probably
from the Windows registry, at least it should be possible to read the
name/model that way…

Change-Id: I39e3679a7c4c581d8e3e4f71842d7ea7cdc2ba67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138380
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/desktop/source/app/crashreport.cxx 
b/desktop/source/app/crashreport.cxx
index a14527c621e2..0458edf9793a 100644
--- a/desktop/source/app/crashreport.cxx
+++ b/desktop/source/app/crashreport.cxx
@@ -346,6 +346,7 @@ void CrashReporter::writeSystemInfo()
 #elif defined _WIN32
 void CrashReporter::writeSystemInfo()
 {
+#if !defined(_ARM64_)
 // Get CPU model name and flags.
 // See https://docs.microsoft.com/en-us/cpp/intrinsics/cpuid-cpuidex
 // and https://en.wikipedia.org/wiki/CPUID .
@@ -456,6 +457,7 @@ void CrashReporter::writeSystemInfo()
 }
 if( !flags.isEmpty())
 addKeyValue( "CPUFlags", flags.makeStringAndClear(), AddItem );
+#endif
 // Get total memory.
 MEMORYSTATUSEX memoryStatus;
 memoryStatus.dwLength = sizeof( memoryStatus );
commit 64c60a67930ebf9a1b19b4396c9fea3c4c973e62
Author: Caolán McNamara 
AuthorDate: Thu Aug 18 12:45:45 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Aug 18 16:06:33 2022 +0200

cid#1509305 Dereference null return value

Change-Id: I17175b9ce05b784844e49aed53d85a55e33a0f45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138484
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/docshell/olinefun.cxx 
b/sc/source/ui/docshell/olinefun.cxx
index 76ea01eae3bc..70fafd8e1e2a 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -640,6 +640,9 @@ void ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool 
bColumns, sal_uInt16 nLevel
 bRecord = false;
 
 ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
+if (!pTable)
+return;
+
 ScOutlineArray& rArray = bColumns ? pTable->GetColArray() : 
pTable->GetRowArray();
 ScOutlineEntry* pEntry = rArray.GetEntry( nLevel, nEntry );
 SCCOLROW nStart = pEntry->GetStart();


[Libreoffice-commits] core.git: 2 commits - desktop/source editeng/source include/editeng sw/ooxmlexport_setup.mk sw/qa sw/source writerfilter/qa writerfilter/source

2022-06-07 Thread Miklos Vajna (via logerrit)
 desktop/source/deployment/dp_persmap.cxx  
|5 
 editeng/source/items/frmitems.cxx 
|   68 ++---
 include/editeng/boxitem.hxx   
|   15 +-
 sw/ooxmlexport_setup.mk   
|1 
 sw/qa/core/layout/layout.cxx  
|   71 ++
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
|   42 +
 sw/qa/extras/ww8import/ww8import.cxx  
|4 
 sw/source/core/layout/paintfrm.cxx
|4 
 sw/source/filter/ww8/wrtww8.cxx   
|2 
 sw/source/uibase/shells/tabsh.cxx 
|2 
 writerfilter/qa/cppunittests/dmapper/PropertyMap.cxx  
|   60 
 writerfilter/qa/cppunittests/dmapper/data/negative-page-border-no-margin.docx 
|binary
 writerfilter/qa/cppunittests/dmapper/data/negative-page-border.docx   
|binary
 writerfilter/source/dmapper/PropertyMap.cxx   
|2 
 14 files changed, 239 insertions(+), 37 deletions(-)

New commits:
commit 1f127a2b9e1c1daab0972f98fc8708ecb7afa299
Author: Miklos Vajna 
AuthorDate: Tue Jun 7 08:03:34 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jun 7 08:45:46 2022 +0200

sw layout: allow negative page border distances

Writer follows the CSS box model when it comes to page borders: there
can be a positive distance between the edge of the page and the border,
and again a positive distance between the border and the body frame.

This ensures that the page border never intersect with the body frame,
which is usually what users expect. Word, however, can work with 2
distances for border and text, both measured from the edge of the page,
leading to a page border, which is inside the body text. This is
described at great detail at

.

Fix the problem by allowing negative border distances: this doesn't
influence the position or the size of the body frame, but it gives us a
way to position the border more towards the center of the page, leading
the matching layout between Writer and Word.

The doc model (to allow negative border distances), UNO API and DOCX
filter is updated in this commit. The ODT filter works without explicit
effort. Other filters are not yet updated in this commit.

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

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index a31df88ca0f0..9780af4904c0 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1313,6 +1313,20 @@ SvxBoxItem::~SvxBoxItem()
 {
 }
 
+void SvxBoxItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxBoxItem"));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("top-dist"),
+  
BAD_CAST(OString::number(nTopDist).getStr()));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bottom-dist"),
+  
BAD_CAST(OString::number(nBottomDist).getStr()));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("left-dist"),
+  
BAD_CAST(OString::number(nLeftDist).getStr()));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("right-dist"),
+  
BAD_CAST(OString::number(nRightDist).getStr()));
+SfxPoolItem::dumpAsXml(pWriter);
+(void)xmlTextWriterEndElement(pWriter);
+}
 
 boost::property_tree::ptree SvxBoxItem::dumpAsJSON() const
 {
@@ -1380,7 +1394,7 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 {
 bool bConvert = 0!=(nMemberId_TWIPS);
 table::BorderLine2 aRetLine;
-sal_uInt16 nDist = 0;
+sal_Int16 nDist = 0;
 bool bDistMember = false;
 nMemberId &= ~CONVERT_TWIPS;
 switch(nMemberId)
@@ -1670,7 +1684,6 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 if(!(rVal >>= nDist))
 return false;
 
-if(nDist >= 0)
 {
 if( bConvert )
 nDist = o3tl::toTwips(nDist, o3tl::Length::mm100);
@@ -1883,10 +1896,10 @@ void SvxBoxItem::ScaleMetrics( tools::Long nMult, 
tools::Long nDiv )
 if ( pBottom )  pBottom->ScaleMetrics( nMult, nDiv );
 if ( pLeft )pLeft->ScaleMetrics( nMult, nDiv );
 if ( pRight )   pRight->ScaleMetrics( nMult, nDiv );
-nTopDist = static_cast(BigInt::Scale( 

[Libreoffice-commits] core.git: 2 commits - desktop/source oox/inc oox/Library_oox.mk oox/source sfx2/source

2022-04-14 Thread Tomaž Vajngerl (via logerrit)
 desktop/source/lib/init.cxx |   10 +++
 oox/Library_oox.mk  |1 
 oox/inc/drawingml/chart/datatablecontext.hxx|   42 ++
 oox/inc/drawingml/chart/datatablemodel.hxx  |   41 ++
 oox/inc/drawingml/chart/plotareacontext.hxx |   15 -
 oox/inc/drawingml/chart/plotareamodel.hxx   |9 ---
 oox/source/drawingml/chart/datatablecontext.cxx |   68 
 oox/source/drawingml/chart/plotareacontext.cxx  |   32 ---
 oox/source/drawingml/chart/plotareamodel.cxx|7 --
 sfx2/source/control/unoctitm.cxx|8 ++
 10 files changed, 171 insertions(+), 62 deletions(-)

New commits:
commit 32e38ec654cfd467aad74da59366bd41142b3bdc
Author: Tomaž Vajngerl 
AuthorDate: Thu Apr 14 15:57:01 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Apr 15 01:35:09 2022 +0200

oox: move DataTable{Context,Model} into own file, prop. "showKeys"

Move DataTableContext and DataTableModel into its own files and
add the missing "showKeys" property of the data table (dTable).

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

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index ca88ab100039..01da0aa4374d 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -100,6 +100,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
 oox/source/drawingml/chart/datasourcecontext \
 oox/source/drawingml/chart/datasourceconverter \
 oox/source/drawingml/chart/datasourcemodel \
+oox/source/drawingml/chart/datatablecontext \
 oox/source/drawingml/chart/modelbase \
 oox/source/drawingml/chart/objectformatter \
 oox/source/drawingml/chart/plotareacontext \
diff --git a/oox/inc/drawingml/chart/datatablecontext.hxx 
b/oox/inc/drawingml/chart/datatablecontext.hxx
new file mode 100644
index ..01a75c6e634d
--- /dev/null
+++ b/oox/inc/drawingml/chart/datatablecontext.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include 
+
+namespace oox::drawingml::chart
+{
+struct DataTableModel;
+
+/** Handler for a data table context (c:dTable element).
+ */
+class DataTableContext final : public ContextBase
+{
+public:
+explicit DataTableContext(::oox::core::ContextHandler2Helper& rParent, 
DataTableModel& rModel);
+virtual ~DataTableContext() override;
+
+virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement,
+   const 
AttributeList& rAttribs) override;
+};
+
+} // namespace oox::drawingml::chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/drawingml/chart/datatablemodel.hxx 
b/oox/inc/drawingml/chart/datatablemodel.hxx
new file mode 100644
index ..5c7fe7901200
--- /dev/null
+++ b/oox/inc/drawingml/chart/datatablemodel.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+namespace oox::drawingml::chart
+{
+struct DataTableModel
+{
+bool mbShowHBorder : 1; /// Show Horizontal Border
+bool mbShowVBorder : 1; /// Show 

[Libreoffice-commits] core.git: 2 commits - desktop/source sc/source sfx2/source

2022-03-14 Thread Mert Tumer (via logerrit)
 desktop/source/lib/init.cxx |7 ++-
 sc/source/ui/docshell/docsh.cxx |   29 ++---
 sfx2/source/view/viewsh.cxx |1 +
 3 files changed, 25 insertions(+), 12 deletions(-)

New commits:
commit 422fd364934d93ea02a614e8f431bfc1126b5a2d
Author: Mert Tumer 
AuthorDate: Wed Dec 29 16:34:38 2021 +0300
Commit: Mert Tumer 
CommitDate: Mon Mar 14 11:52:33 2022 +0100

LOK android: Fix csv sheet name becomes temp name

Signed-off-by: Mert Tumer 
Change-Id: If43d7a995a5e53734fc7ecdcbf9b750b4886dc45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127684
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131516

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 4179a0ba5acf..8c64e3a8416f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -137,6 +137,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace com::sun::star;
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::lang::XMultiServiceFactory;
@@ -1286,17 +1288,22 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 sc::SetFormulaDirtyContext aCxt;
 m_aDocument.SetAllFormulasDirty(aCxt);
 
-// The same resulting name has to be handled in
-// ScExternalRefCache::initializeDoc() and related, hence
-// pass 'true' for RenameTab()'s bExternalDocument for a
-// composed name so ValidTabName() will not be checked,
-// which could veto the rename in case it contained
-// characters that Excel does not handle. If we wanted to
-// change that then it needed to be handled in all
-// corresponding places of the external references
-// manager/cache. Likely then we'd also need a method to
-// compose a name excluding such characters.
-m_aDocument.RenameTab( 0, INetURLObject( 
rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
+bool bIsMobile = comphelper::LibreOfficeKit::isActive() && 
SfxViewShell::Current()
+&& SfxViewShell::Current()->isLOKMobilePhone();
+// for mobile case, we use a copy of the original document 
and give it a temporary name before editing
+// Therefore, the sheet name becomes ugly, long and 
nonsensical.
+if (!bIsMobile)
+// The same resulting name has to be handled in
+// ScExternalRefCache::initializeDoc() and related, 
hence
+// pass 'true' for RenameTab()'s bExternalDocument for 
a
+// composed name so ValidTabName() will not be checked,
+// which could veto the rename in case it contained
+// characters that Excel does not handle. If we wanted 
to
+// change that then it needed to be handled in all
+// corresponding places of the external references
+// manager/cache. Likely then we'd also need a method 
to
+// compose a name excluding such characters.
+m_aDocument.RenameTab( 0, INetURLObject( 
rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
 
 bOverflowRow = aImpEx.IsOverflowRow();
 bOverflowCol = aImpEx.IsOverflowCol();
commit 2df5a083a83f6e83ac45465d4b65887421ac945d
Author: Mert Tumer 
AuthorDate: Mon Jan 10 13:23:03 2022 +0300
Commit: Mert Tumer 
CommitDate: Mon Mar 14 11:52:20 2022 +0100

lok: Fix freshly added comments are not displayed

Signed-off-by: Mert Tumer 
Change-Id: Ice772eff8b9f8ae8c23ec1e66675e33a80492028
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128217
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131515
Tested-by: Jenkins

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b5db7f8cb1e6..0e1c47e9b5dc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1479,13 +1479,18 @@ void CallbackFlushHandler::queue(const int type, 
CallbackData& aCallbackData)
 SAL_INFO("lok", "Queue: [" << type << "]: [" << aCallbackData.getPayload() 
<< "] on " << m_queue1.size() << " entries.");
 
 bool bIsChartActive = false;
+bool bIsComment = false;
 if (type == LOK_CALLBACK_GRAPHIC_SELECTION)
 {
 LokChartHelper aChartHelper(SfxViewShell::Current());
 bIsChartActive = aChartHelper.GetWindow() != nullptr;
 }
+else if (type == LOK_CALLBACK_COMMENT)
+{
+bIsComment = true;
+}
 
-if (callbacksDisabled() && 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/vcl sc/source sfx2/source vcl/inc vcl/jsdialog vcl/source

2022-01-24 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx  |   14 +++--
 include/vcl/jsdialog/executor.hxx|5 ++-
 sc/source/ui/cctrl/checklistmenu.cxx |4 ++
 sfx2/source/sidebar/DeckLayouter.cxx |5 ++-
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   19 +++--
 vcl/jsdialog/executor.cxx|4 +-
 vcl/jsdialog/jsdialogbuilder.cxx |   51 ---
 vcl/source/gdi/salgdilayout.cxx  |6 +++-
 8 files changed, 70 insertions(+), 38 deletions(-)

New commits:
commit b9f53322df937098eef4fd5b2889989a38e4ffda
Author: Szymon Kłos 
AuthorDate: Mon Nov 15 09:13:35 2021 +0100
Commit: Szymon Kłos 
CommitDate: Mon Jan 24 12:17:20 2022 +0100

jsdialog: use string identifiers

Thanks to that it is easier to debug and find widgets in maps.
Sidebar and notebookbar are now in different map entries.
This fixes the issue when destroying notebookbar deleted sidebar's
widgets.
After this patch sidebar works correctly when using notebookbar mode in
lok.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6e41ede6c35f..ef2365a017e6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4031,15 +4031,23 @@ static void lcl_sendDialogEvent(unsigned long long int 
nWindowId, const char* pA
 OString sControlId = OUStringToOString(aMap["id"], 
RTL_TEXTENCODING_ASCII_US);
 
 // dialogs send own id but notebookbar and sidebar controls are 
remembered by SfxViewShell id
-bool bFoundWeldedControl = jsdialog::ExecuteAction(nWindowId, 
sControlId, aMap);
+bool bFoundWeldedControl = 
jsdialog::ExecuteAction(std::to_string(nWindowId), sControlId, aMap);
 if (!bFoundWeldedControl)
-bFoundWeldedControl = jsdialog::ExecuteAction(nCurrentShellId, 
sControlId, aMap);
+bFoundWeldedControl = 
jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "sidebar", 
sControlId, aMap);
+if (!bFoundWeldedControl)
+bFoundWeldedControl = 
jsdialog::ExecuteAction(std::to_string(nCurrentShellId) + "notebookbar", 
sControlId, aMap);
+if (!bFoundWeldedControl && !SfxViewShell::Current())
+{
+// this is needed for dialogs shown before document is loaded: 
MacroWarning dialog, etc...
+// these dialogs are created with WindowId "0"
+bFoundWeldedControl = jsdialog::ExecuteAction("0", sControlId, 
aMap);
+}
 
 if (bFoundWeldedControl)
 return;
 
 // force resend - used in mobile-wizard
-jsdialog::SendFullUpdate(nCurrentShellId, "Panel");
+jsdialog::SendFullUpdate(std::to_string(nCurrentShellId) + "sidebar", 
"Panel");
 
 } catch(...) {}
 }
diff --git a/include/vcl/jsdialog/executor.hxx 
b/include/vcl/jsdialog/executor.hxx
index 787c4d5a0f54..149df76d0b1c 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -60,8 +60,9 @@ public:
 
 namespace jsdialog
 {
-VCL_DLLPUBLIC bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, 
StringMap& rData);
-VCL_DLLPUBLIC void SendFullUpdate(sal_uInt64 nWindowId, const OString& 
rWidget);
+VCL_DLLPUBLIC bool ExecuteAction(const std::string& nWindowId, const OString& 
rWidget,
+ StringMap& rData);
+VCL_DLLPUBLIC void SendFullUpdate(const std::string& nWindowId, const OString& 
rWidget);
 VCL_DLLPUBLIC StringMap jsonToStringMap(const char* pJSON);
 };
 
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 8615fee77cfe..0d4a3857d34f 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -323,6 +323,10 @@ void ScCheckListMenuControl::launchSubMenu()
 
 mxMenu->select(*mxScratchIter);
 pSubMenu->GrabFocus();
+
+// TODO: still needed?
+//if (comphelper::LibreOfficeKit::isActive())
+//jsdialog::SendFullUpdate(std::to_string(pSubMenu->GetLOKWindowId()), 
"toggle_all");
 }
 
 IMPL_LINK_NOARG(ScCheckListMenuControl, PostPopdownHdl, void*, void)
diff --git a/sfx2/source/sidebar/DeckLayouter.cxx 
b/sfx2/source/sidebar/DeckLayouter.cxx
index 766159c58835..ef623a64a483 100644
--- a/sfx2/source/sidebar/DeckLayouter.cxx
+++ b/sfx2/source/sidebar/DeckLayouter.cxx
@@ -308,7 +308,10 @@ sal_Int32 PlacePanels (
 }
 
 if (comphelper::LibreOfficeKit::isActive())
-
jsdialog::SendFullUpdate(reinterpret_cast(SfxViewShell::Current()), 
"Panel");
+{
+sal_uInt64 nShellId = 
reinterpret_cast(SfxViewShell::Current());
+jsdialog::SendFullUpdate(std::to_string(nShellId) + "sidebar", 
"Panel");
+}
 
 return nY;
 }
diff --git 

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

2021-12-21 Thread Noel Grandin (via logerrit)
 desktop/source/app/app.cxx |   19 ++-
 vcl/source/helper/threadex.cxx |2 +-
 2 files changed, 7 insertions(+), 14 deletions(-)

New commits:
commit d6fa091a75eaf665ec734a56ef1e10b72bc603dd
Author: Noel Grandin 
AuthorDate: Tue Dec 21 10:12:57 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Dec 21 10:40:33 2021 +0100

no point in release solar mutex before calling PostUserEvent

which will just acquire it gain

Change-Id: I62b0d43e15f93994a53d64b24f9765c5e7b676ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127213
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index b254c927fd10..be4360ed560d 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1567,20 +1567,13 @@ int Desktop::Main()
 // Reap the process started by fire_glxtest_process().
 reap_glxtest_process();
 
-// Release solar mutex just before we wait for our client to connect
-{
-SolarMutexReleaser aReleaser;
-
-// Post user event to startup first application component window
-// We have to send this OpenClients message short before execute() 
to
-// minimize the risk that this message overtakes type detection 
construction!!
-Application::PostUserEvent( LINK( this, Desktop, OpenClients_Impl 
) );
+// Post user event to startup first application component window
+// We have to send this OpenClients message short before execute() to
+// minimize the risk that this message overtakes type detection 
construction!!
+Application::PostUserEvent( LINK( this, Desktop, OpenClients_Impl ) );
 
-// Post event to enable acceptors
-Application::PostUserEvent( LINK( this, Desktop, 
EnableAcceptors_Impl) );
-
-// Acquire solar mutex just before we enter our message loop
-}
+// Post event to enable acceptors
+Application::PostUserEvent( LINK( this, Desktop, EnableAcceptors_Impl) 
);
 
 // call Application::Execute to process messages in vcl message loop
 #if HAVE_FEATURE_JAVA
commit 4b83a4131ff6f2ddf457f6a2754d491722d3e2dc
Author: Noel Grandin 
AuthorDate: Tue Dec 21 10:12:38 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Dec 21 10:40:18 2021 +0100

no point in release solar mutex before calling PostUserEvent

which will just acquire it again

Change-Id: If483a74ccac762f288bcd05956066ce726a96516
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127212
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx
index 1d55ddc08562..cbd342bd28df 100644
--- a/vcl/source/helper/threadex.cxx
+++ b/vcl/source/helper/threadex.cxx
@@ -51,8 +51,8 @@ void SolarThreadExecutor::execute()
 {
 m_aStart.reset();
 m_aFinish.reset();
-SolarMutexReleaser aReleaser;
 ImplSVEvent* nEvent = Application::PostUserEvent(LINK(this, 
SolarThreadExecutor, worker));
+SolarMutexReleaser aReleaser;
 if (m_aStart.wait() == osl::Condition::result_timeout)
 {
 m_bTimeout = true;


[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit sfx2/source

2021-08-16 Thread Pranam Lashkari (via logerrit)
 desktop/source/lib/init.cxx   |   11 +++
 include/LibreOfficeKit/LibreOfficeKit.h   |7 +--
 include/LibreOfficeKit/LibreOfficeKit.hxx |4 ++--
 sfx2/source/view/viewsh.cxx   |1 +
 4 files changed, 15 insertions(+), 8 deletions(-)

New commits:
commit f4538c29079a4a940540e5194075aaeee4d0ba3a
Author: Pranam Lashkari 
AuthorDate: Fri Jul 16 16:42:04 2021 +0530
Commit: Pranam Lashkari 
CommitDate: Mon Aug 16 09:01:54 2021 +0200

LOK: freemium: added new parameter in the API

Added new parameter in the freemium API to make it consistent with other 
APIs

Change-Id: Ieb73fd1f97e1886051b1de44a93ba87622862e2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119974
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120484
Tested-by: Jenkins
Reviewed-by: Pranam Lashkari 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0eecb2b4b352..18ee858c72c0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1043,9 +1043,12 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* 
pThis,
  int nType,
  int nCharCode,
  int nKeyCode);
-static void doc_setFreemiumDenyList(const char* freemiumDenyList);
+static void doc_setFreemiumDenyList(LibreOfficeKitDocument* pThis,
+const char* freemiumDenyList);
 
-static void doc_setFreemiumView(int nViewId, bool isFreemium);
+static void doc_setFreemiumView(LibreOfficeKitDocument* pThis,
+int nViewId,
+bool isFreemium);
 
 static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis,
 unsigned nWindowId,
@@ -3557,12 +3560,12 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* 
pThis, int nType, int nChar
 }
 }
 
-static void doc_setFreemiumDenyList(const char* freemiumDenyList)
+static void doc_setFreemiumDenyList(LibreOfficeKitDocument* /*pThis*/, const 
char* freemiumDenyList)
 {
 comphelper::LibreOfficeKit::setFreemiumDenyList(freemiumDenyList);
 }
 
-static void doc_setFreemiumView(int nViewId, bool isFreemium)
+static void doc_setFreemiumView(LibreOfficeKitDocument* /*pThis*/, int 
nViewId, bool isFreemium)
 {
 SolarMutexGuard aGuard;
 SfxLokHelper::setFreemiumView(nViewId, isFreemium);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 527fee4f2e7d..79a6b2a3faea 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -464,10 +464,13 @@ struct _LibreOfficeKitDocumentClass
 unsigned char** pBitmapBuffer,
 int* pWidth, int* pHeight, size_t* pByteSize);
 /// @see lok::Document::setFreemiumDenyList
-void (*setFreemiumDenyList) (const char* freemiumDenyList);
+void (*setFreemiumDenyList) (LibreOfficeKitDocument* pThis,
+const char* freemiumDenyList);
 
 /// @see lok::Document::setFreemiumView
-void (*setFreemiumView) (int nViewId, bool isFreemium);
+void (*setFreemiumView) (LibreOfficeKitDocument* pThis,
+int nViewId,
+bool isFreemium);
 
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index cd35cdc51fe6..778f3a80d3fe 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -804,12 +804,12 @@ public:
 }
 void setFreemiumDenyList(const char* freemiumDenyList)
 {
-mpDoc->pClass->setFreemiumDenyList(freemiumDenyList);
+mpDoc->pClass->setFreemiumDenyList(mpDoc, freemiumDenyList);
 }
 
 void setFreemiumView(int nViewId, bool isFreemium)
 {
-mpDoc->pClass->setFreemiumView(nViewId, isFreemium);
+mpDoc->pClass->setFreemiumView(mpDoc, nViewId, isFreemium);
 }
 
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
commit 085797cb5c26a274328fa639a8100bd52cd9652d
Author: Miklos Vajna 
AuthorDate: Thu Jul 8 11:49:13 2021 +0200
Commit: Pranam Lashkari 
CommitDate: Mon Aug 16 09:01:34 2021 +0200

sfx2: fix uninitialized SfxViewShell::mbLOKIsFreemiumView

Introduced in commit 1b9fe58acb7b5bbbc83ecca30e17663fff7f0db4 (LOK:
introduced Freemium LOK API, 2021-06-02).

Change-Id: Ifdd6c13a64a167fa00b0305441c52340167f3809
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118632
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pranam Lashkari 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120483
Tested-by: Jenkins

diff --git a/sfx2/source/view/viewsh.cxx 

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

2021-08-14 Thread Emircan Agac (via logerrit)
 desktop/source/lib/init.cxx |6 +++---
 sw/source/core/undo/unattr.cxx  |2 +-
 sw/source/filter/ww8/ww8atr.cxx |   40 
 3 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit d5eceef8e02886edc142267ee8d74f7adb198a1b
Author: Emircan Agac 
AuthorDate: Fri Aug 13 16:46:29 2021 +0300
Commit: Ilmari Lauhakangas 
CommitDate: Sat Aug 14 08:36:45 2021 +0200

tdf#140226: use StaticWhichCast

Change-Id: I5eb25fdfd629e397582cd49e3fa4acab32c05bbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120456
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 024a65c6c9b1..9ca61d6c0a4d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -823,17 +823,17 @@ void ExecuteOrientationChange()
 
 
 
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_SIZE,
 pItem);
-pPageSizeItem.reset( static_cast(pItem->Clone()) );
+pPageSizeItem.reset(>Clone()->StaticWhichCast(SID_ATTR_PAGE_SIZE));
 
 
 
 
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_LRSPACE,
 pItem);
-pPageLRMarginItem.reset( static_cast(pItem->Clone()) 
);
+
pPageLRMarginItem.reset(>Clone()->StaticWhichCast(SID_ATTR_PAGE_LRSPACE));
 
 
 
 
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_ULSPACE,
 pItem);
-pPageULMarginItem.reset( static_cast(pItem->Clone()) 
);
+
pPageULMarginItem.reset(>Clone()->StaticWhichCast(SID_ATTR_PAGE_ULSPACE));
 
 
 {
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 5329f1c00c59..3c3f05ac1895 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -846,7 +846,7 @@ SwUndoDefaultAttr::SwUndoDefaultAttr( const SfxItemSet& 
rSet, const SwDoc& rDoc
 const SfxPoolItem* pItem;
 if( SfxItemState::SET == rSet.GetItemState( RES_PARATR_TABSTOP, false, 
 ) ) {
 // store separately, because it may change!
-m_pTabStop.reset( static_cast(pItem->Clone()) );
+m_pTabStop.reset(>Clone()->StaticWhichCast(RES_PARATR_TABSTOP));
 if ( 1 != rSet.Count() ) { // are there more attributes?
 m_pOldSet.reset( new SfxItemSet( rSet ) );
 }
commit 1fdb3f98590532705be9972d031eb09027795760
Author: Emircan Agac 
AuthorDate: Thu Aug 12 19:55:50 2021 +0300
Commit: Ilmari Lauhakangas 
CommitDate: Sat Aug 14 08:36:32 2021 +0200

tdf#140226: use StaticWhichCast

Change-Id: I54f898d3341155d88b6b955b9e5001de71c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120406
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index ab73216a78aa..0783784cce46 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -5361,40 +5361,40 @@ void AttributeOutputBase::OutputItem( const 
SfxPoolItem& rHt )
 CharCrossedOut(rHt.StaticWhichCast(RES_CHRATR_CROSSEDOUT));
 break;
 case RES_CHRATR_ESCAPEMENT:
-CharEscapement( static_cast< const SvxEscapementItem& >( rHt ) );
+CharEscapement(rHt.StaticWhichCast(RES_CHRATR_ESCAPEMENT));
 break;
 case RES_CHRATR_FONT:
-CharFont( static_cast< const SvxFontItem& >( rHt ) );
+CharFont(rHt.StaticWhichCast(RES_CHRATR_FONT));
 break;
 case RES_CHRATR_FONTSIZE:
-CharFontSize( static_cast< const SvxFontHeightItem& >( rHt ) );
+CharFontSize(rHt.StaticWhichCast(RES_CHRATR_FONTSIZE));
 break;
 case RES_CHRATR_KERNING:
-CharKerning( static_cast< const SvxKerningItem& >( rHt ) );
+CharKerning(rHt.StaticWhichCast(RES_CHRATR_KERNING));
 break;
 case RES_CHRATR_LANGUAGE:
-CharLanguage( static_cast< const SvxLanguageItem& >( rHt ) );
+CharLanguage(rHt.StaticWhichCast(RES_CHRATR_LANGUAGE));
 break;
 case RES_CHRATR_POSTURE:
-CharPosture( static_cast< const SvxPostureItem& >( rHt ) );
+CharPosture(rHt.StaticWhichCast(RES_CHRATR_POSTURE));
 break;
 case RES_CHRATR_SHADOWED:
-CharShadow( static_cast< const SvxShadowedItem& >( rHt ) );
+CharShadow(rHt.StaticWhichCast(RES_CHRATR_SHADOWED));
 break;
 case RES_CHRATR_UNDERLINE:
-CharUnderline( static_cast< const SvxUnderlineItem& >( rHt ) );
+CharUnderline(rHt.StaticWhichCast(RES_CHRATR_UNDERLINE));
 break;
 case RES_CHRATR_WEIGHT:
-CharWeight( static_cast< const SvxWeightItem& >( rHt ) );
+CharWeight(rHt.StaticWhichCast(RES_CHRATR_WEIGHT));
 break;
 case RES_CHRATR_AUTOKERN:
-

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

2021-04-16 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx |   11 +++
 filter/source/svg/svgexport.cxx |2 ++
 include/vcl/layout.hxx  |7 +--
 include/vcl/uitest/uiobject.hxx |2 ++
 vcl/source/uitest/uiobject.cxx  |   39 +++
 vcl/source/window/layout.cxx|8 
 6 files changed, 63 insertions(+), 6 deletions(-)

New commits:
commit ebeb1d1ae554e8301d876b19afc05f454acdfc1c
Author: Szymon Kłos 
AuthorDate: Fri Apr 2 20:13:32 2021 +0200
Commit: Szymon Kłos 
CommitDate: Fri Apr 16 14:55:04 2021 +0200

jsdialog: uitest: handle click for drawing area

Change-Id: I5ea78697b87f4b2a468f8507470b62031bee4aa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113524
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114202
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e2027ab218ba..cd4b3da2d729 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3809,6 +3809,17 @@ static void lcl_sendDialogEvent(unsigned long long int 
nWindowId, const char* pA
 aMap["VALUE"] = aMap["data"];
 pUIWindow->execute(sValue, aMap);
 }
+else if (sAction == "click" && aMap["type"] == "drawingarea")
+{
+int separatorPos = aMap["data"].indexOf(';');
+if (separatorPos > 0)
+{
+// x;y
+aMap["POSX"] = aMap["data"].copy(0, separatorPos);
+aMap["POSY"] = aMap["data"].copy(separatorPos + 1);
+}
+pUIWindow->execute(sClickAction, aMap);
+}
 else
 pUIWindow->execute(sClickAction, aMap);
 }
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 9a896915b1ed..5a2b7310ea48 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -707,12 +707,7 @@ private:
 }
 }
 virtual void StartDrag(sal_Int8 nAction, const Point& rPosPixel) override;
-virtual FactoryFunction GetUITestFactory() const override
-{
-if (m_pFactoryFunction)
-return m_pFactoryFunction;
-return Control::GetUITestFactory();
-}
+virtual FactoryFunction GetUITestFactory() const override;
 
 public:
 VclDrawingArea(vcl::Window *pParent, WinBits nStyle)
diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx
index 1a2c192a4c63..b4df10a40c9e 100644
--- a/include/vcl/uitest/uiobject.hxx
+++ b/include/vcl/uitest/uiobject.hxx
@@ -557,6 +557,8 @@ protected:
 public:
 DrawingAreaUIObject(const VclPtr& rDrawingArea);
 virtual ~DrawingAreaUIObject() override;
+virtual void execute(const OUString& rAction, const StringMap& 
rParameters) override;
+static std::unique_ptr create(vcl::Window* pWindow);
 };
 
 #endif
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index 4d8390e212a2..11c6e7ec7d6e 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -1735,6 +1735,45 @@ DrawingAreaUIObject::~DrawingAreaUIObject()
 {
 }
 
+void DrawingAreaUIObject::execute(const OUString& rAction, const StringMap& 
rParameters)
+{
+if (rAction == "CLICK")
+{
+// POSX and POSY are percentage of width/height dimensions
+if (rParameters.find("POSX") != rParameters.end() &&
+rParameters.find("POSY") != rParameters.end())
+{
+auto aPosX = rParameters.find("POSX");
+auto aPosY = rParameters.find("POSY");
+
+OString sPosX2 = OUStringToOString(aPosX->second, 
RTL_TEXTENCODING_ASCII_US);
+OString sPoxY2 = OUStringToOString(aPosY->second, 
RTL_TEXTENCODING_ASCII_US);
+
+if (!sPosX2.isEmpty() && !sPoxY2.isEmpty())
+{
+double fPosX = std::atof(sPosX2.getStr());
+double fPosY = std::atof(sPoxY2.getStr());
+
+fPosX = fPosX * mxDrawingArea->GetOutputWidthPixel();
+fPosY = fPosY * mxDrawingArea->GetOutputHeightPixel();
+
+MouseEvent aEvent(Point(fPosX, fPosY), 1, 
MouseEventModifiers::NONE, MOUSE_LEFT, 0);
+mxDrawingArea->MouseButtonDown(aEvent);
+mxDrawingArea->MouseButtonUp(aEvent);
+}
+}
+}
+else
+WindowUIObject::execute(rAction, rParameters);
+}
+
+std::unique_ptr DrawingAreaUIObject::create(vcl::Window* pWindow)
+{
+VclDrawingArea* pVclDrawingArea = dynamic_cast(pWindow);
+assert(pVclDrawingArea);
+return std::unique_ptr(new DrawingAreaUIObject(pVclDrawingArea));
+}
+
 IconViewUIObject::IconViewUIObject(const VclPtr& xIconView):
 TreeListUIObject(xIconView)
 {
diff --git a/vcl/source/window/layout.cxx 

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

2021-02-17 Thread Rafael Lima (via logerrit)
 desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx   |   12 -
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx  |6 ++--
 desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx |   14 +--
 desktop/source/deployment/registry/package/dp_package.cxx|4 +--
 desktop/source/deployment/registry/script/dp_script.cxx  |2 -
 desktop/source/deployment/registry/sfwk/dp_sfwk.cxx  |2 -
 desktop/source/lib/init.cxx  |8 +++---
 helpcontent2 |2 -
 8 files changed, 25 insertions(+), 25 deletions(-)

New commits:
commit a90315573a96e0e72846c6d676ca59dd386bd3f5
Author: Rafael Lima 
AuthorDate: Wed Feb 17 13:32:10 2021 +0100
Commit: Gerrit Code Review 
CommitDate: Wed Feb 17 13:32:10 2021 +0100

Update git submodules

* Update helpcontent2 from branch 'master'
  to 00cf8de0436b61d64c7c406de2106ee0c1949459
  - Create SF Filesystem Help page

Also in this patch:
- lib_ScriptForge.xhp: add links to table of contents
- sf_dialogcontrol.xhp: silence strings for translation

Change-Id: I9b69be483d93957cdc793d95f56f33a48e3f1c85
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/110788
Tested-by: Jenkins
Reviewed-by: Rafael Lima 

diff --git a/helpcontent2 b/helpcontent2
index ec6e0c930fd8..00cf8de0436b 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit ec6e0c930fd8a7ca5dc6a84a686602acff69234e
+Subproject commit 00cf8de0436b61d64c7c406de2106ee0c1949459
commit fd8bedb54a66bb62bfbfc48639f780b433d7defe
Author: Noel 
AuthorDate: Wed Feb 17 12:47:53 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 17 13:31:57 2021 +0100

loplugin:referencecasting in desktop

Change-Id: I19da92c3cbf082965f01fd2339f42419f4229aa1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111056
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx 
b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index d2fca9d95e03..95cb874f1ca9 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -844,7 +844,7 @@ void ExtensionCmdQueue::Thread::_addExtension( 
::rtl::Reference< ProgressCmdEnv
 uno::Any anyTitle;
 try
 {
-anyTitle = ::ucbhelper::Content( rPackageURL, rCmdEnv.get(), 
m_xContext ).getPropertyValue( "Title" );
+anyTitle = ::ucbhelper::Content( rPackageURL, rCmdEnv, m_xContext 
).getPropertyValue( "Title" );
 }
 catch ( const uno::Exception & )
 {
@@ -868,7 +868,7 @@ void ExtensionCmdQueue::Thread::_addExtension( 
::rtl::Reference< ProgressCmdEnv
 try
 {
 xExtMgr->addExtension(rPackageURL, uno::Sequence(),
-  rRepository, xAbortChannel, rCmdEnv.get() );
+  rRepository, xAbortChannel, rCmdEnv );
 }
 catch ( const ucb::CommandFailedException & )
 {
@@ -897,7 +897,7 @@ void ExtensionCmdQueue::Thread::_removeExtension( 
::rtl::Reference< ProgressCmdE
 OUString id( dp_misc::getIdentifier( xPackage ) );
 try
 {
-xExtMgr->removeExtension( id, xPackage->getName(), 
xPackage->getRepositoryName(), xAbortChannel, rCmdEnv.get() );
+xExtMgr->removeExtension( id, xPackage->getName(), 
xPackage->getRepositoryName(), xAbortChannel, rCmdEnv );
 }
 catch ( const deployment::DeploymentException & )
 {}
@@ -985,7 +985,7 @@ void ExtensionCmdQueue::Thread::_enableExtension( 
::rtl::Reference< ProgressCmdE
 
 try
 {
-xExtMgr->enableExtension( xPackage, xAbortChannel, rCmdEnv.get() );
+xExtMgr->enableExtension( xPackage, xAbortChannel, rCmdEnv );
 if ( m_pDialogHelper )
 m_pDialogHelper->updatePackageInfo( xPackage );
 }
@@ -1009,7 +1009,7 @@ void ExtensionCmdQueue::Thread::_disableExtension( 
::rtl::Reference< ProgressCmd
 
 try
 {
-xExtMgr->disableExtension( xPackage, xAbortChannel, rCmdEnv.get() );
+xExtMgr->disableExtension( xPackage, xAbortChannel, rCmdEnv );
 if ( m_pDialogHelper )
 m_pDialogHelper->updatePackageInfo( xPackage );
 }
@@ -1033,7 +1033,7 @@ void ExtensionCmdQueue::Thread::_acceptLicense( 
::rtl::Reference< ProgressCmdEnv
 
 try
 {
-xExtMgr->checkPrerequisitesAndEnable( xPackage, xAbortChannel, 
rCmdEnv.get() );
+xExtMgr->checkPrerequisitesAndEnable( xPackage, xAbortChannel, rCmdEnv 
);
 if ( m_pDialogHelper )
 m_pDialogHelper->updatePackageInfo( xPackage );
 }
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx 
b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index ed6ed79fd256..980e086ebc69 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/tools tools/source vcl/inc vcl/jsdialog

2020-12-08 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx  |1 
 include/tools/json_writer.hxx|2 
 tools/source/misc/json_writer.cxx|2 
 vcl/inc/jsdialog/jsdialogbuilder.hxx |9 +++
 vcl/jsdialog/jsdialogbuilder.cxx |   82 ---
 5 files changed, 68 insertions(+), 28 deletions(-)

New commits:
commit 84a3f79fffbb32ee5e083cdb4bd58cb6aa20a381
Author: Szymon Kłos 
AuthorDate: Thu Dec 3 14:09:43 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Dec 8 11:22:44 2020 +0100

jsdialog: don't skip commands

api was extended and now we send no only
the latest state of a current window (may be skipped),
but also commands like: close window .
Make sure commands will not be skipped when new dialog
appears.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 66a32dafbc97..e1e8ac652d3f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1524,7 +1524,6 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_TEXT_VIEW_SELECTION:
 case LOK_CALLBACK_VIEW_CURSOR_VISIBLE:
 case LOK_CALLBACK_CALC_FUNCTION_LIST:
-case LOK_CALLBACK_JSDIALOG:
 {
 // deleting the duplicate of visible cursor message can cause 
hyperlink popup not to show up on second/or more click on the same place.
 // If the hyperlink is not empty we can bypass that to show 
the popup
commit 913fa080fa8ed17228dc87fe885ec47df917ade6
Author: Szymon Kłos 
AuthorDate: Thu Dec 3 11:16:08 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Dec 8 11:22:31 2020 +0100

jsdialog: send close on dialog response

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

diff --git a/include/tools/json_writer.hxx b/include/tools/json_writer.hxx
index 440fedccf45e..2e50670c5b26 100644
--- a/include/tools/json_writer.hxx
+++ b/include/tools/json_writer.hxx
@@ -76,7 +76,7 @@ public:
 std::string extractAsStdString();
 
 /** returns true if the current JSON data matches the string */
-bool isDataEquals(const std::string&);
+bool isDataEquals(const std::string&) const;
 
 private:
 void endNode();
diff --git a/tools/source/misc/json_writer.cxx 
b/tools/source/misc/json_writer.cxx
index a0e0280b840e..1246f0578fca 100644
--- a/tools/source/misc/json_writer.cxx
+++ b/tools/source/misc/json_writer.cxx
@@ -422,7 +422,7 @@ std::string JsonWriter::extractAsStdString()
 return ret;
 }
 
-bool JsonWriter::isDataEquals(const std::string& s)
+bool JsonWriter::isDataEquals(const std::string& s) const
 {
 return s.length() == static_cast(mPos - mpBuffer)
&& memcmp(s.data(), mpBuffer, s.length()) == 0;
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index ab7c038648d3..d3c6e7b26d48 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class ToolBox;
 class ComboBox;
@@ -47,6 +48,12 @@ public:
 
 void Invoke() override;
 void ForceUpdate();
+void sendClose();
+
+private:
+void send(std::unique_ptr aJsonWriter);
+std::unique_ptr dumpStatus() const;
+std::unique_ptr generateCloseMessage() const;
 };
 
 class JSDialogSender
@@ -61,6 +68,7 @@ public:
 }
 
 void notifyDialogState(bool bForce = false);
+void sendClose();
 };
 
 class JSDropTarget final
@@ -216,6 +224,7 @@ public:
 
 virtual void collapse(weld::Widget* pEdit, weld::Widget* pButton) override;
 virtual void undo_collapse() override;
+virtual void response(int response) override;
 };
 
 class JSLabel : public JSWidget
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 3c663bac10e0..08e66eedb6f5 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -40,7 +40,7 @@ JSDialogNotifyIdle::JSDialogNotifyIdle(VclPtr 
aNotifierWindow,
 
 void JSDialogNotifyIdle::ForceUpdate() { m_bForce = true; }
 
-void JSDialogNotifyIdle::Invoke()
+void JSDialogNotifyIdle::send(std::unique_ptr aJsonWriter)
 {
 if (!m_aNotifierWindow)
 return;
@@ -48,39 +48,63 @@ void JSDialogNotifyIdle::Invoke()
 const vcl::ILibreOfficeKitNotifier* pNotifier = 
m_aNotifierWindow->GetLOKNotifier();
 if (pNotifier)
 {
-tools::JsonWriter aJsonWriter;
-

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

2020-08-26 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx   |4 +++-
 editeng/source/items/frmitems.cxx |   33 +
 include/editeng/boxitem.hxx   |4 
 svx/source/tbxctrls/tbcontrl.cxx  |2 +-
 4 files changed, 41 insertions(+), 2 deletions(-)

New commits:
commit cc2823b980d0ab87278de87282ddfc6a49b2508a
Author: Szymon Kłos 
AuthorDate: Mon Aug 10 12:57:00 2020 +0200
Commit: Szymon Kłos 
CommitDate: Wed Aug 26 13:18:43 2020 +0200

lok: send cell border state updates

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 35a518d701ad..b61767ff4a88 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2824,7 +2824,9 @@ static void doc_iniUnoCommands ()
 OUString(".uno:AlignMiddle"),
 OUString(".uno:AlignDown"),
 OUString(".uno:TraceChangeMode"),
-OUString(".uno:FreezePanesRow")
+OUString(".uno:FreezePanesRow"),
+OUString(".uno:BorderInner"),
+OUString(".uno:BorderOuter")
 };
 
 util::URL aCommandURL;
diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 53b3b0d15ff7..371621157b8e 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1294,6 +1294,23 @@ SvxBoxItem::~SvxBoxItem()
 }
 
 
+boost::property_tree::ptree SvxBoxItem::dumpAsJSON() const
+{
+boost::property_tree::ptree aTree;
+
+boost::property_tree::ptree aState;
+aState.put("top", GetTop() && !GetTop()->isEmpty());
+aState.put("bottom", GetBottom() && !GetBottom()->isEmpty());
+aState.put("left", GetLeft() && !GetLeft()->isEmpty());
+aState.put("right", GetRight() && !GetRight()->isEmpty());
+
+aTree.push_back(std::make_pair("state", aState));
+aTree.put("commandName", ".uno:BorderOuter");
+
+return aTree;
+}
+
+
 static bool CmpBrdLn( const std::unique_ptr & pBrd1, const 
SvxBorderLine* pBrd2 )
 {
 if( pBrd1.get() == pBrd2 )
@@ -2072,6 +2089,22 @@ SvxBoxInfoItem::~SvxBoxInfoItem()
 {
 }
 
+
+boost::property_tree::ptree SvxBoxInfoItem::dumpAsJSON() const
+{
+boost::property_tree::ptree aTree;
+
+boost::property_tree::ptree aState;
+aState.put("vertical", GetVert() && !GetVert()->isEmpty());
+aState.put("horizontal", GetHori() && !GetHori()->isEmpty());
+
+aTree.push_back(std::make_pair("state", aState));
+aTree.put("commandName", ".uno:BorderInner");
+
+return aTree;
+}
+
+
 bool SvxBoxInfoItem::operator==( const SfxPoolItem& rAttr ) const
 {
 assert(SfxPoolItem::operator==(rAttr));
diff --git a/include/editeng/boxitem.hxx b/include/editeng/boxitem.hxx
index 7ebb52b12212..3ef4a05ff11c 100644
--- a/include/editeng/boxitem.hxx
+++ b/include/editeng/boxitem.hxx
@@ -115,6 +115,8 @@ public:
 static css::table::BorderLine2 SvxLineToLine( const 
editeng::SvxBorderLine* pLine, bool bConvert );
 static bool LineToSvxLine(const css::table::BorderLine& rLine, 
editeng::SvxBorderLine& rSvxLine, bool bConvert);
 static bool LineToSvxLine(const css::table::BorderLine2& rLine, 
editeng::SvxBorderLine& rSvxLine, bool bConvert);
+
+virtual boost::property_tree::ptree dumpAsJSON() const override;
 };
 
 inline void SvxBoxItem::SetAllDistances(sal_uInt16 const nNew)
@@ -230,6 +232,8 @@ public:
 nValidFlags &= ~nValid;
 }
 voidResetFlags();
+
+virtual boost::property_tree::ptree dumpAsJSON() const override;
 };
 
 namespace editeng
commit 77f12e60687ab639da34aa71e84085d1c3d5a402
Author: Szymon Kłos 
AuthorDate: Thu Aug 6 10:56:41 2020 +0200
Commit: Szymon Kłos 
CommitDate: Wed Aug 26 13:18:33 2020 +0200

lok: Hide not working 'More Styles' option

Option was shown in the sidebar style dropdown.

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

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 64533b2c786b..dbb0ea75c97c 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2861,7 +2861,7 @@ void SvxStyleToolBoxControl::FillStyleBox()
 for (const auto& rStyle : aStyles)
 pBox->append_text(rStyle);
 
-if (pImpl->bSpecModeWriter || pImpl->bSpecModeCalc)
+if ((pImpl->bSpecModeWriter || pImpl->bSpecModeCalc) && 
!comphelper::LibreOfficeKit::isActive())
 pBox->append_text(pImpl->aMore);
 
 pBox->thaw();
___
Libreoffice-commits 

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

2020-08-14 Thread Noel Grandin (via logerrit)
 desktop/source/app/app.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 161a72d1bf35413b700bddaf88f1c8b2bc47139b
Author: Noel Grandin 
AuthorDate: Fri Aug 14 10:45:19 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 14 13:32:42 2020 +0200

add comments and log some exceptions

Change-Id: I8fab74e92a932fd284a63357e7a20f208af2d20d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100728
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 57f88713cba4..c3baa5392817 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -551,6 +551,7 @@ void Desktop::DeInit()
 } catch (const RuntimeException&) {
 // someone threw an exception during shutdown
 // this will leave some garbage behind...
+TOOLS_WARN_EXCEPTION("desktop.app", "exception throwing during 
shutdown, will leave some garbage behind");
 }
 }
 
@@ -2295,7 +2296,8 @@ void Desktop::HandleAppEvent( const ApplicationEvent& 
rAppEvent )
 }
 break;
 case ApplicationEvent::Type::ShowDialog:
-// ignore all errors here. It's clicking a menu entry only ...
+// This is only used on macOS, and only for About or Preferences.
+// Ignore all errors here. It's clicking a menu entry only ...
 // The user will try it again, in case nothing happens .-)
 try
 {
@@ -2319,7 +2321,9 @@ void Desktop::HandleAppEvent( const ApplicationEvent& 
rAppEvent )
 }
 }
 catch(const css::uno::Exception&)
-{}
+{
+TOOLS_WARN_EXCEPTION("desktop.app", "exception thrown by dialog");
+}
 break;
 case ApplicationEvent::Type::Unaccept:
 // try to remove corresponding acceptor
commit 27d9aa3eff7e26c21218bece0310705a0453553f
Author: Noel Grandin 
AuthorDate: Fri Aug 14 10:59:32 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 14 13:32:36 2020 +0200

dont catch Desktop::OpenClients_Impl

rather just let the debugger or crashpad handle it

Change-Id: I44e0dd06f2c84a7bf0099093a53032d759c18dea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100729
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 9b9fa3896de5..57f88713cba4 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1150,7 +1150,7 @@ void Desktop::Exception(ExceptionCategory nCategory)
 {
 case ExceptionCategory::ResourceNotLoaded:
 {
-Application::Abort( OUString() );
+Application::Abort( "OS threw signal 
OSL_SIGNAL_USER_RESOURCEFAILURE" );
 break;
 }
 
@@ -1841,7 +1841,6 @@ class ExitTimer : public Timer
 
 IMPL_LINK_NOARG(Desktop, OpenClients_Impl, void*, void)
 {
-try {
 // #i114963#
 // Enable IPC thread before OpenClients
 //
@@ -1869,9 +1868,6 @@ IMPL_LINK_NOARG(Desktop, OpenClients_Impl, void*, void)
 const char *pExitPostStartup = getenv ("OOO_EXIT_POST_STARTUP");
 if (pExitPostStartup && *pExitPostStartup)
 new ExitTimer();
-} catch (const css::uno::Exception ) {
-Application::Abort( "UNO exception during client open: " + e.Message );
-}
 }
 
 void Desktop::OpenClients()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit vcl/inc vcl/jsdialog

2020-07-03 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx   |4 ++--
 include/LibreOfficeKit/LibreOfficeKit.h   |2 +-
 include/LibreOfficeKit/LibreOfficeKit.hxx |2 +-
 vcl/inc/jsdialog/jsdialogbuilder.hxx  |1 +
 vcl/jsdialog/jsdialogbuilder.cxx  |   12 +++-
 5 files changed, 16 insertions(+), 5 deletions(-)

New commits:
commit 126c5e57d732359788010d6a364a5011d2e4a8c8
Author: Szymon Kłos 
AuthorDate: Thu Jun 25 11:24:15 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 3 14:48:53 2020 +0200

revert jsdialog: always clean remember widgets

Don't delete all widgets when nested tab page
is used

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

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index ba4641171a2c..1ef216f18c99 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -53,6 +53,7 @@ class JSInstanceBuilder : public SalInstanceBuilder
 /// used in case of tab pages where dialog is not a direct top level
 VclPtr m_aParentDialog;
 bool m_bHasTopLevelDialog;
+bool m_bIsNotebookbar;
 
 friend VCL_DLLPUBLIC weld::Widget* jsdialog::FindWeldWidgetsMap(sal_uInt64 
nWindowId,
 const 
OString& rWidget);
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 767a465c5f3f..8f12489ed44c 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -72,6 +72,7 @@ JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, 
const OUString& rUIR
 , m_nWindowId(0)
 , m_aParentDialog(nullptr)
 , m_bHasTopLevelDialog(false)
+, m_bIsNotebookbar(false)
 {
 vcl::Window* pRoot = m_xBuilder->get_widget_root();
 if (pRoot && pRoot->GetParent())
@@ -91,6 +92,7 @@ JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, 
const OUString& rUIRo
 , m_nWindowId(0)
 , m_aParentDialog(nullptr)
 , m_bHasTopLevelDialog(false)
+, m_bIsNotebookbar(false)
 {
 vcl::Window* pRoot = m_xBuilder->get_widget_root();
 if (pRoot && pRoot->GetParent())
@@ -99,12 +101,19 @@ JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, 
const OUString& rUIRo
 if (m_aParentDialog)
 m_nWindowId = m_aParentDialog->GetLOKWindowId();
 if (!m_nWindowId && nWindowId)
+{
 m_nWindowId = nWindowId;
+m_bIsNotebookbar = true;
+}
 InsertWindowToMap(m_nWindowId);
 }
 }
 
-JSInstanceBuilder::~JSInstanceBuilder() { 
GetLOKWeldWidgetsMap().erase(m_nWindowId); }
+JSInstanceBuilder::~JSInstanceBuilder()
+{
+if (m_nWindowId && (m_bHasTopLevelDialog || m_bIsNotebookbar))
+GetLOKWeldWidgetsMap().erase(m_nWindowId);
+}
 
 std::map& JSInstanceBuilder::GetLOKWeldWidgetsMap()
 {
@@ -144,6 +153,7 @@ void JSInstanceBuilder::RememberWidget(const OString& id, 
weld::Widget* pWidget)
 auto it = GetLOKWeldWidgetsMap().find(m_nWindowId);
 if (it != GetLOKWeldWidgetsMap().end())
 {
+it->second.erase(id);
 it->second.insert(WidgetMap::value_type(id, pWidget));
 }
 }
commit af2c3124332c02b3ef4065481c1c5b72baf032e8
Author: Szymon Kłos 
AuthorDate: Wed Jun 24 11:27:39 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 3 14:48:46 2020 +0200

jsdialog: change sendDialogEvent API parameter

WindowId with 64bit length is needed

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6e25e8c71b7a..a34565e9d0c1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1008,7 +1008,7 @@ static void doc_removeTextContext(LibreOfficeKitDocument* 
pThis,
   int nCharBefore,
   int nCharAfter);
 static void doc_sendDialogEvent(LibreOfficeKitDocument* pThis,
-   unsigned nLOKWindowId,
+   unsigned long long int nLOKWindowId,
const char* pArguments);
 static void doc_postWindowKeyEvent(LibreOfficeKitDocument* pThis,
unsigned nLOKWindowId,
@@ -3597,7 +3597,7 @@ public:
 
 } // anonymous namespace
 
-static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned 
nWindowId, const char* pArguments)
+static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned 
long long int 

[Libreoffice-commits] core.git: 2 commits - desktop/source vcl/jsdialog vcl/source

2020-07-03 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx  |1 +
 vcl/jsdialog/jsdialogbuilder.cxx |6 +-
 vcl/source/window/builder.cxx|4 +++-
 3 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 645021ad49628319423ad29d866d7adb3aee9d97
Author: Szymon Kłos 
AuthorDate: Thu Jun 18 14:08:48 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 3 12:13:25 2020 +0200

jsdialog: always clean remember widgets

avoid crash when old, freed widged will be used

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

diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 9f566b7c7434..1932bcbd7d02 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -101,11 +101,7 @@ JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, 
const OUString& rUIRo
 }
 }
 
-JSInstanceBuilder::~JSInstanceBuilder()
-{
-if (m_nWindowId && m_bHasTopLevelDialog)
-GetLOKWeldWidgetsMap().erase(m_nWindowId);
-}
+JSInstanceBuilder::~JSInstanceBuilder() { 
GetLOKWeldWidgetsMap().erase(m_nWindowId); }
 
 std::map& 
JSInstanceBuilder::GetLOKWeldWidgetsMap()
 {
commit cef4ed2a79a5c0643afd513bc163fadff047ea82
Author: Szymon Kłos 
AuthorDate: Tue Jun 23 07:48:48 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 3 12:13:13 2020 +0200

jsdialog: working number format field

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1ced81cb6ea2..2f14c8ab2518 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3662,6 +3662,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 OString posString = 
OUStringToOString(entryPos, RTL_TEXTENCODING_ASCII_US);
 int pos = std::atoi(posString.getStr());
 pCombobox->set_active(pos);
+pCombobox->signal_changed();
 }
 }
 else if (sAction == "change")
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index e1c00944fc8c..3e1b71105a2c 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -174,7 +174,9 @@ weld::Builder* Application::CreateBuilder(weld::Widget* 
pParent, const OUString
 
 weld::Builder* Application::CreateInterimBuilder(vcl::Window* pParent, const 
OUString )
 {
-if (comphelper::LibreOfficeKit::isActive() && rUIFile == 
"svx/ui/stylespreview.ui")
+if (comphelper::LibreOfficeKit::isActive()
+&& (rUIFile == "svx/ui/stylespreview.ui"
+|| rUIFile == "modules/scalc/ui/numberbox.ui"))
 {
 return new JSInstanceBuilder(pParent, 
VclBuilderContainer::getUIRootDir(), rUIFile, 
css::uno::Reference());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source include/vcl vcl/jsdialog vcl/source

2020-06-20 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx  |  134 ++-
 include/vcl/jsdialog/jsdialogbuilder.hxx |   10 +-
 include/vcl/salvtables.hxx   |5 -
 include/vcl/toolkit/combobox.hxx |2 
 include/vcl/weld.hxx |3 
 vcl/jsdialog/jsdialogbuilder.cxx |   86 ++-
 vcl/source/app/salvtables.cxx|2 
 7 files changed, 177 insertions(+), 65 deletions(-)

New commits:
commit 292d9519bd368db69920cf0f8b94e0e51c3d14a1
Author: Szymon Kłos 
AuthorDate: Fri Mar 6 11:11:57 2020 +0100
Commit: Szymon Kłos 
CommitDate: Sat Jun 20 20:36:25 2020 +0200

jsdialog: remember weld instances

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8bbec959b44f..357111d220af 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3588,7 +3588,6 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 
 StringMap aMap(jsonToStringMap(pArguments));
 VclPtr pWindow = vcl::Window::FindLOKWindow(nWindowId);
-JSInstanceBuilder* pBuilder = 
JSInstanceBuilder::FindLOKWeldBuilder(nWindowId);
 
 if (!pWindow && nWindowId >= 10 /* why unsigned? */)
 pWindow = getSidebarWindow();
@@ -3610,18 +3609,20 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 
 try
 {
-bool bIsWeldedDialog = pBuilder != nullptr;
+OString sControlId = OUStringToOString(aMap["id"], 
RTL_TEXTENCODING_ASCII_US);
+weld::Widget* pWidget = 
JSInstanceBuilder::FindWeldWidgetsMap(nWindowId, sControlId);
+
+bool bIsWeldedDialog = pWidget != nullptr;
 bool bContinueWithLOKWindow = false;
 
 if (bIsWeldedDialog)
 {
-OString sControlId = OUStringToOString(aMap["id"], 
RTL_TEXTENCODING_ASCII_US);
 OUString sControlType = aMap["type"];
 OUString sAction = aMap["cmd"];
 
 if (sControlType == "tabcontrol")
 {
-auto pNotebook = pBuilder->weld_notebook(sControlId, 
false);
+auto pNotebook = dynamic_cast(pWidget);
 if (pNotebook)
 {
 if (sAction == "selecttab")
@@ -3637,7 +3638,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 }
 else if (sControlType == "combobox")
 {
-auto pCombobox = pBuilder->weld_combo_box(sControlId, 
false);
+auto pCombobox = dynamic_cast(pWidget);
 if (pCombobox)
 {
 if (sAction == "selected")
@@ -3651,6 +3652,11 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 pCombobox->set_active(pos);
 }
 }
+else if (sAction == "change")
+{
+pCombobox->set_entry_text(aMap["data"]);
+pCombobox->signal_changed();
+}
 else
 bContinueWithLOKWindow = true;
 }
diff --git a/include/vcl/jsdialog/jsdialogbuilder.hxx 
b/include/vcl/jsdialog/jsdialogbuilder.hxx
index 382623a83da6..f57d3da7ec7f 100644
--- a/include/vcl/jsdialog/jsdialogbuilder.hxx
+++ b/include/vcl/jsdialog/jsdialogbuilder.hxx
@@ -10,6 +10,7 @@
 #include 
 
 class ComboBox;
+typedef std::map WidgetMap;
 
 class JSDialogSender
 {
@@ -28,6 +29,9 @@ class VCL_DLLPUBLIC JSInstanceBuilder : public 
SalInstanceBuilder
 {
 vcl::LOKWindowId m_nWindowId;
 
+static std::map& GetLOKWeldWidgetsMap();
+void RememberWidget(const OString& id, weld::Widget* pWidget);
+
 public:
 JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const 
OUString& rUIFile);
 virtual ~JSInstanceBuilder() override;
@@ -44,8 +48,7 @@ public:
 virtual std::unique_ptr weld_notebook(const OString& id,
   bool bTakeOwnership 
= false) override;
 
-static std::map& 
GetLOKWeldBuilderMap();
-static JSInstanceBuilder* FindLOKWeldBuilder(vcl::LOKWindowId nWindowId);
+static weld::Widget* FindWeldWidgetsMap(vcl::LOKWindowId nWindowId, const 
OString& rWidget);
 };
 
 template 
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index dc73addd0c10..e14c2c0d5ed3 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -613,7 +613,6 @@ 

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

2020-03-30 Thread Michael Weghorn (via logerrit)
 desktop/source/lib/lokinteractionhandler.cxx |4 
 vcl/source/filter/ipdf/pdfread.cxx   |1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 1d8529c67692b119924bc5760372daa64fa4cb4a
Author: Michael Weghorn 
AuthorDate: Mon Mar 30 11:19:55 2020 +0200
Commit: Michael Weghorn 
CommitDate: Mon Mar 30 14:17:36 2020 +0200

lok: Avoid deadlock for password-protected doc with gtktiledviewer

Since commit 629bc69708a280b79f07b58adcda8593e22cf422
("LOK: hold the solar mutex consistently for document method calls.",
2016-10-19), the SolarMutex needs to be acquired in
'lo_setDocumentPassword'.

This caused a deadlock for gtktiledviewer when trying to open a
password-protected file, since the callback handler runs in a
different thread there.

Temporarily release the SolarMutex in
LOKInteractionHandler::handlePasswordRequest to prevent that
and make opening password-protected files with gtktiledviewer
work again.

Change-Id: I3ec8067c2b22aff5867eb0d526d399a18947fd48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91350
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index f749bd4397c2..3dfd602b261a 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace com::sun::star;
 
@@ -275,6 +276,9 @@ bool LOKInteractionHandler::handlePasswordRequest(const 
uno::SequencehasOptionalFeature(bIsRequestPasswordToModify ? 
LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY
 : 
LOK_FEATURE_DOCUMENT_PASSWORD))
 {
+// release SolarMutex, so the callback handler, which may run in 
another thread,
+// can acquire it in 'lo_setDocumentPassword'
+SolarMutexReleaser aReleaser;
 m_pLOKit->mpCallback(bIsRequestPasswordToModify ? 
LOK_CALLBACK_DOCUMENT_PASSWORD_TO_MODIFY
 : 
LOK_CALLBACK_DOCUMENT_PASSWORD,
 sUrl.getStr(),
commit c664523d7b4523e9bb73b1e81e4c3faba5b47ee0
Author: Caolán McNamara 
AuthorDate: Mon Mar 30 12:10:49 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon Mar 30 14:17:22 2020 +0200

stray fResolutionDPI left behind

from...

commit 489b18edd6dc87287f260ba87d95abcc95d87932
Date:   Sun Mar 29 16:30:19 2020 +0200

pdfium: fix setting the size of the document when opening PDF

Change-Id: I86c6983f3d22e5169416436bffc0e347a888591a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91357
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/filter/ipdf/pdfread.cxx 
b/vcl/source/filter/ipdf/pdfread.cxx
index 8a90b0ab93ca..187bc459c2f9 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -305,7 +305,6 @@ size_t ImportPDFUnloaded(const OUString& rURL, 
std::vectorhttps://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-24 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx   |   19 +
 vcl/inc/salvtables.hxx|  120 +++
 vcl/source/app/salvtables.cxx |  430 ++
 3 files changed, 364 insertions(+), 205 deletions(-)

New commits:
commit 0a35eafca9f74d2858bd3323d74d64813fa9107a
Author: Szymon Kłos 
AuthorDate: Mon Feb 24 16:06:48 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Feb 25 08:15:56 2020 +0100

jsdialog: Refresh dialog after action

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0869b3a92ab7..8c7ac75e6b80 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3582,7 +3582,24 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 } catch(...) {}
 
 // force resend
-pWindow->Resize();
+const vcl::ILibreOfficeKitNotifier* pNotifier = 
pWindow->GetLOKNotifier();
+if (!pNotifier)
+{
+pWindow->Resize();
+return;
+}
+
+try
+{
+// Mobile.
+std::stringstream aStream;
+boost::property_tree::ptree aTree = pWindow->DumpAsPropertyTree();
+aTree.put("id", pWindow->GetLOKWindowId());
+boost::property_tree::write_json(aStream, aTree);
+const std::string message = aStream.str();
+pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, 
message.c_str());
+}
+catch (boost::property_tree::json_parser::json_parser_error&) {}
 }
 }
 
commit 9dba074405b3db3a0bd2b09a15c98abf4a2cd646
Author: Szymon Kłos 
AuthorDate: Fri Feb 21 14:35:13 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Feb 25 08:15:46 2020 +0100

Move SalInstanceEdit declaration to the header file

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

diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 3d41d3589871..519e2ddf7ef9 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -7,6 +7,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 class SalInstanceBuilder : public weld::Builder
 {
@@ -495,4 +497,122 @@ public:
 virtual weld::Container* weld_content_area() override;
 };
 
+class WeldTextFilter : public TextFilter
+{
+private:
+Link& m_rInsertTextHdl;
+
+public:
+WeldTextFilter(Link& rInsertTextHdl);
+
+virtual OUString filter(const OUString& rText) override;
+};
+
+class SalInstanceEntry : public SalInstanceWidget, public virtual weld::Entry
+{
+private:
+VclPtr<::Edit> m_xEntry;
+
+DECL_LINK(ChangeHdl, Edit&, void);
+DECL_LINK(CursorListener, VclWindowEvent&, void);
+DECL_LINK(ActivateHdl, Edit&, bool);
+
+WeldTextFilter m_aTextFilter;
+
+public:
+SalInstanceEntry(::Edit* pEntry, SalInstanceBuilder* pBuilder, bool 
bTakeOwnership);
+
+virtual void set_text(const OUString& rText) override;
+
+virtual OUString get_text() const override;
+
+virtual void set_width_chars(int nChars) override;
+
+virtual int get_width_chars() const override;
+
+virtual void set_max_length(int nChars) override;
+
+virtual void select_region(int nStartPos, int nEndPos) override;
+
+bool get_selection_bounds(int& rStartPos, int& rEndPos) override;
+
+virtual void replace_selection(const OUString& rText) override;
+
+virtual void set_position(int nCursorPos) override;
+
+virtual int get_position() const override;
+
+virtual void set_editable(bool bEditable) override;
+
+virtual bool get_editable() const override;
+
+virtual void set_message_type(weld::EntryMessageType eType) override;
+
+virtual void set_font(const vcl::Font& rFont) override;
+
+virtual void connect_cursor_position(const Link& rLink) 
override;
+
+virtual void set_placeholder_text(const OUString& rText) override;
+
+Edit& getEntry();
+
+void fire_signal_changed();
+
+virtual void cut_clipboard() override;
+
+virtual void copy_clipboard() override;
+
+virtual void paste_clipboard() override;
+
+virtual ~SalInstanceEntry() override;
+};
+
+class SalInstanceSpinButton : public SalInstanceEntry, public virtual 
weld::SpinButton
+{
+private:
+VclPtr m_xButton;
+
+DECL_LINK(UpDownHdl, SpinField&, void);
+DECL_LINK(LoseFocusHdl, Control&, void);
+DECL_LINK(OutputHdl, Edit&, bool);
+DECL_LINK(InputHdl, sal_Int64*, TriState);
+DECL_LINK(ActivateHdl, Edit&, bool);
+
+double toField(int nValue) const;
+
+int fromField(double fValue) const;
+
+public:
+SalInstanceSpinButton(FormattedField* pButton, SalInstanceBuilder* 
pBuilder,
+  bool bTakeOwnership);
+
+virtual int 

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

2019-12-05 Thread Andrea Gelmini (via logerrit)
 desktop/source/deployment/inc/lockfile.hxx |2 +-
 sw/source/uibase/uiview/view2.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e989c3015ec34b55d9e519e2b8750cddd976c91d
Author: Andrea Gelmini 
AuthorDate: Wed Dec 4 20:22:40 2019 +0100
Commit: Julien Nabet 
CommitDate: Thu Dec 5 10:09:09 2019 +0100

Fix typo

Change-Id: Idd7c5295314ef2a36f37125837c8276bb5feb4d2
Reviewed-on: https://gerrit.libreoffice.org/84494
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index be7a42416eae..43694ab1239b 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -531,7 +531,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
 }
 else
 {
-// set the specific graphic attrbutes to the graphic
+// set the specific graphic attributes to the graphic
 bReturn = true;
 AutoCaption( GRAPHIC_CAP );
 rReq.Done();
commit e5a72dfe6d84bccdad0b44a6abd879e1c770df20
Author: Andrea Gelmini 
AuthorDate: Wed Dec 4 20:22:14 2019 +0100
Commit: Julien Nabet 
CommitDate: Thu Dec 5 10:08:34 2019 +0100

Fix typo

Change-Id: I3cabc94a2916b1433285a7c725607fbda80cb8ac
Reviewed-on: https://gerrit.libreoffice.org/84476
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/desktop/source/deployment/inc/lockfile.hxx 
b/desktop/source/deployment/inc/lockfile.hxx
index dc1e66cc0890..6fa8fcfdcae3 100644
--- a/desktop/source/deployment/inc/lockfile.hxx
+++ b/desktop/source/deployment/inc/lockfile.hxx
@@ -57,7 +57,7 @@ namespace desktop {
 {
 public:
 
-// constructs a new lockfile onject
+// constructs a new lockfile object
 Lockfile( bool bIPCserver = true );
 
 // separating GUI code:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: 2 commits - desktop/source sal/android

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

New commits:
commit 668b03284c4b0df56d5a000cc38dd1144ec33bbe
Author: Jan Holesovsky 
AuthorDate: Wed Nov 20 17:55:43 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Mon Dec 2 11:13:54 2019 +0100

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

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

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8f05cc487672..7fb08f0bec15 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include 
 
 #include 
@@ -2712,13 +2713,6 @@ static void doc_setPartMode(LibreOfficeKitDocument* 
pThis,
 }
 }
 
-#if defined(ANDROID)
-/// For the distinction if the LOK is used for the 'old' (JNI-based) or the
-/// 'new' (loolwsd-based) app.  Default to the 'new', ie. not used from JNI as
-/// implemented in sal/android/libreofficekit-jni.c.
-bool android_lok_from_jni = false;
-#endif
-
 static void doc_paintTile(LibreOfficeKitDocument* pThis,
   unsigned char* pBuffer,
   const int nCanvasWidth, const int nCanvasHeight,
@@ -2756,15 +2750,12 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 #else
 ScopedVclPtrInstance< VirtualDevice > pDevice(DeviceFormat::DEFAULT);
 
-#if defined(ANDROID)
-if (!android_lok_from_jni)
+#if HAVE_FEATURE_ANDROID_LOK
+// Set background to transparent by default.
+// [Unless it is the 'old' (JNI-based) Android app - no idea why it
+// needs avoiding this.]
+pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
 #endif
-{
-// Set background to transparent by default.
-// [Unless it is the 'old' (JNI-based) Android app - no idea why it
-// needs avoiding this.]
-pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
-}
 
 pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
 Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c
index e4d7f4828a54..08827df54f07 100644
--- a/sal/android/libreofficekit-jni.c
+++ b/sal/android/libreofficekit-jni.c
@@ -37,7 +37,6 @@ extern const char* data_dir;
 extern const char* cache_dir;
 extern void* apk_file;
 extern int apk_file_size;
-extern bool android_lok_from_jni; ///< for the distinction if the LOK is used 
for the 'old' (JNI-based) or the 'new' (loolwsd-based) app
 AAssetManager* native_asset_manager;
 
 extern void Java_org_libreoffice_android_Bootstrap_putenv(JNIEnv* env, jobject 
clazz, jstring string);
@@ -164,10 +163,6 @@ jboolean 
Java_org_libreoffice_kit_LibreOfficeKit_initializeNative
 
 (void) clazz;
 
-// the 'old' app needs to avoid setting the virtual device to transparent
-// in paintTile(), so indicate we are using the 'old' app
-android_lok_from_jni = true;
-
 libreofficekit_initialize(env, dataDir, cacheDir, apkFile, assetManager);
 
 // LibreOfficeKit expects a path to the program/ directory
commit b648e36c775e8707e7f6a49b264951916cf4092d
Author: Jan Holesovsky 
AuthorDate: Wed Nov 27 15:28:59 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Mon Dec 2 11:13:38 2019 +0100

android: Hint how to enable fontconfig logging.

Change-Id: I8901780fa29c6d27bb53e44b07d95259b5bd02df
Reviewed-on: https://gerrit.libreoffice.org/83920
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit f3af7708e3535d3171832aa2308d1e7f6193def4)
Reviewed-on: https://gerrit.libreoffice.org/84189
Tested-by: Jenkins

diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c
index 1307ab6a5fbb..e4d7f4828a54 100644
--- a/sal/android/libreofficekit-jni.c
+++ b/sal/android/libreofficekit-jni.c
@@ -104,6 +104,9 @@ jboolean libreofficekit_initialize(JNIEnv* env,
 close(fd);
 LOGI("Setting FONTCONFIG_FILE to %s", fontsConfPath);
 setenv("FONTCONFIG_FILE", fontsConfPath, 1);
+// DEBUG:
+//setenv("FC_DEBUG", "8191", 1); // log everything
+//Java_org_libreoffice_android_Bootstrap_redirect_1stdio(NULL, NULL, 
JNI_TRUE);
 }
 free(fontsConfPath);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-04 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx  |   85 ---
 vcl/source/window/window.cxx |2 -
 2 files changed, 25 insertions(+), 62 deletions(-)

New commits:
commit 5dff78b49f489aaa552384e14225a798a8a093a6
Author: Michael Meeks 
AuthorDate: Mon Nov 4 15:44:04 2019 +
Commit: Michael Meeks 
CommitDate: Mon Nov 4 17:43:20 2019 +0100

lok: share conversion of OUString to C strings.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b00638eaa127..ef201b32061e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -260,6 +260,20 @@ static OUString getUString(const char* pString)
 return OStringToOUString(sString, RTL_TEXTENCODING_UTF8);
 }
 
+// Tolerate embedded \0s etc.
+static char *convertOString(const OString )
+{
+char* pMemory = static_cast(malloc(rStr.getLength() + 1));
+assert(pMemory); // don't tolerate failed allocations.
+memcpy(pMemory, rStr.getStr(), rStr.getLength() + 1);
+return pMemory;
+}
+
+static char *convertOUString(const OUString )
+{
+return convertOString(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8));
+}
+
 /// Try to convert a relative URL to an absolute one, unless it already looks 
like a URL.
 static OUString getAbsoluteURL(const char* pURL)
 {
@@ -2544,13 +2558,7 @@ static char* doc_getPartInfo(LibreOfficeKitDocument* 
pThis, int nPart)
 return nullptr;
 }
 
-OUString aPartInfo = pDoc->getPartInfo( nPart );
-OString aString = OUStringToOString(aPartInfo, RTL_TEXTENCODING_UTF8);
-
-char* pMemory = static_cast(malloc(aString.getLength() + 1));
-assert(pMemory); // Don't handle OOM conditions
-strcpy(pMemory, aString.getStr());
-return pMemory;
+return convertOUString(pDoc->getPartInfo(nPart));
 }
 
 static void doc_selectPart(LibreOfficeKitDocument* pThis, int nPart, int 
nSelect)
@@ -2599,13 +2607,7 @@ static char* 
doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
 return nullptr;
 }
 
-OUString sRectangles = pDoc->getPartPageRectangles();
-OString aString = OUStringToOString(sRectangles, RTL_TEXTENCODING_UTF8);
-char* pMemory = static_cast(malloc(aString.getLength() + 1));
-assert(pMemory); // Don't handle OOM conditions
-strcpy(pMemory, aString.getStr());
-return pMemory;
-
+return convertOUString(pDoc->getPartPageRectangles());
 }
 
 static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
@@ -2622,13 +2624,7 @@ static char* doc_getPartName(LibreOfficeKitDocument* 
pThis, int nPart)
 return nullptr;
 }
 
-OUString sName = pDoc->getPartName( nPart );
-OString aString = OUStringToOString(sName, RTL_TEXTENCODING_UTF8);
-char* pMemory = static_cast(malloc(aString.getLength() + 1));
-assert(pMemory); // Don't handle OOM conditions
-strcpy(pMemory, aString.getStr());
-return pMemory;
-
+return convertOUString(pDoc->getPartName(nPart));
 }
 
 static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart)
@@ -2645,13 +2641,7 @@ static char* doc_getPartHash(LibreOfficeKitDocument* 
pThis, int nPart)
 return nullptr;
 }
 
-OUString sHash = pDoc->getPartHash(nPart);
-OString aString = OUStringToOString(sHash, RTL_TEXTENCODING_UTF8);
-char* pMemory = static_cast(malloc(aString.getLength() + 1));
-assert(pMemory); // Don't handle OOM conditions
-strcpy(pMemory, aString.getStr());
-return pMemory;
-
+return convertOUString(pDoc->getPartHash(nPart));
 }
 
 static void doc_setPartMode(LibreOfficeKitDocument* pThis,
@@ -3752,14 +3742,6 @@ static bool getFromTransferrable(
 return true;
 }
 
-// Tolerate embedded \0s etc.
-static char *convertOString(const OString )
-{
-char* pMemory = static_cast(malloc(rStr.getLength() + 1));
-memcpy(pMemory, rStr.getStr(), rStr.getLength() + 1);
-return pMemory;
-}
-
 static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* 
pMimeType, char** pUsedMimeType)
 {
 comphelper::ProfileZone aZone("doc_getTextSelection");
@@ -3914,7 +3896,7 @@ static int doc_getClipboard(LibreOfficeKitDocument* pThis,
 else
 {
 (*pOutSizes)[i] = aRet.getLength();
-(*pOutStreams)[i] =  convertOString(aRet);
+(*pOutStreams)[i] = convertOString(aRet);
 }
 }
 
@@ -4490,13 +4472,8 @@ static char* 
doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
 OUString aHeaders = pDoc->getRowColumnHeaders(aRectangle);
 if (aHeaders.isEmpty())
 return nullptr;
-
-OString aString = OUStringToOString(aHeaders, RTL_TEXTENCODING_UTF8);
-
-char* pMemory = static_cast(malloc(aString.getLength() + 1));
-assert(pMemory); // Don't handle OOM conditions
-

[Libreoffice-commits] core.git: 2 commits - desktop/source offapi/com

2019-08-02 Thread Michael Meeks (via logerrit)
 desktop/source/lib/lokclipboard.hxx |2 +-
 offapi/com/sun/star/datatransfer/XTransferable2.idl |2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 6a3c5b418437ae928553530b938f4b7b3e5ea9e0
Author: Michael Meeks 
AuthorDate: Fri Aug 2 13:58:48 2019 -0400
Commit: Michael Meeks 
CommitDate: Fri Aug 2 14:00:30 2019 -0400

clipboard: elide string constructor.

Change-Id: I18c01e77e0ddf4b86f2f5ba610509555160f96c3

diff --git a/desktop/source/lib/lokclipboard.hxx 
b/desktop/source/lib/lokclipboard.hxx
index 6c0509265db4..7da5f3ef3900 100644
--- a/desktop/source/lib/lokclipboard.hxx
+++ b/desktop/source/lib/lokclipboard.hxx
@@ -54,7 +54,7 @@ public:
 const css::uno::Reference& 
xTransferable,
 const 
css::uno::Reference& 
xClipboardOwner)
 override;
-OUString SAL_CALL getName() override { return OUString("CLIPBOARD"); }
+OUString SAL_CALL getName() override { return "CLIPBOARD"; }
 
 // XClipboardEx
 sal_Int8 SAL_CALL getRenderingCapabilities() override { return 0; }
commit e5e26b83e722bc49727c434ea5c775a97f737566
Author: Michael Meeks 
AuthorDate: Fri Aug 2 13:13:51 2019 -0400
Commit: Michael Meeks 
CommitDate: Fri Aug 2 14:00:30 2019 -0400

XTransferable2 - add missing 'since' tag on isComplex.

Change-Id: Ib8165edb4d87fb5bbb115fe26b8dbbe5a70bd59a

diff --git a/offapi/com/sun/star/datatransfer/XTransferable2.idl 
b/offapi/com/sun/star/datatransfer/XTransferable2.idl
index a6b53f0671e2..9fb99e600177 100644
--- a/offapi/com/sun/star/datatransfer/XTransferable2.idl
+++ b/offapi/com/sun/star/datatransfer/XTransferable2.idl
@@ -34,6 +34,8 @@ interface XTransferable2 : 
com::sun::star::datatransfer::XTransferable
 
 /**
  * Returns true if the selection contains embedded objects or is a large 
text blob.
+ *
+ * @since LibreOffice 6.4
  */
 boolean isComplex();
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-25 Thread Ashod Nakashian (via logerrit)
 desktop/source/lib/init.cxx |   61 +++-
 vcl/source/app/svapp.cxx|9 +-
 2 files changed, 40 insertions(+), 30 deletions(-)

New commits:
commit 987c03d5c237c6a86ac886991435220e7381ced1
Author: Ashod Nakashian 
AuthorDate: Thu May 9 22:49:37 2019 -0400
Commit: Noel Grandin 
CommitDate: Thu Jul 25 19:24:19 2019 +0200

LOK: Do not offset window coordinates in LOK

This fixes the issue with selecting the incorrect
color when clicking on the color presets in the
color picker window in LOK. Because the window
coordinates are shifted in Core, and LOK client
sends in absolute coordinates, the shift causes
a different color to be selected.

(cherry picked from commit 171a2300d37d73065e5e3bd4b77678e35f678adf)

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ebb52d175027..42972ce713b5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3278,7 +3278,7 @@ static void 
doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned
 return;
 }
 
-Point aPos(nX, nY);
+const Point aPos(nX, nY);
 MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, 
nButtons, nModifier);
 
 if (Dialog* pDialog = dynamic_cast(pWindow.get()))
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 4967144e38e4..6632364f1c6c 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -70,6 +70,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -880,8 +881,12 @@ ImplSVEvent* Application::PostMouseEvent( VclEventId 
nEvent, vcl::Window *pWin,
 {
 Point aTransformedPos( pMouseEvent->GetPosPixel() );
 
-aTransformedPos.AdjustX(pWin->GetOutOffXPixel() );
-aTransformedPos.AdjustY(pWin->GetOutOffYPixel() );
+// LOK uses (0, 0) as the origin of all windows; don't offset.
+if (!comphelper::LibreOfficeKit::isActive())
+{
+aTransformedPos.AdjustX(pWin->GetOutOffXPixel());
+aTransformedPos.AdjustY(pWin->GetOutOffYPixel());
+}
 
 const MouseEvent aTransformedEvent( aTransformedPos, 
pMouseEvent->GetClicks(), pMouseEvent->GetMode(),
 pMouseEvent->GetButtons(), 
pMouseEvent->GetModifier() );
commit 4289b86e33b3658a131781ce0e26d86a70b967a8
Author: Ashod Nakashian 
AuthorDate: Wed May 8 21:33:55 2019 -0400
Commit: Noel Grandin 
CommitDate: Thu Jul 25 19:24:03 2019 +0200

LOK: Reduce and improve logging of event compression

Change-Id: I84e0e8806eb6f4fbda063ebc29fafa791d472bb8
(cherry picked from commit d5b900630caefc4d3b62a31906117cf4acd623b1)
Reviewed-on: https://gerrit.libreoffice.org/76322
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2db298e3998c..ebb52d175027 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1179,11 +1179,13 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 // Dump the queue state and validate cached data.
 int i = 1;
 std::ostringstream oss;
-oss << '\n';
+if (m_queue.empty())
+oss << "Empty";
+else
+oss << m_queue.size() << " items\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));
+SAL_INFO("lok", "Current Queue: " << oss.str());
 for (const CallbackData& c : m_queue)
 assert(c.validate());
 }
@@ -1396,45 +1398,53 @@ bool 
CallbackFlushHandler::processWindowEvent(CallbackData& aCallbackData)
 const boost::property_tree::ptree& aOldTree = elem.getJson();
 if (aOldTree.get("action", "") == "invalidate")
 {
-const unsigned nOldDialogId = aOldTree.get("id", 
0);
-std::string aOldRectStr = 
aOldTree.get("rectangle", "");
-// not possible that we encounter an empty
-// rectangle here; we already handled this
-// case before
-std::istringstream aOldRectStream(aOldRectStr);
+// Not possible that we encounter an empty rectangle here; 
we already handled this case above.
+std::istringstream 
aOldRectStream(aOldTree.get("rectangle", ""));
 long nOldLeft, nOldTop, nOldWidth, nOldHeight;
 char nOldComma;
 aOldRectStream >> nOldLeft >> nOldComma >> nOldTop 

[Libreoffice-commits] core.git: 2 commits - desktop/source distro-configs/LibreOfficeiOS.conf distro-configs/LibreOfficeiOS_Sim.conf

2019-06-03 Thread Tomaž Vajngerl (via logerrit)
 desktop/source/lib/init.cxx|   72 -
 distro-configs/LibreOfficeiOS.conf |   11 -
 distro-configs/LibreOfficeiOS_Sim.conf |   32 ++
 3 files changed, 77 insertions(+), 38 deletions(-)

New commits:
commit b4653db6504a7e12203d5defeea536a0decf76d8
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 3 14:42:44 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 3 10:32:15 2019 +0200

Add distro config for iOS simulator to make building easier

Change-Id: Iff70622732792224b3c0a080f95d69f86c167ae6
Reviewed-on: https://gerrit.libreoffice.org/73370
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/distro-configs/LibreOfficeiOS.conf 
b/distro-configs/LibreOfficeiOS.conf
index 411ba8d69798..7786120e2279 100644
--- a/distro-configs/LibreOfficeiOS.conf
+++ b/distro-configs/LibreOfficeiOS.conf
@@ -27,15 +27,6 @@
 
 --without-tls
 
-# iOS simulator (debug)
-#--enable-ios-simulator
-#--enable-debug
-
-# iOS Device (debug)
-#--enable-ios-simulator
-#--enable-debug
-#--host=arm64-apple-darwin
-
-# iOS Device (release)
+# iOS device
 --host=arm64-apple-darwin
 
diff --git a/distro-configs/LibreOfficeiOS_Sim.conf 
b/distro-configs/LibreOfficeiOS_Sim.conf
new file mode 100644
index ..146be2bd3bcc
--- /dev/null
+++ b/distro-configs/LibreOfficeiOS_Sim.conf
@@ -0,0 +1,32 @@
+--disable-breakpad
+--disable-firebird-sdbc
+--disable-online-update
+
+--without-export-validation
+--without-helppack-integration
+--without-java
+--without-junit
+
+--with-theme=colibre tango
+
+--with-build-platform-configure-options=--with-system-jpeg=no
+--with-macosx-version-min-required=10.11
+
+--disable-avahi
+--disable-avmedia
+--disable-compiler-plugins
+--disable-cups
+--disable-database-connectivity
+--disable-dconf
+--disable-extensions
+--disable-kde5
+--disable-odk
+--disable-openssl
+--disable-pdfium
+--disable-python
+
+--without-tls
+
+# iOS simulator (debug)
+--enable-ios-simulator
+--enable-debug
commit 80c5c68fede7af89e7a3732408e97364498fbbcd
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 3 12:50:47 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 3 10:32:02 2019 +0200

LOK: Factor out iOS painting code

Change-Id: Ica706842003fe60ba864e013614eb535580446bb
Reviewed-on: https://gerrit.libreoffice.org/73363
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index aea40f41a2cb..2a19ef820c1a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1598,6 +1598,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, 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 ...
@@ -2446,7 +2485,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 // would do - because that one is trying to fit the lines between cells to 
integer multiples of
 // pixels.
 comphelper::ScopeGuard dpiScaleGuard([]() { 

[Libreoffice-commits] core.git: 2 commits - desktop/source toolkit/source vcl/source

2019-05-20 Thread Tor Lillqvist (via logerrit)
 desktop/source/lib/init.cxx|   15 ++-
 toolkit/source/awt/vclxtoolkit.cxx |9 -
 vcl/source/window/window.cxx   |4 +++-
 3 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit 6d6277f23337c8eae9acabdf830e33fcc3ee9923
Author: Tor Lillqvist 
AuthorDate: Tue May 21 01:26:53 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Tue May 21 02:32:59 2019 +0300

tdf#125397: Avoid crash if GetpApp() returns null, can happen on iOS at 
least

Change-Id: Ib0dfb00c6a00640fe35769f21f167bf3eae8769b

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 7435ce177244..c6dc06416c8f 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2299,7 +2299,9 @@ void Window::Show(bool bVisible, ShowFlags nFlags)
 if ( !pSVData->mpIntroWindow )
 {
 // The right way would be just to call this (not even in the 
'if')
-GetpApp()->InitFinished();
+auto pApp = GetpApp();
+if ( pApp )
+pApp->InitFinished();
 }
 else if ( !ImplIsWindowOrChild( pSVData->mpIntroWindow ) )
 {
commit 123c7b80447a2b433e19d0d04be444c4dfdd0551
Author: Tor Lillqvist 
AuthorDate: Mon May 20 23:53:12 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Tue May 21 02:32:51 2019 +0300

tdf#125397: Fixes for threads and SolarMutex on iOS

We need to call SfxApplication::GetOrCreate() in lo_initialize() now.
Otherwise we will crash in sfx2. No idea why it worked earlier.

I think we want to avoid the "VCLXToolkit VCL main thread" ever
running in the iOS app. I don't think we had it running earlier, but
now for some reason it got started when creating a document from a
template, and that seemed to cause a hang.

Also, when creating a document from a template, lo_initialize() is
called from the app's real main thread (the one that the process
starts in). In that case we do want to release the SolarMutex after
InitVCL() if this was the first time we called InitVCL(). Awful crack.

Not really sure I fully understand all that is going on, but this
change does seem to fix recent problems... All this thread and
SolarMutex stuff is so incredibly fragile.

Change-Id: Ib04498ad199b64f27701f89d2df7003bca316406

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 22a646ef934a..646505603311 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -96,6 +96,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -4598,7 +4599,6 @@ static void lo_runLoop(LibreOfficeKit* /*pThis*/,
void* pData)
 {
 #ifdef IOS // Maybe ANDROID, too?
-InitVCL();
 Application::GetSolarMutex().acquire();
 #endif
 
@@ -4922,6 +4922,19 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 // CommandLineArgs):
 desktop::Desktop::GetCommandLineArgs().setHeadless();
 
+#ifdef IOS
+if (InitVCL() && [NSThread isMainThread])
+{
+static bool bFirstTime = true;
+if (bFirstTime)
+{
+Application::GetSolarMutex().release();
+bFirstTime = false;
+}
+}
+SfxApplication::GetOrCreate();
+#endif
+
 if (eStage == PRE_INIT)
 {
 {
diff --git a/toolkit/source/awt/vclxtoolkit.cxx 
b/toolkit/source/awt/vclxtoolkit.cxx
index 8750d90beb0f..69567b33c17b 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -835,6 +835,8 @@ bool lcl_convertMessageBoxType(
 return ( eVal != css::awt::MessageBoxType::MessageBoxType_MAKE_FIXED_SIZE 
);
 }
 
+#ifndef IOS
+
 static sal_Int32nVCLToolkitInstanceCount = 0;
 static bool bInitedByVCLToolkit = false;
 
@@ -905,6 +907,8 @@ static void ToolkitWorkerFunction( void* pArgs )
 }
 }
 
+#endif
+
 // constructor, which might initialize VCL
 VCLXToolkit::VCLXToolkit():
 cppu::WeakComponentImplHelper<
@@ -922,6 +926,7 @@ VCLXToolkit::VCLXToolkit():
 hSvToolsLib = nullptr;
 fnSvtCreateWindow = nullptr;
 
+#ifndef IOS
 osl::Guard< osl::Mutex > aGuard( getInitMutex() );
 nVCLToolkitInstanceCount++;
 if( ( nVCLToolkitInstanceCount == 1 ) && ( !Application::IsInMain() ) )
@@ -930,6 +935,7 @@ VCLXToolkit::VCLXToolkit():
 CreateMainLoopThread( ToolkitWorkerFunction, this );
 getInitCondition().wait();
 }
+#endif
 }
 
 void SAL_CALL VCLXToolkit::disposing()
@@ -943,6 +949,7 @@ void SAL_CALL VCLXToolkit::disposing()
 }
 #endif
 
+#ifndef IOS
 {
 osl::Guard< osl::Mutex > aGuard( getInitMutex() );
 if( --nVCLToolkitInstanceCount == 0 )
@@ -955,7 +962,7 @@ void SAL_CALL 

[Libreoffice-commits] core.git: 2 commits - desktop/source qadevOOo/tests

2019-05-13 Thread Andrea Gelmini (via logerrit)
 desktop/source/deployment/registry/inc/dp_backend.h |2 +-
 qadevOOo/tests/java/ifc/container/_XContainerQuery.java |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 89fd86540580ebbc269848b3c4b6539e070829a0
Author: Andrea Gelmini 
AuthorDate: Mon May 13 13:54:15 2019 +
Commit: Julien Nabet 
CommitDate: Mon May 13 20:30:43 2019 +0200

Fix typo

Change-Id: I93cefdcf044854bb20a9524351548bb9721d393e
Reviewed-on: https://gerrit.libreoffice.org/72242
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/qadevOOo/tests/java/ifc/container/_XContainerQuery.java 
b/qadevOOo/tests/java/ifc/container/_XContainerQuery.java
index 20e49b7e29ef..68cacca00a45 100644
--- a/qadevOOo/tests/java/ifc/container/_XContainerQuery.java
+++ b/qadevOOo/tests/java/ifc/container/_XContainerQuery.java
@@ -85,7 +85,7 @@ public class _XContainerQuery extends MultiMethodTest {
  * If object relation is available, the function was called with relation
  * as parameter. The returned XEnumeration must not be null 
and
  * elements of it must be valid.
- * If object relation is not available, the result is always 
true
+ * If object relation is not available, the result is always 
true
 */
 public void _createSubSetEnumerationByQuery() {
 
commit 2c1190a21f812667097409256b96754651a74cfd
Author: Andrea Gelmini 
AuthorDate: Wed May 8 10:13:10 2019 +
Commit: Julien Nabet 
CommitDate: Mon May 13 20:30:19 2019 +0200

Fix typo

Change-Id: I81d227fa99058ea0d13576d36897f186164b6ad6
Reviewed-on: https://gerrit.libreoffice.org/72251
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/desktop/source/deployment/registry/inc/dp_backend.h 
b/desktop/source/deployment/registry/inc/dp_backend.h
index 03f2640a4cf4..319c0904541c 100644
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -201,7 +201,7 @@ class PackageRegistryBackend
 {
 //The map held originally WeakReferences. The map entries are removed in 
the disposing
 //function, which is called when the XPackages are destructed or they are
-//explicitly disposed. The latter happens, for example, when a extension is
+//explicitly disposed. The latter happens, for example, when an extension 
is
 //removed (see dp_manager.cxx). However, because of how the help systems 
work, now
 // XPackageManager::getDeployedPackages is called often. This results in a 
lot
 //of bindPackage calls which are costly. Therefore we keep hard references 
in
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: 2 commits - desktop/source vcl/headless

2019-04-24 Thread Tor Lillqvist (via logerrit)
 desktop/source/lib/init.cxx |4 
 vcl/headless/svpinst.cxx|5 +
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 6e246024c8b7ad3d8b953f92a2e5a01686f3a00e
Author: Tor Lillqvist 
AuthorDate: Wed Apr 24 13:25:08 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 24 14:19:04 2019 +0300

tdf#124923: Remove unneeded iOS ifdeffery

Now with "Unipoll" this actually caused the app to hang. Unclear
whether this ifdef had ever been strictly needed. (But before
"Unipoll" it did not cause any harm.)

Change-Id: I5cc399f76fcdb267eb96bf7790474c14f2ce9955

diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 69353b104fc3..a9c3488114fc 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -173,9 +173,7 @@ void SvpSalInstance::Wakeup(SvpRequest const request)
 g_CheckedMutex = true;
 }
 #endif
-#ifdef IOS
-(void)request;
-#else
+
 ImplSVData* pSVData = ImplGetSVData();
 
 if (pSVData->mpWakeCallback)
@@ -187,7 +185,6 @@ void SvpSalInstance::Wakeup(SvpRequest const request)
 pMutex->m_Request = request;
 pMutex->m_wakeUpMain = true;
 pMutex->m_WakeUpMainCond.notify_one();
-#endif
 }
 
 bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
commit 971cad365574267998e2a697441d42175ded61a3
Author: Tor Lillqvist 
AuthorDate: Wed Apr 24 13:19:44 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 24 14:19:04 2019 +0300

tdf#124923: Need to call InitVCL() on iOS before using SolarMutexGuard

Change-Id: If5781ae101e58c26368e57787cb301f84ffa82a5

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7fcf018813d4..c4a36e9e182e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4521,6 +4521,10 @@ static void lo_runLoop(LibreOfficeKit* /*pThis*/,
LibreOfficeKitWakeCallback pWakeCallback,
void* pData)
 {
+#ifdef IOS // Maybe ANDROID, too?
+InitVCL();
+#endif
+
 SolarMutexGuard aGuard;
 vcl::lok::registerPollCallbacks(pPollCallback, pWakeCallback, pData);
 lo_startmain(nullptr);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2018-12-23 Thread Libreoffice Gerrit user
 desktop/source/deployment/gui/dp_gui_theextmgr.cxx |1 
 filter/source/msfilter/msdffimp.cxx|   35 -
 2 files changed, 21 insertions(+), 15 deletions(-)

New commits:
commit 721bc6dafbed2185a9aedae35a34d3395eaed0bc
Author: Caolán McNamara 
AuthorDate: Sun Dec 23 17:26:36 2018 +
Commit: Caolán McNamara 
CommitDate: Sun Dec 23 22:23:22 2018 +0100

Related: tdf#122204 clarify 0xFFF0 size meaning

Change-Id: I71432b1a705d54f44c63f3734281a87b155c6f10
Reviewed-on: https://gerrit.libreoffice.org/65582
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 8f79471e7351..06deedf59392 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -2157,11 +2157,13 @@ void 
DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
 {
 sal_uInt16 nNumElemMemVert = 0;
 rIn.ReadUInt16( nNumElemVert ).ReadUInt16( nNumElemMemVert 
).ReadUInt16( nElemSizeVert );
+// If this value is 0xFFF0 then this record is an array of 
truncated 8 byte elements. Only the 4
+// low-order bytes are recorded
+if (nElemSizeVert == 0xFFF0)
+nElemSizeVert = 4;
 }
-if (nElemSizeVert != 8)
-nElemSizeVert = 4;
 //sanity check that the stream is long enough to fulfill nNumElem 
* nElemSize;
-bool bImport = rIn.remainingSize() / nElemSizeVert >= nNumElemVert;
+bool bImport = nElemSizeVert && (rIn.remainingSize() / 
nElemSizeVert >= nNumElemVert);
 if (bImport)
 {
 aCoordinates.realloc( nNumElemVert );
@@ -2390,15 +2392,16 @@ void 
DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
 sal_uInt16 nElemSizeVert = 8;
 
 if ( SeekToContent( DFF_Prop_connectorPoints, rIn ) )
-rIn.ReadUInt16( nNumElemVert ).ReadUInt16( nNumElemMemVert 
).ReadUInt16( nElemSizeVert );
-
-bool bImport = false;
-if (nNumElemVert && nElemSizeVert)
 {
-//sanity check that the stream is long enough to fulfill 
nNumElemVert * nElemSizeVert;
-bImport = rIn.remainingSize() / nElemSizeVert >= nNumElemVert;
+rIn.ReadUInt16( nNumElemVert ).ReadUInt16( nNumElemMemVert 
).ReadUInt16( nElemSizeVert );
+// If this value is 0xFFF0 then this record is an array of 
truncated 8 byte elements. Only the 4
+// low-order bytes are recorded
+if (nElemSizeVert == 0xFFF0)
+nElemSizeVert = 4;
 }
 
+// sanity check that the stream is long enough to fulfill 
nNumElemVert * nElemSizeVert;
+bool bImport = nElemSizeVert && (rIn.remainingSize() / 
nElemSizeVert >= nNumElemVert);
 if (bImport)
 {
 aGluePoints.realloc( nNumElemVert );
@@ -5513,13 +5516,15 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
 if (SeekToContent(DFF_Prop_pWrapPolygonVertices, rSt))
 {
 pTextImpRec->pWrapPolygon.reset();
-sal_uInt16 nNumElemVert(0), nNumElemMemVert(0), nElemSizeVert(0);
+sal_uInt16 nNumElemVert(0), nNumElemMemVert(0), nElemSizeVert(8);
 rSt.ReadUInt16( nNumElemVert ).ReadUInt16( nNumElemMemVert 
).ReadUInt16( nElemSizeVert );
-bool bOk = false;
-if (nNumElemVert && ((nElemSizeVert == 8) || (nElemSizeVert == 4)))
-{
-bOk = rSt.remainingSize() / nElemSizeVert >= nNumElemVert;
-}
+// If this value is 0xFFF0 then this record is an array of 
truncated 8 byte elements. Only the 4
+// low-order bytes are recorded
+if (nElemSizeVert == 0xFFF0)
+nElemSizeVert = 4;
+
+// sanity check that the stream is long enough to fulfill 
nNumElemVert * nElemSizeVert;
+bool bOk = nElemSizeVert && (rSt.remainingSize() / nElemSizeVert 
>= nNumElemVert);
 if (bOk)
 {
 pTextImpRec->pWrapPolygon.reset(new 
tools::Polygon(nNumElemVert));
commit f877d2882e4d257136ef2de901ff4f71b71916bd
Author: Caolán McNamara 
AuthorDate: Sun Dec 23 20:05:14 2018 +
Commit: Caolán McNamara 
CommitDate: Sun Dec 23 22:23:07 2018 +0100

tdf#122269 don't prompt to restart if we're exiting the application anyway

Change-Id: I6272ae92b7e948680fb7241c387eb205adbbea01
Reviewed-on: https://gerrit.libreoffice.org/65588
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx 
b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 

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

2018-12-11 Thread Libreoffice Gerrit user
 desktop/source/deployment/registry/package/dp_package.cxx |2 -
 include/sal/log-areas.dox |1 
 sw/source/core/bastyp/calc.cxx|   16 ++
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit d00513ab7d0b36819a5c9f8154d2fcd18d8e6197
Author: Samuel Mehrbrodt 
AuthorDate: Tue Dec 11 10:45:23 2018 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Tue Dec 11 15:15:40 2018 +0100

Add some logging to sw calc

Change-Id: I4cadbb928ab0fbb407e9d569e77e6c20229e1810
Reviewed-on: https://gerrit.libreoffice.org/64940
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 1468680d065e..aa9c3e3ccd09 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -509,6 +509,7 @@ certain functionality.
 
 @li @c sw
 @li @c sw.a11y - accessibility
+@li @c sw.calc - formula calculation
 @li @c sw.core - Writer core
 @li @c sw.createcopy
 @li @c sw.doc
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index d678e0b87965..d58ee08bdacc 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -1033,25 +1033,32 @@ SwSbxValue SwCalc::PrimFunc(bool )
 switch (m_eCurrOper)
 {
 case CALC_SIN:
+SAL_INFO("sw.calc", "sin");
 return StdFunc(, false);
 break;
 case CALC_COS:
+SAL_INFO("sw.calc", "cos");
 return StdFunc(, false);
 break;
 case CALC_TAN:
+SAL_INFO("sw.calc", "tan");
 return StdFunc(, false);
 break;
 case CALC_ATAN:
+SAL_INFO("sw.calc", "atan");
 return StdFunc(, false);
 break;
 case CALC_ASIN:
+SAL_INFO("sw.calc", "asin");
 return StdFunc(, true);
 break;
 case CALC_ACOS:
+SAL_INFO("sw.calc", "acos");
 return StdFunc(, true);
 break;
 case CALC_NOT:
 {
+SAL_INFO("sw.calc", "not");
 GetToken();
 SwSbxValue nErg = Prim();
 if( SbxSTRING == nErg.GetType() )
@@ -1079,6 +1086,7 @@ SwSbxValue SwCalc::PrimFunc(bool )
 }
 case CALC_NUMBER:
 {
+SAL_INFO("sw.calc", "number: " << m_nNumberValue.GetDouble());
 SwSbxValue nErg;
 if( GetToken() == CALC_PHD )
 {
@@ -1101,6 +1109,7 @@ SwSbxValue SwCalc::PrimFunc(bool )
 }
 case CALC_NAME:
 {
+SAL_INFO("sw.calc", "name");
 SwSbxValue nErg;
 switch(SwCalcOper eOper = GetToken())
 {
@@ -1126,6 +1135,7 @@ SwSbxValue SwCalc::PrimFunc(bool )
 }
 case CALC_MINUS:
 {
+SAL_INFO("sw.calc", "-");
 SwSbxValue nErg;
 GetToken();
 nErg.PutDouble( -(Prim().GetDouble()) );
@@ -1134,6 +1144,7 @@ SwSbxValue SwCalc::PrimFunc(bool )
 }
 case CALC_LP:
 {
+SAL_INFO("sw.calc", "(");
 GetToken();
 SwSbxValue nErg = Expr();
 if( m_eCurrOper != CALC_RP )
@@ -1150,6 +1161,7 @@ SwSbxValue SwCalc::PrimFunc(bool )
 }
 case CALC_MEAN:
 {
+SAL_INFO("sw.calc", "mean");
 m_nListPor = 1;
 GetToken();
 SwSbxValue nErg = Expr();
@@ -1161,6 +1173,7 @@ SwSbxValue SwCalc::PrimFunc(bool )
 }
 case CALC_SQRT:
 {
+SAL_INFO("sw.calc", "sqrt");
 GetToken();
 SwSbxValue nErg = Prim();
 if( nErg.GetDouble() < 0 )
@@ -1175,6 +1188,7 @@ SwSbxValue SwCalc::PrimFunc(bool )
 case CALC_MIN:
 case CALC_MAX:
 {
+SAL_INFO("sw.calc", "sum/date/min/max");
 GetToken();
 SwSbxValue nErg = Expr();
 return nErg;
@@ -1182,12 +1196,14 @@ SwSbxValue SwCalc::PrimFunc(bool )
 }
 case CALC_ENDCALC:
 {
+SAL_INFO("sw.calc", "endcalc");
 SwSbxValue nErg;
 nErg.Clear();
 return nErg;
 break;
 }
 default:
+SAL_INFO("sw.calc", "syntax error");
 m_eError = SwCalcError::Syntax;
 break;
 }
commit f611179ac6bf85d3c9d9a30d525447c54743bb6d
Author: Samuel Mehrbrodt 
AuthorDate: Tue Dec 4 10:53:43 2018 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Tue Dec 11 15:15:28 2018 +0100

Expand warning (mention file path)

Change-Id: Ib97d0da4c52215009dd2142908168c68ea0aebcb
Reviewed-on: https://gerrit.libreoffice.org/64939
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/desktop/source/deployment/registry/package/dp_package.cxx 
b/desktop/source/deployment/registry/package/dp_package.cxx
index f76a8df08a47..ec2ffa5b3bec 

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

2018-12-01 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |   94 +---
 1 file changed, 88 insertions(+), 6 deletions(-)

New commits:
commit d7a88b902af983145b196990949e89420e5bc4cf
Author: Tomaž Vajngerl 
AuthorDate: Thu Nov 29 21:53:48 2018 +0100
Commit: Tomaž Vajngerl 
CommitDate: Sat Dec 1 09:07:33 2018 +0100

Add SolarMutexGuard where needed

When triggering rechecking of signature status, an assert fails and
brings down the program because we don't hold a SolarMutex. The
rechecking of signature status needs to broadcasts.

Change-Id: Ib500b06d2e191465df1e0da2097ddb1b6b06725a
Reviewed-on: https://gerrit.libreoffice.org/64292
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d96c7737157d..f235728e65bb 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3802,6 +3802,8 @@ static bool doc_insertCertificate(LibreOfficeKitDocument* 
pThis,
 if (!xCertificate.is())
 return false;
 
+SolarMutexGuard aGuard;
+
 return pObjectShell->SignDocumentContentUsingCertificate(xCertificate);
 }
 
@@ -3879,6 +3881,8 @@ static int doc_getSignatureState(LibreOfficeKitDocument* 
pThis)
 if (!pObjectShell)
 return int(SignatureState::UNKNOWN);
 
+SolarMutexGuard aGuard;
+
 pObjectShell->RecheckSignature(false);
 
 return int(pObjectShell->GetDocumentSignatureState());
commit d69edca3e004ab8669b3363b4755da8bb42f62fc
Author: Tomaž Vajngerl 
AuthorDate: Thu Nov 29 21:52:26 2018 +0100
Commit: Tomaž Vajngerl 
CommitDate: Sat Dec 1 09:07:25 2018 +0100

lokit: convert PEM certificate to DER if it is detected as such

Change-Id: I1ae105067c109a32f4acc34749b425d9e4e26514
Reviewed-on: https://gerrit.libreoffice.org/64291
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a7ce8182ebd1..d96c7737157d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -526,6 +527,48 @@ int lcl_getViewId(const std::string& payload)
 return 0;
 }
 
+std::string extractCertificate(const std::string & certificate)
+{
+const std::string header("-BEGIN CERTIFICATE-");
+const std::string footer("-END CERTIFICATE-");
+
+std::string result;
+
+size_t pos1 = certificate.find(header);
+if (pos1 == std::string::npos)
+return result;
+
+size_t pos2 = certificate.find(footer, pos1 + 1);
+if (pos2 == std::string::npos)
+return result;
+
+pos1 = pos1 + header.length();
+pos2 = pos2 - pos1;
+
+return certificate.substr(pos1, pos2);
+}
+
+std::string extractPrivateKey(const std::string & privateKey)
+{
+const std::string header("-BEGIN PRIVATE KEY-");
+const std::string footer("-END PRIVATE KEY-");
+
+std::string result;
+
+size_t pos1 = privateKey.find(header);
+if (pos1 == std::string::npos)
+return result;
+
+size_t pos2 = privateKey.find(footer, pos1 + 1);
+if (pos2 == std::string::npos)
+return result;
+
+pos1 = pos1 + header.length();
+pos2 = pos2 - pos1;
+
+return privateKey.substr(pos1, pos2);
+}
+
 }  // end anonymous namespace
 
 // Could be anonymous in principle, but for the unit testing purposes, we
@@ -3724,11 +3767,34 @@ static bool 
doc_insertCertificate(LibreOfficeKitDocument* pThis,
 if (!xCertificateCreator.is())
 return false;
 
-uno::Sequence aCertificateSequence(nCertificateBinarySize);
-std::copy(pCertificateBinary, pCertificateBinary + nCertificateBinarySize, 
aCertificateSequence.begin());
+uno::Sequence aCertificateSequence;
 
-uno::Sequence aPrivateKeySequence(nPrivateKeySize);
-std::copy(pPrivateKeyBinary, pPrivateKeyBinary + nPrivateKeySize, 
aPrivateKeySequence.begin());
+std::string aCertificateString(reinterpret_cast(pCertificateBinary), nCertificateBinarySize);
+std::string aCertificateBase64String = 
extractCertificate(aCertificateString);
+if (!aCertificateBase64String.empty())
+{
+OUString aBase64OUString = 
OUString::createFromAscii(aCertificateBase64String.c_str());
+comphelper::Base64::decode(aCertificateSequence, aBase64OUString);
+}
+else
+{
+aCertificateSequence.realloc(nCertificateBinarySize);
+std::copy(pCertificateBinary, pCertificateBinary + 
nCertificateBinarySize, aCertificateSequence.begin());
+}
+
+uno::Sequence aPrivateKeySequence;
+std::string aPrivateKeyString(reinterpret_cast(pPrivateKeyBinary), nPrivateKeySize);
+std::string aPrivateKeyBase64String = extractPrivateKey(aPrivateKeyString);
+if (!aPrivateKeyBase64String.empty())
+{
+OUString aBase64OUString = 
OUString::createFromAscii(aPrivateKeyBase64String.c_str());
+

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

2018-10-22 Thread Libreoffice Gerrit user
 desktop/source/deployment/misc/dp_ucb.cxx   |4 ++--
 extensions/source/propctrlr/propertyhandler.hxx |5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 62da1fde05ca2c4d13b294699e5672743e9a95d8
Author: Caolán McNamara 
AuthorDate: Mon Oct 22 15:14:57 2018 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 22 17:48:21 2018 +0200

pvs-studio: V670 The uninitialized class member 'm_aMutex' is used

Change-Id: I7ac2662afe77e6e9170b004b335635f97ae03692
Reviewed-on: https://gerrit.libreoffice.org/62184
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/extensions/source/propctrlr/propertyhandler.hxx 
b/extensions/source/propctrlr/propertyhandler.hxx
index 325f207a2312..da77b687e24f 100644
--- a/extensions/source/propctrlr/propertyhandler.hxx
+++ b/extensions/source/propctrlr/propertyhandler.hxx
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -69,7 +70,8 @@ namespace pcr
 >   PropertyHandler_Base;
 /** the base class for property handlers
 */
-class PropertyHandler : public PropertyHandler_Base
+class PropertyHandler : public ::cppu::BaseMutex
+  , public PropertyHandler_Base
 {
 private:
 /// cache for getSupportedProperties
@@ -82,7 +84,6 @@ namespace pcr
 PropertyChangeListeners   
m_aPropertyListeners;
 
 protected:
-mutable ::osl::Mutex  m_aMutex;
 /// the context in which the instance was created
 css::uno::Reference< css::uno::XComponentContext >m_xContext;
 /// the component we're inspecting
commit b1faaf7335d2c7bb951c1170e66ee6aab9d37e66
Author: Tor Lillqvist 
AuthorDate: Mon Oct 22 18:46:09 2018 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Oct 22 18:47:35 2018 +0300

Put quotes around a URL in a message to make it more obvious if it is empty

Change-Id: I03fe3f70ee97066d9c2083d4ef091c501f241392

diff --git a/desktop/source/deployment/misc/dp_ucb.cxx 
b/desktop/source/deployment/misc/dp_ucb.cxx
index 017aad657279..75bbbe843142 100644
--- a/desktop/source/deployment/misc/dp_ucb.cxx
+++ b/desktop/source/deployment/misc/dp_ucb.cxx
@@ -103,7 +103,7 @@ bool create_folder(
 // invalid: has to be at least "auth:/..."
 if (throw_exc)
 throw ContentCreationException(
-"Cannot create folder (invalid path): " + url,
+"Cannot create folder (invalid path): '" + url + "'",
 Reference(), ContentCreationError_UNKNOWN );
 return false;
 }
@@ -154,7 +154,7 @@ bool create_folder(
 }
 if (throw_exc)
 throw ContentCreationException(
-"Cannot create folder: " + url,
+"Cannot create folder: '" + url + "'",
 Reference(), ContentCreationError_UNKNOWN );
 return false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-08 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx |   50 ++--
 1 file changed, 26 insertions(+), 24 deletions(-)

New commits:
commit 6fed64c36c4a198d960e22a8489dbade512be575
Author: Ashod Nakashian 
AuthorDate: Fri Jul 6 16:49:29 2018 -0400
Commit: Jan Holesovsky 
CommitDate: Mon Oct 8 17:31:03 2018 +0200

desktop: move font initialization into preloadData

Reviewed-on: https://gerrit.libreoffice.org/57160
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit bbba0902fc1f1c6bb2a7f1e6ff2b682e2fbd3cc9)

Change-Id: I66840512b45e987cc7b08b07b65bdb24f2023a41

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a5b79d6ec840..eef796ce91a0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3815,9 +3815,35 @@ static void preloadData()
 images.getImageUrl("forcefed.png", "style", "FO_oo");
 
 std::cerr << "Preload languages\n";
+
 // force load language singleton
 SvtLanguageTable::HasLanguageType(LANGUAGE_SYSTEM);
 (void)LanguageTag::isValidBcp47("foo", nullptr);
+
+std::cerr << "Preload fonts\n";
+
+// Initialize fonts.
+css::uno::Reference xLangSrv = 
css::linguistic2::LinguServiceManager::create(xContext);
+if (xLangSrv.is())
+{
+css::uno::Reference 
xSpell(xLangSrv->getSpellChecker(), css::uno::UNO_QUERY);
+css::uno::Reference 
xLocales(xSpell, css::uno::UNO_QUERY);
+if (xLocales.is())
+aLocales = xLocales->getLocales();
+}
+
+for (const auto& aLocale : aLocales)
+{
+//TODO: Add more types and cache more aggessively. For now this 
initializes the fontcache.
+using namespace ::com::sun::star::i18n::ScriptType;
+LanguageType nLang;
+nLang = 
MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale,
 false), LATIN);
+OutputDevice::GetDefaultFont(DefaultFontType::LATIN_SPREADSHEET, 
nLang, GetDefaultFontFlags::OnlyOne);
+nLang = 
MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale,
 false), ASIAN);
+OutputDevice::GetDefaultFont(DefaultFontType::CJK_SPREADSHEET, nLang, 
GetDefaultFontFlags::OnlyOne);
+nLang = 
MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale,
 false), COMPLEX);
+OutputDevice::GetDefaultFont(DefaultFontType::CTL_SPREADSHEET, nLang, 
GetDefaultFontFlags::OnlyOne);
+}
 }
 
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const 
char* pUserProfileUrl)
@@ -3987,30 +4013,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 
 preloadData();
 
-// Initialize fonts.
-css::uno::Sequence< css::lang::Locale > aLocales;
-css::uno::Reference 
xLangSrv = css::linguistic2::LinguServiceManager::create(xContext);
-if (xLangSrv.is())
-{
-css::uno::Reference 
xSpell(xLangSrv->getSpellChecker(), css::uno::UNO_QUERY);
-css::uno::Reference 
xLocales(xSpell, css::uno::UNO_QUERY);
-if (xLocales.is())
-aLocales = xLocales->getLocales();
-}
-
-for (const auto& aLocale : aLocales)
-{
-//TODO: Add more types and cache more aggessively. For now 
this initializes the fontcache.
-using namespace ::com::sun::star::i18n::ScriptType;
-LanguageType nLang;
-nLang = 
MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale,
 false), LATIN);
-
OutputDevice::GetDefaultFont(DefaultFontType::LATIN_SPREADSHEET, nLang, 
GetDefaultFontFlags::OnlyOne);
-nLang = 
MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale,
 false), ASIAN);
-
OutputDevice::GetDefaultFont(DefaultFontType::CJK_SPREADSHEET, nLang, 
GetDefaultFontFlags::OnlyOne);
-nLang = 
MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType(aLocale,
 false), COMPLEX);
-
OutputDevice::GetDefaultFont(DefaultFontType::CTL_SPREADSHEET, nLang, 
GetDefaultFontFlags::OnlyOne);
-}
-
 // Release Solar Mutex, lo_startmain thread should acquire it.
 Application::ReleaseSolarMutex();
 }
commit e93a5993c370203cfd4104803b6976626d1389e1
Author: Aron Budea 
AuthorDate: Fri Jul 6 15:32:49 2018 +0200
Commit: Jan Holesovsky 
CommitDate: Mon Oct 8 17:31:03 2018 +0200

desktop: move dictionary preload before font init

spell-checker is initialized during font init

since e7f65920b12517b31f0c5cbfd0dcb8df96d20ba4

Change-Id: Ia5b5223aa8cc00d0e80451142ae18a7046ad00d4

[Libreoffice-commits] core.git: 2 commits - desktop/source ios/CustomTarget_iOS_setup.mk

2018-09-05 Thread Libreoffice Gerrit user
 desktop/source/lib/init.cxx   |8 
 ios/CustomTarget_iOS_setup.mk |4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 46b2350cb303a84ffd549447d313c7ced50e7032
Author: Tor Lillqvist 
AuthorDate: Wed Sep 5 21:57:29 2018 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Sep 5 21:57:59 2018 +0300

Handle passing a null pAppPath to lo_initialize() on iOS

Change-Id: I293ede0dbac4b36a1b91b86100bc11593b402d06

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 416b42f3ce04..5c89c1dbd386 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3857,6 +3857,14 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 ::osl::Module::getUrlFromAddress( reinterpret_cast< oslGenericFunction 
>(lo_initialize),
   aAppURL);
 osl::FileBase::getSystemPathFromFileURL( aAppURL, aAppPath );
+#ifdef IOS
+// The above gives something like
+// 
"/private/var/containers/Bundle/Application/953AA851-CC15-4C60-A2CB-C2C6F24E6F71/Foo.app/Foo",
+// and we want to drop the final component (the binary name).
+sal_Int32 lastSlash = aAppPath.lastIndexOf('/');
+assert(lastSlash > 0);
+aAppPath = aAppPath.copy(0, lastSlash);
+#endif
 }
 
 OUString aAppURL;
commit 60569747d57cb1eb5b67ec57198b7f9ab7b87fb0
Author: Tor Lillqvist 
AuthorDate: Wed Sep 5 20:30:24 2018 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Sep 5 21:57:59 2018 +0300

Don't copy files into the source directory, use workdir

(The LibreOfficeLight Xcode project still needs to be adapted
correspondingly.)

Change-Id: I0b17c595fc0d169f6393ab8734a1eecb241f59be

diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk
index 4f4449e6eaaa..94fffd34349e 100644
--- a/ios/CustomTarget_iOS_setup.mk
+++ b/ios/CustomTarget_iOS_setup.mk
@@ -9,7 +9,7 @@
 
 
 #- Env 
-IOSGEN  = $(SRCDIR)/ios/generated
+IOSGEN  = $(BUILDDIR)/workdir/CustomTarget/ios
 IOSRES  = $(IOSGEN)/resources
 IOSDIRS = $(IOSGEN) \
   $(IOSGEN)/Debug_x86_64 \
@@ -105,7 +105,7 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \
) > $(IOSRES)/program/versionrc
 
$(SRCDIR)/bin/lo-all-static-libs | sed -e 's/ /\
-/g' >$(WORKDIR)/ios-all-static-libs.list
+/g' >$(IOSGEN)/ios-all-static-libs.list
 
 #- clean ios  -
 $(call gb_CustomTarget_get_clean_target,ios/iOS_setup):
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-25 Thread Noel Grandin
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx   |   12 -
 desktop/source/deployment/gui/dp_gui_extlistbox.hxx   |4 +--
 desktop/source/deployment/gui/dp_gui_updatedialog.cxx |   22 ++--
 desktop/source/deployment/gui/dp_gui_updatedialog.hxx |4 +--
 sd/source/ui/animations/CustomAnimationDialog.cxx |   24 --
 sd/source/ui/animations/CustomAnimationDialog.hxx |6 ++--
 sd/source/ui/animations/CustomAnimationPane.cxx   |   12 -
 sd/source/ui/animations/CustomAnimationPane.hxx   |2 -
 8 files changed, 39 insertions(+), 47 deletions(-)

New commits:
commit e5dfdbcc2084bfdb213afbe03d00136e93d5c4d2
Author: Noel Grandin 
Date:   Thu Jun 21 15:34:16 2018 +0200

loplugin:useuniqueptr in CustomAnimationDialog

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

diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx 
b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 224bf1223bc1..fbcdad9097c9 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -2167,9 +2167,9 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* 
pParent, STLPropertySe
 sal_uInt16 nTimingId = mpTabControl->GetPageId("timing");
 sal_uInt16 nTextAnimId = mpTabControl->GetPageId("textanim");
 
-mpEffectTabPage = VclPtr::Create( 
mpTabControl, mpSet );
+mpEffectTabPage = VclPtr::Create( 
mpTabControl, mpSet.get() );
 mpTabControl->SetTabPage( nEffectId, mpEffectTabPage );
-mpDurationTabPage = VclPtr::Create( 
mpTabControl, mpSet );
+mpDurationTabPage = VclPtr::Create( 
mpTabControl, mpSet.get() );
 mpTabControl->SetTabPage( nTimingId, mpDurationTabPage );
 
 bool bHasText = false;
@@ -2178,7 +2178,7 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* 
pParent, STLPropertySe
 
 if( bHasText )
 {
-mpTextAnimTabPage = VclPtr::Create( 
mpTabControl, mpSet );
+mpTextAnimTabPage = VclPtr::Create( 
mpTabControl, mpSet.get() );
 mpTabControl->SetTabPage( nTextAnimId, mpTextAnimTabPage );
 }
 else
@@ -2202,8 +2202,8 @@ void CustomAnimationDialog::dispose()
 mpDurationTabPage.disposeAndClear();
 mpTextAnimTabPage.disposeAndClear();
 
-delete mpSet;
-delete mpResultSet;
+mpSet.reset();
+mpResultSet.reset();
 
 mpTabControl.clear();
 TabDialog::dispose();
@@ -2211,23 +2211,21 @@ void CustomAnimationDialog::dispose()
 
 STLPropertySet* CustomAnimationDialog::getResultSet()
 {
-delete mpResultSet;
-
 mpResultSet = createDefaultSet();
 
-mpEffectTabPage->update( mpResultSet );
-mpDurationTabPage->update( mpResultSet );
+mpEffectTabPage->update( mpResultSet.get() );
+mpDurationTabPage->update( mpResultSet.get() );
 if( mpTextAnimTabPage )
-mpTextAnimTabPage->update( mpResultSet );
+mpTextAnimTabPage->update( mpResultSet.get() );
 
-return mpResultSet;
+return mpResultSet.get();
 }
 
-STLPropertySet* CustomAnimationDialog::createDefaultSet()
+std::unique_ptr CustomAnimationDialog::createDefaultSet()
 {
 Any aEmpty;
 
-STLPropertySet* pSet = new STLPropertySet();
+std::unique_ptr pSet(new STLPropertySet());
 pSet->setPropertyDefaultValue( nHandleMaxParaDepth, makeAny( sal_Int32(-1) 
) );
 
 pSet->setPropertyDefaultValue( nHandleHasAfterEffect, makeAny( false ) );
diff --git a/sd/source/ui/animations/CustomAnimationDialog.hxx 
b/sd/source/ui/animations/CustomAnimationDialog.hxx
index 2ad30fb2bcb1..14f605b2984f 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.hxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.hxx
@@ -148,11 +148,11 @@ public:
 
 STLPropertySet* getResultSet();
 
-static STLPropertySet* createDefaultSet();
+static std::unique_ptr createDefaultSet();
 
 private:
-STLPropertySet* mpSet;
-STLPropertySet* mpResultSet;
+std::unique_ptr mpSet;
+std::unique_ptr mpResultSet;
 
 VclPtr mpTabControl;
 
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx 
b/sd/source/ui/animations/CustomAnimationPane.cxx
index 2421d51ec461..a3a3d5d44dc3 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -917,7 +917,7 @@ void CustomAnimationPane::UpdateLook()
 }
 }
 
-void addValue( STLPropertySet* pSet, sal_Int32 nHandle, const Any& rValue )
+void addValue( std::unique_ptr& pSet, sal_Int32 nHandle, const 
Any& rValue )
 {
 switch( pSet->getPropertyState( nHandle ) )
 {
@@ -1122,9 +1122,9 @@ static bool hasVisibleShape( const Reference< XShape >& 
xShape )
 return true;
 }
 
-STLPropertySet* CustomAnimationPane::createSelectionSet()
+std::unique_ptr CustomAnimationPane::createSelectionSet()
 {
-STLPropertySet* pSet = CustomAnimationDialog::createDefaultSet();
+

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

2018-03-04 Thread Noel Grandin
 desktop/source/deployment/gui/dp_gui_theextmgr.cxx |7 ++-
 desktop/source/deployment/gui/dp_gui_theextmgr.hxx |4 ++--
 lotuswordpro/source/filter/explode.cxx |   18 --
 lotuswordpro/source/filter/explode.hxx |5 +++--
 4 files changed, 11 insertions(+), 23 deletions(-)

New commits:
commit 4eca66541bbe77767f29138f6d0265229d61173d
Author: Noel Grandin 
Date:   Thu Mar 1 10:23:22 2018 +0200

loplugin:useuniqueptr in HuffmanTreeNode

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

diff --git a/lotuswordpro/source/filter/explode.cxx 
b/lotuswordpro/source/filter/explode.cxx
index 7f60a9dfa737..497252d1d67a 100644
--- a/lotuswordpro/source/filter/explode.cxx
+++ b/lotuswordpro/source/filter/explode.cxx
@@ -459,16 +459,6 @@ HuffmanTreeNode::HuffmanTreeNode(sal_uInt32 nValue )
 }
 HuffmanTreeNode::~HuffmanTreeNode()
 {
-if (left)
-{
-delete left;
-left = nullptr;
-}
-if (right)
-{
-delete right;
-right = nullptr;
-}
 }
 
 HuffmanTreeNode * HuffmanTreeNode::InsertNode(sal_uInt32 nValue, const 
sal_Char * pInCode)
@@ -485,9 +475,9 @@ HuffmanTreeNode * HuffmanTreeNode::InsertNode(sal_uInt32 
nValue, const sal_Char
 pParent = InsertNode(0x, aCode.c_str());
 }
 if (cLast == '0')
-pParent->left = pNew;
+pParent->left.reset(pNew);
 else // (cChar == '1')
-pParent->right = pNew;
+pParent->right.reset(pNew);
 
 return pNew;
 }
@@ -502,11 +492,11 @@ HuffmanTreeNode * HuffmanTreeNode::QueryNode(const 
sal_Char * pCode)
 sal_Char cChar= pCode[i];
 if (cChar == '0')
 {
-pNode = pNode->left;
+pNode = pNode->left.get();
 }
 else // (cChar == '1')
 {
-pNode = pNode->right;
+pNode = pNode->right.get();
 }
 }
 return pNode;
diff --git a/lotuswordpro/source/filter/explode.hxx 
b/lotuswordpro/source/filter/explode.hxx
index 013bb6bc881c..1b8cc587811c 100644
--- a/lotuswordpro/source/filter/explode.hxx
+++ b/lotuswordpro/source/filter/explode.hxx
@@ -57,14 +57,15 @@
 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_EXPLODE_HXX
 
 #include 
+#include 
 
 class SvStream;
 
 class HuffmanTreeNode
 {
 public:
-HuffmanTreeNode * left;
-HuffmanTreeNode * right;
+std::unique_ptr left;
+std::unique_ptr right;
 sal_uInt32 value;
 
 explicit HuffmanTreeNode(sal_uInt32 value = 0x) ;
commit 4516546b9efeeaa7cffe608fca8b544230aee3f1
Author: Noel Grandin 
Date:   Thu Mar 1 09:58:58 2018 +0200

loplugin:useuniqueptr in TheExtensionManager

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

diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx 
b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index b9dd8cd947f5..ca84148ec7de 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -104,7 +104,6 @@ TheExtensionManager::~TheExtensionManager()
 {
 m_pUpdReqDialog.disposeAndClear();
 m_pExtMgrDialog.disposeAndClear();
-delete m_pExecuteCmdQueue;
 }
 
 
@@ -117,8 +116,7 @@ void TheExtensionManager::createDialog( const bool 
bCreateUpdDlg )
 if ( !m_pUpdReqDialog )
 {
 m_pUpdReqDialog = VclPtr::Create( nullptr, 
this );
-delete m_pExecuteCmdQueue;
-m_pExecuteCmdQueue = new ExtensionCmdQueue( m_pUpdReqDialog.get(), 
this, m_xContext );
+m_pExecuteCmdQueue.reset( new ExtensionCmdQueue( 
m_pUpdReqDialog.get(), this, m_xContext ) );
 createPackageList();
 }
 }
@@ -128,8 +126,7 @@ void TheExtensionManager::createDialog( const bool 
bCreateUpdDlg )
 m_pExtMgrDialog = VclPtr::Create( 
VCLUnoHelper::GetWindow(m_xParent), this );
 else
 m_pExtMgrDialog = VclPtr::Create( nullptr, this, 
Dialog::InitFlag::NoParent );
-delete m_pExecuteCmdQueue;
-m_pExecuteCmdQueue = new ExtensionCmdQueue( m_pExtMgrDialog.get(), 
this, m_xContext );
+m_pExecuteCmdQueue.reset( new ExtensionCmdQueue( 
m_pExtMgrDialog.get(), this, m_xContext ) );
 m_pExtMgrDialog->setGetExtensionsURL( m_sGetExtensionsURL );
 createPackageList();
 }
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx 
b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index 3437249efd81..5db21a5a40ca 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -55,7 +55,7 @@ 

[Libreoffice-commits] core.git: 2 commits - desktop/source ios/CustomTarget_iOS_setup.mk

2018-01-20 Thread jan Iversen
 desktop/source/app/appinit.cxx |7 +++
 ios/CustomTarget_iOS_setup.mk  |1 -
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit cc2b9a257b6436ab6f84d6e158a64c09b0937eb6
Author: jan Iversen 
Date:   Sat Jan 20 18:52:39 2018 +0100

iOS, remove double [bootstrap]

two bootstrap sections in one rc file seems wrong.

Change-Id: Ic7f8eac2d3d07b35736d11ad1fbe705135cb1785

diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk
index 543ef306a7db..6242354eeebe 100644
--- a/ios/CustomTarget_iOS_setup.mk
+++ b/ios/CustomTarget_iOS_setup.mk
@@ -58,7 +58,6 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \
(echo '[Bootstrap]' \
&& echo 'URE_BOOTSTRAP=file://$$APP_DATA_DIR/fundamentalrc' \
&& echo 'HOME=$$SYSUSERHOME'  \
-   && echo '[Bootstrap]' \
) > $(IOSRES)/rc
 
# Set up fundamentalrc, unorc, bootstraprc and versionrc.
commit feb601b75142f3234bb51f9566a70c4db488a061
Author: jan Iversen 
Date:   Sat Jan 20 18:51:13 2018 +0100

iOS, allow unorc to be read

One reason why init did not work, was that it did a throw due
to a wrong path on unorc

Change-Id: I928f25358befe05f8986e9ebcffda27e8beb397c

diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 853eaf8734ae..826c525eb6c1 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -80,6 +80,13 @@ void Desktop::InitApplicationServiceManager()
 sm.set(
 cppu::defaultBootstrap_InitialComponentContext( aUnoRc 
)->getServiceManager(),
 UNO_QUERY_THROW);
+#elif defined(IOS)
+OUString uri( "$APP_DATA_DIR" );
+rtl_bootstrap_expandMacros(  );
+OUString aUnoRc("file://" + uri  + "/unorc");
+sm.set(
+   cppu::defaultBootstrap_InitialComponentContext( aUnoRc 
)->getServiceManager(),
+   UNO_QUERY_THROW);
 #else
 sm.set(
 cppu::defaultBootstrap_InitialComponentContext()->getServiceManager(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit libreofficekit/source

2018-01-08 Thread Pranav Kant
 desktop/source/lib/init.cxx|5 +
 include/LibreOfficeKit/LibreOfficeKitGtk.h |6 ++
 libreofficekit/source/gtk/lokdocview.cxx   |   22 ++
 3 files changed, 21 insertions(+), 12 deletions(-)

New commits:
commit 169b9264f4c8b6a64ea445766b3f7e18cfee1eb0
Author: Pranav Kant 
Date:   Mon Jan 8 22:39:23 2018 +0530

lokdialog: Enable input before posting mouse events

Change-Id: Ib878544cf902aa3c12c59e4c7be6fff20d3a91a9

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f8aebcfc8606..ae0a99b8424f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2447,6 +2447,11 @@ static void 
doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned
 Point aPos(nX, nY);
 MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, 
nButtons, nModifier);
 
+if (Dialog* pDialog = dynamic_cast(pWindow.get()))
+{
+pDialog->EnableInput();
+}
+
 switch (nType)
 {
 case LOK_MOUSEEVENT_MOUSEBUTTONDOWN:
commit 9b47049bfaa40ab5eea6f69ad0abc7b771ea8fe9
Author: Pranav Kant 
Date:   Fri Dec 22 14:50:52 2017 +0530

lokdocview: Make g-ir-compiler, scanner happy

Silence their warnings

Change-Id: Id397745bbf7fe6687b60eeca60d5a0b67da421b1

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index dd35505e2b86..fb18aae8aab6 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -90,8 +90,6 @@ GtkWidget* lok_doc_view_new_from_widget   
 (LOKDocView*
  * @cancellable:
  * @callback:
  * @userdata:
- *
- * Returns: %TRUE if the document is loaded successfully, %FALSE otherwise
  */
 void   lok_doc_view_open_document  
(LOKDocView* pDocView,
 const 
gchar* pPath,
@@ -136,7 +134,7 @@ void   lok_doc_view_set_zoom
   (LOKDocView*
 /**
  * lok_doc_view_set_visible_area:
  * @pDocView: The #LOKDocView instance
- * @fZoom: The new visible area of pDocView in twips.
+ * @pVisibleArea: The new visible area of pDocView in twips.
  *
  * Sets the new visible area of the widget. This helps e.g. the page down key
  * to jump the correct length, which depends on the amount of visible height of
@@ -308,7 +306,7 @@ gbooleanlok_doc_view_paste  
   (LOKDocView*
 /**
  * lok_doc_view_set_document_password:
  * @pDocView: The #LOKDocView instance
- * @pUrl: the URL of the document to set password for, as sent with signal 
`password-required`
+ * @pURL: the URL of the document to set password for, as sent with signal 
`password-required`
  * @pPassword: (nullable) (allow-none): the password, NULL for no password
  *
  * Set the password for password protected documents
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index ca4e2433c43a..a4bf0c64f3b5 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -3205,7 +3205,9 @@ static void lok_doc_view_class_init (LOKDocViewClass* 
pClass)
  G_TYPE_STRING);
 
 /**
- * The key ruler related properties on change are reported by this.
+ * LOKDocView::ruler:
+ * @pDocView: the #LOKDocView on which the signal is emitted
+ * @pPayload: the JSON string contaning the information about ruler 
properties
  *
  * The payload format is:
  *
@@ -3217,8 +3219,6 @@ static void lok_doc_view_class_init (LOKDocViewClass* 
pClass)
  *  "pageWidth": "...",
  *  "unit": "..."
  *  }
- *
- * Here all aproperties are same as described in svxruler.
  */
 doc_view_signals[RULER] =
 g_signal_new("ruler",
@@ -3231,10 +3231,13 @@ static void lok_doc_view_class_init (LOKDocViewClass* 
pClass)
  G_TYPE_STRING);
 
 /**
- * Window related callbacks are emitted under this category. It includes
- * external windows like dialogs, autopopups for now.
+ * LOKDocView::window::
+ * @pDocView: the #LOKDocView on which the signal is emitted
+ * @pPayload: the JSON string containing the information about the window
  *
- * The payload format is:
+ * This signal emits information about external windows like dialogs, 
autopopups for now.
+ *
+ * The payload format of pPayload is:
  *
  * {
  *"id": "unique integer id of the dialog",
@@ -3269,11 +3272,14 @@ static void lok_doc_view_class_init (LOKDocViewClass* 
pClass)
  G_TYPE_STRING);
 
 /**
+ * LOKDocView::invalidate-header::
+ * @pDocView: the #LOKDocView on which the signal is emitted
+ * @pPayload: can be either "row", "column", or "all".
+ *
  * The 

[Libreoffice-commits] core.git: 2 commits - desktop/source ios/CustomTarget_iOS.mk ios/LibreOfficeKit ios/LibreOfficeLight

2017-10-24 Thread jan Iversen
 desktop/source/lib/init.cxx |7 +
 ios/CustomTarget_iOS.mk |2 -
 ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj |6 
 ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c  |1 
 ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj |   14 
++
 5 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit d8a299e12937896f0346881cd7b9b7602010b2c4
Author: jan Iversen 
Date:   Mon Oct 23 17:34:01 2017 +0200

iOS, updates to make structure

Clean works better with this update.

Change-Id: I8afe796048fd4f796a4c92b64121f754293ee973

diff --git a/ios/CustomTarget_iOS.mk b/ios/CustomTarget_iOS.mk
index 452b5d7dde9b..496070d5d9d2 100644
--- a/ios/CustomTarget_iOS.mk
+++ b/ios/CustomTarget_iOS.mk
@@ -158,7 +158,7 @@ $(call gb_CustomTarget_get_clean_target,ios/ios):
, $(WORKDIR)/ios/build.log \
)
$(call gb_Helper_print_on_error, \
-   xcodebuild -xcconfig $(IOSKITXC) -project $(IOSKITPRJ) clean \
+   xcodebuild -xcconfig $(IOSKITXC) -configuration Debug -project 
$(IOSKITPRJ) clean \
, $(WORKDIR)/ios/build.log \
)
rm -f $(IOSGEN)/$(IOSKIT)
diff --git a/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj 
b/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj
index 82fa34fb22ed..caa67a55b8bf 100644
--- a/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj
@@ -25,6 +25,7 @@
 /* Begin PBXFileReference section */
39503A6E1F94C3B700F19C78 /* LibreOfficeKit.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
LibreOfficeKit.h; sourceTree = ""; };
39503A721F94CBA000F19C78 /* LibreOfficeKit.c */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = 
LibreOfficeKit.c; sourceTree = ""; };
+   3950BAE11F9CA739001A4E96 /* loKit.xcconfig */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = 
loKit.xcconfig; path = 
../../../../../../Users/jani/lo_ios/workdir/ios/loKit.xcconfig; sourceTree = 
""; };
39B5D2151F78130F008FB162 /* libLibreOfficeKit.a */ = {isa = 
PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = 
libLibreOfficeKit.a; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
@@ -42,6 +43,7 @@
3969A8C91F782610006F06A9 /* Support files */ = {
isa = PBXGroup;
children = (
+   3950BAE11F9CA739001A4E96 /* loKit.xcconfig */,
);
name = "Support files";
sourceTree = "";
@@ -138,6 +140,7 @@
 /* Begin XCBuildConfiguration section */
39B5D21C1F78130F008FB162 /* Debug */ = {
isa = XCBuildConfiguration;
+   baseConfigurationReference = 3950BAE11F9CA739001A4E96 
/* loKit.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@@ -210,6 +213,7 @@
};
39B5D21D1F78130F008FB162 /* Release */ = {
isa = XCBuildConfiguration;
+   baseConfigurationReference = 3950BAE11F9CA739001A4E96 
/* loKit.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@@ -277,6 +281,7 @@
};
39B5D21F1F78130F008FB162 /* Debug */ = {
isa = XCBuildConfiguration;
+   baseConfigurationReference = 3950BAE11F9CA739001A4E96 
/* loKit.xcconfig */;
buildSettings = {
MACH_O_TYPE = staticlib;
OTHER_LDFLAGS = "";
@@ -289,6 +294,7 @@
};
39B5D2201F78130F008FB162 /* Release */ = {
isa = XCBuildConfiguration;
+   baseConfigurationReference = 3950BAE11F9CA739001A4E96 
/* loKit.xcconfig */;
buildSettings = {
MACH_O_TYPE = staticlib;
OTHER_LDFLAGS = "";
diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c 
b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
index d8e41ebf740f..59a1c217b514 100644
--- a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
+++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
@@ -5,7 +5,6 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at 

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

2017-10-13 Thread Jan-Marek Glogowski
 desktop/source/deployment/misc/dp_update.cxx |   21 +++--
 uui/source/iahndl.cxx|2 --
 2 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit 2c6e7f6cf121446ef41f34e972aae205f233a191
Author: Jan-Marek Glogowski 
Date:   Fri Oct 13 18:57:08 2017 +0200

Log found extension updates

The OSL_ASSERT doesn't make any sense, if you don't know what it
compares. So simply log all found updates.

Change-Id: I002b65cf4a658036916a217a89d0df7f0168ee70

diff --git a/desktop/source/deployment/misc/dp_update.cxx 
b/desktop/source/deployment/misc/dp_update.cxx
index b4c385c61cea..828fdff2143f 100644
--- a/desktop/source/deployment/misc/dp_update.cxx
+++ b/desktop/source/deployment/misc/dp_update.cxx
@@ -94,12 +94,13 @@ void getOwnUpdateInfos(
 Sequence 
urls(i->second.extension->getUpdateInformationURLs());
 if (urls.getLength())
 {
-const OUString id =  dp_misc::getIdentifier(i->second.extension);
+const OUString search_id = 
dp_misc::getIdentifier(i->second.extension);
+SAL_INFO( "extensions.update", "Searching update for " << 
search_id );
 uno::Any anyError;
 //It is unclear from the idl if there can be a null reference 
returned.
 //However all valid information should be the same
 Sequence >
-infos(getUpdateInformation(updateInformation, urls, id, 
anyError));
+infos(getUpdateInformation(updateInformation, urls, search_id, 
anyError));
 if (anyError.hasValue())
 out_errors.emplace_back(i->second.extension, anyError);
 
@@ -110,15 +111,15 @@ void getOwnUpdateInfos(
 Reference< xml::dom::XNode >(infos[j], UNO_QUERY_THROW));
 if (!infoset.hasDescription())
 continue;
-boost::optional< OUString > id2(infoset.getIdentifier());
-if (!id2)
+boost::optional< OUString > result_id(infoset.getIdentifier());
+if (!result_id)
 continue;
-OSL_ASSERT(*id2 == id);
-if (*id2 == id)
-{
-i->second.version = infoset.getVersion();
-i->second.info.set(infos[j], UNO_QUERY_THROW);
-}
+SAL_INFO( "extensions.update", "  found version "
+  << infoset.getVersion() << " for " << *result_id );
+if (*result_id != search_id)
+continue;
+i->second.version = infoset.getVersion();
+i->second.info.set(infos[j], UNO_QUERY_THROW);
 break;
 }
 }
commit d3ae94f04e0cfeba49f5e0de66848743391fc336
Author: Jan-Marek Glogowski 
Date:   Fri Oct 13 18:55:01 2017 +0200

Don't crash on extension update check

We don't need to release the SolarMutex, as we don't own it.

Change-Id: Id0a0ae8d478dc56d0da2ab296f8031e935920c97

diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index f3a801a47c0c..36ba5046d983 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -172,7 +172,6 @@ UUIInteractionHelper::handleRequest(
 HandleData aHD(rRequest);
 Link aLink(,handlerequest);
 Application::PostUserEvent(aLink,this);
-SolarMutexReleaser aReleaser;
 aHD.wait();
 return aHD.bHandled;
 }
@@ -224,7 +223,6 @@ UUIInteractionHelper::getStringFromRequest(
 HandleData aHD(rRequest);
 Link aLink(,getstringfromrequest);
 Application::PostUserEvent(aLink,this);
-SolarMutexReleaser aReleaser;
 aHD.wait();
 return aHD.m_aResult;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-09-14 Thread Michael Meeks
 desktop/source/lib/init.cxx |   24 
 sd/source/core/drawdoc.cxx  |4 +---
 sw/source/uibase/config/viewopt.cxx |3 ---
 3 files changed, 25 insertions(+), 6 deletions(-)

New commits:
commit f2de8a282a131f0294c41fa994083df47d5d61f0
Author: Michael Meeks 
Date:   Thu Sep 14 10:29:32 2017 +0100

Revert "Disable spellcheck when LOK is active"

This reverts commit c92ebc850345924619a12327f36cc6ac9c0b09d1.

Change-Id: Idd01cffbd71643d5a9132b518432c5e173b4787a
Reviewed-on: https://gerrit.libreoffice.org/42270
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index b418f1ed7a2c..54b2474008b9 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -100,7 +100,6 @@
 
 #include 
 #include 
-#include 
 
 using namespace ::sd;
 using namespace ::com::sun::star;
@@ -229,8 +228,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, 
SfxObjectShell* pDrDocSh)
 SetLanguage( 
MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage_CTL,
 css::i18n::ScriptType::COMPLEX), EE_CHAR_LANGUAGE_CTL );
 
-if (!comphelper::LibreOfficeKit::isActive())
-mbOnlineSpell = aOptions.bIsSpellAuto;
+mbOnlineSpell = aOptions.bIsSpellAuto;
 }
 
 LanguageType eRealLanguage = MsLangId::getRealLanguage( meLanguage );
diff --git a/sw/source/uibase/config/viewopt.cxx 
b/sw/source/uibase/config/viewopt.cxx
index ecb592979ad0..3a00aa3e7b4b 100644
--- a/sw/source/uibase/config/viewopt.cxx
+++ b/sw/source/uibase/config/viewopt.cxx
@@ -318,9 +318,6 @@ bool SwViewOption::IsAutoCompleteWords()
 
 void SwViewOption::SetOnlineSpell(bool b)
 {
-if (comphelper::LibreOfficeKit::isActive())
-return;
-
 b ? (m_nCoreOptions |= ViewOptFlags1::OnlineSpell ) : ( m_nCoreOptions &= 
~ViewOptFlags1::OnlineSpell);
 }
 
commit 91cf85936aff8bcc3b837584a834a0f2d9f3ed3a
Author: Michael Meeks 
Date:   Wed Sep 13 16:16:11 2017 +0100

Pre-load dictionaries for online.

Change-Id: Ied81f20900060ff6a78704fa9195320b8fb86e45
Reviewed-on: https://gerrit.libreoffice.org/42269
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6e8136d740a0..f9a825564c88 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -54,6 +54,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -3150,6 +3153,25 @@ static void lo_status_indicator_callback(void *data, 
comphelper::LibreOfficeKit:
 }
 }
 
+static void preloadData()
+{
+// First: sit down and read all dictionaries: yum.
+css::uno::Reference xLngSvcMgr =
+
css::linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext());
+css::uno::Reference 
xSpellChecker(xLngSvcMgr->getSpellChecker());
+
+css::uno::Reference 
xLocales(xSpellChecker, css::uno::UNO_QUERY_THROW);
+uno::Sequence< css::lang::Locale > aLocales = xLocales->getLocales();
+SAL_INFO("lok", "Preloading #" << aLocales.getLength() << " dictionaries");
+for (auto  : aLocales)
+{
+SAL_INFO("lok", "load " << it.Language << "_" << it.Country);
+css::beans::PropertyValues aNone;
+xSpellChecker->isValid("forcefed", it, aNone);
+}
+SAL_INFO("lok", "Preloading done");
+}
+
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const 
char* pUserProfileUrl)
 {
 enum {
@@ -3261,6 +3283,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 // 3) InitVCL()
 aService->initialize({css::uno::makeAny("preload")});
 
+preloadData();
+
 // Release Solar Mutex, lo_startmain thread should acquire it.
 Application::ReleaseSolarMutex();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-08-13 Thread Markus Mohrhard
 desktop/source/app/app.cxx |2 +-
 desktop/source/app/updater.cxx |   13 ++---
 2 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit d8b123b4b00bbc5094ff79491d2675b476087632
Author: Markus Mohrhard 
Date:   Wed Aug 9 16:33:23 2017 +0200

updater: fix the updater path on windows

Change-Id: I69ff622c12a289c4ac240ee4a7313eeffc3203b9
Reviewed-on: https://gerrit.libreoffice.org/40987
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index f284eab096e5..d1cd07d76f1e 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -274,8 +274,7 @@ bool update()
 OUString aTempDirURL = aTempDir.GetURL();
 CopyUpdaterToTempDir(Updater::getExecutableDirURL(), aTempDirURL);
 
-OUString aTempDirPath = getPathFromURL(aTempDirURL);
-OUString aUpdaterPath = aTempDirPath + "/" + 
OUString::fromUtf8(pUpdaterName);
+OUString aUpdaterPath = getPathFromURL(aTempDirURL + "/" + 
OUString::fromUtf8(pUpdaterName));
 
 Updater::log("Calling the updater with parameters: ");
 CharT** pArgs = createCommandLine();
@@ -297,6 +296,7 @@ bool update()
 }
 else
 {
+SAL_WARN("desktop.updater", "Updater executable path: " << 
aUpdaterPath);
 for (size_t i = 0; i < 8 + rtl_getAppCommandArgCount(); ++i)
 {
 SAL_WARN("desktop.updater", pArgs[i]);
commit 93d641caceecb953fa268745c29a0c9fb30f6457
Author: Markus Mohrhard 
Date:   Wed Aug 9 15:43:36 2017 +0200

updater: use desktop.updater log scope consistently

Change-Id: I242890aeda4820ada6f06e4cbe01b73d5faf549e
Reviewed-on: https://gerrit.libreoffice.org/40924
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index cc5e59dcda9b..7557e78a414b 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1403,7 +1403,7 @@ int Desktop::Main()
 {
 if (!aSeeAlso.isEmpty())
 {
-SAL_INFO("updater", "See also: " << aSeeAlso);
+SAL_INFO("desktop.updater", "See also: " << aSeeAlso);
 Reference< css::system::XSystemShellExecute > 
xSystemShell(
 
SystemShellExecute::create(::comphelper::getProcessComponentContext()) );
 
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 6c0206059a6a..f284eab096e5 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -297,7 +297,6 @@ bool update()
 }
 else
 {
-SAL_WARN("updater", "Executable Path:" << aUpdaterPath);
 for (size_t i = 0; i < 8 + rtl_getAppCommandArgCount(); ++i)
 {
 SAL_WARN("desktop.updater", pArgs[i]);
@@ -378,13 +377,13 @@ update_file parse_update_file(const 
orcus::json::detail::node& rNode)
 {
 if (rNode.type() != orcus::json::detail::node_t::object)
 {
-SAL_WARN("desktop.update", "invalid update or language file entry");
+SAL_WARN("desktop.updater", "invalid update or language file entry");
 throw invalid_update_info();
 }
 
 if (rNode.child_count() < 4)
 {
-SAL_WARN("desktop.update", "invalid update or language file entry");
+SAL_WARN("desktop.updater", "invalid update or language file entry");
 throw invalid_update_info();
 }
 
@@ -395,7 +394,7 @@ update_file parse_update_file(const 
orcus::json::detail::node& rNode)
 
 if (aHashTypeNode.string_value() != "sha512")
 {
-SAL_WARN("desktop.update", "invalid hash type");
+SAL_WARN("desktop.updater", "invalid hash type");
 throw invalid_update_info();
 }
 
@@ -419,7 +418,7 @@ update_info parse_response(const std::string& rResponse)
 auto aDocumentRoot = aJsonDoc.get_document_root();
 if (aDocumentRoot.type() != orcus::json_node_t::object)
 {
-SAL_WARN("desktop.Update", "invalid root entries: " << rResponse);
+SAL_WARN("desktop.updater", "invalid root entries: " << rResponse);
 throw invalid_update_info();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-08-01 Thread Markus Mohrhard
 desktop/source/app/app.cxx |1 +
 onlineupdate/source/update/updater/updater.cxx |3 +++
 2 files changed, 4 insertions(+)

New commits:
commit cff13c4b34430c2f70a70d96e758a8278db8f5ca
Author: Markus Mohrhard 
Date:   Wed Aug 2 05:39:19 2017 +0200

updater: log the update check time

Change-Id: I41092b3548715a89baf9d795aa58c87a0e1621b2
Reviewed-on: https://gerrit.libreoffice.org/40658
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index a8d066cd032f..dffa9a7ebc95 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1444,6 +1444,7 @@ int Desktop::Main()
 else if (isTimeForUpdateCheck())
 {
 sal_uInt64 nNow = tools::Time::GetSystemTicks();
+Updater::log("Update Check Time: " + OUString::number(nNow));
 std::shared_ptr< comphelper::ConfigurationChanges > batch(
 comphelper::ConfigurationChanges::create());
 officecfg::Office::Update::Update::LastUpdateTime::set(nNow, 
batch);
commit 9d3654668ec7d4a7e6e3627dde86093e8db18c0d
Author: Markus Mohrhard 
Date:   Wed Aug 2 03:37:55 2017 +0200

updater: disable the special handling of the user profile

This should be unnecessary for the one step updating strategy.

Change-Id: I8dddeae4fb4a560a1c261c0c2e84183d72fc638c
Reviewed-on: https://gerrit.libreoffice.org/40656
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/onlineupdate/source/update/updater/updater.cxx 
b/onlineupdate/source/update/updater/updater.cxx
index 08aa201cb47e..8a1ef8bf5b24 100644
--- a/onlineupdate/source/update/updater/updater.cxx
+++ b/onlineupdate/source/update/updater/updater.cxx
@@ -332,6 +332,8 @@ namespace {
 
 bool is_userprofile_in_instdir()
 {
+return false;
+/*
 // the algorithm is:
 // 1.) if userprofile path length is smaller than installation dir,
 //  the profile is surely not in instdir
@@ -350,6 +352,7 @@ bool is_userprofile_in_instdir()
 return false;
 
 return NS_tstrncmp(userprofile, gInstallDirPath, installdir_len) == 0;
+*/
 }
 
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source uitest/libreoffice

2017-06-12 Thread Markus Mohrhard
 desktop/source/app/updater.cxx   |   14 ++
 desktop/source/app/updater.hxx   |1 +
 uitest/libreoffice/connection.py |1 -
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 21f5966f123e20251a3ab7535b669693be1d8e6a
Author: Markus Mohrhard 
Date:   Mon Jun 12 01:09:09 2017 +0200

remove debug print statement

Change-Id: I419dd9311bc4fbb9fcd2e73a83c5272ecbec242d
Reviewed-on: https://gerrit.libreoffice.org/38680
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 
Tested-by: Jenkins 

diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py
index 81f10ab36910..cc1e6acd2b0f 100644
--- a/uitest/libreoffice/connection.py
+++ b/uitest/libreoffice/connection.py
@@ -82,7 +82,6 @@ class OfficeConnection:
 if 'LIBO_LANG' in environ:
 env = environ
 env['LC_ALL'] = environ['LIBO_LANG']
-print(env)
 
 self.pro = subprocess.Popen(argv, env=env)
 return self.pro
commit 42aac9ef70d459dc85cb77333a08a4c9ab52955c
Author: Markus Mohrhard 
Date:   Sun Jun 11 07:47:53 2017 +0200

better updater logging

Change-Id: I6012f2159d058cbb2afb4b685badb8c870adf07b
Reviewed-on: https://gerrit.libreoffice.org/38679
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index d6b5574bd2ba..1dac58923a3c 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -144,17 +144,20 @@ char** createCommandLine()
 OUString aPatchDir = Updater::getPatchDirURL();
 rtl::Bootstrap::expandMacros(aPatchDir);
 OUString aTempDirPath = getPathFromURL(aPatchDir);
+Updater::log("Patch Dir: " + aTempDirPath);
 createStr(aTempDirPath, pArgs, 1);
 }
 {
 // the actual update directory
 OUString aInstallPath = getPathFromURL(aLibExecDirURL);
+Updater::log("Install Dir: " + aInstallPath);
 createStr(aInstallPath, pArgs, 2);
 }
 {
 // the temporary updated build
 OUString aUpdateDirURL = Updater::getUpdateDirURL();
 OUString aWorkingDir = getPathFromURL(aUpdateDirURL);
+Updater::log("Working Dir: " + aWorkingDir);
 createStr(aWorkingDir, pArgs, 3);
 }
 {
@@ -164,6 +167,7 @@ char** createCommandLine()
 {
 OUString aExeDir = Updater::getExecutableDirURL();
 OUString aSofficePath = getPathFromURL(aExeDir);
+Updater::log("soffice Path: " + aSofficePath);
 createStr(aSofficePath, pArgs, 5);
 }
 {
@@ -215,8 +219,10 @@ void update()
 OUString aTempDirPath = getPathFromURL(aTempDirURL);
 OString aPath = OUStringToOString(aTempDirPath + "/" + 
OUString::fromUtf8(pUpdaterName), RTL_TEXTENCODING_UTF8);
 
+Updater::log("Calling the updater with parameters: ");
 char** pArgs = createCommandLine();
 
+
 #if UNX
 if (execv(aPath.getStr(), pArgs))
 {
@@ -730,4 +736,12 @@ void Updater::log(const OString& rMessage)
 aLog.WriteLine(rMessage);
 }
 
+void Updater::log(const char* pMessage)
+{
+OUString aUpdateLog = getUpdateInfoLog();
+SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE);
+aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the 
end
+aLog.WriteCharPtr(pMessage);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/updater.hxx b/desktop/source/app/updater.hxx
index f3f28bc638ec..922d5264ec5e 100644
--- a/desktop/source/app/updater.hxx
+++ b/desktop/source/app/updater.hxx
@@ -30,6 +30,7 @@ public:
 
 static void log(const OUString& rMessage);
 static void log(const OString& rMessage);
+static void log(const char* pMessage);
 };
 
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-12-09 Thread Tor Lillqvist
 desktop/source/deployment/gui/dp_gui_dialog2.cxx |2 ++
 ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx |2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 7f3410880e122da5c3df5e453f469dde0e94b74a
Author: Tor Lillqvist 
Date:   Fri Dec 9 11:04:58 2016 +0200

loplugin:staticmethods

Change-Id: I385e54f5ddadda894102be2bb9a7dc408415ac68

diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx 
b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 46a9d65..219b2fa 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -943,6 +943,8 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleUpdateBtn, Button*, 
void)
 {
 #if ENABLE_EXTENSION_UPDATE
 m_pManager->checkUpdates( false, true );
+#else
+(void) this;
 #endif
 }
 
commit 073f8cdbb77d62a6838c78ff63fca73896b86c79
Author: Tor Lillqvist 
Date:   Fri Dec 9 09:12:49 2016 +0200

loplugin:refcounting

Fixes: "uno::Reference field with template parameter that does not
contain ::static_type() css::uno::Reference, parent
is http_dav_ucp::SerfGetReqProcImpl, should probably be using
rtl::Reference instead [loplugin:refcounting]"

Change-Id: I43211bb397031a4961df77ee39038e6ef9da6bb1

diff --git a/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx 
b/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx
index f463f42..3271fb9 100644
--- a/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx
+++ b/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx
@@ -71,7 +71,7 @@ protected:
 void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket ) 
override;
 
 private:
-css::uno::Reference< SerfInputStream > xInputStream;
+rtl::Reference< SerfInputStream > xInputStream;
 css::uno::Reference< css::io::XOutputStream > xOutputStream;
 const std::vector< OUString > * mpHeaderNames;
 DAVResource* mpResource;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source editeng/source include/svl include/toolkit lotuswordpro/source oox/source package/source sc/source sd/source svl/qa svl/source svx/source sw/

2016-11-13 Thread David Tardon
 desktop/source/app/sofficemain.cxx |4 +-
 editeng/source/editeng/editdoc.hxx |2 -
 include/svl/IndexedStyleSheets.hxx |6 +--
 include/toolkit/controls/tabpagecontainer.hxx  |2 -
 include/toolkit/controls/tkscrollbar.hxx   |2 -
 include/toolkit/controls/unocontrols.hxx   |   34 -
 lotuswordpro/source/filter/lwptblformula.hxx   |4 +-
 oox/source/drawingml/shape.cxx |2 -
 package/source/zippackage/ZipPackageStream.cxx |2 -
 sc/source/filter/xml/xmlcelli.cxx  |2 -
 sc/source/filter/xml/xmlconti.cxx  |2 -
 sc/source/ui/view/cellsh4.cxx  |4 +-
 sd/source/core/stlpool.cxx |4 +-
 sd/source/ui/func/fuconstr.cxx |2 -
 sd/source/ui/view/drviews9.cxx |2 -
 svl/qa/unit/items/test_IndexedStyleSheets.cxx  |2 -
 svl/source/items/style.cxx |6 +--
 svx/source/accessibility/AccessibleEmptyEditSource.cxx |2 -
 sw/qa/core/test_ToxTextGenerator.cxx   |4 +-
 sw/source/core/tox/ToxTextGenerator.cxx|4 +-
 sw/source/ui/dbui/mmresultdialogs.cxx  |4 +-
 sw/source/uibase/utlui/unotools.cxx|2 -
 toolkit/source/controls/tkspinbutton.cxx   |2 -
 vcl/source/app/IconThemeScanner.cxx|4 +-
 vcl/source/uitest/uiobject.cxx |2 -
 xmlsecurity/source/pdfio/pdfverify.cxx |2 -
 26 files changed, 54 insertions(+), 54 deletions(-)

New commits:
commit 3838475c2fbeb3c84c2ee96a1845893b20d9495a
Author: David Tardon 
Date:   Sun Nov 13 19:13:36 2016 +0100

drop extra semicolons

Change-Id: Ie6713d1bdf0010e5bc0bb70ca995c4dd36408673

diff --git a/desktop/source/app/sofficemain.cxx 
b/desktop/source/app/sofficemain.cxx
index 755da59..b0d155b 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -81,7 +81,7 @@ static bool dumpCallback(const 
google_breakpad::MinidumpDescriptor& descriptor,
 {
 std::string ini_path = CrashReporter::getIniFileName();
 std::ofstream minidump_file(ini_path, std::ios_base::app);
-minidump_file << "DumpFile=" << descriptor.path() << "\n";;
+minidump_file << "DumpFile=" << descriptor.path() << "\n";
 minidump_file.close();
 SAL_WARN("desktop", "minidump generated: " << descriptor.path());
 return succeeded;
@@ -97,7 +97,7 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* 
id,
 // TODO: moggi: can we avoid this conversion
 std::wstring_convert conv1;
 std::string aPath = conv1.to_bytes(std::wstring(path)) + 
conv1.to_bytes(std::wstring(id)) + ".dmp";
-minidump_file << "DumpFile=" << aPath << "\n";;
+minidump_file << "DumpFile=" << aPath << "\n";
 minidump_file.close();
 SAL_WARN("desktop", "minidump generated: " << aPath);
 return succeeded;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 159dc64..f027cd1 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1136,7 +1136,7 @@ Reference< XShape > const & Shape::createAndInsert(
 if ( pFontRef->maPhClr.isUsed() )
 {
 aCharStyleProperties.maFillProperties.maFillColor 
= pFontRef->maPhClr;
-
aCharStyleProperties.maFillProperties.moFillType.set(XML_solidFill);;
+
aCharStyleProperties.maFillProperties.moFillType.set(XML_solidFill);
 }
 }
 }
diff --git a/package/source/zippackage/ZipPackageStream.cxx 
b/package/source/zippackage/ZipPackageStream.cxx
index 932a5af..f7b 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -177,7 +177,7 @@ uno::Reference< io::XInputStream > 
ZipPackageStream::GetRawEncrStreamNoHeaderCop
 // create temporary stream
 uno::Reference < io::XTempFile > xTempFile = 
io::TempFile::create(m_xContext);
 uno::Reference < io::XOutputStream > xTempOut = 
xTempFile->getOutputStream();
-uno::Reference < io::XInputStream > xTempIn = xTempFile->getInputStream();;
+uno::Reference < io::XInputStream > xTempIn = xTempFile->getInputStream();
 uno::Reference < io::XSeekable > xTempSeek( xTempOut, UNO_QUERY_THROW );
 
 // copy the raw stream to the temporary file starting from the current 
position
diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index 42780fd..abc6987 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1145,7 +1145,7 @@ void 

[Libreoffice-commits] core.git: 2 commits - desktop/source desktop/unx desktop/win32 include/desktop vcl/opengl

2016-05-30 Thread Tor Lillqvist
 desktop/source/app/app.cxx |2 
 desktop/source/inc/exithelper.h|   38 
 desktop/unx/source/start.c |2 
 desktop/win32/source/officeloader/officeloader.cxx |2 
 include/desktop/exithelper.h   |   38 
 vcl/opengl/win/gdiimpl.cxx |   99 +
 6 files changed, 140 insertions(+), 41 deletions(-)

New commits:
commit 933a9d9245fdeceefd92fba9a5cb4db6bca92984
Author: Tor Lillqvist 
Date:   Mon May 30 14:20:11 2016 +0300

On Windows, compile OpenGL shaders in advance and disable on failure

If the shader compilation or loading of an already compiled shader
fails, disable OpenGL in the registry and exit with the
EXITHELPER_CRASH_WITH_RESTART status. The wrapper process will thus
run soffice.bin once more, and this time OpenGL will not be used.

Change-Id: I3cc4a615f00a8a1adb584493861e4956c83cec32

diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index cf45a46..04ca857 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -8,6 +8,7 @@
  */
 
 #include "opengl/win/gdiimpl.hxx"
+#include 
 #include 
 #include 
 #include 
@@ -349,6 +350,97 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, 
int& rPixelFormat,
 return bArbMultisampleSupported;
 }
 
+namespace
+{
+
+bool tryShaders(const OUString& rVertexShader, const OUString& 
rFragmentShader, const OUString& rGeometryShader = "")
+{
+GLint nId;
+
+// Somewhat mysteriously, the OpenGLHelper::LoadShaders() API saves a 
compiled binary of the
+// shader only if you give it the digest of the shaders. We have API to 
calculate the digest
+// only of the combination of vertex and fragment (but not geometry) 
shader. So if we have a
+// geometry shader, we should not save the binary.
+if (rGeometryShader.isEmpty())
+nId = OpenGLHelper::LoadShaders(rVertexShader, rFragmentShader, 
rGeometryShader, "", OpenGLHelper::GetDigest( rVertexShader, rFragmentShader, 
""));
+else
+nId = OpenGLHelper::LoadShaders(rVertexShader, rFragmentShader, 
rGeometryShader);
+if (!nId)
+return false;
+glDeleteProgram(nId);
+return glGetError() == GL_NO_ERROR;
+}
+
+bool compiledShaderBinariesWork()
+{
+static bool bBeenHere = false;
+static bool bResult;
+
+if (bBeenHere)
+return bResult;
+
+bBeenHere = true;
+
+bResult =
+(
+#if 0 // Only look at shaders used by vcl for now
+ // canvas
+ tryShaders("dummyVertexShader", 
"linearMultiColorGradientFragmentShader") &&
+ tryShaders("dummyVertexShader", 
"linearTwoColorGradientFragmentShader") &&
+ tryShaders("dummyVertexShader", 
"radialMultiColorGradientFragmentShader") &&
+ tryShaders("dummyVertexShader", 
"radialTwoColorGradientFragmentShader") &&
+ tryShaders("dummyVertexShader", 
"rectangularMultiColorGradientFragmentShader") &&
+ tryShaders("dummyVertexShader", 
"rectangularTwoColorGradientFragmentShader") &&
+ // chart2
+ (GLEW_VERSION_3_3 ?
+  (tryShaders("shape3DVertexShader", "shape3DFragmentShader") &&
+   tryShaders("shape3DVertexShaderBatchScroll", 
"shape3DFragmentShaderBatchScroll") &&
+   tryShaders("shape3DVertexShaderBatch", 
"shape3DFragmentShaderBatch") &&
+   tryShaders("textVertexShaderBatch", "textFragmentShaderBatch")) :
+  (tryShaders("shape3DVertexShaderV300", 
"shape3DFragmentShaderV300"))) &&
+ tryShaders("textVertexShader", "textFragmentShader") &&
+ tryShaders("screenTextVertexShader", "screenTextFragmentShader") &&
+ tryShaders("commonVertexShader", "commonFragmentShader") &&
+ tryShaders("pickingVertexShader", "pickingFragmentShader") &&
+ tryShaders("backgroundVertexShader", "backgroundFragmentShader") &&
+ tryShaders("symbolVertexShader", "symbolFragmentShader") &&
+ tryShaders("symbolVertexShader", "symbolFragmentShader") &&
+ // slideshow
+ tryShaders("reflectionVertexShader", "reflectionFragmentShader") &&
+ tryShaders("basicVertexShader", "basicFragmentShader") &&
+ tryShaders("vortexVertexShader", "vortexFragmentShader", 
"vortexGeometryShader") &&
+ tryShaders("basicVertexShader", "rippleFragmentShader") &&
+ tryShaders("glitterVertexShader", "glitterFragmentShader") &&
+ tryShaders("honeycombVertexShader", "honeycombFragmentShader", 
"honeycombGeometryShader") &&
+#endif
+ // vcl
+ tryShaders("combinedVertexShader", "combinedFragmentShader") &&
+ tryShaders("dumbVertexShader", "invert50FragmentShader") &&
+ tryShaders("combinedTextureVertexShader", 
"combinedTextureFragmentShader") &&
+ tryShaders("textureVertexShader", "areaScaleFragmentShader") &&
+ 

[Libreoffice-commits] core.git: 2 commits - desktop/source scripting/java

2016-05-15 Thread Caolán McNamara
 desktop/source/lib/init.cxx
 |3 -
 
scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
   |   25 +-
 
scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
 |   25 +-
 3 files changed, 28 insertions(+), 25 deletions(-)

New commits:
commit 49cdc1da7660328d64a964fbc26611bf8ce158aa
Author: Caolán McNamara 
Date:   Sun May 15 12:47:48 2016 +0100

coverity#1361587 Dereference null return value

and

coverity#1361588 Dereference null return value

Change-Id: Ia282c37e94d9d4131d18b3ccf6a8b7cb12c12344

diff --git 
a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
 
b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
index 5c8bd6a..c432007 100644
--- 
a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
+++ 
b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
@@ -69,24 +69,25 @@ public class ScriptEditorForBeanShell implements 
ScriptEditor, ActionListener {
 
 // try to load the template for BeanShell scripts
 static {
+BSHTEMPLATE = "// BeanShell script";
 try {
 URL url = 
ScriptEditorForBeanShell.class.getResource("template.bsh");
-InputStream in = url.openStream();
-StringBuilder buf = new StringBuilder();
-byte[] b = new byte[1024];
-int len;
-
-while ((len = in.read(b)) != -1) {
-buf.append(new String(b, 0, len));
-}
+if (url != null) {
+InputStream in = url.openStream();
+StringBuilder buf = new StringBuilder();
+byte[] b = new byte[1024];
+int len;
+
+while ((len = in.read(b)) != -1) {
+buf.append(new String(b, 0, len));
+}
 
-in.close();
+in.close();
 
-BSHTEMPLATE = buf.toString();
+BSHTEMPLATE = buf.toString();
+}
 } catch (IOException ioe) {
-BSHTEMPLATE = "// BeanShell script";
 } catch (Exception e) {
-BSHTEMPLATE = "// BeanShell script";
 }
 }
 
diff --git 
a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
 
b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
index 755086d..a43abc2 100644
--- 
a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
+++ 
b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java
@@ -55,24 +55,25 @@ public class ScriptEditorForJavaScript implements 
ScriptEditor {
 HashMap();
 
 static {
+JSTEMPLATE = "// JavaScript script";
 try {
 URL url = 
ScriptEditorForJavaScript.class.getResource("template.js");
-InputStream in = url.openStream();
-StringBuilder buf = new StringBuilder();
-byte[] b = new byte[1024];
-int len;
-
-while ((len = in.read(b)) != -1) {
-buf.append(new String(b, 0, len));
-}
+if (url != null) {
+InputStream in = url.openStream();
+StringBuilder buf = new StringBuilder();
+byte[] b = new byte[1024];
+int len;
+
+while ((len = in.read(b)) != -1) {
+buf.append(new String(b, 0, len));
+}
 
-in.close();
+in.close();
 
-JSTEMPLATE = buf.toString();
+JSTEMPLATE = buf.toString();
+}
 } catch (IOException ioe) {
-JSTEMPLATE = "// JavaScript script";
 } catch (Exception e) {
-JSTEMPLATE = "// JavaScript script";
 }
 }
 
commit e141017c686c4fb1dbd3533d396f62f103f7
Author: Caolán McNamara 
Date:   Sun May 15 12:43:02 2016 +0100

coverity#1361589 Resource leak

this is the pattern used everywhere else.

Change-Id: I18bdb43203bae8b9e36d59b4c457aa2087fdc117

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ad393e6..09f6883 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1188,7 +1188,8 @@ public:
 
 std::stringstream aStream;
 boost::property_tree::write_json(aStream, aTree);
-mpCallback->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, 
strdup(aStream.str().c_str()));
+OString aPayload = aStream.str().c_str();
+mpCallback->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, aPayload.getStr());
 }
 
 virtual 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/vcl unotools/source vcl/source

2016-03-13 Thread Caolán McNamara
 desktop/source/app/officeipcthread.cxx |2 -
 desktop/source/deployment/registry/dp_registry.cxx |2 -
 desktop/source/splash/unxsplash.cxx|6 ++---
 include/vcl/toolbox.hxx|1 
 unotools/source/config/fontcfg.cxx |2 -
 vcl/source/window/toolbox.cxx  |   23 +++--
 6 files changed, 24 insertions(+), 12 deletions(-)

New commits:
commit ea943b3badeaf2a68ef08d0911e95603f0b889fc
Author: Caolán McNamara 
Date:   Sun Mar 13 20:47:30 2016 +

quieten debugging soffice startup

Change-Id: I3f9ef32d789b7b344cc09bbed6f344e428a31ca4

diff --git a/desktop/source/app/officeipcthread.cxx 
b/desktop/source/app/officeipcthread.cxx
index e9ad39b..1e02113 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -249,7 +249,7 @@ rtl::Reference< OfficeIPCThread > 
OfficeIPCThread::pGlobalOfficeIPCThread;
 // Into a hex string of well known length ff132a86...
 OUString CreateMD5FromString( const OUString& aMsg )
 {
-SAL_WARN("desktop.app", "create md5 from '" << aMsg << "'");
+SAL_INFO("desktop.app", "create md5 from '" << aMsg << "'");
 
 rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
 if ( handle )
diff --git a/desktop/source/deployment/registry/dp_registry.cxx 
b/desktop/source/deployment/registry/dp_registry.cxx
index 8d203f6..8d02f77 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.cxx
@@ -397,7 +397,7 @@ Reference 
PackageRegistryImpl::create(
 buf.append( Reference(
 xBackend, UNO_QUERY_THROW )
 ->getImplementationName() );
-dp_misc::writeConsole( buf.makeStringAndClear() + "\n");
+dp_misc::TRACE( buf.makeStringAndClear() + "\n");
 }
 dp_misc::TRACE( "> [dp_registry.cxx] ambiguous backends:\n\n" );
 for ( t_registryset::const_iterator iPos(
diff --git a/desktop/source/splash/unxsplash.cxx 
b/desktop/source/splash/unxsplash.cxx
index 4018535..7bc5f54 100644
--- a/desktop/source/splash/unxsplash.cxx
+++ b/desktop/source/splash/unxsplash.cxx
@@ -36,7 +36,7 @@ namespace desktop
 
 UnxSplashScreen::~UnxSplashScreen()
 {
-SAL_WARN("desktop.splash", "UnxSplashScreen::~UnxSplashScreen()");
+SAL_INFO("desktop.splash", "UnxSplashScreen::~UnxSplashScreen()");
 if ( m_pOutFd )
 {
 fclose( m_pOutFd );
@@ -52,7 +52,7 @@ void SAL_CALL UnxSplashScreen::start( const OUString& 
/*aText*/, sal_Int32 /*nRa
 void SAL_CALL UnxSplashScreen::end()
 throw ( uno::RuntimeException, std::exception )
 {
-SAL_WARN("desktop.splash", "UnxSplashScreen::end()");
+SAL_INFO("desktop.splash", "UnxSplashScreen::end()");
 if( !m_pOutFd )
 return;
 
@@ -101,7 +101,7 @@ UnxSplashScreen::initialize( const css::uno::Sequence< 
css::uno::Any>& )
 {
 int fd = aNum.toInt32();
 m_pOutFd = fdopen( fd, "w" );
-SAL_WARN("desktop.splash", "Got argument '--splash-pipe=" << fd << 
" ('"
+SAL_INFO("desktop.splash", "Got argument '--splash-pipe=" << fd << 
" ('"
 << aNum << "') ("
 << static_cast(m_pOutFd) << ")");
 }
diff --git a/unotools/source/config/fontcfg.cxx 
b/unotools/source/config/fontcfg.cxx
index 62913d1..b4585c8 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -392,7 +392,7 @@ FontSubstConfiguration::FontSubstConfiguration() :
 m_xConfigProvider.clear();
 m_xConfigAccess.clear();
 }
-SAL_WARN("unotools.config", "config provider: " << 
static_cast(m_xConfigProvider.is())
+SAL_INFO("unotools.config", "config provider: " << 
static_cast(m_xConfigProvider.is())
 << ", config access: " << static_cast(m_xConfigAccess.is()));
 }
 
commit a6435dc298a7dec944eedadd46a17fa6d76e5169
Author: Caolán McNamara 
Date:   Sun Mar 13 20:42:13 2016 +

coverity#1355505 Uninitialized pointer field

Change-Id: I95259c8a572529f47ef4fddf59f9ca29d078b6f4

diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index da057b8..b0a686f 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -159,6 +159,7 @@ private:
bool bInvalidateLower = true);
 SAL_DLLPRIVATE void InvalidateMenuButton();
 
+SAL_DLLPRIVATE voidImplInitToolBoxData();
 SAL_DLLPRIVATE voidImplInit( vcl::Window* pParent, WinBits 
nStyle );
 using DockingWindow::ImplInitSettings;
 SAL_DLLPRIVATE voidImplInitSettings( bool bFont, bool 
bForeground, bool bBackground );
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 075e44e..b638fc7 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx

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

2016-03-10 Thread Stephan Bergmann
 desktop/source/app/dispatchwatcher.cxx |   22 +-
 desktop/source/app/dispatchwatcher.hxx |7 ++-
 desktop/source/app/officeipcthread.cxx |2 +-
 3 files changed, 4 insertions(+), 27 deletions(-)

New commits:
commit 3b0fda641467cc99ef86eb538de02b7bfda8fae0
Author: Stephan Bergmann 
Date:   Thu Mar 10 15:34:06 2016 +0100

mpDispatchWatcher is a natural place to hold the DispatchWatcher singleton

Change-Id: I6221023f0158388b05db045453111974c5cb0458

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 5950097..49dce81 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -180,26 +180,6 @@ Mutex& DispatchWatcher::GetMutex()
 return theWatcherMutex::get();
 }
 
-// Create or get the dispatch watcher implementation. This implementation must 
be
-// a singleton to prevent access to the framework after it wants to terminate.
-rtl::Reference DispatchWatcher::GetDispatchWatcher()
-{
-static rtl::Reference xDispatchWatcher;
-
-if ( !xDispatchWatcher.is() )
-{
-::osl::MutexGuard aGuard( GetMutex() );
-
-if ( !xDispatchWatcher.is() )
-{
-xDispatchWatcher = new DispatchWatcher();
-}
-}
-
-return xDispatchWatcher;
-}
-
-
 DispatchWatcher::DispatchWatcher()
 : m_nRequestCount(0)
 {
diff --git a/desktop/source/app/dispatchwatcher.hxx 
b/desktop/source/app/dispatchwatcher.hxx
index aa44378..13c5b25 100644
--- a/desktop/source/app/dispatchwatcher.hxx
+++ b/desktop/source/app/dispatchwatcher.hxx
@@ -70,6 +70,8 @@ class DispatchWatcher : public ::cppu::WeakImplHelper< 
css::frame::XDispatchResu
 
 typedef std::vector< DispatchRequest > DispatchList;
 
+DispatchWatcher();
+
 virtual ~DispatchWatcher();
 
 // XEventListener
@@ -79,15 +81,10 @@ class DispatchWatcher : public ::cppu::WeakImplHelper< 
css::frame::XDispatchResu
 // XDispachResultListener
 virtual void SAL_CALL dispatchFinished( const 
css::frame::DispatchResultEvent& aEvent ) throw( css::uno::RuntimeException, 
std::exception ) override;
 
-// Access function to get a dispatcher watcher reference. There must 
be a global reference holder
-static rtl::Reference GetDispatchWatcher();
-
 // execute new dispatch request
 bool executeDispatchRequests( const DispatchList& aDispatches, bool 
bNoTerminate = false );
 
 private:
-DispatchWatcher();
-
 static ::osl::Mutex&GetMutex();
 
 std::unordered_map
diff --git a/desktop/source/app/officeipcthread.cxx 
b/desktop/source/app/officeipcthread.cxx
index b0073a3..7d1ebf4 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -1079,7 +1079,7 @@ bool OfficeIPCThread::ExecuteCmdLineRequests( 
ProcessDocumentsRequest& aRequest
 pGlobalOfficeIPCThread->mnPendingRequests += aDispatchList.size();
 if ( !pGlobalOfficeIPCThread->mpDispatchWatcher.is() )
 {
-pGlobalOfficeIPCThread->mpDispatchWatcher = 
DispatchWatcher::GetDispatchWatcher();
+pGlobalOfficeIPCThread->mpDispatchWatcher = new DispatchWatcher;
 }
 
 // copy for execute
commit 9daa9799acbd3ca74c1932cff35c5cf71b26d7ea
Author: Stephan Bergmann 
Date:   Thu Mar 10 15:15:05 2016 +0100

Just use "this"

Change-Id: If9921d73188e95395b81eb2341487423df7bc750

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 9cdbf66..5950097 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -374,7 +374,7 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList& aDispatchRequ
 aArgs2[0].Value <<= sal_True;
 Reference < XNotifyingDispatch > xDisp( xDispatcher, 
UNO_QUERY );
 if ( xDisp.is() )
-xDisp->dispatchWithNotification( aURL, aArgs2, 
DispatchWatcher::GetDispatchWatcher().get() );
+xDisp->dispatchWithNotification( aURL, aArgs2, this );
 else
 xDispatcher->dispatch( aURL, aArgs2 );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-27 Thread Markus Mohrhard
 desktop/source/app/sofficemain.cxx |1 +
 sd/qa/unit/import-tests.cxx|4 
 2 files changed, 5 insertions(+)

New commits:
commit 1b175e6f2a884740436642056605ec15b92c
Author: Markus Mohrhard 
Date:   Sat Feb 27 14:35:10 2016 +0100

fix clang build

Change-Id: I0a1ed390462e068dc59e360b9b5dd4a798bac21c

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 67c181c..8c53d6b 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -556,6 +556,8 @@ void SdImportTest::testFdo77027()
 xDocShRef->DoClose();
 }
 
+namespace com { namespace sun { namespace star { namespace uno {
+
 template
 std::ostream& operator<<(std::ostream& rStrm, const uno::Reference& xRef)
 {
@@ -563,6 +565,8 @@ std::ostream& operator<<(std::ostream& rStrm, const 
uno::Reference& xRef)
 return rStrm;
 }
 
+} } } }
+
 void SdImportTest::testTdf97808()
 {
 sd::DrawDocShellRef xDocShRef = 
loadURL(getURLFromSrc("/sd/qa/unit/data/tdf97808.fodp"), FODP);
commit 53bd58b54077b6aa57836aab57a317b75edea2ab
Author: Markus Mohrhard 
Date:   Sat Feb 27 14:26:34 2016 +0100

leave comment about minidump location

Change-Id: Ic2f44caabe14efc2555e8d155273f75a2602932c

diff --git a/desktop/source/app/sofficemain.cxx 
b/desktop/source/app/sofficemain.cxx
index 3484b84..5a724d3 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -83,6 +83,7 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
 #if HAVE_FEATURE_BREAKPAD
 
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
+// TODO: we need a better location for this
 google_breakpad::MinidumpDescriptor descriptor("/tmp");
 google_breakpad::ExceptionHandler eh(descriptor, nullptr, dumpCallback, 
nullptr, true, -1);
 #else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-26 Thread Tor Lillqvist
 desktop/source/minidump/minidump_upload.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 1be32cc6d36766d42a0b80d2768bf31e5b8aa8bb
Author: Tor Lillqvist 
Date:   Fri Feb 26 15:01:37 2016 +0200

loplugin:redundantcast

Change-Id: I8c44383a751d7b3440dcdede3646231414e2f89c

diff --git a/desktop/source/minidump/minidump_upload.cxx 
b/desktop/source/minidump/minidump_upload.cxx
index 3077d94..29814be 100644
--- a/desktop/source/minidump/minidump_upload.cxx
+++ b/desktop/source/minidump/minidump_upload.cxx
@@ -45,9 +45,9 @@ static size_t WriteCallback(void *ptr, size_t size,
   if (!userp)
 return 0;
 
-  std::string* response = reinterpret_cast(userp);
+  std::string* response = static_cast(userp);
   size_t real_size = size * nmemb;
-  response->append(reinterpret_cast(ptr), real_size);
+  response->append(static_cast(ptr), real_size);
   return real_size;
 }
 
@@ -117,7 +117,7 @@ bool uploadContent(std::map& 
parameters)
 
 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
 curl_easy_setopt(curl, CURLOPT_WRITEDATA,
-reinterpret_cast(_body));
+static_cast(_body));
 
 // Fail if 400+ is returned from the web server.
 curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
commit 0eeeaae5d1edc0dbd0962666bdf9432e84cfa0e6
Author: Tor Lillqvist 
Date:   Fri Feb 26 14:51:22 2016 +0200

loplugin:nullptr

Change-Id: I11f661b31db8073010a520ccd44d93e1eb7c5bc0

diff --git a/desktop/source/minidump/minidump_upload.cxx 
b/desktop/source/minidump/minidump_upload.cxx
index 220286a..3077d94 100644
--- a/desktop/source/minidump/minidump_upload.cxx
+++ b/desktop/source/minidump/minidump_upload.cxx
@@ -111,7 +111,7 @@ bool uploadContent(std::map& 
parameters)
 
 // Disable 100-continue header.
 char buf[] = "Expect:";
-curl_slist* headerlist = NULL;
+curl_slist* headerlist = nullptr;
 headerlist = curl_slist_append(headerlist, buf);
 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
 
@@ -132,15 +132,15 @@ bool uploadContent(std::map& 
parameters)
 #endif
 /*
  * TODO
-if (error_description != NULL)
+if (error_description != nullptr)
 *error_description = curl_easy_strerror(cc);
 */
 
-if (formpost != NULL)
+if (formpost != nullptr)
 {
 curl_formfree(formpost);
 }
-if (headerlist != NULL)
+if (headerlist != nullptr)
 {
 curl_slist_free_all(headerlist);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-08 Thread Jan Holesovsky
 desktop/source/lib/init.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 809154904fe66441ada6985b153b4c1b20f3eb8f
Author: Jan Holesovsky 
Date:   Mon Feb 8 20:09:37 2016 +0100

lok: Interaction handler for saveAs() too.

Change-Id: I3f0365e05685c21987da194e24a1165c7a3f8b5c

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ca9d3f3..5d5fe77 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -663,6 +663,13 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const 
char* sUrl, const cha
 aSaveMediaDescriptor["FilterName"] <<= aFilterName;
 aSaveMediaDescriptor[MediaDescriptor::PROP_FILTEROPTIONS()] <<= 
aFilterOptions;
 
+// add interaction handler too
+rtl::Reference const pInteraction(
+new 
LOKInteractionHandler(::comphelper::getProcessComponentContext(), "saveas", 
gImpl, pDocument));
+uno::Reference const 
xInteraction(pInteraction.get());
+
+aSaveMediaDescriptor[MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= 
xInteraction;
+
 uno::Reference xStorable(pDocument->mxComponent, 
uno::UNO_QUERY_THROW);
 xStorable->storeAsURL(aURL, 
aSaveMediaDescriptor.getAsConstPropertyValueList());
 
commit bcc940956c4689888297c7bbe8d3744becc2fe9e
Author: Jan Holesovsky 
Date:   Mon Feb 8 20:08:31 2016 +0100

lok: Take over the identity of the document when performing saveAs().

This way we are getting the .uno:ModifiedStatus notification even when
performing saveAs().

Change-Id: I370bf483c50161fd4b7f2255ae85fdb76487a9a0

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index eaac992..ca9d3f3 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -664,7 +664,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const 
char* sUrl, const cha
 aSaveMediaDescriptor[MediaDescriptor::PROP_FILTEROPTIONS()] <<= 
aFilterOptions;
 
 uno::Reference xStorable(pDocument->mxComponent, 
uno::UNO_QUERY_THROW);
-xStorable->storeToURL(aURL, 
aSaveMediaDescriptor.getAsConstPropertyValueList());
+xStorable->storeAsURL(aURL, 
aSaveMediaDescriptor.getAsConstPropertyValueList());
 
 return true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source filter/Configuration_filter.mk filter/source

2016-02-04 Thread Tomaž Vajngerl
 desktop/source/lib/init.cxx  |3 -
 filter/Configuration_filter.mk   |2 
 filter/source/config/fragments/filters/writer_web_jpg_Export.xcu |   21 
++
 filter/source/config/fragments/filters/writer_web_png_Export.xcu |   21 
++
 filter/source/graphic/GraphicExportDialog.cxx|2 
 filter/source/graphic/GraphicExportFilter.cxx|1 
 6 files changed, 48 insertions(+), 2 deletions(-)

New commits:
commit 806d34981f480908645038f4cfc29ebcf25ca145
Author: Tomaž Vajngerl 
Date:   Thu Feb 4 14:44:36 2016 +0100

lok: fix saveAs for a loaded HTML document

a HTML document is reported as "com.sun.star.text.WebDocument"
which is a unsupported document type in LOK so report it as a
LOK_DOCTYPE_TEXT instead.

Change-Id: Iaa77cb8b1f55cf31ebbb4fd4d69c02702e60e251

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 203279c..7c4d8cf 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -622,6 +622,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const 
char* sUrl, const cha
 break;
 case LOK_DOCTYPE_OTHER:
 default:
+SAL_INFO("lok", "Can't save document - unsopported document 
type.");
 return false;
 }
 
@@ -765,7 +766,7 @@ static int doc_getDocumentType (LibreOfficeKitDocument* 
pThis)
 {
 return LOK_DOCTYPE_DRAWING;
 }
-else if (xDocument->supportsService("com.sun.star.text.TextDocument"))
+else if (xDocument->supportsService("com.sun.star.text.TextDocument") 
|| xDocument->supportsService("com.sun.star.text.WebDocument"))
 {
 return LOK_DOCTYPE_TEXT;
 }
commit 9f84b757a2e6678a30a797e85d8236612b952646
Author: Tomaž Vajngerl 
Date:   Thu Feb 4 14:43:28 2016 +0100

Allow HTML (WebDocument) to be exported as PNG or JPEG

Change-Id: Id6b70a88ea479b402e680c7c216a20be3d6e116e

diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk
index 579dc80..38c67fea 100644
--- a/filter/Configuration_filter.mk
+++ b/filter/Configuration_filter.mk
@@ -416,6 +416,8 @@ $(eval $(call 
filter_Configuration_add_filters,fcfg_langpack,fcfg_web_filters.xc
writer_web_StarOffice_XML_Writer \
writer_web_StarOffice_XML_Writer_Web_Template \
writer_web_pdf_Export\
+   writer_web_png_Export\
+   writer_web_jpg_Export\
writerweb8_writer_template\
writerweb8_writer \
 ))
diff --git a/filter/source/config/fragments/filters/writer_web_jpg_Export.xcu 
b/filter/source/config/fragments/filters/writer_web_jpg_Export.xcu
new file mode 100644
index 000..584283f
--- /dev/null
+++ b/filter/source/config/fragments/filters/writer_web_jpg_Export.xcu
@@ -0,0 +1,21 @@
+
+
+EXPORT ALIEN 
3RDPARTYFILTER
+com.sun.star.comp.GraphicExportDialog
+com.sun.star.comp.GraphicExportFilter
+
+
+JPEG - Joint Photographic Experts 
Group
+
+0
+jpg_JPEG
+
+com.sun.star.text.WebDocument
+
diff --git a/filter/source/config/fragments/filters/writer_web_png_Export.xcu 
b/filter/source/config/fragments/filters/writer_web_png_Export.xcu
new file mode 100644
index 000..7408773
--- /dev/null
+++ b/filter/source/config/fragments/filters/writer_web_png_Export.xcu
@@ -0,0 +1,21 @@
+
+
+EXPORT ALIEN 
3RDPARTYFILTER
+com.sun.star.comp.GraphicExportDialog
+com.sun.star.comp.GraphicExportFilter
+
+
+PNG - Portable Network Graphic
+
+0
+png_Portable_Network_Graphic
+
+com.sun.star.text.WebDocument
+
diff --git a/filter/source/graphic/GraphicExportDialog.cxx 
b/filter/source/graphic/GraphicExportDialog.cxx
index f2d9a82..d9d0a0d 100644
--- a/filter/source/graphic/GraphicExportDialog.cxx
+++ b/filter/source/graphic/GraphicExportDialog.cxx
@@ -135,7 +135,7 @@ void GraphicExportDialog::setSourceDocument( const 
Reference& xDocum
 {
 aConfigPath = "Office.Draw/Layout/Other/MeasureUnit";
 }
-else if ( 
xServiceInfo->supportsService("com.sun.star.text.TextDocument") )
+else if ( 
xServiceInfo->supportsService("com.sun.star.text.TextDocument") || 
xServiceInfo->supportsService("com.sun.star.text.WebDocument") )
 {
 aConfigPath = "Office.Writer/Layout/Other/MeasureUnit";
 }
diff --git a/filter/source/graphic/GraphicExportFilter.cxx 
b/filter/source/graphic/GraphicExportFilter.cxx
index 86f0d49..b4141f4 100644
--- a/filter/source/graphic/GraphicExportFilter.cxx
+++ b/filter/source/graphic/GraphicExportFilter.cxx
@@ -47,6 +47,7 @@ void GraphicExportFilter::gatherProperties( const 
Sequence& rProp
 aInternalFilterName = 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit libreofficekit/source

2016-02-03 Thread Jan Holesovsky
 desktop/source/lib/init.cxx  |   39 ++-
 desktop/source/lib/lokinteractionhandler.cxx |  284 +--
 desktop/source/lib/lokinteractionhandler.hxx |   33 ++-
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   14 +
 libreofficekit/source/gtk/lokdocview.cxx |   17 +
 5 files changed, 309 insertions(+), 78 deletions(-)

New commits:
commit c406c90289baa12663a382c7ed664f2cf93b75ab
Author: Jan Holesovsky 
Date:   Tue Feb 2 22:59:34 2016 +0100

lok interaction handler: Add handling of io and network errors.

Change-Id: If7c84a7b24f2072439718fb0c473b73243f2ecc1

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5010bd0..3ae825a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -252,7 +252,7 @@ static OUString getAbsoluteURL(const char* pURL)
 return OUString();
 }
 
-static void jsonToPropertyValues(const char* pJSON, 
uno::Sequence& rPropertyValues)
+static std::vector jsonToPropertyValuesVector(const 
char* pJSON)
 {
 std::vector aArguments;
 if (pJSON && pJSON[0] != '\0')
@@ -279,11 +279,11 @@ static void jsonToPropertyValues(const char* pJSON, 
uno::Sequence(OString(rValue.c_str()).toUInt32());
 else
-SAL_WARN("desktop.lib", "jsonToPropertyValues: unhandled type 
'"<mInteractionMap.insert(std::make_pair(aURL.toUtf8(), pInteraction)));
 comphelper::ScopeGuard const g([&] () {
 if (pair.second)
@@ -985,9 +985,9 @@ static void 
doc_initializeForRendering(LibreOfficeKitDocument* pThis,
 if (pDoc)
 {
 doc_iniUnoCommands();
-uno::Sequence aPropertyValues;
-jsonToPropertyValues(pArguments, aPropertyValues);
-pDoc->initializeForTiledRendering(aPropertyValues);
+
+pDoc->initializeForTiledRendering(
+
comphelper::containerToSequence(jsonToPropertyValuesVector(pArguments)));
 }
 }
 
@@ -1077,20 +1077,33 @@ public:
 static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* 
pCommand, const char* pArguments, bool bNotifyWhenFinished)
 {
 OUString aCommand(pCommand, strlen(pCommand), RTL_TEXTENCODING_UTF8);
+LibLODocument_Impl* pDocument = static_cast(pThis);
 
-uno::Sequence aPropertyValues;
-jsonToPropertyValues(pArguments, aPropertyValues);
-bool bResult = false;
+std::vector 
aPropertyValuesVector(jsonToPropertyValuesVector(pArguments));
 
-LibLODocument_Impl* pDocument = static_cast(pThis);
+// handle potential interaction
+if (aCommand == ".uno:Save")
+{
+rtl::Reference const pInteraction(
+new 
LOKInteractionHandler(::comphelper::getProcessComponentContext(), "save", 
gImpl, pDocument));
+uno::Reference const 
xInteraction(pInteraction.get());
+
+beans::PropertyValue aValue;
+aValue.Name = "InteractionHandler";
+aValue.Value <<= xInteraction;
+
+aPropertyValuesVector.push_back(aValue);
+}
+
+bool bResult = false;
 
 if (bNotifyWhenFinished && pDocument->mpCallback)
 {
-bResult = comphelper::dispatchCommand(aCommand, aPropertyValues,
+bResult = comphelper::dispatchCommand(aCommand, 
comphelper::containerToSequence(aPropertyValuesVector),
 new DispatchResultListener(pCommand, pDocument->mpCallback, 
pDocument->mpCallbackData));
 }
 else
-bResult = comphelper::dispatchCommand(aCommand, aPropertyValues);
+bResult = comphelper::dispatchCommand(aCommand, 
comphelper::containerToSequence(aPropertyValuesVector));
 
 if (!bResult)
 {
diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index 5bb164c..bb287ff 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -19,12 +19,21 @@
 
 #include "lokinteractionhandler.hxx"
 
+#include 
+
 #include 
 #include 
 
 #include 
 #include 
 #include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
 
 #include <../../inc/lib/init.hxx>
 
@@ -34,8 +43,12 @@ using namespace com::sun::star;
 
 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit include/vcl libreofficekit/qa libreofficekit/source sw/inc sw/source

2016-02-02 Thread Miklos Vajna
 desktop/source/lib/init.cxx |   15 +
 include/LibreOfficeKit/LibreOfficeKit.h |2 +
 include/LibreOfficeKit/LibreOfficeKit.hxx   |   15 +
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |   11 ++
 include/vcl/ITiledRenderable.hxx|5 +++
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |3 +
 libreofficekit/source/gtk/lokdocview.cxx|   32 +++-
 sw/inc/unotxdoc.hxx |2 +
 sw/source/uibase/uno/unotxdoc.cxx   |9 +
 9 files changed, 93 insertions(+), 1 deletion(-)

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

LOK: add Document::setClientVisibleArea()

... and implement it in Writer.

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

Change-Id: Iadfb5a225da09a2551ffa41ddf503bb3d22b3eae

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index aaf52f1..5010bd0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -350,6 +350,7 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis,
 int nTilePixelHeight,
 int nTileTwipWidth,
 int nTileTwipHeight);
+static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, 
int nY, int nWidth, int nHeight);
 static int doc_createView(LibreOfficeKitDocument* pThis);
 static void doc_destroyView(LibreOfficeKitDocument* pThis, int nId);
 static void doc_setView(LibreOfficeKitDocument* pThis, int nId);
@@ -396,6 +397,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
resetSelection = doc_resetSelection;
 m_pDocumentClass->getCommandValues = doc_getCommandValues;
 m_pDocumentClass->setClientZoom = doc_setClientZoom;
+m_pDocumentClass->setClientVisibleArea = doc_setClientVisibleArea;
 
 m_pDocumentClass->createView = doc_createView;
 m_pDocumentClass->destroyView = doc_destroyView;
@@ -1496,6 +1498,19 @@ static void doc_setClientZoom(LibreOfficeKitDocument* 
pThis, int nTilePixelWidth
 pDoc->setClientZoom(nTilePixelWidth, nTilePixelHeight, nTileTwipWidth, 
nTileTwipHeight);
 }
 
+static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, 
int nY, int nWidth, int nHeight)
+{
+ITiledRenderable* pDoc = getTiledRenderable(pThis);
+if (!pDoc)
+{
+gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+return;
+}
+
+Rectangle aRectangle(Point(nX, nY), Size(nWidth, nHeight));
+pDoc->setClientVisibleArea(aRectangle);
+}
+
 static int doc_createView(LibreOfficeKitDocument* /*pThis*/)
 {
 SolarMutexGuard aGuard;
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 3411b6f..c98dd1f 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -205,6 +205,8 @@ struct _LibreOfficeKitDocumentClass
 int nTilePixelHeight,
 int nTileTwipWidth,
 int nTileTwipHeight);
+/// @see lok::Document::setVisibleArea).
+void (*setClientVisibleArea) (LibreOfficeKitDocument* pThis, int nX, int 
nY, int nWidth, int nHeight);
 
 /// @see lok::Document::createView().
 int (*createView) (LibreOfficeKitDocument* pThis);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 3132891..1fbd784 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -333,6 +333,21 @@ public:
 }
 
 /**
+ * Inform core about the currently visible area of the document on the
+ * client, so that it can perform e.g. page down (which depends on the
+ * visible height) in a sane way.
+ *
+ * @param nX - top left corner horizontal position
+ * @param nY - top left corner vertical position
+ * @param nWidth - area width
+ * @param nHeight - area height
+ */
+inline void setClientVisibleArea(int nX, int nY, int nWidth, int nHeight)
+{
+mpDoc->pClass->setClientVisibleArea(mpDoc, nX, nY, nWidth, nHeight);
+}
+
+/**
  * Create a new view for an existing document.
  * By default a loaded document has 1 view.
  * @return the ID of the new view.
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index a1e1d80..d9cd347 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -202,6 +202,11 @@ public:
 (void) nTileTwipWidth;
 (void) nTileTwipHeight;
 }
+
+/// @see 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit writerfilter/source

2016-01-21 Thread Miklos Vajna
 desktop/source/lib/init.cxx  |7 ---
 include/LibreOfficeKit/LibreOfficeKit.h  |4 ++--
 include/LibreOfficeKit/LibreOfficeKit.hxx|   11 ---
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   11 +--
 writerfilter/source/dmapper/DomainMapperTableHandler.hxx |3 +--
 5 files changed, 16 insertions(+), 20 deletions(-)

New commits:
commit 2112d171224a0ae8676afa30292623461065d5b7
Author: Miklos Vajna 
Date:   Thu Jan 21 09:12:02 2016 +0100

writerfilter: can use a plain instance for the cell sequence here

Change-Id: I47fee680b6022cc2402341bf523243c526bc8890

diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 0264f1f..95168fa 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -71,7 +71,7 @@ void DomainMapperTableHandler::startTable(unsigned int nRows,
   TablePropertyMapPtr pProps)
 {
 m_aTableProperties = pProps;
-m_aTableSeq.realloc(nRows);
+m_aTableSeq = TableSequence_t(nRows);
 m_nRowIndex = 0;
 
 #ifdef DEBUG_WRITERFILTER
@@ -629,7 +629,6 @@ CellPropertyValuesSeq_t 
DomainMapperTableHandler::endTableGetCellProperties(Tabl
 PropertyMapVector2::const_iterator aLastRowIterator = 
m_aCellProperties.end() - 1;
 sal_Int32 nRow = 0;
 
-//it's a uno::Sequence< beans::PropertyValues >*
 css::uno::Sequence* pCellProperties = 
aCellProperties.getArray();
 PropertyMapVector1::const_iterator aRowIter = m_aRowProperties.begin();
 while( aRowOfCellsIterator != aRowOfCellsIteratorEnd )
@@ -1189,10 +1188,10 @@ void DomainMapperTableHandler::startCell(const 
css::uno::Reference< css::text::X
 #endif
 
 //add a new 'row' of properties
-m_pCellSeq = CellSequencePointer_t(new CellSequence_t(2));
+m_aCellSeq = CellSequence_t(2);
 if (!start.get())
 return;
-(*m_pCellSeq)[0] = start->getStart();
+m_aCellSeq[0] = start->getStart();
 }
 
 void DomainMapperTableHandler::endCell(const css::uno::Reference< 
css::text::XTextRange > & end)
@@ -1206,8 +1205,8 @@ void DomainMapperTableHandler::endCell(const 
css::uno::Reference< css::text::XTe
 
 if (!end.get())
 return;
-(*m_pCellSeq)[1] = end->getEnd();
-m_aRowSeq[m_nCellIndex] = *m_pCellSeq;
+m_aCellSeq[1] = end->getEnd();
+m_aRowSeq[m_nCellIndex] = m_aCellSeq;
 ++m_nCellIndex;
 }
 
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
index 2d9a41e..669ea30ef 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
@@ -29,7 +29,6 @@ namespace writerfilter {
 namespace dmapper {
 
 typedef css::uno::Sequence< css::uno::Reference< css::text::XTextRange > > 
CellSequence_t;
-typedef std::shared_ptr CellSequencePointer_t;
 typedef css::uno::Sequence RowSequence_t;
 typedef css::uno::Sequence TableSequence_t;
 
@@ -63,7 +62,7 @@ class DomainMapperTableHandler
 {
 css::uno::Reference  m_xText;
 DomainMapper_Impl&  m_rDMapper_Impl;
-CellSequencePointer_t   m_pCellSeq;
+CellSequence_t m_aCellSeq;
 RowSequence_tm_aRowSeq;
 TableSequence_t m_aTableSeq;
 
commit 8e0c4694f89dd66314faf5cfd411f58f2f8e1bca
Author: Miklos Vajna 
Date:   Thu Jan 21 09:10:29 2016 +0100

Clean up lok::Office::freeError()

- let it take a non-const pointer, just like free() or g_free() does
- remove lok::Document::freeError(), which was declared, but not
  implemented
- move the declaration at the end of the stable API, but before the
  unstable section

Change-Id: I5a8ced61fc87641dc2fa0ea3615a350361fae3a1

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6b8f369..f2f9034 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -430,7 +430,7 @@ static voidlo_destroy   
(LibreOfficeKit* pThis);
 static int lo_initialize(LibreOfficeKit* pThis, const 
char* pInstallPath, const char* pUserProfilePath);
 static LibreOfficeKitDocument* lo_documentLoad  (LibreOfficeKit* pThis, const 
char* pURL);
 static char *  lo_getError  (LibreOfficeKit* pThis);
-static voidlo_freeError (const char *pfree);
+static voidlo_freeError (char* pFree);
 static LibreOfficeKitDocument* lo_documentLoadWithOptions  (LibreOfficeKit* 
pThis,
const char* pURL,
const char* 
pOptions);
@@ -1574,9 +1574,10 @@ static char* lo_getError (LibreOfficeKit *pThis)
 strcpy(pMemory, 

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

2015-11-24 Thread Miklos Vajna
 desktop/source/lib/init.cxx |   26 +-
 sw/Library_sw.mk|1 
 sw/source/uibase/docvw/SidebarScrollBar.cxx |   72 
 sw/source/uibase/docvw/SidebarScrollBar.hxx |   43 
 sw/source/uibase/docvw/SidebarWin.cxx   |3 -
 5 files changed, 131 insertions(+), 14 deletions(-)

New commits:
commit 55040ea13426e337418143dcfe226dd2a395f041
Author: Miklos Vajna 
Date:   Tue Nov 24 11:58:09 2015 +0100

sw lok comments: fix missing invalidations from the scrollbar

If a comment had a scrollbar, and the user clicked on the down arrow of
it, then the button remained in the "pushed" state, as the scrollbar
invalidations were not routed to the LOK client.

With this, the button gets back to its non-pushed state after the mouse
button is released.

Change-Id: Ie4ba5d0ec07229b0cfc08532e8e91ae25f7a4c9e

diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index c5004cc..b4af6e5 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -600,6 +600,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
 sw/source/uibase/docvw/OverlayRanges \
 sw/source/uibase/docvw/PostItMgr \
 sw/source/uibase/docvw/ShadowOverlayObject \
+sw/source/uibase/docvw/SidebarScrollBar \
 sw/source/uibase/docvw/SidebarTxtControl \
 sw/source/uibase/docvw/SidebarTxtControlAcc \
 sw/source/uibase/docvw/SidebarWin \
diff --git a/sw/source/uibase/docvw/SidebarScrollBar.cxx 
b/sw/source/uibase/docvw/SidebarScrollBar.cxx
new file mode 100644
index 000..909aa76
--- /dev/null
+++ b/sw/source/uibase/docvw/SidebarScrollBar.cxx
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#define LOK_USE_UNSTABLE_API
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+namespace sw
+{
+namespace sidebarwindows
+{
+
+SidebarScrollBar::SidebarScrollBar(SwSidebarWin& rSidebarWin, WinBits nStyle, 
SwView& rView)
+: ScrollBar(, nStyle),
+  m_rSidebarWin(rSidebarWin),
+  m_rView(rView)
+{
+}
+
+void SidebarScrollBar::LogicInvalidate(const Rectangle* pRectangle)
+{
+Rectangle aRectangle;
+
+if (!pRectangle)
+{
+Push(PushFlags::MAPMODE);
+EnableMapMode();
+MapMode aMapMode = GetMapMode();
+aMapMode.SetMapUnit(MAP_TWIP);
+SetMapMode(aMapMode);
+aRectangle = Rectangle(Point(0, 0), PixelToLogic(GetSizePixel()));
+Pop();
+}
+else
+aRectangle = *pRectangle;
+
+// Convert from relative twips to absolute ones.
+vcl::Window& rParent = m_rSidebarWin.EditWin();
+Point aOffset(GetOutOffXPixel() - rParent.GetOutOffXPixel(), 
GetOutOffYPixel() - rParent.GetOutOffYPixel());
+rParent.Push(PushFlags::MAPMODE);
+rParent.EnableMapMode();
+aOffset = rParent.PixelToLogic(aOffset);
+rParent.Pop();
+aRectangle.Move(aOffset.getX(), aOffset.getY());
+
+OString sRectangle = aRectangle.toString();
+SwWrtShell& rWrtShell = m_rView.GetWrtShell();
+rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, 
sRectangle.getStr());
+}
+
+
+SidebarScrollBar::~SidebarScrollBar()
+{
+disposeOnce();
+}
+
+}
+} // end of namespace sw::sidebarwindows
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/docvw/SidebarScrollBar.hxx 
b/sw/source/uibase/docvw/SidebarScrollBar.hxx
new file mode 100644
index 000..9543205
--- /dev/null
+++ b/sw/source/uibase/docvw/SidebarScrollBar.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SW_SOURCE_UIBASE_DOCVW_SIDEBARSCROLLBAR_HXX
+#define INCLUDED_SW_SOURCE_UIBASE_DOCVW_SIDEBARSCROLLBAR_HXX
+
+#include 
+
+class SwView;
+
+namespace sw
+{
+namespace sidebarwindows
+{
+
+class SwSidebarWin;
+
+/// Similar to the VCL scrollbar, but instrumented with Writer-specific 
details for LOK.
+class SidebarScrollBar : public ScrollBar
+{
+SwSidebarWin& m_rSidebarWin;
+SwView& m_rView;
+
+protected:
+/// @see OutputDevice::LogicInvalidate().
+void LogicInvalidate(const Rectangle* pRectangle) override;
+public:
+SidebarScrollBar(SwSidebarWin& rSidebarWin, WinBits nStyle, SwView& rView);
+virtual ~SidebarScrollBar();
+};
+
+}
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git 

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

2015-11-20 Thread Noel Grandin
 desktop/source/app/dispatchwatcher.cxx|1 
 desktop/source/deployment/gui/dp_gui_updatedata.hxx   |3 -
 desktop/source/deployment/gui/dp_gui_updatedialog.cxx |   28 +-
 desktop/source/deployment/manager/dp_extensionmanager.hxx |8 
 desktop/source/migration/migration_impl.hxx   |   14 ---
 extensions/source/abpilot/admininvokationpage.cxx |1 
 extensions/source/abpilot/admininvokationpage.hxx |2 -
 extensions/source/dbpilots/groupboxwiz.hxx|1 
 extensions/source/plugin/inc/plugin/unx/plugcon.hxx   |1 
 extensions/source/plugin/unx/plugcon.cxx  |1 
 extensions/source/plugin/unx/unxmgr.cxx   |   10 +
 11 files changed, 14 insertions(+), 56 deletions(-)

New commits:
commit e3990370f832c8a69d1b6b22ec315dc0616d5535
Author: Noel Grandin 
Date:   Fri Nov 20 14:21:57 2015 +0200

loplugin:unusedfields extensions

Change-Id: I7cee47eca35b02472639cdd267ddd450145803de

diff --git a/extensions/source/abpilot/admininvokationpage.cxx 
b/extensions/source/abpilot/admininvokationpage.cxx
index f8af951..35b73eb 100644
--- a/extensions/source/abpilot/admininvokationpage.cxx
+++ b/extensions/source/abpilot/admininvokationpage.cxx
@@ -27,7 +27,6 @@ namespace abp
 AdminDialogInvokationPage::AdminDialogInvokationPage( 
OAddessBookSourcePilot* _pParent )
 : AddressBookSourcePage(_pParent, "InvokeAdminPage",
 "modules/sabpilot/ui/invokeadminpage.ui")
-, m_bSuccessfullyExecutedDialog(false)
 {
 get(m_pInvokeAdminDialog, "settings");
 get(m_pErrorMessage, "warning");
diff --git a/extensions/source/abpilot/admininvokationpage.hxx 
b/extensions/source/abpilot/admininvokationpage.hxx
index 5308357..bfbc6b2 100644
--- a/extensions/source/abpilot/admininvokationpage.hxx
+++ b/extensions/source/abpilot/admininvokationpage.hxx
@@ -31,8 +31,6 @@ namespace abp
 VclPtr m_pInvokeAdminDialog;
 VclPtr  m_pErrorMessage;
 
-boolm_bSuccessfullyExecutedDialog;
-
 public:
 explicit AdminDialogInvokationPage(OAddessBookSourcePilot* _pParent);
 virtual ~AdminDialogInvokationPage();
diff --git a/extensions/source/dbpilots/groupboxwiz.hxx 
b/extensions/source/dbpilots/groupboxwiz.hxx
index ba90a5f..2c3262d 100644
--- a/extensions/source/dbpilots/groupboxwiz.hxx
+++ b/extensions/source/dbpilots/groupboxwiz.hxx
@@ -33,7 +33,6 @@ namespace dbp
 StringArray aValues;
 OUStringsDefaultField;
 OUStringsDBField;
-OUStringsName;
 };
 
 class OGroupBoxWizard : public OControlWizard
diff --git a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx 
b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx
index ad3fc67..81325eb 100644
--- a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx
+++ b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx
@@ -98,7 +98,6 @@ public:
 char*   pMimeType;
 void*   pShell;
 void*   pWidget;
-void*   pForm;
 
 GtkWidget*  pGtkWindow;
 GtkWidget*  pGtkWidget;
diff --git a/extensions/source/plugin/unx/plugcon.cxx 
b/extensions/source/plugin/unx/plugcon.cxx
index 65c9e61..d50d72a 100644
--- a/extensions/source/plugin/unx/plugcon.cxx
+++ b/extensions/source/plugin/unx/plugcon.cxx
@@ -197,7 +197,6 @@ ConnectorInstance::ConnectorInstance( NPP inst, char* type,
 instance( inst ),
 pShell( nullptr ),
 pWidget( nullptr ),
-pForm( nullptr ),
 pGtkWindow( nullptr ),
 pGtkWidget( nullptr ),
 bShouldUseXEmbed( false ),
diff --git a/extensions/source/plugin/unx/unxmgr.cxx 
b/extensions/source/plugin/unx/unxmgr.cxx
index 8113768..7f45607 100644
--- a/extensions/source/plugin/unx/unxmgr.cxx
+++ b/extensions/source/plugin/unx/unxmgr.cxx
@@ -178,12 +178,6 @@ static bool CheckPlugin( const OString& rPath, list< 
PluginDescription* >& rDesc
 return nDescriptions > 0;
 }
 
-union maxDirent
-{
-char aBuffer[ sizeof( struct dirent ) + PATH_MAX +1 ];
-struct dirent asDirent;
-};
-
 static void CheckPluginRegistryFiles( const OString& rPath, list< 
PluginDescription* >& rDescriptions )
 {
 OStringBuffer aPath( 1024 );
@@ -212,7 +206,7 @@ static void CheckPluginRegistryFiles( const OString& rPath, 
list< PluginDescript
 DIR* pDIR = opendir( rPath.getStr() );
 struct dirent* pDirEnt = nullptr;
 struct stat aStat;
-maxDirent u;
+struct dirent u;
 while( pDIR && ! readdir_r( pDIR, ,  ) && pDirEnt )
 {
 char* pBaseName = u.asDirent.d_name;
@@ -267,7 +261,7 @@ Sequence 
XPluginManager_Impl::impl_getPluginDescriptions() th
 OString aSearchPath = aSearchBuffer.makeStringAndClear();
 
 sal_Int32 nIndex = 0;
-maxDirent u;
+struct dirent 

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

2015-11-16 Thread Michael Stahl
 desktop/source/app/dispatchwatcher.cxx|  126 +-
 sc/source/ui/Accessibility/AccessibleText.cxx |6 +
 2 files changed, 72 insertions(+), 60 deletions(-)

New commits:
commit c994ce8a1d292b02e4c53f7b4061f3bbb840f874
Author: Michael Stahl 
Date:   Mon Nov 16 12:55:06 2015 +0100

desktop: stop --convert-to from creating some not requested ...

... file format by default if the requested filter does not exist.

Much better to write an error message and do nothing.

Change-Id: Ie5404772e7aae5751126bd4c2784b58177804448

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 12da0b4..3239f12 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -128,7 +128,8 @@ const SfxFilter* impl_lookupExportFilterForUrl( const 
rtl::OUString& rUrl, const
 return pBestMatch;
 }
 
-const SfxFilter* impl_getExportFilterFromUrl( const rtl::OUString& rUrl, const 
rtl::OUString& rFactory )
+static const SfxFilter* impl_getExportFilterFromUrl(
+const rtl::OUString& rUrl, const rtl::OUString& rFactory)
 {
 try
 {
@@ -146,10 +147,8 @@ try
 OUString aTempName;
 FileBase::getSystemPathFromFileURL( rUrl, aTempName );
 OString aSource = OUStringToOString ( aTempName, 
osl_getThreadTextEncoding() );
-OString aFactory = OUStringToOString ( rFactory, 
osl_getThreadTextEncoding() );
-std::cerr << "Error:  no export filter for " << aSource << " found, 
now using the default filter for " << aFactory << std::endl;
+std::cerr << "Error: no export filter for " << aSource << " found, 
aborting." << std::endl;
 
-pFilter = SfxFilter::GetDefaultFilterFromFactory( rFactory );
 }
 
 return pFilter;
@@ -539,75 +538,82 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList& aDispatchRequ
 aFilter = impl_GuessFilter( aOutFile, 
aDocService );
 }
 
-sal_Int32 nFilterOptionsIndex = aFilter.indexOf( 
':' );
-Sequence conversionProperties( 0 < 
nFilterOptionsIndex ? 3 : 2 );
-conversionProperties[0].Name = "Overwrite";
-conversionProperties[0].Value <<= sal_True;
-
-conversionProperties[1].Name = "FilterName";
-if( 0 < nFilterOptionsIndex )
+if (aFilter.isEmpty())
 {
-conversionProperties[1].Value <<= 
aFilter.copy( 0, nFilterOptionsIndex );
-
-conversionProperties[2].Name = "FilterOptions";
-conversionProperties[2].Value <<= 
aFilter.copy( nFilterOptionsIndex+1 );
+std::cerr << "Error: no export filter" << 
std::endl;
 }
 else
 {
-conversionProperties[1].Value <<= aFilter;
-}
+sal_Int32 nFilterOptionsIndex = 
aFilter.indexOf(':');
+Sequence conversionProperties( 
0 < nFilterOptionsIndex ? 3 : 2 );
+conversionProperties[0].Name = "Overwrite";
+conversionProperties[0].Value <<= sal_True;
 
-OUString aTempName;
-FileBase::getSystemPathFromFileURL( aName, 
aTempName );
-OString aSource8 = OUStringToOString ( aTempName, 
osl_getThreadTextEncoding() );
-FileBase::getSystemPathFromFileURL( aOutFile, 
aTempName );
-OString aTargetURL8 = OUStringToOString(aTempName, 
osl_getThreadTextEncoding() );
-if( aDispatchRequest.aRequestType != REQUEST_CAT )
-{
-std::cout << "convert " << aSource8 << " -> " 
<< aTargetURL8;
-std::cout << " using filter : " << 
OUStringToOString( aFilter, osl_getThreadTextEncoding() ) << std::endl;
-if( FStatHelper::IsDocument( aOutFile ) )
-std::cout << "Overwriting: " << 
OUStringToOString( aTempName, osl_getThreadTextEncoding() ) << std::endl ;
-}
-try
-{
-xStorable->storeToURL( aOutFile, 
conversionProperties );
-}
-catch (const Exception& rException)
-{
-std::cerr << "Error: Please verify input 
parameters...";
-if 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/vcl libreofficekit/qa sc/inc sc/source

2015-10-30 Thread Miklos Vajna
 desktop/source/lib/init.cxx |   18 ++
 include/vcl/ITiledRenderable.hxx|8 +
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |  128 +++-
 sc/inc/docuno.hxx   |3 
 sc/source/ui/inc/tabview.hxx|2 
 sc/source/ui/unoobj/docuno.cxx  |   13 ++
 sc/source/ui/view/tabview.cxx   |   29 
 7 files changed, 199 insertions(+), 2 deletions(-)

New commits:
commit ecef9cb66c5f6009c7b062b489f93de85b70beeb
Author: Miklos Vajna 
Date:   Fri Oct 30 12:34:38 2015 +0100

gtktiledviewer: initial row headers for spreadsheet documents

Change-Id: Iec9080d7017ddcf2b605243bc820f9664110c2e8

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 8b81c73..8d6d172 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -32,6 +32,37 @@ static int help()
 return 1;
 }
 
+/// Represents the row header widget for spreadsheets.
+class TiledRowBar
+{
+public:
+/// Stores size and content of a single row header.
+struct Header
+{
+int m_nSize;
+std::string m_aText;
+Header(int nSize, const std::string& rText)
+: m_nSize(nSize),
+m_aText(rText)
+{
+}
+};
+
+static const int HEADER_WIDTH = 50;
+
+GtkWidget* m_pDrawingArea;
+std::vector m_aHeaders;
+int m_nHeightPixel = 0;
+
+TiledRowBar(GtkWidget* pDocView);
+static gboolean draw(GtkWidget* pWidget, cairo_t* pCairo, gpointer pData);
+gboolean drawImpl(GtkWidget* pWidget, cairo_t* pCairo);
+static gboolean docConfigureEvent(GtkWidget* pWidget, GdkEventConfigure* 
pEvent, gpointer pData);
+gboolean docConfigureEventImpl(GtkWidget* pWidget, GdkEventConfigure* 
pEvent);
+/// Draws rText at the center of rRectangle on pCairo.
+void drawText(cairo_t* pCairo, const GdkRectangle& rRectangle, const 
std::string& rText);
+};
+
 /// Represents all the state that is specific to one GtkWindow of this app.
 class TiledWindow
 {
@@ -56,6 +87,7 @@ public:
 GtkWidget* m_pFindbarEntry;
 GtkWidget* m_pFindbarLabel;
 bool m_bFindAll;
+std::shared_ptr m_pRowBar;
 
 TiledWindow()
 : m_pDocView(0),
@@ -92,6 +124,92 @@ static TiledWindow& lcl_getTiledWindow(GtkWidget* pWidget)
 return g_aWindows[pToplevel];
 }
 
+TiledRowBar::TiledRowBar(GtkWidget* pDocView)
+: m_pDrawingArea(gtk_drawing_area_new()),
+m_nHeightPixel(0)
+{
+gtk_widget_set_size_request(m_pDrawingArea, HEADER_WIDTH, -1);
+g_signal_connect(m_pDrawingArea, "draw", G_CALLBACK(TiledRowBar::draw), 
this);
+g_signal_connect(pDocView, "configure-event", 
G_CALLBACK(TiledRowBar::docConfigureEvent), this);
+}
+
+gboolean TiledRowBar::draw(GtkWidget* pWidget, cairo_t* pCairo, gpointer pData)
+{
+return static_cast(pData)->drawImpl(pWidget, pCairo);
+}
+
+void TiledRowBar::drawText(cairo_t* pCairo, const GdkRectangle& rRectangle, 
const std::string& rText)
+{
+cairo_text_extents_t extents;
+cairo_text_extents(pCairo, rText.c_str(), );
+// Cairo reference point for text is the bottom left corner.
+cairo_move_to(pCairo, rRectangle.x + rRectangle.width / 2 - extents.width 
/ 2, rRectangle.y + rRectangle.height / 2 + extents.height / 2);
+cairo_show_text(pCairo, rText.c_str());
+}
+
+gboolean TiledRowBar::drawImpl(GtkWidget* /*pWidget*/, cairo_t* pCairo)
+{
+cairo_set_source_rgb(pCairo, 0, 0, 0);
+
+int nTotal = 0;
+for (const Header& rHeader : m_aHeaders)
+{
+GdkRectangle aRectangle;
+aRectangle.x = 0;
+aRectangle.y = nTotal - 1;
+aRectangle.width = HEADER_WIDTH - 1;
+aRectangle.height = rHeader.m_nSize;
+// Bottom line.
+cairo_rectangle(pCairo, aRectangle.x, aRectangle.y + 
aRectangle.height, aRectangle.width, 1);
+cairo_fill(pCairo);
+// Left line.
+cairo_rectangle(pCairo, aRectangle.width, aRectangle.y, 1, 
aRectangle.height);
+cairo_fill(pCairo);
+drawText(pCairo, aRectangle, rHeader.m_aText);
+nTotal += rHeader.m_nSize;
+if (nTotal > m_nHeightPixel)
+break;
+}
+
+return FALSE;
+}
+
+gboolean TiledRowBar::docConfigureEvent(GtkWidget* pWidget, GdkEventConfigure* 
pEvent, gpointer pData)
+{
+return static_cast(pData)->docConfigureEventImpl(pWidget, 
pEvent);
+}
+
+gboolean TiledRowBar::docConfigureEventImpl(GtkWidget* pDocView, 
GdkEventConfigure* /*pEvent*/)
+{
+if (g_aWindows.find(gtk_widget_get_toplevel(pDocView)) == g_aWindows.end())
+return TRUE;
+
+TiledWindow& rWindow = lcl_getTiledWindow(pDocView);
+GtkAdjustment* pVAdjustment = 

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

2015-10-10 Thread Caolán McNamara
 desktop/source/app/app.cxx|   35 ++-
 vcl/source/app/svapp.cxx  |   13 ++---
 vcl/source/fontsubset/sft.cxx |6 --
 3 files changed, 36 insertions(+), 18 deletions(-)

New commits:
commit 3a03ee49e7cced375decefd336294632180414e4
Author: Caolán McNamara 
Date:   Sat Oct 10 12:52:58 2015 +0100

afl-eventtesting: there is no focused/active window in headless mode

so close all open frames, not just the active one
and send events to the first discovered visible window and not the focus
window

Change-Id: I7339bc6743cd3106ceddea049136796121819eb3

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 79b3c86..a3b436d 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1282,23 +1282,32 @@ unsigned int persist_cnt;
 //the application post start-up for ui-testing
 void Desktop::CloseFrameAndReopen(Reference xDesktop)
 {
-Reference xFrame = xDesktop->getActiveFrame();
-Reference xProvider(xFrame, 
css::uno::UNO_QUERY);
+css::uno::Reference xTaskContainer(
+xDesktop->getFrames(), css::uno::UNO_QUERY_THROW);
+sal_Int32 c = xTaskContainer->getCount();
+for (sal_Int32 i = 0; i < c; ++i)
+{
+css::uno::Reference< css::frame::XFrame > xFrame;
+xTaskContainer->getByIndex(i) >>= xFrame;
+if (!xFrame.is())
+continue;
+Reference xProvider(xFrame, 
css::uno::UNO_QUERY);
 
-css::uno::Reference xController = 
xFrame->getController();
-css::uno::Reference xModel = xController->getModel();
-css::uno::Reference< css::util::XModifiable > xModifiable(xModel, 
css::uno::UNO_QUERY);
-xModifiable->setModified(false);
+css::uno::Reference xController = 
xFrame->getController();
+css::uno::Reference xModel = 
xController->getModel();
+css::uno::Reference< css::util::XModifiable > xModifiable(xModel, 
css::uno::UNO_QUERY);
+xModifiable->setModified(false);
 
-css::util::URL aCommand;
-aCommand.Complete = ".uno:CloseDoc";
+css::util::URL aCommand;
+aCommand.Complete = ".uno:CloseDoc";
 
-css::uno::Reference xContext = 
::comphelper::getProcessComponentContext();
-Reference< css::util::XURLTransformer > xParser = 
css::util::URLTransformer::create(xContext);
-xParser->parseStrict(aCommand);
+css::uno::Reference xContext = 
::comphelper::getProcessComponentContext();
+Reference< css::util::XURLTransformer > xParser = 
css::util::URLTransformer::create(xContext);
+xParser->parseStrict(aCommand);
 
-css::uno::Reference< css::frame::XDispatch > xDispatch = 
xProvider->queryDispatch(aCommand, OUString(), 0);
-xDispatch->dispatch(aCommand, css::uno::Sequence< 
css::beans::PropertyValue >());
+css::uno::Reference< css::frame::XDispatch > xDispatch = 
xProvider->queryDispatch(aCommand, OUString(), 0);
+xDispatch->dispatch(aCommand, css::uno::Sequence< 
css::beans::PropertyValue >());
+}
 
 OpenDefault();
 }
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index a583307..1d92469 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -347,9 +347,16 @@ namespace
 {
 bool InjectKeyEvent(SvStream& rStream)
 {
-VclPtr xWin(Application::GetFocusWindow());
-if (!xWin)
-xWin.reset(Application::GetActiveTopWindow());
+if (Application::AnyInput())
+return false;
+
+VclPtr xWin(Application::GetFirstTopLevelWindow());
+while (xWin)
+{
+if (xWin->IsVisible())
+break;
+xWin.reset(Application::GetNextTopLevelWindow(xWin));
+}
 if (!xWin)
 return false;
 
commit b78d4c6503ff47177316685aae79cb5eaf55e33a
Author: Caolán McNamara 
Date:   Sat Oct 10 12:27:32 2015 +0100

valgrind: zero padding bytes

uninitialized memory warnings on --convert-to pdf
of ooo115771-3.doc

Change-Id: I2dac6fe29d23d6e25c2f1d1511886d8b585e498c

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 171d910..ac999a6 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2631,8 +2631,10 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, 
sal_uInt32 glyphID)
 
 if (length > 0) {
 const sal_uInt8* srcptr = glyf + ttf->goffsets[glyphID];
-d->ptr = static_cast(malloc((length + 1) & ~1)); 
assert(d->ptr != 0);
-memcpy( d->ptr, srcptr, length );
+const size_t nChunkLen = ((length + 1) & ~1);
+d->ptr = static_cast(malloc(nChunkLen)); assert(d->ptr != 
0);
+memcpy(d->ptr, srcptr, length);
+memset(d->ptr + length, 0, nChunkLen - length);
 d->compflag = (GetInt16( srcptr, 0, 1 ) < 0);
 } else {
 d->ptr = 0;
___

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

2015-10-09 Thread Caolán McNamara
 desktop/source/app/appinit.cxx   |6 +++---
 sc/source/core/tool/interpr3.cxx |5 -
 2 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit d2a07cd3214af27c5af601992e3c4a1a6e3b3dad
Author: Caolán McNamara 
Date:   Fri Oct 9 16:35:33 2015 +0100

crashtestig: infinite recurse in ooo32833-1.sxc

integralPhi is called with nan(0xf01f6)
which recurses through rtl_math_erfc->rtl_math_erf->rtl_math_erfc
until we run out of stack

Change-Id: Iab8a22fb23686d22d151f2508dbeb44ab47a76b7

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index ab9efe9..3f04e4d 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -1599,7 +1599,10 @@ void ScInterpreter::ScLogNormDist( int nMinParamCount ) 
//expanded, see #i100119
 
 void ScInterpreter::ScStdNormDist()
 {
-PushDouble(integralPhi(GetDouble()));
+double fVal = GetDouble();
+if (!rtl::math::isNan(fVal))
+fVal = integralPhi(fVal);
+PushDouble(fVal);
 }
 
 void ScInterpreter::ScStdNormDist_MS()
commit 6f70f1c04dbe8c1b11227781b20b50e5b10c93d6
Author: Caolán McNamara 
Date:   Fri Oct 9 16:35:19 2015 +0100

afl-eventtesting: we want to allow dialogs in ui-testing mode

Change-Id: Ibd7f88734492c4336e8a92ebbf9c70afdb7b3b5c

diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index b321eef..c41880e 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -97,9 +97,9 @@ void Desktop::RegisterServices(Reference< XComponentContext > 
const & context)
 // interpret command line arguments
 CommandLineArgs& rCmdLine = GetCommandLineArgs();
 
-// Headless mode for FAT Office
-bool bHeadlessMode = rCmdLine.IsHeadless();
-if ( bHeadlessMode )
+// Headless mode for FAT Office, auto cancels any dialogs that popup
+bool bHeadlessMode = rCmdLine.IsHeadless() && 
!rCmdLine.IsEventTesting();
+if (bHeadlessMode)
 Application::EnableHeadlessMode(false);
 
 // read accept string from configuration
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source vcl/inc vcl/source vcl/test vcl/workben

2015-10-06 Thread Caolán McNamara
 desktop/source/app/cmdlineargs.cxx |1 
 vcl/inc/svdata.hxx |6 +++
 vcl/source/app/svapp.cxx   |   65 +
 vcl/test/makefile.mk   |   64 
 vcl/workben/README.eventtesting|   13 +++
 vcl/workben/eventtesting   |binary
 6 files changed, 85 insertions(+), 64 deletions(-)

New commits:
commit 2ad231f9e90071ad2d83dae7a879ce1295db39ee
Author: Caolán McNamara 
Date:   Tue Oct 6 16:18:18 2015 +0100

experimental afl driven ui testing

Change-Id: I1933951c52adc75ed36db2c083c232f29b6140d6

diff --git a/desktop/source/app/cmdlineargs.cxx 
b/desktop/source/app/cmdlineargs.cxx
index 1aab714..a388f7d 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -494,6 +494,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& 
supplier )
 // vcl/unx/generic/app/sm.cxx:
 oArg != "session=" &&
 #endif
+oArg != "eventtesting" &&
 //ignore additional legacy options that don't do anything 
anymore
 oArg != "nocrashreport" &&
 m_unknown.isEmpty())
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 52ea411..87e6589 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -31,6 +31,7 @@
 #include "tools/debug.hxx"
 #include "tools/solar.h"
 #include "vcl/bitmapex.hxx"
+#include "vcl/idle.hxx"
 #include "vcl/dllapi.h"
 #include "vcl/keycod.hxx"
 #include "vcl/svapp.hxx"
@@ -156,7 +157,12 @@ struct ImplSVAppData
  */
 ImeStatusWindowMode meShowImeStatusWindow;
 
+SvFileStream*   mpEventTestInput;
+Idle*   mpEventTestingIdle;
+int mnEventTestLimit;
+
 DECL_STATIC_LINK_TYPED( ImplSVAppData, ImplQuitMsg, void*, void );
+DECL_LINK_TYPED(VclEventTestingHdl, Idle*, void);
 };
 
 struct ImplSVGDIData
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 320ea64..7fb612b 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -327,11 +327,76 @@ const vcl::KeyCode* Application::GetReservedKeyCode( 
sal_uLong i )
 return ::get()->first[i].mKeyCode;
 }
 
+namespace
+{
+bool InjectKeyEvent(SvStream& rStream)
+{
+VclPtr xWin(Application::GetActiveTopWindow());
+if (!xWin)
+return false;
+
+SalKeyEvent aKeyEvent;
+rStream.ReadUInt64(aKeyEvent.mnTime);
+rStream.ReadUInt16(aKeyEvent.mnCode);
+rStream.ReadUInt16(aKeyEvent.mnCharCode);
+rStream.ReadUInt16(aKeyEvent.mnRepeat);
+if (!rStream.good())
+return false;
+
+ImplWindowFrameProc(xWin.get(), NULL, SALEVENT_KEYINPUT, );
+ImplWindowFrameProc(xWin.get(), NULL, SALEVENT_KEYUP, );
+return true;
+}
+}
+
+IMPL_LINK_NOARG_TYPED(ImplSVAppData, VclEventTestingHdl, Idle *, void)
+{
+SAL_INFO("vcl.eventtesting", "EventTestLimit is " << mnEventTestLimit);
+if (mnEventTestLimit == 0)
+{
+delete mpEventTestInput;
+delete mpEventTestingIdle;
+SAL_INFO("vcl.eventtesting", "Event Limit reached, exiting" << 
mnEventTestLimit);
+Application::Quit();
+}
+else
+{
+Scheduler::ProcessTaskScheduling(true);
+if (InjectKeyEvent(*mpEventTestInput))
+--mnEventTestLimit;
+if (!mpEventTestInput->good())
+{
+delete mpEventTestInput;
+delete mpEventTestingIdle;
+SAL_INFO("vcl.eventtesting", "Event Input exhausted, exiting" << 
mnEventTestLimit);
+Application::Quit();
+return;
+}
+Scheduler::ProcessTaskScheduling(true);
+mpEventTestingIdle->Start();
+}
+}
+
 void Application::Execute()
 {
 ImplSVData* pSVData = ImplGetSVData();
 pSVData->maAppData.mbInAppExecute = true;
 
+sal_uInt16 n = GetCommandLineParamCount();
+for (sal_uInt16 i = 0; i != n; ++i)
+{
+if (GetCommandLineParam(i) == "--eventtesting")
+{
+pSVData->maAppData.mnEventTestLimit = 10;
+pSVData->maAppData.mpEventTestingIdle = new Idle("eventtesting");
+
pSVData->maAppData.mpEventTestingIdle->SetIdleHdl(LINK(&(pSVData->maAppData), 
ImplSVAppData, VclEventTestingHdl));
+
pSVData->maAppData.mpEventTestingIdle->SetPriority(SchedulerPriority::LOWEST);
+pSVData->maAppData.mpEventTestInput = new 
SvFileStream("eventtesting", StreamMode::READ);
+pSVData->maAppData.mpEventTestingIdle->Start();
+break;
+}
+}
+
 while ( !pSVData->maAppData.mbAppQuit )
 Application::Yield();
 
diff --git a/vcl/workben/README.eventtesting b/vcl/workben/README.eventtesting
new file mode 100644
index 000..0336f22
--- /dev/null
+++ b/vcl/workben/README.eventtesting
@@ -0,0 +1,13 @@
+Notes on experimental afl driven ui 

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

2015-10-01 Thread Miklos Vajna
 desktop/source/lib/init.cxx |   24 +++-
 include/vcl/virdev.hxx  |2 ++
 sw/source/uibase/config/viewopt.cxx |3 +++
 vcl/source/gdi/virdev.cxx   |   12 
 4 files changed, 36 insertions(+), 5 deletions(-)

New commits:
commit 4fe010cce872ef035fec376298e416f9799c4a21
Author: Miklos Vajna 
Date:   Thu Oct 1 16:43:00 2015 +0200

sw tiled rendering: default to transparent background outside page frames

Change-Id: Ie018a878eb7d7ef14a80a6b86020c114ff14da88

diff --git a/sw/source/uibase/config/viewopt.cxx 
b/sw/source/uibase/config/viewopt.cxx
index 6f29c45..d309671 100644
--- a/sw/source/uibase/config/viewopt.cxx
+++ b/sw/source/uibase/config/viewopt.cxx
@@ -39,6 +39,7 @@
 #include 
 
 #include 
+#include 
 
 #ifdef DBG_UTIL
 bool SwViewOption::s_bTest9 = false;//DrawingLayerNotLoading
@@ -209,6 +210,8 @@ SwViewOption::SwViewOption() :
 m_bTest1 = m_bTest2 = m_bTest3 = m_bTest4 =
  m_bTest5 = m_bTest6 = m_bTest7 = m_bTest8 = m_bTest10 = false;
 #endif
+if (comphelper::LibreOfficeKit::isActive())
+aAppBackgroundColor = COL_TRANSPARENT;
 }
 
 SwViewOption::SwViewOption(const SwViewOption& rVOpt)
commit 1d3b613318654ceb2d34996ef8ca653cfe32a8ea
Author: Miklos Vajna 
Date:   Thu Oct 1 14:17:21 2015 +0200

desktop, vcl: support transparency in VirtualDevices with user-provided 
memory

Change-Id: I65c31995c02a644aa436aecd065255fab38045e4

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 509983c..e902df0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -755,10 +755,21 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
 InitSvpForLibreOfficeKit();
 
 ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), 
(sal_uInt16)32) ;
+
+// Set background to transparent by default.
+memset(pBuffer, 0, nCanvasWidth * nCanvasHeight * 4);
+pDevice->SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
+
 boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() 
);
+
+// Allocate a separate buffer for the alpha device.
+std::vector aAlpha(nCanvasWidth * nCanvasHeight);
+memset(aAlpha.data(), 0, nCanvasWidth * nCanvasHeight);
+boost::shared_array aAlphaBuffer(aAlpha.data(), 
NoDelete());
+
 pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
 Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
-aBuffer, true );
+aBuffer, aAlphaBuffer, true );
 
 pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
@@ -772,6 +783,17 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
 #endif
 
+// Overwrite pBuffer's alpha channel with the separate alpha buffer.
+for (int nRow = 0; nRow < nCanvasHeight; ++nRow)
+{
+for (int nCol = 0; nCol < nCanvasWidth; ++nCol)
+{
+const int nOffset = (nCanvasHeight * nRow) + nCol;
+// VCL's transparent is 0, RGBA's transparent is 0xff.
+pBuffer[nOffset * 4 +3] = 0xff - aAlpha[nOffset];
+}
+}
+
 static bool bDebug = getenv("LOK_DEBUG") != 0;
 if (bDebug)
 {
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
index ef86e5d..669a224 100644
--- a/include/vcl/virdev.hxx
+++ b/include/vcl/virdev.hxx
@@ -48,6 +48,7 @@ private:
  const bool bTopDown );
 SAL_DLLPRIVATE bool ImplSetOutputSizePixel( const Size& rNewSize, bool 
bErase,
 const 
basebmp::RawMemorySharedArray ,
+const 
basebmp::RawMemorySharedArray ,
 const bool bTopDown );
 
 VirtualDevice (const VirtualDevice &) SAL_DELETED_FUNCTION;
@@ -126,6 +127,7 @@ public:
 const 
Fraction& rScale,
 const Point& 
rNewOffset,
 const 
basebmp::RawMemorySharedArray ,
+const 
basebmp::RawMemorySharedArray ,
 const bool 
bTopDown = false );
 boolSetOutputSize( const Size& rNewSize, bool bErase = 
true )
 { return SetOutputSizePixel( LogicToPixel( 
rNewSize ), bErase ); }
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index 7319a1f..5cdb706 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -393,6 +393,7 @@ void VirtualDevice::ImplFillOpaqueRectangle( const 
Rectangle& rRect )
 
 

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

2015-09-15 Thread Marco Cecchetti
 desktop/source/lib/init.cxx  |   23 +--
 include/vcl/opengl/OpenGLContext.hxx |   18 +-
 include/vcl/opengl/OpenGLHelper.hxx  |6 
 vcl/inc/opengl/program.hxx   |3 
 vcl/inc/opengl/win/WinDeviceInfo.hxx |   46 ++
 vcl/inc/opengl/x11/X11DeviceInfo.hxx |   26 +++
 vcl/opengl/program.cxx   |7 
 vcl/source/opengl/OpenGLContext.cxx  |   34 +---
 vcl/source/opengl/OpenGLHelper.cxx   |  267 ++-
 9 files changed, 376 insertions(+), 54 deletions(-)

New commits:
commit d8f78d624b779244f5953fd32960c4f487e320d3
Author: Marco Cecchetti 
Date:   Sun Sep 13 12:15:13 2015 +0200

tdf#93814: Added support for caching shader program binaries.

Change-Id: I21c844b47282f6b3eec443933a86421a074e24df
Reviewed-on: https://gerrit.libreoffice.org/18555
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/opengl/OpenGLContext.hxx 
b/include/vcl/opengl/OpenGLContext.hxx
index ecc5038..b2aaa17 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -55,10 +55,13 @@ class NSOpenGLView;
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
+#include 
 #include 
+#include 
 
 class OpenGLFramebuffer;
 class OpenGLProgram;
@@ -271,15 +274,16 @@ private:
 OpenGLFramebuffer* mpFirstFramebuffer;
 OpenGLFramebuffer* mpLastFramebuffer;
 
-struct ProgramKey
+struct ProgramHash
 {
-ProgramKey( const OUString& vertexShader, const OUString& 
fragmentShader, const OString& preamble );
-bool operator< ( const ProgramKey& other ) const;
-OUString vertexShader;
-OUString fragmentShader;
-OString preamble;
+size_t operator()( const rtl::OString& aDigest ) const
+{
+return (size_t)( rtl_crc32( 0, aDigest.getStr(), 
aDigest.getLength() ) );
+}
 };
-std::map maPrograms;
+
+typedef std::unordered_map< rtl::OString, std::shared_ptr, 
ProgramHash > ProgramCollection;
+ProgramCollection maPrograms;
 OpenGLProgram* mpCurrentProgram;
 #ifdef DBG_UTIL
 std::set maParents;
diff --git a/include/vcl/opengl/OpenGLHelper.hxx 
b/include/vcl/opengl/OpenGLHelper.hxx
index a4729a7..50783f2 100644
--- a/include/vcl/opengl/OpenGLHelper.hxx
+++ b/include/vcl/opengl/OpenGLHelper.hxx
@@ -39,7 +39,11 @@ struct VCL_DLLPUBLIC OpenGLHelper
 {
 OpenGLHelper() SAL_DELETED_FUNCTION; // Should not be instantiated
 
-static GLint LoadShaders(const OUString& rVertexShaderName, const 
OUString& rFragmentShaderName, const OString& preamble = "" );
+public:
+
+static rtl::OString GetDigest(const OUString& rVertexShaderName, const 
OUString& rFragmentShaderName, const rtl::OString& preamble = "" );
+
+static GLint LoadShaders(const OUString& rVertexShaderName, const 
OUString& rFragmentShaderName, const rtl::OString& preamble = "", const 
rtl::OString& rDigest = "" );
 
 /**
  * The caller is responsible for allocate the memory for the RGBA buffer, 
before call
diff --git a/vcl/inc/opengl/program.hxx b/vcl/inc/opengl/program.hxx
index 7bdd43d..3a47512 100644
--- a/vcl/inc/opengl/program.hxx
+++ b/vcl/inc/opengl/program.hxx
@@ -50,7 +50,8 @@ public:
 OpenGLProgram();
 ~OpenGLProgram();
 
-bool Load( const OUString& rVertexShader, const OUString& rFragmentShader, 
const OString& preamble = "" );
+bool Load( const OUString& rVertexShader, const OUString& rFragmentShader,
+   const rtl::OString& preamble = "", const rtl::OString& rDigest 
= "" );
 bool Use();
 bool Clean();
 
diff --git a/vcl/inc/opengl/win/WinDeviceInfo.hxx 
b/vcl/inc/opengl/win/WinDeviceInfo.hxx
index 0c60b35..a400404 100644
--- a/vcl/inc/opengl/win/WinDeviceInfo.hxx
+++ b/vcl/inc/opengl/win/WinDeviceInfo.hxx
@@ -61,6 +61,7 @@ bool ParseDriverVersion(const OUString& rString, uint64_t& 
rVersion);
 
 struct DriverInfo
 {
+
 DriverInfo(OperatingSystem os, const OUString& vendor, VersionComparisonOp 
op,
 uint64_t driverVersion, bool bWhiteListed = false, const char 
*suggestedVersion = nullptr);
 
@@ -159,6 +160,51 @@ public:
 virtual ~WinOpenGLDeviceInfo();
 
 virtual bool isDeviceBlocked();
+
+const OUString& GetDriverVersion() const
+{
+return maDriverVersion;
+}
+
+const OUString& GetDriverDate() const
+{
+return maDriverDate;
+}
+
+const OUString& GetDeviceID() const
+{
+return maDeviceID;
+}
+
+const OUString& GetAdapterVendorID() const
+{
+return maAdapterVendorID;
+}
+
+const OUString& GetAdapterDeviceID() const
+{
+return maAdapterDeviceID;
+}
+
+const OUString& GetAdapterSubsysID() const
+{
+return maAdapterSubsysID;
+}
+const OUString& GetDeviceKey() const
+{
+return maDeviceKey;
+}
+
+  

[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit libreofficekit/qa

2015-09-04 Thread Mihai Varga
 desktop/source/lib/init.cxx   |   26 ++
 include/LibreOfficeKit/LibreOfficeKit.h   |2 +-
 include/LibreOfficeKit/LibreOfficeKit.hxx |9 ++---
 libreofficekit/qa/unit/tiledrendering.cxx |8 ++--
 4 files changed, 35 insertions(+), 10 deletions(-)

New commits:
commit d3c93279667badf0c0feb927e9c46af97a538d84
Author: Mihai Varga 
Date:   Fri Sep 4 11:55:47 2015 +0300

LOK: allow float numbers in json -> property value conversion

Change-Id: I866a44fcb71044d27a9bf06e2f55ca2e4135c23b

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 44a9e19..f15417c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -772,6 +772,8 @@ static void jsonToPropertyValues(const char* pJSON, 
uno::Sequence
Date:   Fri Sep 4 10:27:58 2015 +0300

LOK: added a general getCommandValues method

This method returns a JSON mapping of the posible values for the given
command (e.g. .uno:StyleApply, etc).

returns:
{commandName: "cmdName", commandValues: {json_of_cmd_values}}

Change-Id: Ic8f970d077af6be9bc226f72f725b6cdf2d4c160

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 51302d1..44a9e19 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -235,7 +235,7 @@ static void doc_setGraphicSelection 
(LibreOfficeKitDocument* pThis,
   int nX,
   int nY);
 static void doc_resetSelection (LibreOfficeKitDocument* pThis);
-static char* doc_getStyles(LibreOfficeKitDocument* pThis);
+static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* 
pCommand);
 
 struct LibLODocument_Impl : public _LibreOfficeKitDocument
 {
@@ -270,7 +270,7 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument
 m_pDocumentClass->getTextSelection = doc_getTextSelection;
 m_pDocumentClass->setGraphicSelection = doc_setGraphicSelection;
 m_pDocumentClass->resetSelection = doc_resetSelection;
-m_pDocumentClass->getStyles = doc_getStyles;
+m_pDocumentClass->getCommandValues = doc_getCommandValues;
 
 gDocumentClass = m_pDocumentClass;
 }
@@ -868,15 +868,17 @@ static void doc_resetSelection(LibreOfficeKitDocument* 
pThis)
 pDoc->resetSelection();
 }
 
-static char* doc_getStyles(LibreOfficeKitDocument* pThis)
+static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
 {
 LibLODocument_Impl* pDocument = static_cast(pThis);
 
 boost::property_tree::ptree aTree;
+aTree.put("commandName", pCommand);
 uno::Reference 
xStyleFamiliesSupplier(pDocument->mxComponent, uno::UNO_QUERY);
 uno::Reference 
xStyleFamilies(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY);
 uno::Sequence aStyleFamilies = xStyleFamilies->getElementNames();
 
+boost::property_tree::ptree aValues;
 for (sal_Int32 nStyleFam = 0; nStyleFam < aStyleFamilies.getLength(); 
++nStyleFam)
 {
 boost::property_tree::ptree aChildren;
@@ -889,8 +891,9 @@ static char* doc_getStyles(LibreOfficeKitDocument* pThis)
 aChild.put("", aStyles[nInd]);
 aChildren.push_back(std::make_pair("", aChild));
 }
-aTree.add_child(sStyleFam.toUtf8().getStr(), aChildren);
+aValues.add_child(sStyleFam.toUtf8().getStr(), aChildren);
 }
+aTree.add_child("commandValues", aValues);
 std::stringstream aStream;
 boost::property_tree::write_json(aStream, aTree);
 char* pJson = static_cast(malloc(aStream.str().size() + 1));
@@ -898,6 +901,19 @@ static char* doc_getStyles(LibreOfficeKitDocument* pThis)
 pJson[aStream.str().size()] = '\0';
 return pJson;
 }
+
+static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* 
pCommand)
+{
+if (!strcmp(pCommand, ".uno:StyleApply"))
+{
+return getStyles(pThis, pCommand);
+}
+else {
+gImpl->maLastExceptionMsg = "Unknown command, no values returned";
+return NULL;
+}
+}
+
 static char* lo_getError (LibreOfficeKit *pThis)
 {
 LibLibreOffice_Impl* pLib = static_cast(pThis);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index af7155c..8060f0e 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -161,7 +161,7 @@ struct _LibreOfficeKitDocumentClass
 void (*resetSelection) (LibreOfficeKitDocument* pThis);
 
 /// @see lok::Document:getStyles
-char* (*getStyles) (LibreOfficeKitDocument* pThis);
+char* (*getCommandValues) (LibreOfficeKitDocument* pThis, const char* 
pCommand);
 #endif // LOK_USE_UNSTABLE_API
 };
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index c526bda..4459994 100644
--- 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/tools include/vcl svl/qa svtools/source tools/source vcl/source

2015-07-15 Thread Michael Stahl
 desktop/source/deployment/manager/dp_manager.cxx  |5 
 desktop/source/deployment/registry/component/dp_component.cxx |   22 -
 desktop/source/deployment/registry/package/dp_package.cxx |   11 
 include/tools/inetmime.hxx|  148 --
 include/vcl/btndlg.hxx|6 
 svl/qa/unit/test_INetContentType.cxx  |   12 
 svtools/source/svhtml/parhtml.cxx |5 
 tools/source/inet/inetmime.cxx|   29 -
 vcl/source/window/btndlg.cxx  |   51 +--
 9 files changed, 133 insertions(+), 156 deletions(-)

New commits:
commit 7068b56ba93470c9329e2537fa24b1b1a11487fa
Author: Michael Stahl mst...@redhat.com
Date:   Wed Jul 15 23:43:38 2015 +0200

vcl: replace boost::ptr_vector with std::vectorstd::unique_ptr

Change-Id: I11bd73ff134895d05c7ce054b5ef26829a3bf8c3

diff --git a/include/vcl/btndlg.hxx b/include/vcl/btndlg.hxx
index 5328084..33b86e9 100644
--- a/include/vcl/btndlg.hxx
+++ b/include/vcl/btndlg.hxx
@@ -20,11 +20,13 @@
 #ifndef INCLUDED_VCL_BTNDLG_HXX
 #define INCLUDED_VCL_BTNDLG_HXX
 
-#include boost/ptr_container/ptr_vector.hpp
 #include vcl/dllapi.h
 #include vcl/dialog.hxx
 #include o3tl/typed_flags_set.hxx
 
+#include vector
+#include memory
+
 struct ImplBtnDlgItem;
 class PushButton;
 
@@ -81,7 +83,7 @@ private:
 ButtonDialog operator=( const ButtonDialog ) 
SAL_DELETED_FUNCTION;
 
 private:
-boost::ptr_vectorImplBtnDlgItem maItemList;
+std::vectorstd::unique_ptrImplBtnDlgItem m_ItemList;
 SizemaPageSize;
 SizemaCtrlSize;
 longmnButtonSize;
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index 6b141fe..ec98f89 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -24,8 +24,6 @@
 #include vcl/button.hxx
 #include vcl/btndlg.hxx
 
-typedef boost::ptr_vectorImplBtnDlgItem::iterator btn_iterator;
-typedef boost::ptr_vectorImplBtnDlgItem::const_iterator btn_const_iterator;
 
 struct ImplBtnDlgItem
 {
@@ -64,12 +62,12 @@ ButtonDialog::~ButtonDialog()
 
 void ButtonDialog::dispose()
 {
-for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+for (auto  it : m_ItemList)
 {
 if ( it-mbOwnButton )
 it-mpPushButton.disposeAndClear();
 }
-maItemList.clear();
+m_ItemList.clear();
 Dialog::dispose();
 }
 
@@ -97,7 +95,7 @@ VclPtrPushButton ButtonDialog::ImplCreatePushButton( 
ButtonDialogFlags nBtnFla
 
 ImplBtnDlgItem* ButtonDialog::ImplGetItem( sal_uInt16 nId ) const
 {
-for ( btn_const_iterator it = maItemList.begin(); it != maItemList.end(); 
++it)
+for (auto  it : m_ItemList)
 {
 if (it-mnId == nId)
 return const_castImplBtnDlgItem*((*it));
@@ -116,7 +114,7 @@ long ButtonDialog::ImplGetButtonSize()
 long nSepSize = 0;
 maCtrlSize = Size( IMPL_MINSIZE_BUTTON_WIDTH, IMPL_MINSIZE_BUTTON_HEIGHT );
 
-for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+for (auto  it : m_ItemList)
 {
 nSepSize += nLastSepSize;
 
@@ -140,7 +138,7 @@ long ButtonDialog::ImplGetButtonSize()
 nLastSepSize = IMPL_SEP_BUTTON_Y;
 }
 
-long nButtonCount = maItemList.size();
+size_t const nButtonCount = m_ItemList.size();
 
 if ( GetStyle()  WB_HORZ )
 mnButtonSize  = nSepSize + (nButtonCount*maCtrlSize.Width());
@@ -192,7 +190,7 @@ void ButtonDialog::ImplPosControls()
 }
 
 // Arrange PushButtons
-for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+for (auto  it : m_ItemList)
 {
 if ( GetStyle()  WB_HORZ )
 nX += it-mnSepSize;
@@ -215,7 +213,7 @@ void ButtonDialog::ImplPosControls()
 
 IMPL_LINK( ButtonDialog, ImplClickHdl, PushButton*, pBtn )
 {
-for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+for (auto  it : m_ItemList)
 {
 if ( it-mpPushButton == pBtn )
 {
@@ -237,7 +235,7 @@ void ButtonDialog::StateChanged( StateChangedType nType )
 if ( nType == StateChangedType::InitShow )
 {
 ImplPosControls();
-for (btn_iterator it = maItemList.begin(); it != maItemList.end(); 
++it)
+for (auto  it : m_ItemList)
 {
 if ( it-mpPushButton  it-mbOwnButton )
 it-mpPushButton-SetZOrder(0, ZOrderFlags::Last);
@@ -246,7 +244,7 @@ void ButtonDialog::StateChanged( StateChangedType nType )
 // Set focus on default button.
 if ( mnFocusButtonId != BUTTONDIALOG_BUTTON_NOTFOUND )
 {
-for (btn_iterator it = maItemList.begin(); it != maItemList.end(); 
++it)
+for (auto  it : m_ItemList)
 {
 if (it-mnId == mnFocusButtonId )
 {
@@ -277,7 +275,7 @@ void 

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

2015-06-24 Thread Caolán McNamara
 desktop/source/app/cmdlineargs.hxx   |2 
 desktop/source/app/desktopresid.hxx  |2 
 desktop/source/deployment/gui/dp_gui.h   |2 
 desktop/source/deployment/gui/dp_gui_dialog2.cxx |4 -
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx  |2 
 desktop/source/deployment/gui/dp_gui_extlistbox.hxx  |6 +-
 desktop/source/deployment/gui/dp_gui_shared.hxx  |2 
 desktop/source/deployment/gui/dp_gui_updatedata.hxx  |2 
 desktop/source/deployment/gui/dp_gui_updatedialog.hxx|2 
 desktop/source/deployment/manager/dp_commandenvironments.hxx |6 +-
 desktop/source/deployment/manager/dp_extensionmanager.hxx|2 
 desktop/source/deployment/manager/dp_informationprovider.cxx |2 
 desktop/source/deployment/manager/dp_manager.cxx |2 
 desktop/source/deployment/manager/dp_managerfac.cxx  |2 
 desktop/source/deployment/misc/dp_descriptioninfoset.cxx |2 
 desktop/source/lib/init.cxx  |2 
 desktop/source/migration/services/oo3extensionmigration.hxx  |2 
 desktop/source/offacc/acceptor.hxx   |2 
 desktop/source/pkgchk/unopkg/unopkg_app.cxx  |4 -
 desktop/source/pkgchk/unopkg/unopkg_shared.h |2 
 desktop/source/splash/splash.cxx |2 
 desktop/source/splash/unxsplash.hxx  |2 
 desktop/test/deployment/active/active_native.cxx |4 -
 desktop/test/deployment/passive/passive_native.cxx   |4 -
 sw/qa/extras/ww8export/data/fdo66304-1.odt   |binary
 sw/qa/extras/ww8export/ww8export.cxx |5 ++
 sw/source/core/doc/DocumentContentOperationsManager.cxx  |   25 +++
 27 files changed, 62 insertions(+), 32 deletions(-)

New commits:
commit acdf113baf04263a03d574eac9a8c09f98598b7a
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jun 24 15:57:03 2015 +0100

crashtesting: fix asserts on exporting fdo66304-1.odt to doc

Change-Id: Ia08207143d27f88d09bd45e64ba7c3c12cd2c1a1

diff --git a/sw/qa/extras/ww8export/data/fdo66304-1.odt 
b/sw/qa/extras/ww8export/data/fdo66304-1.odt
new file mode 100644
index 000..c3fb9bc
Binary files /dev/null and b/sw/qa/extras/ww8export/data/fdo66304-1.odt differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx 
b/sw/qa/extras/ww8export/ww8export.cxx
index 2347fdc..e1626cd 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -529,6 +529,11 @@ DECLARE_WW8EXPORT_TEST(testCommentExport, 
comment-export.odt)
 }
 }
 
+DECLARE_WW8EXPORT_TEST(testMoveRange, fdo66304-1.odt)
+{
+//the save must survive without asserting
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 4f7b0bd..f3ef4c2 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -1961,8 +1961,33 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM 
rPaM, SwPosition rPos,
 const std::shared_ptrsw::mark::ContentIdxStore 
pContentStore(sw::mark::ContentIdxStore::Create());
 pContentStore-Save( m_rDoc, rPos.nNode.GetIndex(), 
rPos.nContent.GetIndex(), true );
 
+SwTextNode * pOrigNode = pTNd;
+assert(*aSavePam.GetPoint() == *aSavePam.GetMark() 
+   *aSavePam.GetPoint() == rPos);
+assert(aSavePam.GetPoint()-nContent.GetIdxReg() == pOrigNode);
+assert(aSavePam.GetPoint()-nNode == rPos.nNode.GetIndex());
+assert(rPos.nNode.GetIndex() == pOrigNode-GetIndex());
+
 pTNd = pTNd-SplitContentNode( rPos )-GetTextNode();
 
+//A new node was inserted before the orig pTNd and the content up to
+//rPos moved into it. The old node is returned with the remainder
+//of the content in it.
+//
+//aSavePam was created with rPos, it continues to point to the
+//old node, but with the *original* content index into the node.
+//Seeing as all the orignode content before that index has
+//been removed, the new index into the original node should now be set
+//to 0 and the content index of rPos should also be adapted to the
+//truncated node
+assert(*aSavePam.GetPoint() == *aSavePam.GetMark() 
+   *aSavePam.GetPoint() == rPos);
+assert(aSavePam.GetPoint()-nContent.GetIdxReg() == pOrigNode);
+assert(aSavePam.GetPoint()-nNode == rPos.nNode.GetIndex());
+assert(rPos.nNode.GetIndex() == pOrigNode-GetIndex());
+aSavePam.GetPoint()-nContent.Assign(pOrigNode, 0);
+rPos = *aSavePam.GetMark() = *aSavePam.GetPoint();
+
  

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

2015-06-14 Thread Caolán McNamara
 desktop/source/splash/splash.cxx |2 -
 vcl/inc/salframe.hxx |5 +++
 vcl/inc/unx/gtk/gtkframe.hxx |9 ++
 vcl/source/app/salvtables.cxx|7 -
 vcl/source/window/paint.cxx  |   11 ++--
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |   28 +++--
 vcl/unx/gtk/window/gtksalframe.cxx   |   41 +--
 7 files changed, 67 insertions(+), 36 deletions(-)

New commits:
commit 8f324aebfb94c4b2023894121b954ad4f35eb395
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Jun 14 15:49:56 2015 +0100

Resolves: tdf#91393 autotext (etc) not fully drawn

the paint timer is activating after we ask gtk to
size the window but before we/gtk get the ConfigureNotify
that updates gtk knowledge of the size. So the gtk drawing
calls are clipped to the previous ConfigureNotify size.

So, lets try postponing paints if we have set a size but
not received a configure notify yet

I'll also revert e6a1956034c98204e30b0ca40330249d6f6f8155
in favour of this attempt

Change-Id: If5e993f8e0e65053b59234fce0785398b93c1c46

diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index acdb9b4..f5213a1 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -101,6 +101,9 @@ class VCL_PLUGIN_PUBLIC SalFrame
 : public vcl::DeletionNotifier
 , public SalGeometryProvider
 {
+protected:
+boolm_bAwaitingSizeConfirmation;
+private:
 // the VCL window corresponding to this frame
 VclPtrvcl::Window m_pWindow;
 SALFRAMEPROCm_pProc;
@@ -242,6 +245,8 @@ public:
 // (e.g. input methods, printer update handlers).
 longCallCallback( sal_uInt16 nEvent, const void* 
pEvent ) const
 { return m_pProc ? long(m_pProc( m_pWindow, 
const_castSalFrame*(this), nEvent, pEvent )) : 0; }
+
+bool AwaitingSizeConfirmation() const { return 
m_bAwaitingSizeConfirmation; }
 };
 
 #endif // INCLUDED_VCL_INC_SALFRAME_HXX
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 194a20d..d46b872 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -295,6 +295,15 @@ class GtkSalFrame : public SalFrame, public 
X11WindowProvider
 return (m_nStyle  nMask) != 0;
 }
 
+//call gtk_window_resize if the current size differs and
+//block Paints until Configure is received and the size
+//is valid again
+void window_resize(long nWidth, long nHeight);
+//call gtk_widget_set_size_request if the current size request differs and
+//block Paints until Configure is received and the size
+//is valid again
+void widget_set_size_request(long nWidth, long nHeight);
+
 void resizeWindow( long nWidth, long nHeight );
 void moveWindow( long nX, long nY );
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index c51f4f6..7a68df2 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -29,7 +29,12 @@
 #include salmenu.hxx
 
 
-SalFrame::SalFrame() : m_pWindow( NULL ), m_pProc( NULL ) {}
+SalFrame::SalFrame()
+: m_bAwaitingSizeConfirmation(false)
+, m_pWindow(NULL)
+, m_pProc(NULL)
+{
+}
 
 // this file contains the virtual destructors of the sal interface
 // compilers usually put their vtables where the destructor is
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index ae29766..2bca30e 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -584,12 +584,17 @@ IMPL_LINK_NOARG_TYPED(Window, ImplHandlePaintHdl, Idle *, 
void)
 return;
 }
 
-// save paint events until resizing is done
-if( !ImplDoTiledRendering() 
-mpWindowImpl-mbFrame  
mpWindowImpl-mpFrameData-maResizeIdle.IsActive() )
+// save paint events until resizing or initial sizing done
+if (!ImplDoTiledRendering()  mpWindowImpl-mbFrame 
+(mpWindowImpl-mpFrameData-maResizeIdle.IsActive() ||
+ mpWindowImpl-mpFrame-AwaitingSizeConfirmation()))
+{
 mpWindowImpl-mpFrameData-maPaintIdle.Start();
+}
 else if ( mpWindowImpl-mbReallyVisible )
+{
 ImplCallOverlapPaint();
+}
 }
 
 IMPL_LINK_NOARG_TYPED(Window, ImplHandleResizeTimerHdl, Idle *, void)
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx 
b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 365dba8..463d9fe 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -2914,31 +2914,11 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType 
nType, ControlPart,
 }
 END_CACHE_PIXMAP_RENDER( pixmapRect, pixmap, mask )
 
-// tdf#91301 workaround
-//
-// After introduction of the Idle processing, something has changed so
-// that the underlying GetGdkWindow() does not update its size fast enough;
-// even though the gtk_window_resize is called before 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit include/sfx2 include/svl libreofficekit/qa libreofficekit/source sfx2/sdi svl/source sw/source

2015-05-28 Thread Miklos Vajna
 desktop/source/lib/init.cxx |2 +
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |3 +
 include/sfx2/msg.hxx|2 -
 include/svl/memberid.hrc|2 +
 include/svl/srchitem.hxx|9 +
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   10 +-
 libreofficekit/source/gtk/lokdocview.cxx|8 +
 sfx2/sdi/sfxitems.sdi   |2 +
 svl/source/items/srchitem.cxx   |   32 ++--
 sw/source/uibase/uiview/viewsrch.cxx|   10 ++
 10 files changed, 76 insertions(+), 4 deletions(-)

New commits:
commit 3c9fb5898159fbda9d5b23f3f518044a5df03f72
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu May 28 17:21:50 2015 +0200

gtktiledviewer: use SearchItem.SearchStartPoint*

Change-Id: If0219eda3a2ca3b97c37bea70e35d47e49d38e02

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h 
b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 320121e..b3e50d3 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -74,6 +74,9 @@ voidlok_docview_post_command(LOKDocView* 
pDocView, const char* p
 
 /// Posts a keyboard event to LibreOfficeKit.
 voidlok_docview_post_key(GtkWidget* pWidget, GdkEventKey* 
pEvent, gpointer pData);
+
+/// Get the visible area of the document (in twips).
+void lok_docview_get_visarea(LOKDocView* pThis, GdkRectangle* pArea);
 #ifdef __cplusplus
 }
 #endif
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 5fbd337..d20f43d 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -158,10 +158,18 @@ static void doSearch(bool bBackwards)
 
aTree.put(boost::property_tree::ptree::path_type(SearchItem.SearchString/value,
 '/'), pText);
 
aTree.put(boost::property_tree::ptree::path_type(SearchItem.Backward/type, 
'/'), boolean);
 
aTree.put(boost::property_tree::ptree::path_type(SearchItem.Backward/value, 
'/'), bBackwards);
+
+LOKDocView* pLOKDocView = LOK_DOCVIEW(pDocView);
+GdkRectangle aArea;
+lok_docview_get_visarea(pLOKDocView, aArea);
+
aTree.put(boost::property_tree::ptree::path_type(SearchItem.SearchStartPointX/type,
 '/'), long);
+
aTree.put(boost::property_tree::ptree::path_type(SearchItem.SearchStartPointX/value,
 '/'), aArea.x);
+
aTree.put(boost::property_tree::ptree::path_type(SearchItem.SearchStartPointY/type,
 '/'), long);
+
aTree.put(boost::property_tree::ptree::path_type(SearchItem.SearchStartPointY/value,
 '/'), aArea.y);
+
 std::stringstream aStream;
 boost::property_tree::write_json(aStream, aTree);
 
-LOKDocView* pLOKDocView = LOK_DOCVIEW(pDocView);
 lok_docview_post_command(pLOKDocView, .uno:ExecuteSearch, 
aStream.str().c_str());
 }
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index e3c03db..064e534 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1319,4 +1319,12 @@ SAL_DLLPUBLIC_EXPORT void 
lok_docview_post_key(GtkWidget* /*pWidget*/, GdkEventK
 pDocView-m_pImpl-signalKey(pEvent);
 }
 
+SAL_DLLPUBLIC_EXPORT void lok_docview_get_visarea(LOKDocView* pThis, 
GdkRectangle* pArea)
+{
+GtkAdjustment* pHAdjustment = 
gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(pThis));
+pArea-x = 
pThis-m_pImpl-pixelToTwip(gtk_adjustment_get_value(pHAdjustment));
+GtkAdjustment* pVAdjustment = 
gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(pThis));
+pArea-y = 
pThis-m_pImpl-pixelToTwip(gtk_adjustment_get_value(pVAdjustment));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 1dc60bc9e99304c58007bfd5a964ff3f78480106
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu May 28 17:13:38 2015 +0200

SvxSearchItem: add m_nStartPoint{X,Y}

The idea is that if you have your cursor at the begining of a Writer
document, and you scroll down a lot, then search, then it's annoying
that search jumps back to the start of the document for the first hit.

Add an optional way to provide what is the starting point of such a
search, so we can have when nothing is selected, then search from the
top left corner of the visible area.

No UI yet to enable this, but available via the UNO API.

Change-Id: Ibcf3a5f2eeba1372b1dfe8474081e6591a6e0134

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3ca2744..3993015 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -742,6 +742,8 @@ static void jsonToPropertyValues(const char* pJSON, 
uno::Sequencebeans::Propert
 aValue.Value = OUString::fromUtf8(rValue.c_str());
 

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

2015-05-11 Thread Stephan Bergmann
 desktop/source/deployment/registry/dp_backend.cxx |4 ++--
 solenv/gbuild/platform/com_GCC_defs.mk|8 
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 30a2355f5203f31d8452e92ee18d5d245c1b826f
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon May 11 16:46:13 2015 +0200

Improve exception message

Change-Id: Idce206e0ddebbc9398297f15999579a71f9401c9

diff --git a/desktop/source/deployment/registry/dp_backend.cxx 
b/desktop/source/deployment/registry/dp_backend.cxx
index 3627a9d..720e8ab 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -635,10 +635,10 @@ beans::Optional beans::Ambiguoussal_Bool  
Package::isRegistered(
 catch (const deployment::DeploymentException ) {
 throw;
 }
-catch (const Exception ) {
+catch (const Exception  e) {
 Any exc( ::cppu::getCaughtException() );
 throw deployment::DeploymentException(
-unexpected exception occurred!,
+unexpected  + exc.getValueTypeName() + :  + e.Message,
 static_castOWeakObject *(this), exc );
 }
 }
commit f14cedc4fd7ba784da3f7ca067a1af18b758e368
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon May 11 16:45:56 2015 +0200

Silence Clang -Werror,-Wreturn-type-c-linkage

...after 9f016bd69422bdfb4cf7c4f5e57356eb98db2d8c Switch VclBuilder 
constructors to use VclPtr.

Change-Id: Ifc556c471bfbe3d0abf921ce3556ce75ad7a82ce

diff --git a/solenv/gbuild/platform/com_GCC_defs.mk 
b/solenv/gbuild/platform/com_GCC_defs.mk
index 5b5a2bd..1bb4017 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -72,6 +72,14 @@ gb_CXXFLAGS_COMMON := \
-fno-common \
-pipe \
 
+# VCL_BUILDER_DECL_FACTORY (include/vcl/builderfactory.hxx) routinely causes
+# 'make...' has C-linkage specified, but returns user-defined type
+# 'VclPtrvcl::Window' which is incompatible with C
+# [-Werror,-Wreturn-type-c-linkage]:
+ifeq ($(COM_GCC_IS_CLANG),TRUE)
+gb_CXXFLAGS_COMMON += -Wno-return-type-c-linkage
+endif
+
 gb_CXXFLAGS_Wundef = -Wno-undef
 
 ifneq ($(HAVE_THREADSAFE_STATICS),TRUE)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-05-06 Thread Tor Lillqvist
 desktop/source/lib/init.cxx   |4 +---
 include/LibreOfficeKit/LibreOfficeKit.hxx |4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 968091e1fcd1805073a60a3f7c271009bae41bce
Author: Tor Lillqvist t...@collabora.com
Date:   Wed May 6 21:17:51 2015 +0300

Enable passing in a UserInstallation also in the C++ API

Change-Id: I0549a58bc6cebdfd9d69c078b4a6e8a891182019

diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 0140348..bd8832a 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -284,9 +284,9 @@ public:
 };
 
 /// Factory method to create a lok::Office instance.
-inline Office* lok_cpp_init(const char* pInstallPath)
+inline Office* lok_cpp_init(const char* pInstallPath, const char* 
pUserProfilePath = NULL)
 {
-LibreOfficeKit* pThis = lok_init(pInstallPath);
+LibreOfficeKit* pThis = lok_init_2(pInstallPath, pUserProfilePath);
 if (pThis == NULL || pThis-pClass-nSize == 0)
 return NULL;
 return new ::lok::Office(pThis);
commit 713a8f3f53028b89f0836f86923370515a210585
Author: Tor Lillqvist t...@collabora.com
Date:   Wed May 6 21:15:59 2015 +0300

Nah, the Android NDK we use doesn't have std::to_string()

So do the verbose OUString::number().toUtf8().getStr() dance.

Change-Id: Ied5f6c3ec936544f0f36eeafd07f9496e9061373

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index fcfa33f..4cdce60 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -9,8 +9,6 @@
 
 #include config_folders.h
 
-#include string
-
 #include stdio.h
 #include string.h
 #include stdlib.h
@@ -905,7 +903,7 @@ static void lo_status_indicator_callback(void *data, 
comphelper::LibreOfficeKit:
 pLib-mpCallback(LOK_CALLBACK_STATUS_INDICATOR_START, 0, 
pLib-mpCallbackData);
 break;
 case comphelper::LibreOfficeKit::statusIndicatorCallbackType::SetValue:
-pLib-mpCallback(LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE, 
std::to_string(percent).c_str(), pLib-mpCallbackData);
+pLib-mpCallback(LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE, 
OUString::number(percent).toUtf8().getStr(), pLib-mpCallbackData);
 break;
 case comphelper::LibreOfficeKit::statusIndicatorCallbackType::Finish:
 pLib-mpCallback(LOK_CALLBACK_STATUS_INDICATOR_FINISH, 0, 
pLib-mpCallbackData);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source libreofficekit/qa sal/osl

2015-04-09 Thread Tor Lillqvist
 desktop/source/app/check_ext_deps.cxx  |4 +-
 desktop/source/deployment/misc/dp_misc.cxx |4 +-
 libreofficekit/qa/unit/tiledrendering.cxx  |3 -
 sal/osl/unx/mutex.cxx  |   48 +++--
 4 files changed, 29 insertions(+), 30 deletions(-)

New commits:
commit 72e7bf859df4941e7c86b57d12a4a2254b202ac1
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Apr 9 20:28:18 2015 +0300

Use comphelper::LibreOfficeKit::isActive() instead of LOK_TEST env var

Change-Id: Iaa0c751f101df6db25e9fca9123b81ac63033159

diff --git a/desktop/source/app/check_ext_deps.cxx 
b/desktop/source/app/check_ext_deps.cxx
index 04896a4..8145db1 100644
--- a/desktop/source/app/check_ext_deps.cxx
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -33,6 +33,7 @@
 #include unotools/configmgr.hxx
 #include toolkit/helper/vclunohelper.hxx
 
+#include comphelper/lok.hxx
 #include comphelper/processfactory.hxx
 #include comphelper/sequence.hxx
 #include cppuhelper/bootstrap.hxx
@@ -421,8 +422,7 @@ void Desktop::SynchronizeExtensionRepositories()
 
deployment::ExtensionManager::get(context)-reinstallDeployedExtensions(
 true, user, Referencetask::XAbortChannel(), silent);
 #if !HAVE_FEATURE_MACOSX_SANDBOX
-// getenv is a hack to detect if we're running in a LOK unit test
-if (!getenv(LOK_TEST))
+if (!comphelper::LibreOfficeKit::isActive())
 task::OfficeRestartManager::get(context)-requestRestart(
 silent-getInteractionHandler());
 #endif
diff --git a/desktop/source/deployment/misc/dp_misc.cxx 
b/desktop/source/deployment/misc/dp_misc.cxx
index 60a0658..c5b4eec 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -42,6 +42,7 @@
 #include com/sun/star/task/OfficeRestartManager.hpp
 #include boost/scoped_array.hpp
 #include boost/shared_ptr.hpp
+#include comphelper/lok.hxx
 #include comphelper/processfactory.hxx
 #include salhelper/linkhelper.hxx
 
@@ -558,8 +559,7 @@ void syncRepositories(
 }
 }
 #if !HAVE_FEATURE_MACOSX_SANDBOX
-// getenv is a hack to detect if we're running in a LOK unit test
-if (bModified  !getenv(LOK_TEST))
+if (bModified  !comphelper::LibreOfficeKit::isActive())
 {
 Referencetask::XRestartManager 
restarter(task::OfficeRestartManager::get(comphelper::getProcessComponentContext()));
 if (restarter.is())
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx 
b/libreofficekit/qa/unit/tiledrendering.cxx
index 7c956e6..0d33097 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -84,9 +84,6 @@ void TiledRenderingTest::runAllTests()
 OUString sUserInstallURL = aWorkdirRootURL + /unittest;
 rtl::Bootstrap::set(OUString(UserInstallation), sUserInstallURL);
 
-// No restart in desktop.
-setenv(LOK_TEST, 1, true);
-
 scoped_ptr Office  pOffice( lok_cpp_init(
   m_sLOPath.c_str() ) );
 CPPUNIT_ASSERT( pOffice.get() );
commit 2dede8bfbab5d353f91acc5f5fa7c21b1b1a4fea
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Apr 9 20:26:32 2015 +0300

Change from osl/diagnose.h to sal/log.hxx and add more logging

Change-Id: Iee8c093f5aa8306c3e5336d6dd5e801df6df87a4

diff --git a/sal/osl/unx/mutex.cxx b/sal/osl/unx/mutex.cxx
index 9a00475..4bc726d 100644
--- a/sal/osl/unx/mutex.cxx
+++ b/sal/osl/unx/mutex.cxx
@@ -25,8 +25,8 @@
 #endif
 #include system.hxx
 
+#include sal/log.hxx
 #include osl/mutex.h
-#include osl/diagnose.h
 
 #include pthread.h
 #include stdlib.h
@@ -37,16 +37,13 @@ typedef struct _oslMutexImpl
 pthread_mutex_t mutex;
 } oslMutexImpl;
 
-/*/
-/* osl_createMutex */
-/*/
 oslMutex SAL_CALL osl_createMutex()
 {
 oslMutexImpl* pMutex = 
static_castoslMutexImpl*(malloc(sizeof(oslMutexImpl)));
 pthread_mutexattr_t aMutexAttr;
 int nRet=0;
 
-OSL_ASSERT(pMutex);
+SAL_WARN_IF(!pMutex, sal.osl.mutex, null pMutex);
 
 if ( pMutex == 0 )
 {
@@ -60,8 +57,7 @@ oslMutex SAL_CALL osl_createMutex()
 nRet = pthread_mutex_init((pMutex-mutex), aMutexAttr);
 if ( nRet != 0 )
 {
-OSL_TRACE(osl_createMutex : mutex init/setattr failed. Errno: %d; 
%s\n,
-  nRet, strerror(nRet));
+SAL_WARN(sal.osl.mutex, pthread_muxex_init failed:   
strerror(nRet));
 
 free(pMutex);
 pMutex = 0;
@@ -69,12 +65,16 @@ oslMutex SAL_CALL osl_createMutex()
 
 pthread_mutexattr_destroy(aMutexAttr);
 
+SAL_INFO(sal.osl.mutex, osl_createMutex():   pMutex);
+
 return pMutex;
 }
 
 void SAL_CALL osl_destroyMutex(oslMutexImpl *pMutex)
 {
-OSL_ASSERT(pMutex);
+SAL_WARN_IF(!pMutex, sal.osl.mutex, null pMutex);
+
+SAL_INFO(sal.osl.mutex, osl_destroyMutex(  

[Libreoffice-commits] core.git: 2 commits - desktop/source include/osl sal/osl sal/util

2015-04-01 Thread Tor Lillqvist
 desktop/source/app/officeipcthread.cxx |   15 +++---
 desktop/source/lib/init.cxx|4 ++-
 include/osl/lok.hxx|   34 +
 sal/osl/all/utility.cxx|   20 ++-
 sal/util/sal.map   |5 
 5 files changed, 69 insertions(+), 9 deletions(-)

New commits:
commit 4dde5a623d563f9007dd3539b835489a27128d65
Author: Tor Lillqvist t...@collabora.com
Date:   Tue Mar 31 17:48:08 2015 +0300

Check osl::LibreOfficeKit::isActive(), not Application::IsConsoleOnly()

Console-only is really orthogonal to other things; it has one specific 
meaning
that is relevant on OS X only, see svapp.hxx. Let's not overload it for
LibreOfficeKit things.

Change-Id: I8b94c3a4e6f938ad70f1555a12dac8596819e031

diff --git a/desktop/source/app/officeipcthread.cxx 
b/desktop/source/app/officeipcthread.cxx
index aec9b3c..8c0ac21 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -26,6 +26,7 @@
 #include dispatchwatcher.hxx
 #include boost/scoped_ptr.hpp
 #include stdio.h
+#include osl/lok.hxx
 #include osl/process.h
 #include unotools/bootstrap.hxx
 #include vcl/svapp.hxx
@@ -460,13 +461,13 @@ OfficeIPCThread::Status 
OfficeIPCThread::EnableOfficeIPCThread()
 
 #ifndef ANDROID // On Android it might be that we still for some reason need 
the pipe?
 
-// When console-only (which includes in LibreOfficeKit-based programs) we 
want to be totally
-// independent from any other LibreOffice instance or LOKit-using program. 
Certainly no need for
-// any IPC pipes by definition, as we don't have any reason to do any IPC. 
Why we even call this
-// EnableOfficeIPCThread function from LibreOfficeKit's lo_initialize() I 
am not completely
-// sure, but that code, and this, is such horrible crack that I don't want 
to change it too much.
+// In LibreOfficeKit-based programs we want to be totally independent from 
any other LibreOffice
+// instance or LOKit-using program. Certainly no need for any IPC pipes by 
definition, as we
+// don't have any reason to do any IPC. Why we even call this 
EnableOfficeIPCThread function
+// from LibreOfficeKit's lo_initialize() I am not completely sure, but 
that code, and this, is
+// such horrible crack that I don't want to change it too much.
 
-if (Application::IsConsoleOnly())
+if (osl::LibreOfficeKit::isActive())
 {
 // Setting nPipeMode to PIPEMODE_CREATED causes the trivial path to be 
taken below, starting
 // the listeing thread. (Which will immediately finish, see the 
execute() function, but what
@@ -706,7 +707,7 @@ void OfficeIPCThread::execute()
 #if HAVE_FEATURE_DESKTOP || defined(ANDROID)
 
 #ifndef ANDROID
-if (Application::IsConsoleOnly())
+if (osl::LibreOfficeKit::isActive())
 return;
 #endif
 
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f6aa90f..339e3fd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -891,7 +891,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* 
pAppPath)
 desktop::Desktop::GetCommandLineArgs().setHeadless();
 
 Application::EnableHeadlessMode(true);
-Application::EnableConsoleOnly();
 
 // This is horrible crack. I really would want to go back to simply 
just call
 // InitVCL() here. The OfficeIPCThread thing is just horrible.
commit 8955af9b2b3d29118d314c77092c5c4c0f8e456c
Author: Tor Lillqvist t...@collabora.com
Date:   Sun Mar 29 22:59:22 2015 +0300

Add API to check whether being used through LibreOfficeKit

LibreOffice code, when used in a program through LibreOfficeKit, needs to be
aware of that in certain crucial spots, to avoid behaviour and functionality
that makes no sense in a LibreOfficeKit scenario. As LibreOfficeKit uses a
normal LibreOffice installation to perform its job, this can't be a
compile-time choice. Also, none of the existing run-time headlessness 
modes
fully match what is needed.

Change-Id: Iaccf7f958c549f019b508854800519f54dcadb11

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bdab485..f6aa90f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -22,6 +22,7 @@
 
 #include tools/errinf.hxx
 #include osl/file.hxx
+#include osl/lok.hxx
 #include osl/process.h
 #include osl/thread.h
 #include rtl/strbuf.hxx
@@ -852,6 +853,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* 
pAppPath)
 if (bInitialized)
 return 1;
 
+osl::LibreOfficeKit::setActive();
+
 OUString aAppPath;
 if (pAppPath)
 {
diff --git a/include/osl/lok.hxx b/include/osl/lok.hxx
new file mode 100644
index 000..3b241ef
--- /dev/null
+++ b/include/osl/lok.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 

[Libreoffice-commits] core.git: 2 commits - desktop/source sfx2/source vcl/source

2015-03-28 Thread Tor Lillqvist
 desktop/source/app/app.cxx|   35 --
 desktop/source/app/appinit.cxx|   10 -
 desktop/source/app/check_ext_deps.cxx |1 
 desktop/source/app/sofficemain.cxx|2 -
 sfx2/source/appl/appopen.cxx  |1 
 sfx2/source/doc/objcont.cxx   |6 +
 vcl/source/app/svapp.cxx  |1 
 7 files changed, 3 insertions(+), 53 deletions(-)

New commits:
commit 7fe192da23f4fac73b6ef7393bd8499a373170f3
Author: Tor Lillqvist t...@collabora.com
Date:   Sat Mar 28 15:50:41 2015 +0200

Bin a few SAL_INFOs that basically just say we are here

Such are fairly pointless to keep permanently in the code. Use a temporary
SAL_DEBUG if you need tracing output when you reach a certain lines while
hacking.

Change-Id: I13a898486731c6d2995e92e2c5dcd0d1429e47cc

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index cd9809d..bb352e2 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -523,7 +523,6 @@ Desktop::Desktop()
 , m_aBootstrapError(BE_OK)
 , m_aBootstrapStatus(BS_OK)
 {
-SAL_INFO( desktop.app, desktop (cd13) ::Desktop::Desktop );
 }
 
 Desktop::~Desktop()
@@ -535,7 +534,6 @@ Desktop::~Desktop()
 
 void Desktop::Init()
 {
-SAL_INFO( desktop.app,  desktop (cd13) ::Desktop::Init );
 SetBootstrapStatus(BS_OK);
 
 #if HAVE_FEATURE_EXTENSIONS
@@ -576,7 +574,6 @@ void Desktop::Init()
 const CommandLineArgs rCmdLineArgs = GetCommandLineArgs();
 
 // start ipc thread only for non-remote offices
-SAL_INFO( desktop.app,  desktop (cd13) 
::OfficeIPCThread::EnableOfficeIPCThread );
 OfficeIPCThread::Status aStatus = 
OfficeIPCThread::EnableOfficeIPCThread();
 if ( aStatus == OfficeIPCThread::IPC_STATUS_PIPE_ERROR )
 {
@@ -621,21 +618,15 @@ void Desktop::Init()
 
 void Desktop::InitFinished()
 {
-SAL_INFO( desktop.app, desktop (cd13) ::Desktop::InitFinished );
-
 CloseSplashScreen();
 }
 
 void Desktop::DeInit()
 {
-SAL_INFO( desktop.app, desktop (cd13) ::Desktop::DeInit );
-
 try {
 // instead of removing of the configManager just let it commit all the 
changes
-SAL_INFO( desktop.app, - store config items );
 utl::ConfigManager::storeConfigItems();
 FlushConfiguration();
-SAL_INFO( desktop.app, - store config items );
 
 // close splashscreen if it's still open
 CloseSplashScreen();
@@ -655,17 +646,13 @@ void Desktop::DeInit()
 // someone threw an exception during shutdown
 // this will leave some garbage behind..
 }
-
-SAL_INFO( desktop.app, FINISHED WITH Desktop::DeInit );
 }
 
 bool Desktop::QueryExit()
 {
 try
 {
-SAL_INFO( desktop.app, - store config items );
 utl::ConfigManager::storeConfigItems();
-SAL_INFO( desktop.app, - store config items );
 }
 catch ( const RuntimeException )
 {
@@ -1294,8 +1281,6 @@ int Desktop::Main()
 {
 pExecGlobals = new ExecuteGlobals();
 
-SAL_INFO( desktop.app, desktop (cd13) ::Desktop::Main );
-
 // Remember current context object
 com::sun::star::uno::ContextLayer layer(
 com::sun::star::uno::getCurrentContext() );
@@ -1423,10 +1408,8 @@ int Desktop::Main()
 
 SetDisplayName( aTitle );
 SetSplashScreenProgress(35);
-SAL_INFO( desktop.app, { create SvtPathOptions and 
SvtLanguageOptions );
 pExecGlobals-pPathOptions.reset( new SvtPathOptions);
 SetSplashScreenProgress(40);
-SAL_INFO( desktop.app, } create SvtPathOptions and 
SvtLanguageOptions );
 
 xDesktop = css::frame::Desktop::create( xContext );
 
@@ -1470,9 +1453,7 @@ int Desktop::Main()
 bool bExistsRecoveryData = false;
 bool bExistsSessionData  = false;
 
-SAL_INFO( desktop.app, { impl_checkRecoveryState );
 impl_checkRecoveryState(bCrashed, bExistsRecoveryData, 
bExistsSessionData);
-SAL_INFO( desktop.app, } impl_checkRecoveryState );
 
 OUString pidfileName = rCmdLineArgs.GetPidfileName();
 if ( !pidfileName.isEmpty() )
@@ -1526,9 +1507,7 @@ int Desktop::Main()
 (!bExistsSessionData   
) 
 (!Application::AnyInput( VclInputFlags::APPEVENT ) 
 ))
 {
- SAL_INFO( desktop.app, { create BackingComponent );
  ShowBackingComponent(this);
- SAL_INFO( desktop.app, } create BackingComponent );
 }
 }
 }
@@ -1575,7 +1554,6 @@ int Desktop::Main()
  !rCmdLineArgs.IsNoQuickstart() )
 InitializeQuickstartMode( xContext );
 
-SAL_INFO( desktop.app, desktop (cd13) createInstance 
com.sun.star.frame.Desktop );
 try
 {
 if ( xDesktop.is() )
@@ -1606,8 +1584,6 @@ int Desktop::Main()
 

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

2015-03-06 Thread Bjoern Michaelsen
 desktop/source/deployment/manager/dp_manager.cxx |3 +--
 filter/source/msfilter/svdfppt.cxx   |   13 -
 2 files changed, 5 insertions(+), 11 deletions(-)

New commits:
commit ca3700c42238e71684ec1d5f5eacaea4b1ca3b30
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Fri Mar 6 14:48:24 2015 +0100

v612: obfuscated if/goto

Change-Id: Ia12b325e41238b9e12e2f388273bd01b96d61c08

diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index d7d9cf1..6f0fb86 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -3178,11 +3178,10 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport 
rMan, SvStream rSt, const
 DffRecordHeader aContentDataHd;
 
 const DffRecordHeader* pListHd = rMan.aDocRecManager.GetRecordHeader( 
PPT_PST_List, SEEK_FROM_BEGINNING );
-while( pListHd )
-{
+if( pListHd )
 pListHd-SeekToContent( rSt );
-if ( !rMan.SeekToContentOfProgTag( 9, rSt, *pListHd, aContentDataHd ) )
-break;
+if ( pListHd  rMan.SeekToContentOfProgTag( 9, rSt, *pListHd, 
aContentDataHd ) )
+{
 while ( ( rSt.GetError() == 0 )  ( rSt.Tell()  
aContentDataHd.GetRecEndFilePos() ) )
 {
 ReadDffRecordHeader( rSt, aHd );
@@ -3257,13 +3256,10 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport 
rMan, SvStream rSt, const
 }
 aHd.SeekToEndOfRecord( rSt );
 }
-break;
 }
 
-while( pHd )
+if ( pHd  rMan.SeekToContentOfProgTag( 9, rSt, *pHd, aContentDataHd ) )
 {   // get the extended paragraph styles on mainmaster ( graphical 
bullets, num ruling ... )
-if ( !rMan.SeekToContentOfProgTag( 9, rSt, *pHd, aContentDataHd ) )
-break;
 while ( ( rSt.GetError() == 0 )  ( rSt.Tell()  
aContentDataHd.GetRecEndFilePos() ) )
 {
 ReadDffRecordHeader( rSt, aHd );
@@ -3308,7 +3304,6 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport 
rMan, SvStream rSt, const
 }
 aHd.SeekToEndOfRecord( rSt );
 }
-break;
 }
 rSt.Seek( nOldPos );
 }
commit 8da61f23384c7f3f2850a6362765506e4e078862
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Fri Mar 6 14:35:24 2015 +0100

v612: obfuscated if

Change-Id: Idbcb1f7461ac5a1d5e07d7d65f6a7d86f2e3cc57

diff --git a/desktop/source/deployment/manager/dp_manager.cxx 
b/desktop/source/deployment/manager/dp_manager.cxx
index 8d90501..92f32c5 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -93,11 +93,10 @@ OUString getExtensionFolder(OUString const   parentFolder,
 StrTitle::createCursor (tempFolder, 
::ucbhelper::INCLUDE_FOLDERS_ONLY ) );
 
 OUString title;
-while (xResultSet-next())
+if (xResultSet-next())
 {
 title = Referencesdbc::XRow(
 xResultSet, UNO_QUERY_THROW )-getString(1 /* Title */ ) ;
-break;
 }
 return title;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source starmath/inc

2014-12-22 Thread Takeshi Abe
 desktop/source/app/officeipcthread.hxx |6 --
 starmath/inc/caret.hxx |6 +++---
 2 files changed, 3 insertions(+), 9 deletions(-)

New commits:
commit 6476aba045d71eaf53e03d4d0352f82e3eba6920
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Mon Dec 22 18:42:12 2014 +0900

Drop unused member variables

They were gone with 4ce2602befd59e69264d8e4ced8730b40c2b947c /
b6ff19fba3a1a6d65134539a71d7a8df0e35d4ff.

Change-Id: Ida5790f77d619fdc91dfce11b186ed5e15587ddf

diff --git a/desktop/source/app/officeipcthread.hxx 
b/desktop/source/app/officeipcthread.hxx
index a6b48c1..3f81d40 100644
--- a/desktop/source/app/officeipcthread.hxx
+++ b/desktop/source/app/officeipcthread.hxx
@@ -87,14 +87,8 @@ class OfficeIPCThread : public salhelper::Thread
 ::osl::Condition cReady;
 
 static ::osl::MutexGetMutex();
-static const char *sc_aTerminationSequence;
-static const int sc_nTSeqLength;
 static const char *sc_aShowSequence;
 static const int sc_nShSeqLength;
-static const char *sc_aConfirmationSequence;
-static const int sc_nCSeqLength;
-static const char *sc_aSendArgumentsSequence;
-static const int sc_nCSASeqLength;
 
 OfficeIPCThread();
 
commit c6167c9c7545f7797a8b48b035d09f2901e545bf
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Mon Dec 22 18:30:51 2014 +0900

prefer constant to macro

Change-Id: I5e629491b5be9e2de1f72fdbe6887038305d0742

diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx
index f435617..2b951b4 100644
--- a/starmath/inc/caret.hxx
+++ b/starmath/inc/caret.hxx
@@ -116,9 +116,6 @@ struct SmCaretPosGraphEntry{
 }
 };
 
-/** Define SmCaretPosGraph to be less than one page 4096 */
-#define SmCaretPosGraphSize   255
-
 class SmCaretPosGraph;
 
 /** Iterator for SmCaretPosGraph */
@@ -178,6 +175,9 @@ public:
 }
 friend class SmCaretPosGraphIterator;
 private:
+/** Define SmCaretPosGraph to be less than one page 4096 */
+static const int SmCaretPosGraphSize = 255;
+
 /** Next graph, to be used when this graph is full */
 SmCaretPosGraph* pNext;
 /** Next free entry in graph */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: [Libreoffice-commits] core.git: 2 commits - desktop/source reportdesign/source

2014-12-12 Thread Miklos Vajna
On Thu, Dec 11, 2014 at 10:02:11AM +0100, Miklos Vajna 
vmik...@collabora.co.uk wrote:
 If we have to choose between an empty Writer document in case there is
 nothing to restore and unwanted document imports, I would choose the
 previous. ;-) I would say if the empty Writer document is annoying for
 you, then please fix it without calling doRestore() when
 OOO_DISABLE_RECOVERY is set.

FWIW, this is addressed with
https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=fbe9accf36ac4c52ef5bcb84d455b4d06c317668.


signature.asc
Description: Digital signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice-commits] core.git: 2 commits - desktop/source reportdesign/source

2014-12-11 Thread Miklos Vajna
On Mon, Dec 08, 2014 at 12:00:07PM +0100, Michael Stahl mst...@redhat.com 
wrote:
 not really but presumably OOO_DISABLE_RECOVERY should just disable
 the recovery dialog?  what i don't understand is, why does LO open a new
 writer document if you don't restore the session.

Sure, but with your commit, you also do a doRestore() call, which
restores the document. If there is nothing to restore, this may prevent
the empty writer document, but if there is something to restore, this
will restore the document, and that's quite annoying.

Second scenario: let's say you opened foo.odt, killed soffice.bin, and
now you would open bar.odt. After your change, *both* documents will be
opened, which is again surprising, as only one document was specified in
the commandline.

If we have to choose between an empty Writer document in case there is
nothing to restore and unwanted document imports, I would choose the
previous. ;-) I would say if the empty Writer document is annoying for
you, then please fix it without calling doRestore() when
OOO_DISABLE_RECOVERY is set.


signature.asc
Description: Digital signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice-commits] core.git: 2 commits - desktop/source reportdesign/source

2014-12-08 Thread Miklos Vajna
Hi Michael,

On Fri, Dec 05, 2014 at 02:12:17PM -0800, Michael Stahl mst...@redhat.com 
wrote:
 commit dce74be2bab7a6924578e8f6f6ce37aa593cc481
 Author: Michael Stahl mst...@redhat.com
 Date:   Fri Dec 5 20:57:20 2014 +0100
 
 desktop: avoid starting with new writer doc if OOO_DISABLE_RECOVERY set
 
 Better to show the start center, same as when --norestore is given.

A side-effect of this is the following scenario:

1) Start Writer, type something, save it as test.odt
2) Exit from LO by pressing ^C on the console
3) Start './soffice', test.odt is opened automatically

Is that intended? ;-)

Regards,

Miklos


signature.asc
Description: Digital signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice-commits] core.git: 2 commits - desktop/source reportdesign/source

2014-12-08 Thread Michael Stahl
On 08.12.2014 10:23, Miklos Vajna wrote:
 Hi Michael,
 
 On Fri, Dec 05, 2014 at 02:12:17PM -0800, Michael Stahl mst...@redhat.com 
 wrote:
 commit dce74be2bab7a6924578e8f6f6ce37aa593cc481
 Author: Michael Stahl mst...@redhat.com
 Date:   Fri Dec 5 20:57:20 2014 +0100

 desktop: avoid starting with new writer doc if OOO_DISABLE_RECOVERY set
 
 Better to show the start center, same as when --norestore is given.
 
 A side-effect of this is the following scenario:
 
 1) Start Writer, type something, save it as test.odt
 2) Exit from LO by pressing ^C on the console
 3) Start './soffice', test.odt is opened automatically
 
 Is that intended? ;-)

not really but presumably OOO_DISABLE_RECOVERY should just disable
the recovery dialog?  what i don't understand is, why does LO open a new
writer document if you don't restore the session.


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2014-12-05 Thread Michael Stahl
 desktop/source/app/app.cxx   |6 --
 reportdesign/source/core/api/Section.cxx |2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit a2a9c84deff54321da0042212bae86ede25dd7e2
Author: Michael Stahl mst...@redhat.com
Date:   Fri Dec 5 22:24:14 2014 +0100

fdo#85112: reportdesign: fix SolarMutex assertion

A bit tricky, but all of the UNO wrappers for SdrObjects etc. in svx use
the SolarMutex for locking, so it's reasonable to expect that
reportdesign code also has to lock SolarMutex when it manipulates these.

Change-Id: I3cade8f53d7655e249b82673c87238d5a17256cb

diff --git a/reportdesign/source/core/api/Section.cxx 
b/reportdesign/source/core/api/Section.cxx
index e70bb3b..71993ad 100644
--- a/reportdesign/source/core/api/Section.cxx
+++ b/reportdesign/source/core/api/Section.cxx
@@ -34,6 +34,7 @@
 #include ReportDefinition.hxx
 #include Shape.hxx
 #include svx/unoshape.hxx
+#include vcl/svapp.hxx
 #include RptObject.hxx
 #include ReportDrawPage.hxx
 #include comphelper/property.hxx
@@ -197,6 +198,7 @@ sal_Bool SAL_CALL OSection::supportsService( const 
OUString _rServiceName ) thr
 
 void OSection::init()
 {
+SolarMutexGuard g; // lock while manipulating SdrModel
 uno::Reference report::XReportDefinition xReport = getReportDefinition();
 ::boost::shared_ptrrptui::OReportModel pModel = 
OReportDefinition::getSdrModel(xReport);
 assert(pModel  No model set at the report definition!);
commit dce74be2bab7a6924578e8f6f6ce37aa593cc481
Author: Michael Stahl mst...@redhat.com
Date:   Fri Dec 5 20:57:20 2014 +0100

desktop: avoid starting with new writer doc if OOO_DISABLE_RECOVERY set

Better to show the start center, same as when --norestore is given.

Change-Id: I726a8b7d227b646180fe16ee9c302a329a7fa36c

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index f5722e4..f71aa9b 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -2290,10 +2290,11 @@ void Desktop::OpenClients()
 bool bCrashed= false;
 bool bExistsRecoveryData = false;
 bool bExistsSessionData  = false;
+bool const bDisableRecovery = getenv(OOO_DISABLE_RECOVERY) != 
nullptr;
 
 impl_checkRecoveryState(bCrashed, bExistsRecoveryData, 
bExistsSessionData);
 
-if ( !getenv (OOO_DISABLE_RECOVERY) 
+if ( !bDisableRecovery 
 (
 ( bExistsRecoveryData ) || // = crash with files= 
recovery
 ( bCrashed)// = crash without files = error 
report
@@ -2324,7 +2325,8 @@ void Desktop::OpenClients()
 SAL_WARN( desktop.app, Registration of session listener failed 
 e.Message);
 }
 
-if ( !bExistsRecoveryData  xSessionListener.is() )
+// in bDisableRecovery case call doRestore() to prevent new Writer doc
+if ((!bExistsRecoveryData || bDisableRecovery)  
xSessionListener.is())
 {
 // session management
 try
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source include/osl sal/osl

2014-12-04 Thread Stephan Bergmann
 desktop/source/lib/init.cxx  |6 +-
 include/osl/process.h|9 -
 sal/osl/all/compat.cxx   |4 
 sal/osl/unx/process_impl.cxx |   10 +-
 sal/osl/w32/process.cxx  |   10 +-
 5 files changed, 7 insertions(+), 32 deletions(-)

New commits:
commit 0a40d6c3abba6f005e1b7806919e5169e032f985
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Dec 4 15:52:03 2014 +0100

[API CHANGE] Remove osl_setCommandArgs

...it was added late in the LO 3.3 cycle apparently by error.

While this is strictly speaking an incompatible change, no client code 
should
ever have called this deprecated, internal functionality anyway.  An 
aborting
stub is left in place for soname stability.

Change-Id: Ibbc96ccf76a07a80d732a0713c95ff7b6bf1e528

diff --git a/include/osl/process.h b/include/osl/process.h
index 205e6da..712bb0b 100644
--- a/include/osl/process.h
+++ b/include/osl/process.h
@@ -366,15 +366,6 @@ SAL_DLLPUBLIC sal_uInt32 SAL_CALL 
osl_getCommandArgCount(void);
 SAL_DLLPUBLIC oslProcessError SAL_CALL osl_getCommandArg(
 sal_uInt32 nArg, rtl_uString **strCommandArg);
 
-/** Determine whether or not the command args have already been set.
-
-Deprecated: This function is only for internal use
-
-@return The command args are already set, and may not be set again.
-@since LibreOffice 4.3
-*/
-SAL_DLLPUBLIC int SAL_CALL osl_areCommandArgsSet (void);
-
 /** Set the command-line arguments as passed to the main-function of this 
process.
 
 Deprecated: This function is only for internal use. Passing the args from 
main will
diff --git a/sal/osl/all/compat.cxx b/sal/osl/all/compat.cxx
index ef44215..3f072a1 100644
--- a/sal/osl/all/compat.cxx
+++ b/sal/osl/all/compat.cxx
@@ -23,6 +23,10 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL 
osl_acquireSemaphore(void *) {
 for (;;) { std::abort(); } // avoid must return a value warnings
 }
 
+SAL_DLLPUBLIC_EXPORT int SAL_CALL osl_areCommandArgsSet() {
+for (;;) { std::abort(); } // avoid must return a value warnings
+}
+
 SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL osl_assertFailedLine(
 char const *, sal_Int32, char const *)
 {
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx
index b5c1fe7..62f2f78 100644
--- a/sal/osl/unx/process_impl.cxx
+++ b/sal/osl/unx/process_impl.cxx
@@ -190,14 +190,6 @@ oslProcessError SAL_CALL osl_getCommandArg (sal_uInt32 
nArg, rtl_uString ** strC
 return (result);
 }
 
-int SAL_CALL osl_areCommandArgsSet (void)
-{
-pthread_mutex_lock ((g_command_args.m_mutex));
-int nRet = (int) (g_command_args.m_nCount  0);
-pthread_mutex_unlock ((g_command_args.m_mutex));
-return nRet;
-}
-
 /***
  osl_setCommandArgs().
  **/
diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx
index 0ab8580..087ee2e 100644
--- a/sal/osl/w32/process.cxx
+++ b/sal/osl/w32/process.cxx
@@ -361,15 +361,6 @@ oslProcessError SAL_CALL osl_getCommandArg( sal_uInt32 
nArg, rtl_uString **strCo
 
 /***/
 
-int SAL_CALL osl_areCommandArgsSet(void)
-{
-osl_acquireMutex (*osl_getGlobalMutex());
-int nRet = (int) (g_command_args.m_nCount  0);
-osl_releaseMutex (*osl_getGlobalMutex());
-return nRet;
-}
-
-
 void SAL_CALL osl_setCommandArgs (int argc, char ** argv)
 {
 assert(argc  0);
commit 7fbfc12474b85b31c9d120898fff6e226d76d662
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Dec 4 15:49:48 2014 +0100

Still no need for osl_setCommandArgs

(TOCTOU and all)

Change-Id: I81253c8790b631117634bafa4eea65991a975ba0

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8040f54..8a7ffd53 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -693,11 +693,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath)
 // again (as an assert will fire), this will be the case e.g.
 // for unit tests (and possibly if UNO is being used in addition
 // to LOK in an external program).
-if (!osl_areCommandArgsSet())
-{
-SAL_INFO(lok, commandArgs not previously set);
-osl_setCommandArgs(2, pArgs);
-}
+osl_setCommandArgs(2, pArgs);
 SAL_INFO(lok, attempting to initalize UNO);
 initialize_uno(aAppURL);
 SAL_INFO(lok, uno successfully initalized);
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx
index 7d8cc81..b5c1fe7 100644
--- a/sal/osl/unx/process_impl.cxx
+++ b/sal/osl/unx/process_impl.cxx
@@ -205,7 +205,7 @@ void SAL_CALL osl_setCommandArgs (int argc, char ** argv)
 {
 assert(argc  0);
 pthread_mutex_lock ((g_command_args.m_mutex));
-assert (g_command_args.m_nCount == 0);
+SAL_WARN_IF(g_command_args.m_nCount != 0, sal.osl, args already set);
 if 

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

2014-08-21 Thread Maxim Monastirsky
 desktop/source/app/dispatchwatcher.cxx |   50 +
 1 file changed, 15 insertions(+), 35 deletions(-)

New commits:
commit 9df3a83c304f3dd0e0233d234dc6036ab5eefb77
Author: Maxim Monastirsky momonas...@gmail.com
Date:   Thu Aug 21 22:01:19 2014 +0300

Base the convert-to detection on the actual service

There is no need to run a type detection on the input
file (for a second time!), just to get the document service.

This also simplifies the conversion of some generic formats
like HTML and RTF, using Calc export filters. Previously
setting both input and output filters was required. Now it's
enough to set the input filter, or simply use --calc.

Change-Id: I825e0fe3e7368d6649acb434b13de53a4523064a

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 318fe67..f26d17c 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -151,41 +151,14 @@ catch ( const Exception )
 return 0;
 }
 
-
-static OUString impl_GetFilterFromExt( const OUString aUrl, SfxFilterFlags 
nFlags,
-const OUString aAppl )
+OUString impl_GuessFilter( const OUString rUrlOut, const OUString 
rDocService )
 {
-OUString aFilter;
-SfxMedium* pMedium = new SfxMedium( aUrl,
-STREAM_STD_READ );
-
-const SfxFilter *pSfxFilter = NULL;
-if( nFlags == SFX_FILTER_EXPORT )
-{
-pSfxFilter = impl_getExportFilterFromUrl( aUrl, aAppl );
-}
-else
-{
-SfxGetpApp()-GetFilterMatcher().GuessFilter( *pMedium, pSfxFilter, 
nFlags );
-}
-
-if( pSfxFilter )
-{
-if (nFlags == SFX_FILTER_EXPORT)
-aFilter = pSfxFilter-GetFilterName();
-else
-aFilter = pSfxFilter-GetServiceName();
-}
+OUString aOutFilter;
+const SfxFilter* pOutFilter = impl_getExportFilterFromUrl( rUrlOut, 
rDocService );
+if (pOutFilter)
+aOutFilter = pOutFilter-GetFilterName();
 
-delete pMedium;
-return aFilter;
-}
-static OUString impl_GuessFilter( const OUString aUrlIn, const OUString 
aUrlOut )
-{
-/* aAppl can also be set to Factory like scalc, swriter... */
-OUString aAppl;
-aAppl = impl_GetFilterFromExt( aUrlIn, SFX_FILTER_IMPORT, aAppl );
-return  impl_GetFilterFromExt( aUrlOut, SFX_FILTER_EXPORT, aAppl );
+return aOutFilter;
 }
 
 }
@@ -545,7 +518,14 @@ bool DispatchWatcher::executeDispatchRequests( const 
DispatchList aDispatchRequ
 
 if ( bGuess )
 {
-aFilter = impl_GuessFilter( aName, aOutFile );
+OUString aDocService;
+Reference XModel  xModel( xDoc, UNO_QUERY );
+if ( xModel.is() )
+{
+utl::MediaDescriptor aMediaDesc( 
xModel-getArgs() );
+aDocService = 
aMediaDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_DOCUMENTSERVICE(),
 OUString() );
+}
+aFilter = impl_GuessFilter( aOutFile, 
aDocService );
 }
 
 sal_Int32 nFilterOptionsIndex = aFilter.indexOf( 
':' );
commit cebfcbd456ddfbd7291c85c6a6c329df165ccd3c
Author: Maxim Monastirsky momonas...@gmail.com
Date:   Thu Aug 21 22:47:52 2014 +0300

Better to use an instance with a doc service specified

...to avoid detection of filter from other services, and to
additionally check for filters other than the preferred
by the type (see SfxFilterMatcher::GetFilterForProps).

Change-Id: I64609b32f6aac7553b4b6b96db88acfcad0ce000

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index eba914d..318fe67 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -135,7 +135,7 @@ const SfxFilter* impl_getExportFilterFromUrl( const 
rtl::OUString rUrl, const r
 UNO_QUERY_THROW );
 const rtl::OUString aTypeName( xTypeDetector-queryTypeByURL( rUrl ) );
 
-const SfxFilter* pFilter( SfxGetpApp()-GetFilterMatcher().GetFilter4EA( 
aTypeName, SFX_FILTER_EXPORT ) );
+const SfxFilter* pFilter( SfxFilterMatcher( rFactory ).GetFilter4EA( 
aTypeName, SFX_FILTER_EXPORT ) );
 if ( !pFilter )
 pFilter = impl_lookupExportFilterForUrl( rUrl, rFactory );
 if ( !pFilter )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - desktop/source desktop/uiconfig extensions/source extensions/uiconfig include/vcl reportdesign/source reportdesign/uiconfig sc/uiconfig sfx2/uiconfig svtool

2014-08-20 Thread Caolán McNamara
 desktop/source/deployment/gui/dp_gui_updatedialog.hxx |2 
 desktop/uiconfig/ui/updatedialog.ui   |7 
 extensions/source/bibliography/bib.hrc|   31 
 extensions/source/bibliography/bibview.cxx|1 
 extensions/source/bibliography/general.cxx|  496 
 extensions/source/bibliography/general.hxx|   25 
 extensions/source/bibliography/sections.src   |  126 ---
 extensions/uiconfig/sbibliography/ui/generalpage.ui   |  697 +-
 include/vcl/layout.hxx|   11 
 reportdesign/source/ui/dlg/CondFormat.cxx |2 
 reportdesign/uiconfig/dbreport/ui/condformatdialog.ui |5 
 sc/uiconfig/scalc/ui/retypepassdialog.ui  |   19 
 sc/uiconfig/scalc/ui/sortcriteriapage.ui  |   17 
 sfx2/uiconfig/ui/cmisinfopage.ui  |   25 
 svtools/uiconfig/ui/addresstemplatedialog.ui  |5 
 svx/uiconfig/ui/asianphoneticguidedialog.ui   |5 
 vcl/source/window/builder.cxx |6 
 vcl/source/window/layout.cxx  |   29 
 18 files changed, 967 insertions(+), 542 deletions(-)

New commits:
commit a6c5f2ba6bca8ad95a3731e2770a1d216c9925a0
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Aug 18 14:01:32 2014 +0100

rework RID_TP_GENERAL conversion to make widgets visible, etc.

Change-Id: I93e30198e27631ad4a6865fd202af16094c26a41

diff --git a/extensions/source/bibliography/bib.hrc 
b/extensions/source/bibliography/bib.hrc
index f5370bc..96233b1 100644
--- a/extensions/source/bibliography/bib.hrc
+++ b/extensions/source/bibliography/bib.hrc
@@ -43,37 +43,6 @@
 #define RID_BIB_STR_FRAME_TITLE (RID_BIB_STRING +  4)
 #define RID_MAP_QUESTION(RID_BIB_STRING +  5)
 
-#define ST_IDENTIFIER   (RID_BIB_STRING +  6)
-#define ST_AUTHTYPE (RID_BIB_STRING +  7)
-#define ST_AUTHOR   (RID_BIB_STRING +  8)
-#define ST_YEAR (RID_BIB_STRING +  9)
-#define ST_ISBN (RID_BIB_STRING +  10)
-#define ST_MONTH(RID_BIB_STRING +  11)
-#define ST_PUBLISHER(RID_BIB_STRING +  12)
-#define ST_ADDRESS  (RID_BIB_STRING +  13)
-#define ST_ANNOTE   (RID_BIB_STRING +  14)
-#define ST_BOOKTITLE(RID_BIB_STRING +  15)
-#define ST_CHAPTER  (RID_BIB_STRING +  16)
-#define ST_EDITION  (RID_BIB_STRING +  17)
-#define ST_EDITOR   (RID_BIB_STRING +  18)
-#define ST_HOWPUBLISHED (RID_BIB_STRING +  19)
-#define ST_INSTITUTION  (RID_BIB_STRING +  20)
-#define ST_JOURNAL  (RID_BIB_STRING +  21)
-#define ST_NOTE (RID_BIB_STRING +  22)
-#define ST_NUMBER   (RID_BIB_STRING +  23)
-#define ST_ORGANIZATION (RID_BIB_STRING +  24)
-#define ST_PAGE (RID_BIB_STRING +  25)
-#define ST_SCHOOL   (RID_BIB_STRING +  26)
-#define ST_SERIES   (RID_BIB_STRING +  27)
-#define ST_TITLE(RID_BIB_STRING +  28)
-#define ST_REPORT   (RID_BIB_STRING +  29)
-#define ST_VOLUME   (RID_BIB_STRING +  30)
-#define ST_URL  (RID_BIB_STRING +  31)
-#define ST_CUSTOM1  (RID_BIB_STRING +  32)
-#define ST_CUSTOM2  (RID_BIB_STRING +  33)
-#define ST_CUSTOM3  (RID_BIB_STRING +  34)
-#define ST_CUSTOM4  (RID_BIB_STRING +  35)
-#define ST_CUSTOM5  (RID_BIB_STRING +  36)
 #define ST_ERROR_PREFIX (RID_BIB_STRING +  37)
 #define ST_TYPE_ARTICLE (RID_BIB_STRING +  38)
 #define ST_TYPE_BOOK(RID_BIB_STRING +  39)
diff --git a/extensions/source/bibliography/bibview.cxx 
b/extensions/source/bibliography/bibview.cxx
index 341c3a9..1ecbe3d 100644
--- a/extensions/source/bibliography/bibview.cxx
+++ b/extensions/source/bibliography/bibview.cxx
@@ -113,6 +113,7 @@ namespace bib
 }
 
 m_xGeneralPage = m_pGeneralPage = new BibGeneralPage( this, m_pDatMan 
);
+m_pGeneralPage-Show();
 
 Resize();
 
diff --git a/extensions/source/bibliography/general.cxx 
b/extensions/source/bibliography/general.cxx
index 3975bcb..d139d61 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -27,6 +27,7 @@
 #include com/sun/star/awt/XWindow.hpp
 #include toolkit/helper/vclunohelper.hxx
 #include cppuhelper/implbase1.hxx
+#include vcl/builder.hxx
 #include vcl/settings.hxx
 #include general.hxx
 #include bibresid.hxx
@@ -52,16 +53,6 @@ using namespace ::com::sun::star::form;
 using namespace ::com::sun::star::sdb;
 using namespace ::rtl;
 
-#define DISTANCE_CONTROL_TO_FIXEDTEXT 5
-
-static ::Point lcl_MovePoint(const FixedText rFixedText)
-{
-

[Libreoffice-commits] core.git: 2 commits - desktop/source sal/Library_sal.mk sal/osl

2014-08-14 Thread Tor Lillqvist
 desktop/source/app/check_ext_deps.cxx  |3 ++
 desktop/source/deployment/misc/dp_misc.cxx |4 ++
 sal/Library_sal.mk |1 
 sal/osl/unx/uunxapi.cxx|   39 ++---
 4 files changed, 42 insertions(+), 5 deletions(-)

New commits:
commit 8e279c79f88608a4ab4dfc74c0a66a7947ea1482
Author: Tor Lillqvist t...@collabora.com
Date:   Fri Aug 15 01:39:49 2014 +0300

Don't do the security scope bookmark dance if not in a sandboxed process

No point in doing it in build-time tools like cppumaker which don't
run as sandboxed processes. Just slows them down a lot, while cfprefsd
consumes lots of CPU doing user preference lookups in vain for every
file accessed through the uunxapi functions.

Change-Id: I83e55a8e8d0c4f2c60c60ecad2c831e42c9e5bfd

diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index 16c4876..77d4176 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -81,6 +81,7 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,sal,\
Carbon \
CoreFoundation \
Foundation \
+   $(if $(ENABLE_MACOSX_SANDBOX),Security) \
 ))
 endif
 
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index 6fb75a1..8690c4d 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -37,11 +37,36 @@ inline rtl::OString OUStringToOString(const rtl_uString* s)
 
 #if defined(MACOSX)  MAC_OS_X_VERSION_MIN_REQUIRED = 1070  
HAVE_FEATURE_MACOSX_SANDBOX
 
+#include Foundation/Foundation.h
+#include Security/Security.h
+#include mach-o/dyld.h
+
 static NSUserDefaults *userDefaults = NULL;
+static bool isSandboxed = false;
 
-static void get_user_defaults()
+static void do_once()
 {
-userDefaults = [NSUserDefaults standardUserDefaults];
+SecCodeRef code;
+OSStatus rc = SecCodeCopySelf(kSecCSDefaultFlags, code);
+
+SecStaticCodeRef staticCode;
+if (rc == errSecSuccess)
+rc = SecCodeCopyStaticCode(code, kSecCSDefaultFlags, staticCode);
+
+CFDictionaryRef signingInformation;
+if (rc == errSecSuccess)
+rc = SecCodeCopySigningInformation(staticCode, 
kSecCSRequirementInformation, signingInformation);
+
+CFDictionaryRef entitlements = NULL;
+if (rc == errSecSuccess)
+entitlements = (CFDictionaryRef) 
CFDictionaryGetValue(signingInformation, kSecCodeInfoEntitlementsDict);
+
+if (entitlements != NULL)
+if (CFDictionaryGetValue(entitlements, 
CFSTR(com.apple.security.app-sandbox)) != NULL)
+isSandboxed = true;
+
+if (isSandboxed)
+userDefaults = [NSUserDefaults standardUserDefaults];
 }
 
 typedef struct {
@@ -53,12 +78,15 @@ static accessFilePathState *
 prepare_to_access_file_path( const char *cpFilePath )
 {
 static pthread_once_t once = PTHREAD_ONCE_INIT;
-pthread_once(once, get_user_defaults);
+pthread_once(once, do_once);
 NSURL *fileURL = nil;
 NSData *data = nil;
 BOOL stale;
 accessFilePathState *state;
 
+if (!isSandboxed)
+return NULL;
+
 // If malloc() fails we are screwed anyway
 state = (accessFilePathState*) malloc(sizeof(accessFilePathState));
 
@@ -86,6 +114,9 @@ prepare_to_access_file_path( const char *cpFilePath )
 static void
 done_accessing_file_path( const char * /*cpFilePath*/, accessFilePathState 
*state )
 {
+if (!isSandboxed)
+return;
+
 int saved_errno = errno;
 
 if (state-scopeURL != nil)
@@ -259,7 +290,7 @@ int open_c(const char *cpPath, int oflag, int mode)
 int result = open(cpPath, oflag, mode);
 
 #if defined(MACOSX)  MAC_OS_X_VERSION_MIN_REQUIRED = 1070  
HAVE_FEATURE_MACOSX_SANDBOX
-if (result != -1  (oflag  O_CREAT)  (oflag  O_EXCL))
+if (isSandboxed  result != -1  (oflag  O_CREAT)  (oflag  O_EXCL))
 {
 // A new file was created. Check if it is outside the sandbox.
 // (In that case it must be one the user selected as export or
commit 59ddf7216d52dd5492ffe1362174518dc2f5e0ce
Author: Tor Lillqvist t...@collabora.com
Date:   Tue Feb 25 16:26:30 2014 +0200

Don't do the annoying restart thing when sandboxed on OS X, ignore risks...

So far we have just displayed a hugely annoying dialog sorry, but we
suck, you need to start LibreOffice again. But that sucks. So just
try to do without restart then, and let's see what happens. At least
in trivial testing, no crash.

Change-Id: I475fe49a0fdb8086bb33a165a08b32ac46548857

diff --git a/desktop/source/app/check_ext_deps.cxx 
b/desktop/source/app/check_ext_deps.cxx
index e32bb13..ad2d72b 100644
--- a/desktop/source/app/check_ext_deps.cxx
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -18,6 +18,7 @@
  */
 
 #include config_folders.h
+#include config_features.h
 
 #include osl/file.hxx
 #include osl/mutex.hxx
@@ -420,8 +421,10 @@ void Desktop::SynchronizeExtensionRepositories()
 if (m_bCleanedExtensionCache) {
 

[Libreoffice-commits] core.git: 2 commits - desktop/source include/tools include/vcl rsc/inc rsc/source sw/source tools/source unusedcode.easy vcl/source writerfilter/source

2014-06-15 Thread Caolán McNamara
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx|   30 
 desktop/source/deployment/gui/dp_gui_extlistbox.hxx|6 --
 include/tools/rcid.h   |5 --
 include/vcl/combobox.hxx   |1 
 include/vcl/field.hxx  |1 
 rsc/inc/rscdb.hxx  |2 
 rsc/source/parser/rscicpx.cxx  |   41 -
 rsc/source/parser/rscinit.cxx  |8 ---
 sw/source/uibase/dbui/mailmergehelper.cxx  |   10 
 sw/source/uibase/inc/mailmergehelper.hxx   |2 
 tools/source/rc/resmgr.cxx |1 
 unusedcode.easy|7 ++
 vcl/source/control/combobox.cxx|7 --
 vcl/source/control/field.cxx   |   15 --
 writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx |3 -
 15 files changed, 9 insertions(+), 130 deletions(-)

New commits:
commit 8d373129e9ade194ff7759c9e8736945c4a2fb42
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Jun 14 21:36:11 2014 +0100

callcatcher: update unused code

and strip away some stuff in rsc that should now be dead

Change-Id: I6411e706c50dff299099680f1f942bf61c4e79f2

diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx 
b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 7e8a9b6..051220e 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -175,29 +175,6 @@ ExtensionRemovedListener::~ExtensionRemovedListener()
 
 
 // ExtensionBox_Impl
-
-ExtensionBox_Impl::ExtensionBox_Impl( Window* pParent, TheExtensionManager 
*pManager ) :
-IExtensionListBox( pParent, WB_BORDER | WB_TABSTOP | WB_CHILDDLGCTRL ),
-m_bHasScrollBar( false ),
-m_bHasActive( false ),
-m_bNeedsRecalc( true ),
-m_bInCheckMode( false ),
-m_bAdjustActive( false ),
-m_bInDelete( false ),
-m_nActive( 0 ),
-m_nTopIndex( 0 ),
-m_nActiveHeight( 0 ),
-m_nExtraHeight( 2 ),
-m_aSharedImage( DialogHelper::getResId( RID_IMG_SHARED ) ),
-m_aLockedImage( DialogHelper::getResId( RID_IMG_LOCKED ) ),
-m_aWarningImage( DialogHelper::getResId( RID_IMG_WARNING ) ),
-m_aDefaultImage( DialogHelper::getResId( RID_IMG_EXTENSION ) ),
-m_pScrollBar( NULL ),
-m_pManager( pManager )
-{
-Init();
-}
-
 ExtensionBox_Impl::ExtensionBox_Impl(Window* pParent) :
 IExtensionListBox( pParent, WB_BORDER | WB_TABSTOP | WB_CHILDDLGCTRL ),
 m_bHasScrollBar( false ),
@@ -422,13 +399,6 @@ void ExtensionBox_Impl::CalcActiveHeight( const long nPos )
 m_nActiveHeight = aTextHeight + 2;
 }
 
-
-const Size ExtensionBox_Impl::GetMinOutputSizePixel() const
-{
-return Size( 200, 80 );
-}
-
-
 Rectangle ExtensionBox_Impl::GetEntryRect( const long nPos ) const
 {
 const ::osl::MutexGuard aGuard( m_entriesMutex );
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx 
b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
index 019e804..e94eb41 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
@@ -182,9 +182,8 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox
 
 void Init();
 public:
-ExtensionBox_Impl(Window* pParent);
-ExtensionBox_Impl(Window* pParent, TheExtensionManager 
*pManager);
-   virtual ~ExtensionBox_Impl();
+ExtensionBox_Impl(Window* pParent);
+virtual ~ExtensionBox_Impl();
 
 virtual voidMouseButtonDown( const MouseEvent rMEvt ) SAL_OVERRIDE;
 virtual voidPaint( const Rectangle rPaintRect ) SAL_OVERRIDE;
@@ -192,7 +191,6 @@ public:
 virtual boolNotify( NotifyEvent rNEvt ) SAL_OVERRIDE;
 virtual SizeGetOptimalSize() const SAL_OVERRIDE;
 
-const Size  GetMinOutputSizePixel() const;
 voidSetExtraSize( long nSize ) { m_nExtraHeight = nSize; }
 TEntry_Impl GetEntryData( long nPos ) { return m_vEntries[ nPos ]; }
 longGetEntryCount() { return (long) m_vEntries.size(); }
diff --git a/include/tools/rcid.h b/include/tools/rcid.h
index 3d04f78..aef56b4 100644
--- a/include/tools/rcid.h
+++ b/include/tools/rcid.h
@@ -95,11 +95,6 @@
 
 #define RSC_DATEFIELD   (RSC_NOTYPE + 0x66)
 #define RSC_TIMEFIELD   (RSC_NOTYPE + 0x67)
-#define RSC_NUMERICBOX  (RSC_NOTYPE + 0x69)
-
-
-
-
 
 
 #define RSC_TOOLBOXITEM (RSC_NOTYPE + 0x70)
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 3ea2f64..f0dd459 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -85,7 +85,6 @@ protected:
 SAL_DLLPRIVATE long getMaxWidthScrollBarAndDownButton() const;
 
 protected:
-explicitComboBox( WindowType nType );
 bool 

  1   2   >