[Libreoffice-bugs] [Bug 98127] File created with MSO's right click explorer context menu entry have wrong format after saving in LibO

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98127

--- Comment #5 from Andrew  ---
Created attachment 123550
  --> https://bugs.documentfoundation.org/attachment.cgi?id=123550=edit
DOC document created by right click menu

This is example from my computer where file is created in .DOC format.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98127] File created with MSO's right click explorer context menu entry have wrong format after saving in LibO

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98127

--- Comment #4 from Andrew  ---
(In reply to Buovjaga from comment #3)
> I had to zip it up, because Bugzilla refused to accept the plain DOCX: "The
> file you are trying to attach is empty, does not exist, or you don't have
> permission to read it."

Zipped file has zero length!

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


Re: Build error

2016-03-13 Thread David Tardon
Hello,

On Sun, Mar 13, 2016 at 02:08:39PM +0530, krishna keshav wrote:
> Hello,
> I have trying to build libreoffice recently using make.However the build
> terminates after giving following error http://paste.ubuntu.com/15370838/ .
> I ran the commands stated on termination which resulted in nothing.
> 
> Please help with how should I proceed now.I am using ubuntu 14.04LTS.

You should paste a larger snippet that actually shows the failure.
Otherwise we cannot help you.

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


[Libreoffice-commits] core.git: Branch 'private/tml/fixwintext' - vcl/win

2016-03-13 Thread Tor Lillqvist
 vcl/win/gdi/salfont.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f771b7ac219ccb6eea4afc94445ab2702f6cd4e6
Author: Tor Lillqvist 
Date:   Mon Mar 14 07:29:14 2016 +0200

Fix what seems to have been off-by-one errors in glyph bounds calculation

For some reason the error had a visible impact (as far as I an see,
anyway) only for Graphite fonts. The bottommost pixels were cut
off. (Also leftmost, but that was not so easily visible.)

 Rectangle type, I love you.

Change-Id: I6f7438ec21d2bc1b9bef31cd70e649856f7ec7d5

diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index a47f3d1..3278e88 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -2014,9 +2014,9 @@ bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId 
aGlyphId, Rectangle& rRect )
 rRect = Rectangle( Point( +aGM.gmptGlyphOrigin.x, -aGM.gmptGlyphOrigin.y ),
 Size( aGM.gmBlackBoxX, aGM.gmBlackBoxY ) );
 rRect.Left()= static_cast( mfCurrentFontScale * rRect.Left() );
-rRect.Right()   = static_cast( mfCurrentFontScale * rRect.Right() );
+rRect.Right()   = static_cast( mfCurrentFontScale * rRect.Right() ) + 
1;
 rRect.Top() = static_cast( mfCurrentFontScale * rRect.Top() );
-rRect.Bottom()  = static_cast( mfCurrentFontScale * rRect.Bottom() );
+rRect.Bottom()  = static_cast( mfCurrentFontScale * rRect.Bottom() ) 
+ 1;
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 87195] mailmerge: add image from url field (enhancement)

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=87195

--- Comment #3 from Nicolas ABEL  ---
To trace outgoing mails, we use QR Codes.
We generate them dynamicaly through our mail management software.

We would really need to be able to use the URL of the QRCode and have
LibreOffice mail merge replace the URLs by the pictures in the final mails.

More and more administrations are using mail management softwares.
The unability to use pictures with LibreOffice mail merge is a real trouble.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-commits] core.git: Branch 'private/tml/fixwintext' - 3 commits - vcl/win

2016-03-13 Thread Tim Eves
 vcl/win/gdi/winlayout.cxx |   85 --
 1 file changed, 37 insertions(+), 48 deletions(-)

New commits:
commit 113cb32ea8aea71f39f9986736706dcb2ce47996
Author: Tim Eves 
Date:   Sat Mar 12 14:42:48 2016 +0700

Rename OpenGLGlyphChunk::mnAscent to mnBaselineOffset to reflect curr use

Changed at Tor's stuggestion to better describe to it's use as it's
value would be per chunk and based on the maximum ink box bounds of the
glyphs in the chunk, rather than having anything to do with the font's
real ascent value.

Change-Id: Iba15b26ff105731603b56f736cb9bca841f2cdd9

diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 0c37bd6..a5d810c 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -81,7 +81,7 @@ struct OpenGLGlyphCacheChunk
 std::vector maLocation;
 std::vector maLeftOverhangs;
 std::shared_ptr mpTexture;
-int mnAscent;
+int mnBaselineOffset;
 int mnHeight;
 bool mbVertical;
 bool mbRealGlyphIndices;
@@ -298,7 +298,7 @@ void DumpGlyphBitmap(HDC hDC, const OpenGLGlyphCacheChunk& 
rChunk)
 std::ostringstream sLine("\n", std::ios_base::ate);
 for (long y = 0; y < aBitmap.bmHeight; y++)
 {
-if (y == rChunk.mnAscent + rChunk.getExtraOffset())
+if (y == rChunk.mnBaselineOffset + rChunk.getExtraOffset())
 sLine << "-";
 else
 sLine << ColorFor(GetPixel(hDC, 0, y));
@@ -444,14 +444,14 @@ bool WinFontInstance::AddChunkOfGlyphs(bool 
bRealGlyphIndices, int nGlyphIndex,
 
 // bounds.Top() is the offset from the baseline at (0,0) to the top of the
 // inkbox.
-aChunk.mnAscent = -bounds.Top();
+aChunk.mnBaselineOffset = -bounds.Top();
 aChunk.mnHeight = bounds.getHeight();
 aChunk.mbVertical = false;
 /*
 DWRITE_FONT_METRICS aFontMetrics;
 pTxt->GetFontFace()->GetMetrics();
-aChunk.mnAscent = aFontMetrics.ascent * pTxt->GetEmHeight() / 
aFontMetrics.designUnitsPerEm;
-aChunk.mnHeight = aChunk.mnAscent + aFontMetrics.descent * 
pTxt->GetEmHeight() / aFontMetrics.designUnitsPerEm;
+aChunk.mnBaselineOffset = aFontMetrics.ascent * pTxt->GetEmHeight() / 
aFontMetrics.designUnitsPerEm;
+aChunk.mnHeight = aChunk.mnBaselineOffset + aFontMetrics.descent * 
pTxt->GetEmHeight() / aFontMetrics.designUnitsPerEm;
 */
 
 
@@ -524,7 +524,7 @@ bool WinFontInstance::AddChunkOfGlyphs(bool 
bRealGlyphIndices, int nGlyphIndex,
 return false;
 }
 
-D2D1_POINT_2F baseline = { aChunk.getExtraOffset(), 
aChunk.getExtraOffset() + aChunk.mnAscent };
+D2D1_POINT_2F baseline = { aChunk.getExtraOffset(), 
aChunk.getExtraOffset() + aChunk.mnBaselineOffset };
 DWRITE_GLYPH_RUN glyphs = {
 pTxt->GetFontFace(),
 pTxt->GetEmHeight(),
@@ -612,7 +612,7 @@ bool WinFontInstance::AddChunkOfGlyphs(bool 
bRealGlyphIndices, int nGlyphIndex,
 DeleteDC(hDC);
 return false;
 }
-aChunk.mnAscent = aTextMetric.tmAscent;
+aChunk.mnBaselineOffset = aTextMetric.tmAscent;
 aChunk.mnHeight = aTextMetric.tmHeight;
 
 LOGFONTW aLogfont;
@@ -1753,7 +1753,7 @@ bool SimpleWinLayout::DrawCachedGlyphs(SalGraphics& 
rGraphics) const
 SalTwoRect a2Rects(rChunk.maLocation[n].Left(), 
rChunk.maLocation[n].Top(),
rChunk.maLocation[n].getWidth(), 
rChunk.maLocation[n].getHeight(),
nAdvance + aPos.X() - rChunk.getExtraOffset() + 
rChunk.maLeftOverhangs[n],
-   aPos.Y() - rChunk.mnAscent - 
rChunk.getExtraOffset(),
+   aPos.Y() - rChunk.mnBaselineOffset - 
rChunk.getExtraOffset(),
rChunk.maLocation[n].getWidth(), 
rChunk.maLocation[n].getHeight()); // ???
 pImpl->DrawMask(*rChunk.mpTexture, salColor, a2Rects);
 
@@ -3284,7 +3284,7 @@ bool 
UniscribeLayout::DrawCachedGlyphsUsingTextures(SalGraphics& rGraphics) cons
 SalTwoRect a2Rects(rChunk.maLocation[n].Left(), 
rChunk.maLocation[n].Top(),
rChunk.maLocation[n].getWidth(), 
rChunk.maLocation[n].getHeight(),
nAdvance + aPos.X() + mpGlyphOffsets[i].du 
- rChunk.getExtraOffset() + rChunk.maLeftOverhangs[n],
-   aPos.Y() + mpGlyphOffsets[i].dv - 
rChunk.mnAscent - rChunk.getExtraOffset(),
+   aPos.Y() + mpGlyphOffsets[i].dv - 
rChunk.mnBaselineOffset - rChunk.getExtraOffset(),
rChunk.maLocation[n].getWidth(), 
rChunk.maLocation[n].getHeight()); // ???
 pImpl->DrawMask(*rChunk.mpTexture, salColor, a2Rects);
 }
commit 4bb174633b93d6d881266c157f9bad5d085aedf5
Author: Tim Eves 
Date:   Sat Mar 12 14:34:09 2016 +0700

Fix horizontal occsional alingment issues in OpenGL cached glyphs

  

[Libreoffice-bugs] [Bug 98629] Alt + numeric pad

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98629

Peter Lawson  changed:

   What|Removed |Added

 Status|NEEDINFO|UNCONFIRMED
 Ever confirmed|1   |0

--- Comment #2 from Peter Lawson  ---
> Which Windows version do you use?

10 single language

> Do you see the problem only in Writer or in Calc or Impress too?

Unfortunately I cannot answer because I have reverted to 5.0.1.2

> Do you insert the character in a normal text or into some special area like
> table cell or field?

In a table cell, together with other text. If I paste text from EditPad Lite,
which already contains suit symbols, these do appear

> Do you have tested other applications, e.g. Windows "Editor"?

Fine if I insert when using EditPad or Wordpad - the latter even gets the
colours right!

> What do you mean by "strange editing" in detail?

It's very hard to describe, but the cursor advances from the position where I
place it and then, instead of allowing me to insert characters, deletes them

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98601] can't convert large .XLS to .PDF using a macro or toolbar export button

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98601

--- Comment #3 from Heena Sananse  ---
Hello tommy,

I am using windows 7, 64 bit and Libra Office  Portable File version 4.4.4.0.

Thanks 
Heena Sananse

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


Test Builds with vs2013/2015 32/64 bits rel/debug/dbgutil

2016-03-13 Thread Norbert Thiebaud
test build result on windows
with vs2013/2015 on 32 and 64 bits
in release, debug and dbgutil
for make clean + make and then make check
(all with --disable-firebird-sdbc)

note: I had to revert
https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=0c3ff8ca07265304f9ea0a7aca8c83703cff01a1
which was breaking debug and dbgutil build from clean

msv  | 2013  | 2015  |
bits |32 |64 |32 |64 |
-
rel  | + | + | + | + |
check| + |(2)|(2)| + |
debug| + | + | + | + |
check| + |(1)|(1)|(1)|
dbgut| + | + | + | + |
check|(1)|(1)|(1)|(1)|

(1): cppunit hangs in sc_subsequent_export_test
(2): JUnitTest_toolkit_unoapi_1 intermittent failure
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-bugs] [Bug 93553] Writer crashes or hangs

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=93553

--- Comment #14 from Joel Madero  ---
(In reply to Ben from comment #13)
> Installed LibreOffice 5.1.1 on Ubuntu (Debian).
> So far, it seems that the crash issue does not appear anymore. I will
> perform som more testing and then install 5.1.1. also on Windows and wil
> continue to report the status. One major issue I notied is that most (if not
> all) of the formulas in the document have been changed to a different font.
> Is there an easy way to revert them to the text font used in the document?

Not as far as I know :( Is this with the test file attached that you see
different fonts?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 96896] Writer crashes when frame title is changed via API and user closes print preview

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=96896

--- Comment #14 from akash...@gmail.com ---
Hi,
(In reply to castanheira from comment #13)

> I am actually able to edit the doc after step 4 in case 2. Surprisingly, I
> am also able to edit the doc before step 3! I haven't noticed that before.
> When a new doc is opened using
> loadComponentFromURL("private:factory/swriter","_blank",0,OpenOptions) and
> OpenOptions has a value "ReadOnly" = True, the expression "(read-only)" is
> appended to the window title, but document is not put in read-only mode. It
> is not possible to toggle edit mode using Ctrl+Shift+M (grayed out under
> Edit menu). This behaviour is the same whether window title is changed or
> not.
> To further investigate the behaviour of loadComponentFromURL with the URL
> "private:factory/swriter", I've removed the value "ReadOnly" from
> OpenOptions. Document is opened in edit mode as expected, but Ctrl+Shift+M
> is grayed out under Edit menu until you save document.
> So, it seems that a document cannot be put in read-only mode before it is
> saved to disk. If so, loadComponentFromURL with URL
> "private:factory/swriter" and OpenOptions "ReadOnly"=True should be
> considered unsupported. Nevertheless, Libreoffice appends "(read-only)" to
> the window title...
That is correct. Doc needs to be saved before read-only mode can be toggled.
When trying to switch to read-only mode in a new doc I even get a dialog asking
me to save the doc first. Perhaps a fix for this,as you also mention, would be:
If a doc is opened with a factory/swriter url then read-only mode should be
false only.

> However, when an existing document is opened using
> loadComponentFromURL("file:///C:/Users/Public/existing.odt","_blank",0,
> OpenOptions) and OpenOptions has a value "ReadOnly" = True, the expression
> "(read-only)" is appended to the window title and, as expected, document
> actually opens in read-only mode. Then, if window title is changed using API
> and print preview is selected, the expression "(read-only)" dissapears but
> document remains in read-only mode.
Thanks for confirming this. I was expecting this only as, you would agree with
me, title change will not effect the actual mode of the document. This then is
the problem related to the m_bExternalTitle parameter for the
impl_updateTitleForModel function. 

>Wow =) I just love the analysis from you guys; TBH at this point - I suspect 
>>that no-one else in the project has as deep an understanding of you guys of 
>>this code as is shown in the analysis here.
:)

> Can any dev help me on this?
>git grep -10 leaseNumber
>shows a number of comphelper/ hits - I guess the lease is expired and then 
>>re-used or somesuch (but having not read it - I have far less insight than 
>you >as to what is going on ) - it strikes me Stephan may have a view on 
>framework/ >pieces though.
Thanks for pointing this out.I have figured it out =).
In comphelper/source/misc/numberedcollection.cxx the leaseFunction maintains a
hash with component(a weak reference to it) and its leaseNumber. Now this
component reference doesn't match with the reference of the controller passed
to the impl_updateTitleForController method. Because a weak reference is being
obtained to the original controller and being passed as the component
reference. Hence, even when the original controller is disposed, the hash table
entry is not deleted as it is maintaining a reference to a reference. It only
gets deleted later. Hence the number changes between 2 and 3.

>In terms of proceeding; what I would suggest is:

>a) fix the bug how you think best (akash)
At this moment I am pretty sure on how the bug has to be solved. In my gdb
session I am able to recreate the release of the number by a controller and the
title behaves the way in the way it should. But I am facing a issue:

1. A frame detach event, obviously, has a frame as the source. It is possible
to get the controller related to the frame as well. When the frame event
occurs, we have no data related to the controller. And if we try to get the
data of the controller, we lose information about the type of the event that
has caused us to get the data. Data such as numbered collection is also needed
in all other cases. So there is no way to distinguish between the two.

2. When a new component is being set in the frame, the old controller is
disposed via dispose(). Then perhaps we could call a function in this function
to dispose the title. But the problem is that the controller class stores its
attributes in a XTitle reference for title related things. And within the
XTitle class there are only two function to get the string and to set it.
Nothing else. And we need to get the numbered collection and the component
reference. Then we need to obtain a weak reference to the component.

3. Then I propose to edit the XTitle class. Either to add a new function. Or to
modify the setTitle function which takes a parameter bool dispose false by

[Libreoffice-bugs] [Bug 93553] Writer crashes or hangs

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=93553

--- Comment #13 from Ben  ---
Installed LibreOffice 5.1.1 on Ubuntu (Debian).
So far, it seems that the crash issue does not appear anymore. I will perform
som more testing and then install 5.1.1. also on Windows and wil continue to
report the status. One major issue I notied is that most (if not all) of the
formulas in the document have been changed to a different font. Is there an
easy way to revert them to the text font used in the document?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.hpp loolwsd/LOOLWSD.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentBroker.hpp |9 ---
 loolwsd/LOOLWSD.cpp|   57 ++---
 2 files changed, 39 insertions(+), 27 deletions(-)

New commits:
commit 981e83ece6cc93d5d6c20fef45773b5dfb6b647d
Author: Ashod Nakashian 
Date:   Sun Mar 13 14:00:19 2016 -0400

loolwsd: fixed convert-to (POST) tests

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

diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index fd9efa3..ad068d1 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -31,14 +31,7 @@ public:
 {
 Log::info("Creating DocumentBroker for uri: " + uri + ".");
 
-// The URI of the document is url-encoded
-// and passed in our URL.
-if (uri.size() > 0 && uri[0] == '/')
-{
-// Remove leading '/'.
-uri.erase(0, 1);
-}
-
+// The URI of the document should be url-encoded.
 std::string decodedUri;
 Poco::URI::decode(uri, decodedUri);
 auto uriPublic = Poco::URI(decodedUri);
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 1dc41a2..5435669 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -329,55 +329,67 @@ private:
 
 void handlePostRequest(HTTPServerRequest& request, HTTPServerResponse& 
response, const std::string& id)
 {
-Log::info("Post request.");
+Log::info("Post request: " + request.getURI() + "]");
 StringTokenizer tokens(request.getURI(), "/?");
 if (tokens.count() >= 2 && tokens[1] == "convert-to")
 {
-Log::info("Conversion request.");
 std::string fromPath;
 ConvertToPartHandler handler(fromPath);
 HTMLForm form(request, request.stream(), handler);
-std::string format;
-if (form.has("format"))
-format = form.get("format");
+const std::string format = (form.has("format") ? 
form.get("format") : "");
 
 bool sent = false;
 if (!fromPath.empty())
 {
 if (!format.empty())
 {
+Log::info("Conversion request for URI [" + fromPath + 
"].");
+auto docBroker = DocumentBroker::create(fromPath, 
LOOLWSD::ChildRoot);
+const auto docKey = docBroker->getDocKey();
+
+// This lock could become a bottleneck.
+// In that case, we can use a pool and index by publicPath.
+std::unique_lock 
lock(LOOLWSD::DocBrokersMutex);
+
+Log::debug("New DocumentBroker for docKey [" + docKey + 
"].");
+LOOLWSD::DocBrokers.emplace(docKey, docBroker);
+
 // Load the document.
 std::shared_ptr ws;
 const LOOLSession::Kind kind = LOOLSession::Kind::ToClient;
-auto session = std::make_shared(id, 
kind, ws, nullptr);
-const std::string filePrefix("file://");
+auto session = std::make_shared(id, 
kind, ws, docBroker);
+docBroker->incSessions();
+lock.unlock();
+
 std::string encodedFrom;
-URI::encode(filePrefix + fromPath, "", encodedFrom);
+URI::encode(docBroker->getPublicUri().getPath(), "", 
encodedFrom);
 const std::string load = "load url=" + encodedFrom;
 session->handleInput(load.data(), load.size());
 
 // Convert it to the requested format.
-Path toPath(fromPath);
+Path toPath(docBroker->getPublicUri().getPath());
 toPath.setExtension(format);
-std::string toJailURL = filePrefix + JailedDocumentRoot + 
toPath.getFileName();
+const std::string toJailURL = "file://" + 
JailedDocumentRoot + toPath.getFileName();
 std::string encodedTo;
 URI::encode(toJailURL, "", encodedTo);
 std::string saveas = "saveas url=" + encodedTo + " 
format=" + format + " options=";
 session->handleInput(saveas.data(), saveas.size());
 
-std::string toURL = session->getSaveAs();
-std::string resultingURL;
-URI::decode(toURL, resultingURL);
-
 // Send it back to the client.
-if (resultingURL.find(filePrefix) == 0)
-resultingURL = 
resultingURL.substr(filePrefix.length());
-if (!resultingURL.empty())
+Poco::URI resultURL(session->getSaveAs());
+

[Libreoffice-commits] online.git: loolwsd/test

2016-03-13 Thread Ashod Nakashian
 loolwsd/test/httpwstest.cpp |   55 +++-
 1 file changed, 29 insertions(+), 26 deletions(-)

New commits:
commit cc0a607185ccb1fa170c0aa616724249607bf182
Author: Ashod Nakashian 
Date:   Sun Mar 13 13:23:12 2016 -0400

loolwsd: fix tests to pass URL in GET request

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

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 02d1815..77c5878 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -29,7 +29,6 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
 {
 const Poco::URI _uri;
 Poco::Net::HTTPClientSession _session;
-Poco::Net::HTTPRequest _request;
 Poco::Net::HTTPResponse _response;
 
 CPPUNIT_TEST_SUITE(HTTPWSTest);
@@ -66,8 +65,7 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
 public:
 HTTPWSTest()
 : _uri("http://127.0.0.1:; + std::to_string(ClientPortNumber)),
-  _session(_uri.getHost(), _uri.getPort()),
-  _request(Poco::Net::HTTPRequest::HTTP_GET, "/")
+  _session(_uri.getHost(), _uri.getPort())
 {
 }
 
@@ -84,12 +82,13 @@ void HTTPWSTest::testPaste()
 {
 try
 {
-Poco::Net::WebSocket socket(_session, _request, _response);
-
 // Load a document and make it empty.
 const std::string documentPath = TDOC "/hello.odt";
 const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
 
+Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
+Poco::Net::WebSocket socket(_session, request, _response);
+
 sendTextFrame(socket, "load url=" + documentURL);
 sendTextFrame(socket, "status");
 CPPUNIT_ASSERT_MESSAGE("cannot load the document " + documentURL, 
isDocumentLoaded(socket));
@@ -137,11 +136,12 @@ void HTTPWSTest::testLargePaste()
 {
 try
 {
-Poco::Net::WebSocket socket(_session, _request, _response);
-
 // Load a document and make it empty.
-std::string documentPath = TDOC "/hello.odt";
-std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+const std::string documentPath = TDOC "/hello.odt";
+const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+
+Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
+Poco::Net::WebSocket socket(_session, request, _response);
 
 sendTextFrame(socket, "load url=" + documentURL);
 sendTextFrame(socket, "status");
@@ -187,12 +187,14 @@ void HTTPWSTest::testRenderingOptions()
 {
 try
 {
-Poco::Net::WebSocket socket(_session, _request, _response);
-
 // Load a document and get its size.
 const std::string documentPath = TDOC "/hide-whitespace.odt";
 const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
 const std::string options = 
"{\"rendering\":{\".uno:HideWhitespace\":{\"type\":\"boolean\",\"value\":\"true\"}}}";
+
+Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
+Poco::Net::WebSocket socket(_session, request, _response);
+
 sendTextFrame(socket, "load url=" + documentURL + " options=" + 
options);
 sendTextFrame(socket, "status");
 
@@ -239,11 +241,12 @@ void 
HTTPWSTest::testPasswordProtectedDocumentWithoutPassword()
 {
 try
 {
-
-Poco::Net::WebSocket socket(_session, _request, _response);
-
 const std::string documentPath = TDOC "/password-protected.ods";
 const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
+
+Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
+Poco::Net::WebSocket socket(_session, request, _response);
+
 // Send a load request without password first
 sendTextFrame(socket, "load url=" + documentURL);
 std::string response;
@@ -273,16 +276,16 @@ void 
HTTPWSTest::testPasswordProtectedDocumentWithWrongPassword()
 {
 try
 {
-
-Poco::Net::WebSocket socket(_session, _request, _response);
-
 const std::string documentPath = TDOC "/password-protected.ods";
 const std::string documentURL = "file://" + 
Poco::Path(documentPath).makeAbsolute().toString();
-std::string response;
+
+Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
+Poco::Net::WebSocket socket(_session, request, _response);
 
 // Send a load request with incorrect password
 sendTextFrame(socket, "load url=" + documentURL + " password=2");
 
+std::string 

[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLWSD.cpp |   46 --
 1 file changed, 24 insertions(+), 22 deletions(-)

New commits:
commit 66cd6cd5c3d3dc38b680c300b292c535fa981875
Author: Ashod Nakashian 
Date:   Sun Mar 13 13:21:36 2016 -0400

loolwsd: improved DocumentBroker lifetime and thread handling

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

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index ca08811..1dc41a2 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -508,35 +508,36 @@ private:
 auto docBroker = DocumentBroker::create(request.getURI(), 
LOOLWSD::ChildRoot);
 const auto docKey = docBroker->getDocKey();
 
-{
-// This lock could become a bottleneck.
-// In that case, we can use a pool and index by publicPath.
-std::unique_lock lock(LOOLWSD::DocBrokersMutex);
+// This lock could become a bottleneck.
+// In that case, we can use a pool and index by publicPath.
+std::unique_lock lock(LOOLWSD::DocBrokersMutex);
 
-// Lookup this document.
-auto it = LOOLWSD::DocBrokers.find(docKey);
-if (it != LOOLWSD::DocBrokers.end())
-{
-// Get the DocumentBroker from the Cache.
-docBroker = it->second;
-assert(docBroker);
-}
-else
-{
-// Set one we just created.
-LOOLWSD::DocBrokers.emplace(docKey, docBroker);
-}
+// Lookup this document.
+auto it = LOOLWSD::DocBrokers.find(docKey);
+if (it != LOOLWSD::DocBrokers.end())
+{
+// Get the DocumentBroker from the Cache.
+Log::debug("Found DocumentBroker for docKey [" + docKey + "].");
+docBroker = it->second;
+assert(docBroker);
+}
+else
+{
+// Set one we just created.
+Log::debug("New DocumentBroker for docKey [" + docKey + "].");
+LOOLWSD::DocBrokers.emplace(docKey, docBroker);
 }
 
+auto ws = std::make_shared(request, response);
+auto session = std::make_shared(id, 
LOOLSession::Kind::ToClient, ws, docBroker);
+docBroker->incSessions();
+lock.unlock();
+
 // Request a kit process for this doc.
 const std::string aMessage = "request " + id + " " + docKey + "\r\n";
 Log::debug("MasterToBroker: " + aMessage.substr(0, aMessage.length() - 
2));
 Util::writeFIFO(LOOLWSD::BrokerWritePipe, aMessage);
 
-auto ws = std::make_shared(request, response);
-auto session = std::make_shared(id, 
LOOLSession::Kind::ToClient, ws, docBroker);
-docBroker->incSessions();
-
 // For ToClient sessions, we store incoming messages in a queue and 
have a separate
 // thread that handles them. This is so that we can empty the queue 
when we get a
 // "canceltiles" message.
@@ -570,9 +571,10 @@ private:
 queue.put("eof");
 queueHandlerThread.join();
 
-std::unique_lock lock(LOOLWSD::DocBrokersMutex);
+lock.lock();
 if (docBroker->decSessions() == 0)
 {
+Log::debug("Removing DocumentBroker for docKey [" + docKey + "].");
 LOOLWSD::DocBrokers.erase(docKey);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.hpp loolwsd/MasterProcessSession.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentBroker.hpp   |2 +-
 loolwsd/MasterProcessSession.cpp |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e0b14c0e22f46a05de3cba3561f2f8300b90c5e5
Author: Ashod Nakashian 
Date:   Sun Mar 13 13:19:14 2016 -0400

loolwsd: give Broker the docKey, not URL

And reject connections with no doc URL.

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

diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index 544efbb..fd9efa3 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -33,7 +33,7 @@ public:
 
 // The URI of the document is url-encoded
 // and passed in our URL.
-if (uri.size() > 1 && uri[0] == '/')
+if (uri.size() > 0 && uri[0] == '/')
 {
 // Remove leading '/'.
 uri.erase(0, 1);
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index e1b7a6d..98941b3 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -750,7 +750,7 @@ void MasterProcessSession::dispatchChild()
 {
 Log::info() << "Retrying child permission... " << retries << 
Log::end;
 // request again new URL session
-const std::string message = "request " + getId() + " " + _docURL + 
"\r\n";
+const std::string message = "request " + getId() + " " + 
_docBroker->getDocKey() + "\r\n";
 Log::trace("MasterToBroker: " + message.substr(0, 
message.length()-2));
 Util::writeFIFO(LOOLWSD::BrokerWritePipe, message);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/LOOLBroker.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLBroker.cpp |   31 ++-
 1 file changed, 18 insertions(+), 13 deletions(-)

New commits:
commit c42ea2ea1300d8034d6df9e67862830b375132b6
Author: Ashod Nakashian 
Date:   Sun Mar 13 11:11:28 2016 -0400

loolwsd: avoid complaining when killing exited child

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

diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index 7cf211d..81bf06f 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -88,15 +88,17 @@ namespace
 
 ~ChildProcess()
 {
-close();
+close(true);
 }
 
-void close()
+void close(const bool rude)
 {
 if (_pid != -1)
 {
-if (kill(_pid, SIGINT) != 0 && kill(_pid, 0) != 0)
-Log::warn("Cannot terminate lokit [" + 
std::to_string(_pid) + "]. Abandoning.");
+if (kill(_pid, SIGINT) != 0 && rude && kill(_pid, 0) != 0)
+{
+Log::error("Cannot terminate lokit [" + 
std::to_string(_pid) + "]. Abandoning.");
+}
 
 std::ostringstream message;
 message << "rmdoc" << " "
@@ -165,14 +167,14 @@ namespace
 }
 
 /// Safely removes a child process.
-void removeChild(const Process::PID pid)
+void removeChild(const Process::PID pid, const bool rude)
 {
 std::lock_guard lock(forkMutex);
 const auto it = _childProcesses.find(pid);
 if (it != _childProcesses.end())
 {
 // Close the child resources.
-it->second->close();
+it->second->close(rude);
 _childProcesses.erase(it);
 }
 }
@@ -347,7 +349,7 @@ public:
 if (isEmptyChild)
 {
 // This is probably a child in bad state. Rid of it and 
create new.
-removeChild(child->getPid());
+removeChild(child->getPid(), true);
 }
 }
 else
@@ -360,7 +362,7 @@ public:
 else if (tokens[0] == "kill" && tokens.count() == 2)
 {
 Process::PID nPid = 
static_cast(std::stoi(tokens[1]));
-removeChild(nPid);
+removeChild(nPid, true);
 }
 }
 
@@ -754,7 +756,7 @@ int main(int argc, char** argv)
 Log::info() << "Child process [" << pid << "] exited with 
code: "
 << WEXITSTATUS(status) << "." << Log::end;
 
-removeChild(pid);
+removeChild(pid, false);
 }
 else
 if (WIFSIGNALED(status))
@@ -770,7 +772,7 @@ int main(int argc, char** argv)
  << " signal: " << strsignal(WTERMSIG(status))
  << Log::end;
 
-removeChild(pid);
+removeChild(pid, false);
 }
 else if (WIFSTOPPED(status))
 {
@@ -803,22 +805,25 @@ int main(int argc, char** argv)
 }
 else if (pid < 0)
 {
-Log::error("Error: waitpid failed.");
 // No child processes
 if (errno == ECHILD)
 {
 if (childExitCode == EXIT_SUCCESS)
 {
-Log::warn("Warn: last child exited successfully, fork new 
one.");
+Log::info("Last child exited successfully, fork new one.");
 ++forkCounter;
 }
 else
 {
 Log::error("Error: last child exited with error code.");
-TerminationFlag = true;
+TerminationFlag = true; //FIXME: Why?
 continue;
 }
 }
+else
+{
+Log::error("waitpid failed.");
+}
 }
 
 if (forkCounter > 0 && childExitCode == EXIT_SUCCESS)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/LOOLKit.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLKit.cpp |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit f2eec85b2a84d58eb2d125f1a826d71fdcd85d4b
Author: Ashod Nakashian 
Date:   Sun Mar 13 11:02:47 2016 -0400

loolwsd: jailId ought be random, but must be PID

Ideally, we will have a randomized path for the jails.

Unfortunately, this will make it harder to cleanup
after an ungraceful exit of a child, including recovery
of docs etc.

Having a PID for the jailId makes this issue easier by
implicitly implying the jail path for a given child.

To prevent security leaks, we should at least randomize
the doc directory within the jail, as such:

/chroot//user/docs//

For now we use jailId=pid=rand.

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

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 36ae9b4..dcf5e61 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -784,7 +784,10 @@ void lokit_main(const std::string& childRoot,
 
 std::map _documents;
 
-static const std::string jailId = Util::encodeId(Util::rng::getNext());
+// Ideally this will be a random ID, but broker will cleanup
+// our jail directory when we die, and it's simpler to know
+// the jailId (i.e. the path) implicitly by knowing our pid.
+static const std::string jailId = std::to_string(Process::id());
 static const std::string process_name = "loolkit";
 
 if (prctl(PR_SET_NAME, reinterpret_cast(process_name.c_str()), 0, 0, 0) != 0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/LOOLKit.cpp loolwsd/MasterProcessSession.cpp loolwsd/MasterProcessSession.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLKit.cpp  |7 ++-
 loolwsd/MasterProcessSession.cpp |   35 +++
 loolwsd/MasterProcessSession.hpp |4 
 3 files changed, 5 insertions(+), 41 deletions(-)

New commits:
commit 29e9ba68c3fcf58c65a9272b8bb80369750fd0c4
Author: Ashod Nakashian 
Date:   Sun Mar 13 11:02:12 2016 -0400

loolwsd: removed unnecessary childId, which is in the child URL

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

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 33aebe1..36ae9b4 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -399,8 +399,8 @@ public:
 }
 
 Log::info() << "Creating " << (_clientViews ? "new" : "first")
-<< " view for url: " << _url << " for thread: " << 
sessionId
-<< " on child: " << _jailId << Log::end;
+<< " view for url: " << _url << " for sessionId: " << 
sessionId
+<< " on jailId: " << _jailId << Log::end;
 
 // Open websocket connection between the child process and the
 // parent. The parent forwards us requests that it can't handle.
@@ -416,9 +416,6 @@ public:
 auto session = std::make_shared(sessionId, ws, 
_loKitDocument, _jailId,
[this](const std::string& id, const std::string& uri, 
const std::string& docPassword, bool isDocPasswordProvided) { return onLoad(id, 
uri, docPassword, isDocPasswordProvided); },
[this](const std::string& id) { onUnload(id); });
-// child -> 0,  sessionId -> 1, PID -> 2
-const std::string hello("child " + sessionId + " " + _jailId);
-session->sendTextFrame(hello);
 
 auto thread = std::make_shared(session, ws);
 const auto aInserted = _connections.emplace(intSessionId, thread);
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index d78a762..e1b7a6d 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -112,7 +112,7 @@ bool MasterProcessSession::_handleInput(const char *buffer, 
int length)
 return true;
 }
 
-if (haveSeparateProcess())
+if (_kind == Kind::ToPrisoner)
 {
 // Note that this handles both forwarding requests from the client to 
the child process, and
 // forwarding replies from the child process to the client. Or does it?
@@ -120,7 +120,6 @@ bool MasterProcessSession::_handleInput(const char *buffer, 
int length)
 // Snoop at some messages and manipulate tile cache information as 
needed
 auto peer = _peer.lock();
 
-if (_kind == Kind::ToPrisoner)
 {
 if (!peer)
 {
@@ -205,7 +204,7 @@ bool MasterProcessSession::_handleInput(const char *buffer, 
int length)
 }
 }
 
-if (_kind == Kind::ToPrisoner && peer && peer->_tileCache && 
!_isDocPasswordProtected)
+if (peer && peer->_tileCache && !_isDocPasswordProtected)
 {
 if (tokens[0] == "tile:")
 {
@@ -280,31 +279,7 @@ bool MasterProcessSession::_handleInput(const char 
*buffer, int length)
 return true;
 }
 
-if (tokens[0] == "child")
-{
-if (_kind != Kind::ToPrisoner)
-{
-sendTextFrame("error: cmd=child kind=invalid");
-return false;
-}
-if (!_peer.expired())
-{
-sendTextFrame("error: cmd=child kind=invalid");
-return false;
-}
-if (tokens.count() != 3)
-{
-sendTextFrame("error: cmd=child kind=syntax");
-return false;
-}
-
-// child -> 0,  sessionId -> 1, PID -> 2
-setId(tokens[1]);
-_childId = tokens[2];
-
-Log::info() << getName() << " Child jailId=" << _childId << ", 
sessionId=" << getId() << Log::end;
-}
-else if (_kind == Kind::ToPrisoner)
+if (_kind == Kind::ToPrisoner)
 {
 // Message from child process to be forwarded to client.
 
@@ -420,10 +395,6 @@ bool MasterProcessSession::_handleInput(const char 
*buffer, int length)
 return true;
 }
 
-bool MasterProcessSession::haveSeparateProcess()
-{
-return !_childId.empty();
-}
 bool MasterProcessSession::invalidateTiles(const char* /*buffer*/, int 
/*length*/, StringTokenizer& tokens)
 {
 int part, tilePosX, tilePosY, tileWidth, tileHeight;
diff --git a/loolwsd/MasterProcessSession.hpp b/loolwsd/MasterProcessSession.hpp
index f2049fe..c1b6dd6 100644
--- a/loolwsd/MasterProcessSession.hpp
+++ b/loolwsd/MasterProcessSession.hpp
@@ -25,8 +25,6 @@ public:
  std::shared_ptr docBroker);
 virtual ~MasterProcessSession();
 
-bool haveSeparateProcess();
-
 virtual bool 

[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp loolwsd/MasterProcessSession.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLWSD.cpp  |2 ++
 loolwsd/MasterProcessSession.cpp |3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 38c4acd5f0ec6e96458e86ddb357e12177dd8dd0
Author: Ashod Nakashian 
Date:   Sat Mar 12 20:39:34 2016 -0500

loolwsd: moved document loading outside of MasterProcessSession

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

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 28b1a8e..1d63532 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -681,6 +681,8 @@ public:
 }
 }
 
+docBroker->load(jailId);
+
 auto ws = std::make_shared(request, response);
 auto session = std::make_shared(sessionId, 
LOOLSession::Kind::ToPrisoner, ws, docBroker);
 
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index bdb730f..d78a762 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -801,9 +801,6 @@ void MasterProcessSession::dispatchChild()
 return;
 }
 
-const auto jailRoot = Poco::Path(LOOLWSD::ChildRoot, 
childSession->_childId);
-_docBroker->load(childSession->_childId);
-
 _peer = childSession;
 childSession->_peer = shared_from_this();
 childSession->_docBroker = _docBroker;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentBroker.hpp |   37 -
 1 file changed, 4 insertions(+), 33 deletions(-)

New commits:
commit 1aa7a6cf05526282f93516713a1bfee143e1c3f8
Author: Ashod Nakashian 
Date:   Sun Mar 13 10:05:40 2016 -0400

loolwsd: simplified DocumentBroker::create

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

diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index f4fc674..544efbb 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -27,8 +27,10 @@ class DocumentBroker
 public:
 
 static
-Poco::URI getUri(std::string uri)
+std::shared_ptr create(std::string uri, const std::string& 
childRoot)
 {
+Log::info("Creating DocumentBroker for uri: " + uri + ".");
+
 // The URI of the document is url-encoded
 // and passed in our URL.
 if (uri.size() > 1 && uri[0] == '/')
@@ -47,42 +49,11 @@ public:
 uriPublic.normalize();
 }
 
-Log::info("Public URI [" + uriPublic.toString() + "].");
 if (uriPublic.getPath().empty())
 {
 throw std::runtime_error("Invalid URI.");
 }
 
-return uriPublic;
-}
-
-static
-std::shared_ptr create(const std::string& uri, const 
std::string& childRoot)
-{
-std::string decodedUri;
-Poco::URI::decode(uri, decodedUri);
-auto uriPublic = Poco::URI(decodedUri);
-
-if (uriPublic.isRelative() || uriPublic.getScheme() == "file")
-{
-// TODO: Validate and limit access to local paths!
-uriPublic.normalize();
-}
-
-Log::info("Public URI [" + uriPublic.toString() + "].");
-if (uriPublic.getPath().empty())
-{
-throw std::runtime_error("Invalid URI.");
-}
-
-return create(uriPublic, childRoot);
-}
-
-static
-std::shared_ptr create(const Poco::URI& uriPublic, const 
std::string& childRoot)
-{
-Log::info("Creating DocumentBroker for uri: " + uriPublic.toString());
-
 std::string docKey;
 Poco::URI::encode(uriPublic.getPath(), "", docKey);
 
@@ -168,7 +139,7 @@ private:
 {
 assert(!_docKey.empty());
 assert(!_childRoot.empty());
-Log::info("DocumentBroker [" + _uriPublic.toString() + "] created.");
+Log::info("DocumentBroker [" + _uriPublic.toString() + "] created. 
DocKey: [" + _docKey + "]");
 }
 
 private:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.hpp loolwsd/LOOLWSD.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentBroker.hpp |6 +-
 loolwsd/LOOLWSD.cpp|7 ++-
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 0b18a67da21debd051f151718f271cea27c30bc8
Author: Ashod Nakashian 
Date:   Sun Mar 13 10:04:54 2016 -0400

loolwsd: DocumentBroker cleanup

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

diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index 71c9681..f4fc674 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -148,6 +148,8 @@ public:
 Poco::URI getJailedUri() const { return _uriJailed; }
 const std::string& getJailId() const { return _jailId; }
 const std::string& getDocKey() const { return _docKey; }
+unsigned decSessions() { return --_sessionsCount; }
+unsigned incSessions() { return ++_sessionsCount; }
 
 std::string getJailRoot() const
 {
@@ -161,7 +163,8 @@ private:
const std::string& childRoot) :
_uriPublic(uriPublic),
_docKey(docKey),
-   _childRoot(childRoot)
+   _childRoot(childRoot),
+   _sessionsCount(0)
 {
 assert(!_docKey.empty());
 assert(!_childRoot.empty());
@@ -176,6 +179,7 @@ private:
 std::string _jailId;
 std::unique_ptr _storage;
 std::mutex _mutex;
+std::atomic _sessionsCount;
 };
 
 #endif
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 1d63532..ca08811 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -535,6 +535,7 @@ private:
 
 auto ws = std::make_shared(request, response);
 auto session = std::make_shared(id, 
LOOLSession::Kind::ToClient, ws, docBroker);
+docBroker->incSessions();
 
 // For ToClient sessions, we store incoming messages in a queue and 
have a separate
 // thread that handles them. This is so that we can empty the queue 
when we get a
@@ -569,7 +570,11 @@ private:
 queue.put("eof");
 queueHandlerThread.join();
 
-//TODO: Cleanup DocumentBroker.
+std::unique_lock lock(LOOLWSD::DocBrokersMutex);
+if (docBroker->decSessions() == 0)
+{
+LOOLWSD::DocBrokers.erase(docKey);
+}
 }
 
 public:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: rsc/source

2016-03-13 Thread Norbert Thiebaud
 rsc/source/parser/rscdb.cxx |   11 +--
 rsc/source/prj/gui.cxx  |4 +++-
 rsc/source/rsc/rsc.cxx  |   12 +---
 rsc/source/rscpp/cpp.h  |   10 +-
 rsc/source/rscpp/cpp1.c |   14 +++---
 rsc/source/rscpp/cpp2.c |6 +++---
 rsc/source/rscpp/cpp3.c |   16 
 rsc/source/rscpp/cpp4.c |   12 ++--
 rsc/source/rscpp/cpp6.c |4 ++--
 9 files changed, 52 insertions(+), 37 deletions(-)

New commits:
commit 982fcf11b763ac1b4cd2b68291ea7d94fe14752d
Author: Norbert Thiebaud 
Date:   Sun Mar 13 11:50:41 2016 -0500

Revert "tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals"

This reverts commit 0c3ff8ca07265304f9ea0a7aca8c83703cff01a1.
that was breaking debug and dbgutil build on windows (at least)

Change-Id: Ide58bd4551029bb4e1ef791bb65ad191fbb25cae

diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index 7f135be..2c253e8 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -83,6 +83,9 @@ OString RscTypCont::ChangeLanguage(const OString& rNewLang)
 if (bAppendEnUsFallback)
 aFallbacks.push_back( "en-US");
 
+#if OSL_DEBUG_LEVEL > 1
+fprintf( stderr, "RscTypCont::ChangeLanguage: " );
+#endif
 
 aLangFallbacks.clear();
 
@@ -96,11 +99,15 @@ OString RscTypCont::ChangeLanguage(const OString& rNewLang)
 AddLanguage( aLang.getStr() );
 nID = GetLangId( aLang );
 }
-SAL_INFO("rsc", "RscTypCont::ChangeLanguage: '" <<
-aLang << "' (0x" << std::hex << nID << ") (" << (bAdd ? "added" : 
"exists"));
+#if OSL_DEBUG_LEVEL > 1
+fprintf( stderr, " '%s' (0x%hx) (%s)", aLang.getStr(), (int)nID, (bAdd 
? "added" : "exists") );
+#endif
 aLangFallbacks.push_back( nID);
 }
 
+#if OSL_DEBUG_LEVEL > 1
+fprintf( stderr, "\n" );
+#endif
 
 return aRet;
 }
diff --git a/rsc/source/prj/gui.cxx b/rsc/source/prj/gui.cxx
index f95f469..3a0f060 100644
--- a/rsc/source/prj/gui.cxx
+++ b/rsc/source/prj/gui.cxx
@@ -42,7 +42,9 @@ static RscVerbosity lcl_determineVerbosity( int argc, char ** 
argv )
 
 int rsc2_main( int argc, char **argv )
 {
-SAL_WARN("rsc", "debugging " << argv[0]);
+#if OSL_DEBUG_LEVEL > 1
+fprintf( stderr, "debugging %s\n", argv[0] );
+#endif
 
 ERRTYPE aError;
 
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index e4e9a83..6d663a2 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -96,7 +96,9 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * 
pEH )
 i = 1;
 while( ppStr && i < (aCmdLine.GetCount() -1) )
 {
-SAL_INFO("rsc", "CmdLineArg: \"" << *ppStr << "\"");
+#if OSL_DEBUG_LEVEL > 1
+fprintf( stderr, "CmdLineArg: \"%s\"\n", *ppStr );
+#endif
 if (strcmp(*ppStr, "-isystem") == 0)
 {
 // ignore "-isystem" and following arg
@@ -773,7 +775,9 @@ bool RscCompiler::GetImageFilePath( const 
RscCmdLine::OutputFile& rOutputFile,
 bFile = aFS.isRegular();
 }
 
-SAL_INFO("rsc", "Searching image: " << aSysPath);
+#if OSL_DEBUG_LEVEL > 1
+fprintf( stderr, "Searching image: %s\n", aSysPath.getStr() );
+#endif
 
 if( bFile )
 {
@@ -808,7 +812,9 @@ bool RscCompiler::GetImageFilePath( const 
RscCmdLine::OutputFile& rOutputFile,
 fprintf( pSysListFile, "%s\n", 
rContext.pCmdLine->substitutePaths( aSysPath ).getStr() );
 }
 
-SAL_INFO("rsc", "ImagePath to add: " << rImagePath);
+#if OSL_DEBUG_LEVEL > 1
+fprintf( stderr, "ImagePath to add: %s\n", rImagePath.getStr() 
);
+#endif
 }
 
 ++aDirIter;
diff --git a/rsc/source/rscpp/cpp.h b/rsc/source/rscpp/cpp.h
index fb7ff4d..0114c29 100644
--- a/rsc/source/rscpp/cpp.h
+++ b/rsc/source/rscpp/cpp.h
@@ -28,7 +28,7 @@
 /* in cpp1.c: file-pointer auf stdout oder file */
 extern FILE* pCppOut;   /* BP */
 #define PUTCHAR( d )   fprintf( pCppOut, "%c", (d) )/* BP */
-#if OSL_DEBUG_LEVEL > 0
+#if OSL_DEBUG_LEVEL > 1
 extern FILE* pDefOut;   /* ER */
 #ifdef EVALDEFS
 #define NEVALBUF2048
@@ -228,7 +228,7 @@ extern char*magic[];/* Magic predefined 
symbols */
 extern FILEINFO* infile;/* Current input file   */
 extern char work[NWORK + 1];/* #define scratch  */
 extern char*workp;  /* Free space in work   */
-#if OSL_DEBUG_LEVEL > 0
+#if OSL_DEBUG_LEVEL > 1
 extern int  debug;  /* Debug level  */
 /* ER dump & evaluate #define's */
 extern int  bDumpDefs;  /* TRUE if #define's dump req.  */
@@ -269,7 +269,7 @@ void InitCpp6( void );
 void output( int c );
 void sharp( void );
 void cppmain( void );
-#if OSL_DEBUG_LEVEL > 0
+#if 

[Libreoffice-commits] online.git: loolwsd/DocumentBroker.hpp loolwsd/MasterProcessSession.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentBroker.hpp   |3 ++-
 loolwsd/MasterProcessSession.cpp |   10 ++
 2 files changed, 4 insertions(+), 9 deletions(-)

New commits:
commit c6b47cc43768a37324691c7f003bfe7ad7fe68e1
Author: Ashod Nakashian 
Date:   Sat Mar 12 20:20:49 2016 -0500

loolwsd: removed superfluous getJailPath

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

diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index e2cd9ee..71c9681 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -95,7 +95,7 @@ public:
 }
 
 /// Loads a document from the public URI into the jail.
-bool load(const std::string& jailRoot, const std::string& jailId)
+bool load(const std::string& jailId)
 {
 Log::debug("Loading from URI: " + _uriPublic.toString());
 
@@ -114,6 +114,7 @@ public:
 
 // user/doc/jailId
 const auto jailPath = Poco::Path(JailedDocumentRoot, jailId);
+const std::string jailRoot = getJailRoot();
 
 Log::info("jailPath: " + jailPath.toString() + ", jailRoot: " + 
jailRoot);
 
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index d47f2b2..bdb730f 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -195,7 +195,7 @@ bool MasterProcessSession::_handleInput(const char *buffer, 
int length)
 if (url.find(filePrefix) == 0)
 {
 // Rewrite file:// URLs, as they are visible to the 
outside world.
-Path path(MasterProcessSession::getJailPath(_childId), 
url.substr(filePrefix.length()));
+const Path path(_docBroker->getJailRoot(), 
url.substr(filePrefix.length()));
 url = filePrefix + path.toString().substr(1);
 }
 peer->_saveAsQueue.put(url);
@@ -424,12 +424,6 @@ bool MasterProcessSession::haveSeparateProcess()
 {
 return !_childId.empty();
 }
-
-Poco::Path MasterProcessSession::getJailPath(const std::string& childId)
-{
-return Path::forDirectory(LOOLWSD::ChildRoot + Path::separator() + 
childId);
-}
-
 bool MasterProcessSession::invalidateTiles(const char* /*buffer*/, int 
/*length*/, StringTokenizer& tokens)
 {
 int part, tilePosX, tilePosY, tileWidth, tileHeight;
@@ -808,7 +802,7 @@ void MasterProcessSession::dispatchChild()
 }
 
 const auto jailRoot = Poco::Path(LOOLWSD::ChildRoot, 
childSession->_childId);
-_docBroker->load(jailRoot.toString(), childSession->_childId);
+_docBroker->load(childSession->_childId);
 
 _peer = childSession;
 childSession->_peer = shared_from_this();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.hpp loolwsd/LOOLWSD.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentBroker.hpp |   23 +--
 loolwsd/LOOLWSD.cpp|2 +-
 2 files changed, 18 insertions(+), 7 deletions(-)

New commits:
commit c0cf48f5ac885b878afd0b67c63332bdc91a94b8
Author: Ashod Nakashian 
Date:   Sat Mar 12 20:14:32 2016 -0500

loolwsd: jailRoot moved in DocumentBroker

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

diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index e78ccc3..e2cd9ee 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -57,7 +57,7 @@ public:
 }
 
 static
-std::shared_ptr create(const std::string& uri)
+std::shared_ptr create(const std::string& uri, const 
std::string& childRoot)
 {
 std::string decodedUri;
 Poco::URI::decode(uri, decodedUri);
@@ -75,18 +75,18 @@ public:
 throw std::runtime_error("Invalid URI.");
 }
 
-return create(uriPublic);
+return create(uriPublic, childRoot);
 }
 
 static
-std::shared_ptr create(const Poco::URI& uriPublic)
+std::shared_ptr create(const Poco::URI& uriPublic, const 
std::string& childRoot)
 {
 Log::info("Creating DocumentBroker for uri: " + uriPublic.toString());
 
 std::string docKey;
 Poco::URI::encode(uriPublic.getPath(), "", docKey);
 
-return std::shared_ptr(new DocumentBroker(uriPublic, 
docKey));
+return std::shared_ptr(new DocumentBroker(uriPublic, 
docKey, childRoot));
 }
 
 ~DocumentBroker()
@@ -148,18 +148,29 @@ public:
 const std::string& getJailId() const { return _jailId; }
 const std::string& getDocKey() const { return _docKey; }
 
+std::string getJailRoot() const
+{
+assert(!_jailId.empty());
+return Poco::Path(_childRoot, _jailId).toString();
+}
+
 private:
 DocumentBroker(const Poco::URI& uriPublic,
-   const std::string& docKey) :
+   const std::string& docKey,
+   const std::string& childRoot) :
_uriPublic(uriPublic),
-   _docKey(docKey)
+   _docKey(docKey),
+   _childRoot(childRoot)
 {
+assert(!_docKey.empty());
+assert(!_childRoot.empty());
 Log::info("DocumentBroker [" + _uriPublic.toString() + "] created.");
 }
 
 private:
 const Poco::URI _uriPublic;
 const std::string _docKey;
+const std::string _childRoot;
 Poco::URI _uriJailed;
 std::string _jailId;
 std::unique_ptr _storage;
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index d382e35..28b1a8e 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -505,7 +505,7 @@ private:
 // request.getCookies(cookies);
 // Log::info("Cookie: " + cookies.get("PHPSESSID", ""));
 
-auto docBroker = DocumentBroker::create(request.getURI());
+auto docBroker = DocumentBroker::create(request.getURI(), 
LOOLWSD::ChildRoot);
 const auto docKey = docBroker->getDocKey();
 
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.hpp loolwsd/DocumentStoreManager.hpp loolwsd/LOOLWSD.cpp loolwsd/LOOLWSD.hpp loolwsd/MasterProcessSession.cpp loolwsd/MasterProcessSession.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentBroker.hpp   |  171 +++
 loolwsd/DocumentStoreManager.hpp |  160 
 loolwsd/LOOLWSD.cpp  |   62 --
 loolwsd/LOOLWSD.hpp  |8 -
 loolwsd/MasterProcessSession.cpp |   16 +--
 loolwsd/MasterProcessSession.hpp |8 -
 6 files changed, 240 insertions(+), 185 deletions(-)

New commits:
commit bb16272e11d30acbfc2ec2c033f80bfa2a4c65bc
Author: Ashod Nakashian 
Date:   Sat Mar 12 19:29:17 2016 -0500

loolwsd: DocumentStoreManager -> DocumentBroker

Renamed DocumentStoreManager to DocumentBroker and
restructured the handshake process.

Currently, at first client connection to a given doc
a DocumentBroker is created to serve as the clearing house
of all client-side activities on the document.

Prime goals is loading and saving of the document, but
also to guarantee race-free management of the doc.

Each doc has a unique DocKey based on the URL (the path,
without queries). This DocKey is used as key into a map
of all DocumentBrokers. The latter is shared among
MasterProcessSession instances.

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

diff --git a/loolwsd/DocumentStoreManager.hpp b/loolwsd/DocumentBroker.hpp
similarity index 54%
rename from loolwsd/DocumentStoreManager.hpp
rename to loolwsd/DocumentBroker.hpp
index 68ecdae..e78ccc3 100644
--- a/loolwsd/DocumentStoreManager.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -7,8 +7,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_DOCUMENTSTOREMANAGER_HPP
-#define INCLUDED_DOCUMENTSTOREMANAGER_HPP
+#ifndef INCLUDED_DOCUMENTBROKER_HPP
+#define INCLUDED_DOCUMENTBROKER_HPP
 
 #include 
 #include 
@@ -18,9 +18,11 @@
 
 #include "Storage.hpp"
 
-/// A DocumentStoreManager as mananged by us.
+/// DocumentBroker is responsible for setting up a document
+/// in jail and brokering loading it from Storage
+/// and saving it back.
 /// Contains URI, physical path, etc.
-class DocumentStoreManager
+class DocumentBroker
 {
 public:
 
@@ -55,9 +57,7 @@ public:
 }
 
 static
-std::shared_ptr create(const std::string& uri,
- const std::string& jailRoot,
- const std::string& jailId)
+std::shared_ptr create(const std::string& uri)
 {
 std::string decodedUri;
 Poco::URI::decode(uri, decodedUri);
@@ -75,17 +75,39 @@ public:
 throw std::runtime_error("Invalid URI.");
 }
 
-return create(uriPublic, jailRoot, jailId);
+return create(uriPublic);
 }
 
 static
-std::shared_ptr create(
-const Poco::URI& uriPublic,
-const std::string& jailRoot,
-const std::string& jailId)
+std::shared_ptr create(const Poco::URI& uriPublic)
 {
-Log::info("Creating DocumentStoreManager with uri: " + 
uriPublic.toString() +
-  ", jailRoot: " + jailRoot + ", jailId: " + jailId);
+Log::info("Creating DocumentBroker for uri: " + uriPublic.toString());
+
+std::string docKey;
+Poco::URI::encode(uriPublic.getPath(), "", docKey);
+
+return std::shared_ptr(new DocumentBroker(uriPublic, 
docKey));
+}
+
+~DocumentBroker()
+{
+Log::info("~DocumentBroker [" + _uriPublic.toString() + "] 
destroyed.");
+}
+
+/// Loads a document from the public URI into the jail.
+bool load(const std::string& jailRoot, const std::string& jailId)
+{
+Log::debug("Loading from URI: " + _uriPublic.toString());
+
+std::unique_lock lock(_mutex);
+
+if (_storage)
+{
+// Already loaded. Just return.
+return true;
+}
+
+_jailId = jailId;
 
 // The URL is the publicly visible one, not visible in the chroot jail.
 // We need to map it to a jailed path and copy the file there.
@@ -95,64 +117,53 @@ public:
 
 Log::info("jailPath: " + jailPath.toString() + ", jailRoot: " + 
jailRoot);
 
-auto uriJailed = uriPublic;
-std::unique_ptr storage;
-if (uriPublic.isRelative() || uriPublic.getScheme() == "file")
+if (_uriPublic.isRelative() || _uriPublic.getScheme() == "file")
 {
-Log::info("Public URI [" + uriPublic.toString() + "] is a file.");
-storage.reset(new LocalStorage(jailRoot, jailPath.toString(), 
uriPublic.getPath()));
-const auto localPath = storage->loadStorageFileToLocal();
-uriJailed = Poco::URI(Poco::URI("file://"), localPath);
+

[Libreoffice-commits] online.git: loolwsd/LOOLKit.cpp loolwsd/LOOLWSD.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLKit.cpp |   14 +++---
 loolwsd/LOOLWSD.cpp |   12 +---
 2 files changed, 20 insertions(+), 6 deletions(-)

New commits:
commit 8ef45a975e1ef950d4e754e43b82cda78f917847
Author: Ashod Nakashian 
Date:   Sat Mar 12 18:12:40 2016 -0500

loolwsd: child URI now includes docKey

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

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 4fb6141..33aebe1 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define LOK_USE_UNSTABLE_API
 #include 
@@ -310,10 +311,12 @@ public:
 
 Document(LibreOfficeKit *loKit,
  const std::string& jailId,
+ const std::string& docKey,
  const std::string& url)
   : _multiView(std::getenv("LOK_VIEW_CALLBACK")),
 _loKit(loKit),
 _jailId(jailId),
+_docKey(docKey),
 _url(url),
 _loKitDocument(nullptr),
 _docPassword(""),
@@ -404,7 +407,7 @@ public:
 
 HTTPClientSession cs("127.0.0.1", MASTER_PORT_NUMBER);
 cs.setTimeout(0);
-HTTPRequest request(HTTPRequest::HTTP_GET, CHILD_URI + "sessionId=" + 
sessionId + "=" + _jailId);
+HTTPRequest request(HTTPRequest::HTTP_GET, CHILD_URI + "sessionId=" + 
sessionId + "=" + _jailId + "=" + _docKey);
 HTTPResponse response;
 
 auto ws = std::make_shared(cs, request, response);
@@ -734,6 +737,7 @@ private:
 const bool _multiView;
 LibreOfficeKit *_loKit;
 const std::string _jailId;
+const std::string _docKey;
 const std::string _url;
 std::string _jailedUrl;
 
@@ -1007,12 +1011,16 @@ void lokit_main(const std::string& childRoot,
 {
 const std::string& sessionId = tokens[1];
 const unsigned intSessionId = 
Util::decodeId(sessionId);
-const std::string& url = tokens[2];
+const std::string& docKey = tokens[2];
 
+std::string url;
+Poco::URI::decode(docKey, url);
 Log::debug("Thread request for session [" + sessionId 
+ "], url: [" + url + "].");
 auto it = _documents.lower_bound(url);
 if (it == _documents.end())
-it = _documents.emplace_hint(it, url, 
std::make_shared(loKit, jailId, url));
+{
+it = _documents.emplace_hint(it, url, 
std::make_shared(loKit, jailId, docKey, url));
+}
 
 it->second->createSession(sessionId, intSessionId);
 isUsedKit = true;
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 1e833d9..b295bb6 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -506,7 +506,8 @@ private:
 // Log::info("Cookie: " + cookies.get("PHPSESSID", ""));
 
 const auto uri = DocumentStoreManager::getUri(request.getURI());
-const auto docKey = uri.getPath();
+std::string docKey;
+Poco::URI::encode(uri.getPath(), "", docKey);
 
 // Request a kit process for this doc.
 const std::string aMessage = "request " + id + " " + docKey + "\r\n";
@@ -609,6 +610,7 @@ public:
 const auto params = 
Poco::URI(request.getURI()).getQueryParameters();
 std::string sessionId;
 std::string jailId;
+std::string docKey;
 for (const auto& param : params)
 {
 if (param.first == "sessionId")
@@ -619,16 +621,20 @@ public:
 {
 jailId = param.second;
 }
+else if (param.first == "docKey")
+{
+docKey = param.second;
+}
 }
 
-Log::debug("Child socket for SessionId: " + sessionId + ", jailId: 
" + jailId + " connected.");
-
 thread_name += sessionId;
 if (prctl(PR_SET_NAME, reinterpret_cast(thread_name.c_str()), 0, 0, 0) != 0)
 Log::error("Cannot set thread name to " + thread_name + ".");
 
 Log::debug("Thread [" + thread_name + "] started.");
 
+Log::debug("Child socket for SessionId: " + sessionId + ", jailId: 
" + jailId +
+   ", docKey: " + docKey + " connected.");
 auto ws = std::make_shared(request, response);
 auto session = std::make_shared(sessionId, 
LOOLSession::Kind::ToPrisoner, ws, nullptr);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] online.git: loolwsd/LOOLKit.cpp loolwsd/Util.cpp loolwsd/Util.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLKit.cpp |5 +++--
 loolwsd/Util.cpp|   17 -
 loolwsd/Util.hpp|3 ++-
 3 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit 019aed134e17b69e615a5990eab8c471184973e9
Author: Ashod Nakashian 
Date:   Sat Mar 12 10:15:45 2016 -0500

loolwsd: using random jailId

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

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 5414a26..4fb6141 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -414,7 +414,7 @@ public:
[this](const std::string& id, const std::string& uri, 
const std::string& docPassword, bool isDocPasswordProvided) { return onLoad(id, 
uri, docPassword, isDocPasswordProvided); },
[this](const std::string& id) { onUnload(id); });
 // child -> 0,  sessionId -> 1, PID -> 2
-const std::string hello("child " + sessionId + " " + 
std::to_string(Process::id()));
+const std::string hello("child " + sessionId + " " + _jailId);
 session->sendTextFrame(hello);
 
 auto thread = std::make_shared(session, ws);
@@ -764,6 +764,7 @@ void lokit_main(const std::string& childRoot,
 #ifdef LOOLKIT_NO_MAIN
 // Reinitialize logging when forked.
 Log::initialize("kit");
+Util::rng::reseed();
 #endif
 
 struct pollfd pollPipeBroker;
@@ -782,7 +783,7 @@ void lokit_main(const std::string& childRoot,
 
 std::map _documents;
 
-static const std::string jailId = std::to_string(Process::id());
+static const std::string jailId = Util::encodeId(Util::rng::getNext());
 static const std::string process_name = "loolkit";
 
 if (prctl(PR_SET_NAME, reinterpret_cast(process_name.c_str()), 0, 0, 0) != 0)
diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp
index 7485a9e..5fc9a2a 100644
--- a/loolwsd/Util.cpp
+++ b/loolwsd/Util.cpp
@@ -65,7 +65,22 @@ namespace rng
 {
 static std::random_device _rd;
 static std::mutex _rngMutex;
-static std::mt19937_64 _rng = std::mt19937_64(_rd());
+
+// Create the prng with a random-device for seed.
+// If we don't have a hardware random-device, we will get the same seed.
+// In that case we are better off with an arbitrary, but changing, seed.
+static std::mt19937_64 _rng = std::mt19937_64(_rd.entropy()
+? _rd()
+: (clock() + getpid()));
+
+// A new seed is used to shuffle the sequence.
+// N.B. Always reseed after getting forked!
+void reseed()
+{
+_rng.seed(_rd.entropy() ? _rd() : (clock() + getpid()));
+}
+
+// Returns a new random number.
 unsigned getNext()
 {
 std::unique_lock lock(_rngMutex);
diff --git a/loolwsd/Util.hpp b/loolwsd/Util.hpp
index 1e6e515..2e83ea8 100644
--- a/loolwsd/Util.hpp
+++ b/loolwsd/Util.hpp
@@ -50,7 +50,8 @@ namespace Util
 {
 namespace rng
 {
-   unsigned getNext();
+void reseed();
+unsigned getNext();
 }
 
 /// Encode an integral ID into a string, with padding support.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentStoreManager.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentStoreManager.hpp |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 8d108a03b8b8eea6fbd7bf2a750fa780b442e483
Author: Ashod Nakashian 
Date:   Sat Mar 12 18:10:53 2016 -0500

loolwsd: childId -> jailId

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

diff --git a/loolwsd/DocumentStoreManager.hpp b/loolwsd/DocumentStoreManager.hpp
index d8fca30..68ecdae 100644
--- a/loolwsd/DocumentStoreManager.hpp
+++ b/loolwsd/DocumentStoreManager.hpp
@@ -56,8 +56,8 @@ public:
 
 static
 std::shared_ptr create(const std::string& uri,
-const std::string& jailRoot,
-const std::string& childId)
+ const std::string& jailRoot,
+ const std::string& jailId)
 {
 std::string decodedUri;
 Poco::URI::decode(uri, decodedUri);
@@ -75,22 +75,23 @@ public:
 throw std::runtime_error("Invalid URI.");
 }
 
-return create(uriPublic, jailRoot, childId);
+return create(uriPublic, jailRoot, jailId);
 }
 
 static
 std::shared_ptr create(
 const Poco::URI& uriPublic,
 const std::string& jailRoot,
-const std::string& childId)
+const std::string& jailId)
 {
-Log::info("Creating DocumentStoreManager with uri: " + 
uriPublic.toString() + ", jailRoot: " + jailRoot + ", childId: " + childId);
+Log::info("Creating DocumentStoreManager with uri: " + 
uriPublic.toString() +
+  ", jailRoot: " + jailRoot + ", jailId: " + jailId);
 
 // The URL is the publicly visible one, not visible in the chroot jail.
 // We need to map it to a jailed path and copy the file there.
 
-// user/doc/childId
-const auto jailPath = Poco::Path(JailedDocumentRoot, childId);
+// user/doc/jailId
+const auto jailPath = Poco::Path(JailedDocumentRoot, jailId);
 
 Log::info("jailPath: " + jailPath.toString() + ", jailRoot: " + 
jailRoot);
 
@@ -113,7 +114,7 @@ public:
 uriJailed = Poco::URI(Poco::URI("file://"), localPath);
 }
 
-auto document = std::shared_ptr(new 
DocumentStoreManager(uriPublic, uriJailed, childId, storage));
+auto document = std::shared_ptr(new 
DocumentStoreManager(uriPublic, uriJailed, jailId, storage));
 
 return document;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/Common.hpp loolwsd/LOOLKit.cpp loolwsd/LOOLWSD.cpp loolwsd/LOOLWSD.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/Common.hpp  |1 +
 loolwsd/LOOLKit.cpp |3 +--
 loolwsd/LOOLWSD.cpp |   22 +-
 loolwsd/LOOLWSD.hpp |1 -
 4 files changed, 19 insertions(+), 8 deletions(-)

New commits:
commit 1268507bf0c9cbc37e9f9c567c2e7ea026119d2c
Author: Ashod Nakashian 
Date:   Sat Mar 12 08:46:36 2016 -0500

loolwsd: child WS URL format changed

The current format is more flexible and standard.

/loolwsd/child?sessionId=xxx=yyy

The sessionId is the client-specific connection ID (which
 is originally passed to the child via the Broker.

The jailId is the PID of the child.

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

diff --git a/loolwsd/Common.hpp b/loolwsd/Common.hpp
index 40251d3..d6b7b3f 100644
--- a/loolwsd/Common.hpp
+++ b/loolwsd/Common.hpp
@@ -35,6 +35,7 @@ constexpr int READ_BUFFER_SIZE = 2048;
 constexpr int SMALL_MESSAGE_SIZE = READ_BUFFER_SIZE / 2;
 
 static const std::string JailedDocumentRoot = "/user/docs/";
+static const std::string CHILD_URI = "/loolws/child?";
 
 #endif
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 59f526d..5414a26 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -68,7 +68,6 @@ using Poco::Thread;
 using Poco::ThreadLocal;
 using Poco::Util::Application;
 
-const std::string CHILD_URI = "/loolws/child/";
 const std::string FIFO_PATH = "pipe";
 const std::string FIFO_BROKER = "loolbroker.fifo";
 const std::string FIFO_NOTIFY = "loolnotify.fifo";
@@ -405,7 +404,7 @@ public:
 
 HTTPClientSession cs("127.0.0.1", MASTER_PORT_NUMBER);
 cs.setTimeout(0);
-HTTPRequest request(HTTPRequest::HTTP_GET, CHILD_URI + sessionId);
+HTTPRequest request(HTTPRequest::HTTP_GET, CHILD_URI + "sessionId=" + 
sessionId + "=" + _jailId);
 HTTPResponse response;
 
 auto ws = std::make_shared(cs, request, response);
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 2fcc86c..162dae7 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -617,16 +617,29 @@ public:
 void handleRequest(HTTPServerRequest& request, HTTPServerResponse& 
response) override
 {
 assert(request.serverAddress().port() == MASTER_PORT_NUMBER);
-assert(request.getURI().find(LOOLWSD::CHILD_URI) == 0);
+assert(request.getURI().find(CHILD_URI) == 0);
 
 std::string thread_name = "prison_ws_";
 try
 {
-const auto index = request.getURI().find_last_of('/');
-const auto id = request.getURI().substr(index + 1);
+const auto params = 
Poco::URI(request.getURI()).getQueryParameters();
+std::string sessionId;
+std::string jailId;
+for (const auto& param : params)
+{
+if (param.first == "sessionId")
+{
+sessionId = param.second;
+}
+else if (param.first == "jailId")
+{
+jailId = param.second;
+}
+}
 
-thread_name += id;
+Log::debug("Child socket for SessionId: " + sessionId + ", jailId: 
" + jailId + " connected.");
 
+thread_name += sessionId;
 if (prctl(PR_SET_NAME, reinterpret_cast(thread_name.c_str()), 0, 0, 0) != 0)
 Log::error("Cannot set thread name to " + thread_name + ".");
 
@@ -775,7 +788,6 @@ std::string LOOLWSD::LoSubPath = "lo";
 
 int LOOLWSD::NumPreSpawnedChildren = 10;
 bool LOOLWSD::DoTest = false;
-const std::string LOOLWSD::CHILD_URI = "/loolws/child/";
 const std::string LOOLWSD::PIDLOG = "/tmp/loolwsd.pid";
 const std::string LOOLWSD::FIFO_PATH = "pipe";
 const std::string LOOLWSD::FIFO_LOOLWSD = "loolwsdfifo";
diff --git a/loolwsd/LOOLWSD.hpp b/loolwsd/LOOLWSD.hpp
index e7ce8eb..37c3561 100644
--- a/loolwsd/LOOLWSD.hpp
+++ b/loolwsd/LOOLWSD.hpp
@@ -45,7 +45,6 @@ public:
 static std::string LoSubPath;
 //static Auth AuthAgent;
 
-static const std::string CHILD_URI;
 static const std::string PIDLOG;
 static const std::string FIFO_PATH;
 static const std::string FIFO_LOOLWSD;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp loolwsd/MasterProcessSession.cpp loolwsd/MasterProcessSession.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLWSD.cpp  |   37 ++-
 loolwsd/MasterProcessSession.cpp |   41 +++
 loolwsd/MasterProcessSession.hpp |   12 +--
 3 files changed, 46 insertions(+), 44 deletions(-)

New commits:
commit 64d2ff98b8e8329a8f0a2b57dbdc490733ecb28a
Author: Ashod Nakashian 
Date:   Sat Mar 12 09:07:33 2016 -0500

loolwsd: document saving and restructuring

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

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 162dae7..1e833d9 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -508,29 +508,13 @@ private:
 const auto uri = DocumentStoreManager::getUri(request.getURI());
 const auto docKey = uri.getPath();
 
-// This lock could become a bottleneck.
-// In that case, we can use a pool and index by publicPath.
-std::unique_lock lock(LOOLWSD::SessionsMutex);
-
-// Lookup this document.
-auto it = LOOLWSD::Sessions.find(docKey);
-std::shared_ptr document;
-if (it != LOOLWSD::Sessions.end())
-{
-// Get the DocumentStoreManager from the first session.
-auto sessionsMap = it->second;
-assert(!sessionsMap.empty());
-document = sessionsMap.begin()->second->getDocumentStoreManager();
-}
-else
-{
-// Set up the document and its storage.
-const auto jailRoot = Poco::Path(LOOLWSD::ChildRoot, id);
-document = DocumentStoreManager::create(uri, jailRoot.toString(), 
id);
-}
+// Request a kit process for this doc.
+const std::string aMessage = "request " + id + " " + docKey + "\r\n";
+Log::debug("MasterToBroker: " + aMessage.substr(0, aMessage.length() - 
2));
+Util::writeFIFO(LOOLWSD::BrokerWritePipe, aMessage);
 
 auto ws = std::make_shared(request, response);
-auto session = std::make_shared(id, 
LOOLSession::Kind::ToClient, ws, document);
+auto session = std::make_shared(id, 
LOOLSession::Kind::ToClient, ws, nullptr);
 
 // For ToClient sessions, we store incoming messages in a queue and 
have a separate
 // thread that handles them. This is so that we can empty the queue 
when we get a
@@ -646,7 +630,16 @@ public:
 Log::debug("Thread [" + thread_name + "] started.");
 
 auto ws = std::make_shared(request, response);
-auto session = std::make_shared(id, 
LOOLSession::Kind::ToPrisoner, ws, nullptr);
+auto session = std::make_shared(sessionId, 
LOOLSession::Kind::ToPrisoner, ws, nullptr);
+
+std::unique_lock 
lock(MasterProcessSession::AvailableChildSessionMutex);
+MasterProcessSession::AvailableChildSessions.emplace(sessionId, 
session);
+
+Log::info() << " mapped " << session << " jailId=" << jailId << ", 
id=" << sessionId
+<< " into _availableChildSessions, size=" << 
MasterProcessSession::AvailableChildSessions.size() << Log::end;
+
+lock.unlock();
+MasterProcessSession::AvailableChildSessionCV.notify_one();
 
 SocketProcessor(ws, response, [](const char* data, const 
int size, bool)
 {
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 46174c9..5e1e33b 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -117,7 +117,7 @@ bool MasterProcessSession::_handleInput(const char *buffer, 
int length)
 // Note that this handles both forwarding requests from the client to 
the child process, and
 // forwarding replies from the child process to the client. Or does it?
 
-// Snoop at some  messages and manipulate tile cache information as 
needed
+// Snoop at some messages and manipulate tile cache information as 
needed
 auto peer = _peer.lock();
 
 if (_kind == Kind::ToPrisoner)
@@ -128,6 +128,27 @@ bool MasterProcessSession::_handleInput(const char 
*buffer, int length)
 return false;
 }
 
+if (tokens[0] == "unocommandresult:")
+{
+const std::string stringMsg(buffer, length);
+Log::info(getName() +"Command: " + stringMsg);
+const auto index = stringMsg.find_first_of("{");
+if (index != std::string::npos)
+{
+const std::string stringJSON = stringMsg.substr(index);
+Poco::JSON::Parser parser;
+const auto result = parser.parse(stringJSON);
+const auto object = 
result.extract();
+if 

[Libreoffice-bugs] [Bug 98610] Installation failed repeated download/install attempts

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98610

Joe Bachofen, Sr.  changed:

   What|Removed |Added

 Status|NEEDINFO|RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #8 from Joe Bachofen, Sr.  ---
Downloaded the file LibreOffice_4.4.5_Win_x86.msi so the installer could find
it and then finish the V:5.0.5.2 installation.  That worked; installation is
done.
Thank you.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98641] New: function error about "lookup"

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98641

Bug ID: 98641
   Summary: function error about "lookup"
   Product: LibreOffice
   Version: 5.0.5.2 release
  Hardware: x86 (IA32)
OS: Windows (All)
Status: UNCONFIRMED
  Severity: normal
  Priority: medium
 Component: Calc
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: beautiful...@163.com

Created attachment 123549
  --> https://bugs.documentfoundation.org/attachment.cgi?id=123549=edit
the questions attachment

in the attachment (the name is "error1.ods")-sheet1-"BB15:BB24",I want to used
the function "lookup" and "countif" rearrangement the "BB3:BC12" according to
rank "BC" ,but as you can see ,the return value is error a part . i don't know
what happen,may be it is BUG or not ,please help.

in the "sheet2" the problems still exist(at the "A17:A19")

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-commits] online.git: loolwsd/LOOLBroker.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLBroker.cpp |   24 +---
 1 file changed, 17 insertions(+), 7 deletions(-)

New commits:
commit 2a11e1840abba7f85cdec12a0d314886ad7534a3
Author: Ashod Nakashian 
Date:   Fri Mar 11 17:26:48 2016 -0500

loolwsd: improved creating kit sessions

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

diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index aedd8f7..7cf211d 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -329,23 +329,33 @@ public:
 const auto child = findChild(url);
 if (child)
 {
-if (child->getUrl() == url)
-Log::debug("Found URL [" + url + "] hosted on child [" + 
std::to_string(child->getPid()) + "].");
+const auto childPid = std::to_string(child->getPid());
+const auto isEmptyChild = child->getUrl().empty();
+if (isEmptyChild)
+Log::debug("Found URL [" + url + "] hosted on child [" + 
childPid + "].");
 else
-Log::debug("URL [" + url + "] is not hosted. Using empty 
child [" + std::to_string(child->getPid()) + "].");
+Log::debug("URL [" + url + "] is not hosted. Using empty 
child [" + childPid + "].");
 
-if (!createThread(child->getPid(), session, url))
+if (createThread(child->getPid(), session, url))
 {
-Log::error("Error creating thread [" + session + "] for 
URL [" + url + "].");
+child->setUrl(url);
+Log::debug("Child [" + childPid + "] now hosts [" + url + 
"] for session [" + session + "].");
+return;
 }
 
-child->setUrl(url);
+Log::error("Error creating thread [" + session + "] for URL [" 
+ url + "] on child [" + childPid + "].");
+if (isEmptyChild)
+{
+// This is probably a child in bad state. Rid of it and 
create new.
+removeChild(child->getPid());
+}
 }
 else
 {
 Log::info("No children available. Creating more.");
-++forkCounter;
 }
+
+++forkCounter;
 }
 else if (tokens[0] == "kill" && tokens.count() == 2)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/LOOLBroker.cpp loolwsd/LOOLKit.cpp loolwsd/MasterProcessSession.cpp loolwsd/Util.cpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLBroker.cpp   |3 ++-
 loolwsd/LOOLKit.cpp  |   14 --
 loolwsd/MasterProcessSession.cpp |6 +++---
 loolwsd/Util.cpp |2 +-
 4 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 0d8fcf5699ec243cf999c659592b64ff3e20f690
Author: Ashod Nakashian 
Date:   Fri Mar 11 17:25:44 2016 -0500

loolwsd: logging

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

diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index fa5ef56..aedd8f7 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -233,6 +233,7 @@ public:
 return -1;
 }
 
+Log::debug("Recv child response: [" + response + "].");
 return bytes;
 }
 
@@ -369,7 +370,7 @@ public:
 Log::debug("Thread [" + thread_name + "] started.");
 
 Util::pollPipeForReading(pollPipeBroker, FIFO_LOOLWSD, readerBroker,
- [this](std::string& message) {return 
handleInput(message); } );
+ [this](std::string& message) { return 
handleInput(message); } );
 
 Log::debug("Thread [" + thread_name + "] finished.");
 }
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 9ac2dc8..59f526d 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -415,7 +415,7 @@ public:
[this](const std::string& id, const std::string& uri, 
const std::string& docPassword, bool isDocPasswordProvided) { return onLoad(id, 
uri, docPassword, isDocPasswordProvided); },
[this](const std::string& id) { onUnload(id); });
 // child -> 0,  sessionId -> 1, PID -> 2
-std::string hello("child " + sessionId + " " + 
std::to_string(Process::id()));
+const std::string hello("child " + sessionId + " " + 
std::to_string(Process::id()));
 session->sendTextFrame(hello);
 
 auto thread = std::make_shared(session, ws);
@@ -479,7 +479,9 @@ public:
 /// Set Document password for given URL
 void setDocumentPassword(int nPasswordType)
 {
-Log::info("setDocumentPassword: passwordProtected=" + 
std::to_string(_isDocPasswordProtected) + " passwordProvided=" + 
std::to_string(_isDocPasswordProvided) + " password='" + _docPassword + "'");
+Log::info() << "setDocumentPassword: passwordProtected=" << 
_isDocPasswordProtected
+<< " passwordProvided=" << _isDocPasswordProvided
+<< " password='" << _docPassword <<  "'" << Log::end;
 
 if (_isDocPasswordProtected && _isDocPasswordProvided)
 {
@@ -768,7 +770,7 @@ void lokit_main(const std::string& childRoot,
 struct pollfd pollPipeBroker;
 ssize_t bytes = -1;
 int   ready = 0;
-bool  isDirtyKit = false;
+bool  isUsedKit = false;
 char  buffer[READ_BUFFER_SIZE];
 char* start = nullptr;
 char* end = nullptr;
@@ -929,7 +931,7 @@ void lokit_main(const std::string& childRoot,
 it = (it->second->canDiscard() ? _documents.erase(it) 
: ++it);
 }
 
-if (isDirtyKit && _documents.empty())
+if (isUsedKit && _documents.empty())
 TerminationFlag = true;
 }
 else
@@ -981,7 +983,7 @@ void lokit_main(const std::string& childRoot,
 it = (it->second->canDiscard() ? _documents.erase(it) 
: ++it);
 }
 
-if (isDirtyKit && _documents.empty())
+if (isUsedKit && _documents.empty())
 {
 TerminationFlag = true;
 response += "down \r\n";
@@ -1013,7 +1015,7 @@ void lokit_main(const std::string& childRoot,
 it = _documents.emplace_hint(it, url, 
std::make_shared(loKit, jailId, url));
 
 it->second->createSession(sessionId, intSessionId);
-isDirtyKit = true;
+isUsedKit = true;
 response += "ok \r\n";
 }
 else
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 7f052ac..46174c9 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -456,8 +456,8 @@ bool MasterProcessSession::loadDocument(const char* 
/*buffer*/, int /*length*/,
 
 // Request a kit process for this doc.
 Poco::URI uri(_docURL);
-const std::string aMessage = "request " + getId() + " " + 
uri.getPath() + "\n";
-Log::trace("MasterToBroker: " + aMessage.substr(0, aMessage.length() - 
1));
+const std::string aMessage = "request " + getId() + " " + 

[Libreoffice-commits] online.git: loolwsd/Storage.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/Storage.hpp |   48 
 1 file changed, 36 insertions(+), 12 deletions(-)

New commits:
commit 52d9e2033c829c81f71b8d3097393b87ed7ddea4
Author: Ashod Nakashian 
Date:   Fri Mar 11 13:45:13 2016 -0500

loolwsd: improved WopiStorage with working PutFile

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

diff --git a/loolwsd/Storage.hpp b/loolwsd/Storage.hpp
index 18a336a..b3605c5 100644
--- a/loolwsd/Storage.hpp
+++ b/loolwsd/Storage.hpp
@@ -15,6 +15,7 @@
 #include 
 
 #include 
+#include 
 
 #include "Common.hpp"
 #include "Auth.hpp"
@@ -61,11 +62,18 @@ public:
 /// Writes the contents of the file back to the source.
 virtual bool saveLocalFileToStorage() = 0;
 
+static
+size_t getFileSize(const std::string& filename)
+{
+return std::ifstream(filename, std::ifstream::ate | 
std::ifstream::binary).tellg();
+}
+
 protected:
 const std::string _localStorePath;
 const std::string _jailPath;
 const std::string _uri;
 std::string _jailedFilePath;
+std::string _filename;
 };
 
 /// Trivial implementation of local storage that does not need do anything.
@@ -168,10 +176,7 @@ public:
 Poco::Net::HTTPResponse response;
 std::istream& rs = session.receiveResponse(response);
 
-Log::info() << "WOPI::GetFile Status for URI [" << _uri << "]: "
-<< response.getStatus() << " " << response.getReason() << 
Log::end;
-
-auto logger = Log::debug();
+auto logger = Log::trace();
 logger << "WOPI::GetFile header for URI [" << _uri << "]:\n";
 for (auto& pair : response)
 {
@@ -181,31 +186,50 @@ public:
 logger << Log::end;
 
 //TODO: Get proper filename.
-const auto filename = "filename";
-_jailedFilePath = Poco::Path(getLocalRootPath(), filename).toString();
+_filename = "filename";
+_jailedFilePath = Poco::Path(getLocalRootPath(), _filename).toString();
 std::ofstream ofs(_jailedFilePath);
 std::copy(std::istreambuf_iterator(rs),
   std::istreambuf_iterator(),
   std::ostreambuf_iterator(ofs));
+const auto size = getFileSize(_jailedFilePath);
+
+Log::info() << "WOPI::GetFile downloaded " << size << " bytes from [" 
<< _uri
+<< "] -> " << _jailedFilePath << ": "
+<< response.getStatus() << " " << response.getReason() << 
Log::end;
 
 // Now return the jailed path.
-return Poco::Path(_jailPath, filename).toString();
+return Poco::Path(_jailPath, _filename).toString();
 }
 
 bool saveLocalFileToStorage() override
 {
+Log::info("Uploading URI [" + _uri + "] from [" + _jailedFilePath + 
"].");
+const auto size = getFileSize(_jailedFilePath);
+
 Poco::URI uriObject(_uri);
 Poco::Net::HTTPClientSession session(uriObject.getHost(), 
uriObject.getPort());
-Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, 
_uri, Poco::Net::HTTPMessage::HTTP_1_1);
+Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, 
uriObject.getPathAndQuery(), Poco::Net::HTTPMessage::HTTP_1_1);
+request.set("X-WOPIOverride", "PUT");
+request.setContentType("application/octet-stream");
+request.setContentLength(size);
 
+std::ostream& os = session.sendRequest(request);
 std::ifstream ifs(_jailedFilePath);
-request.read(ifs);
+Poco::StreamCopier::copyStream(ifs, os);
 
 Poco::Net::HTTPResponse response;
-session.sendRequest(request);
-Log::info() << "WOPI::PutFile Status: " <<  response.getStatus() << " 
" << response.getReason() << Log::end;
+std::istream& rs = session.receiveResponse(response);
+std::ostringstream oss;
+Poco::StreamCopier::copyStream(rs, oss);
+
+Log::info("WOPI::PutFile response: " + oss.str());
+const auto success = (response.getStatus() == 
Poco::Net::HTTPResponse::HTTP_OK);
+Log::info() << "WOPI::PutFile uploaded " << size << " bytes from [" << 
_jailedFilePath  << "]:"
+<< "] -> [" << _uri << "]: "
+<<  response.getStatus() << " " << response.getReason() << 
Log::end;
 
-return (response.getStatus() == Poco::Net::HTTPResponse::HTTP_OK);
+return success;
 }
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentStoreManager.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentStoreManager.hpp |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit e014b0b22fb2f1bb75f74121dba335ae92a40ce6
Author: Ashod Nakashian 
Date:   Fri Mar 11 11:26:19 2016 -0500

loolwsd: Storage passed to DocumentStoreManager

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

diff --git a/loolwsd/DocumentStoreManager.hpp b/loolwsd/DocumentStoreManager.hpp
index 9369730..d8fca30 100644
--- a/loolwsd/DocumentStoreManager.hpp
+++ b/loolwsd/DocumentStoreManager.hpp
@@ -113,7 +113,7 @@ public:
 uriJailed = Poco::URI(Poco::URI("file://"), localPath);
 }
 
-auto document = std::shared_ptr(new 
DocumentStoreManager(uriPublic, uriJailed, childId, std::move(storage)));
+auto document = std::shared_ptr(new 
DocumentStoreManager(uriPublic, uriJailed, childId, storage));
 
 return document;
 }
@@ -125,6 +125,7 @@ public:
 
 bool save()
 {
+assert(_storage);
 return _storage->saveLocalFileToStorage();
 }
 
@@ -136,7 +137,7 @@ private:
 DocumentStoreManager(const Poco::URI& uriPublic,
  const Poco::URI& uriJailed,
  const std::string& jailId,
- std::unique_ptr storage) :
+ std::unique_ptr& storage) :
_uriPublic(uriPublic),
_uriJailed(uriJailed),
_jailId(jailId),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 98485] change the lable of a Button does not work

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98485

--- Comment #4 from Jun Ma  ---
The system and libreoffice versions i've tried on is below:

1.5 64bit GE-0200
Linux version 3.19.8 (nfs@build) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) )
Version: 5.2.0.0.alpha0+
Build ID: 775d93d0c0dc902dab6e3bdb978501b5d6295f8b
CPU Threads: 4; OS Version: Linux 3.19; UI Render: default; 
Locale: zh-CN (zh_CN.utf-8)

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp loolwsd/LOOLWSD.hpp loolwsd/MasterProcessSession.cpp loolwsd/MasterProcessSession.hpp loolwsd/test

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLWSD.cpp  |   36 +++-
 loolwsd/LOOLWSD.hpp  |   10 --
 loolwsd/MasterProcessSession.cpp |9 ++---
 loolwsd/MasterProcessSession.hpp |6 +-
 loolwsd/test/httpwstest.cpp  |2 +-
 5 files changed, 51 insertions(+), 12 deletions(-)

New commits:
commit f1007266e1644d3d7fde6149036646ec0f8198eb
Author: Ashod Nakashian 
Date:   Thu Mar 10 22:33:03 2016 -0500

loolwsd: DocumentStoreManager shared by MasterProcessSession instances

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

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 23cc2a1..2fcc86c 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -149,6 +149,8 @@ using Poco::Util::Option;
 using Poco::Util::OptionSet;
 using Poco::Util::ServerApplication;
 
+std::map> LOOLWSD::Sessions;
+std::mutex LOOLWSD::SessionsMutex;
 
 /// Handles the filename part of the convert-to POST request payload.
 class ConvertToPartHandler : public PartHandler
@@ -347,7 +349,7 @@ private:
 // Load the document.
 std::shared_ptr ws;
 const LOOLSession::Kind kind = LOOLSession::Kind::ToClient;
-auto session = std::make_shared(id, 
kind, ws);
+auto session = std::make_shared(id, 
kind, ws, nullptr);
 const std::string filePrefix("file://");
 std::string encodedFrom;
 URI::encode(filePrefix + fromPath, "", encodedFrom);
@@ -495,7 +497,7 @@ private:
 
 void handleGetRequest(HTTPServerRequest& request, HTTPServerResponse& 
response, const std::string& id)
 {
-Log::info("Starting Get request processor for session [" + id + "].");
+Log::info("Starting GET request handler for session [" + id + "].");
 
 //TODO: Authenticate the caller.
 // authenticate(request, response);
@@ -503,8 +505,32 @@ private:
 // request.getCookies(cookies);
 // Log::info("Cookie: " + cookies.get("PHPSESSID", ""));
 
+const auto uri = DocumentStoreManager::getUri(request.getURI());
+const auto docKey = uri.getPath();
+
+// This lock could become a bottleneck.
+// In that case, we can use a pool and index by publicPath.
+std::unique_lock lock(LOOLWSD::SessionsMutex);
+
+// Lookup this document.
+auto it = LOOLWSD::Sessions.find(docKey);
+std::shared_ptr document;
+if (it != LOOLWSD::Sessions.end())
+{
+// Get the DocumentStoreManager from the first session.
+auto sessionsMap = it->second;
+assert(!sessionsMap.empty());
+document = sessionsMap.begin()->second->getDocumentStoreManager();
+}
+else
+{
+// Set up the document and its storage.
+const auto jailRoot = Poco::Path(LOOLWSD::ChildRoot, id);
+document = DocumentStoreManager::create(uri, jailRoot.toString(), 
id);
+}
+
 auto ws = std::make_shared(request, response);
-auto session = std::make_shared(id, 
LOOLSession::Kind::ToClient, ws);
+auto session = std::make_shared(id, 
LOOLSession::Kind::ToClient, ws, document);
 
 // For ToClient sessions, we store incoming messages in a queue and 
have a separate
 // thread that handles them. This is so that we can empty the queue 
when we get a
@@ -534,7 +560,7 @@ private:
 }
 });
 
-Log::info("Get request processor for session [" + id + "] finished. 
Clearing and joining the queue.");
+Log::info("Finishing GET request handler for session [" + id + "]. 
Clearing and joining the queue.");
 queue.clear();
 queue.put("eof");
 queueHandlerThread.join();
@@ -607,7 +633,7 @@ public:
 Log::debug("Thread [" + thread_name + "] started.");
 
 auto ws = std::make_shared(request, response);
-auto session = std::make_shared(id, 
LOOLSession::Kind::ToPrisoner, ws);
+auto session = std::make_shared(id, 
LOOLSession::Kind::ToPrisoner, ws, nullptr);
 
 SocketProcessor(ws, response, [](const char* data, const 
int size, bool)
 {
diff --git a/loolwsd/LOOLWSD.hpp b/loolwsd/LOOLWSD.hpp
index e0120fe..e7ce8eb 100644
--- a/loolwsd/LOOLWSD.hpp
+++ b/loolwsd/LOOLWSD.hpp
@@ -24,6 +24,7 @@
 #include "Common.hpp"
 #include "Util.hpp"
 
+class MasterProcessSession;
 
 class LOOLWSD: public Poco::Util::ServerApplication
 {
@@ -31,8 +32,8 @@ public:
 LOOLWSD();
 ~LOOLWSD();
 
-// An Application is a singleton anyway, so just keep these as
-// statics
+// An Application is a 

[Libreoffice-commits] online.git: loolwsd/DocumentStoreManager.hpp loolwsd/LOOLWSD.cpp loolwsd/LOOLWSD.hpp loolwsd/MasterProcessSession.cpp loolwsd/MasterProcessSession.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentStoreManager.hpp |  148 +++
 loolwsd/LOOLWSD.cpp  |2 
 loolwsd/LOOLWSD.hpp  |  124 
 loolwsd/MasterProcessSession.cpp |2 
 loolwsd/MasterProcessSession.hpp |2 
 5 files changed, 150 insertions(+), 128 deletions(-)

New commits:
commit 73bde2b5d2ca37ab167f0164e773eda7d431866e
Author: Ashod Nakashian 
Date:   Thu Mar 10 21:42:33 2016 -0500

loolwsd: moved DocumentURI into own file and renamed to DocumentStoreManager

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

diff --git a/loolwsd/DocumentStoreManager.hpp b/loolwsd/DocumentStoreManager.hpp
new file mode 100644
index 000..76ae479
--- /dev/null
+++ b/loolwsd/DocumentStoreManager.hpp
@@ -0,0 +1,148 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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_DOCUMENTSTOREMANAGER_HPP
+#define INCLUDED_DOCUMENTSTOREMANAGER_HPP
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include "Storage.hpp"
+
+/// A DocumentStoreManager as mananged by us.
+/// Contains URI, physical path, etc.
+class DocumentStoreManager
+{
+public:
+
+static
+Poco::URI getUri(std::string uri)
+{
+// The URI of the document is url-encoded
+// and passed in our URL.
+if (uri.size() > 1 && uri[0] == '/')
+{
+// Remove leading '/'.
+uri.erase(0, 1);
+}
+
+std::string decodedUri;
+Poco::URI::decode(uri, decodedUri);
+auto uriPublic = Poco::URI(decodedUri);
+
+if (uriPublic.isRelative() || uriPublic.getScheme() == "file")
+{
+// TODO: Validate and limit access to local paths!
+uriPublic.normalize();
+}
+
+Log::info("Public URI [" + uriPublic.toString() + "].");
+if (uriPublic.getPath().empty())
+{
+throw std::runtime_error("Invalid URI.");
+}
+
+return uriPublic;
+}
+
+static
+std::shared_ptr create(const std::string& uri,
+const std::string& jailRoot,
+const std::string& childId)
+{
+std::string decodedUri;
+Poco::URI::decode(uri, decodedUri);
+auto uriPublic = Poco::URI(decodedUri);
+
+if (uriPublic.isRelative() || uriPublic.getScheme() == "file")
+{
+// TODO: Validate and limit access to local paths!
+uriPublic.normalize();
+}
+
+Log::info("Public URI [" + uriPublic.toString() + "].");
+if (uriPublic.getPath().empty())
+{
+throw std::runtime_error("Invalid URI.");
+}
+
+return create(uriPublic, jailRoot, childId);
+}
+
+static
+std::shared_ptr create(
+const Poco::URI& uriPublic,
+const std::string& jailRoot,
+const std::string& childId)
+{
+Log::info("Creating DocumentStoreManager with uri: " + 
uriPublic.toString() + ", jailRoot: " + jailRoot + ", childId: " + childId);
+
+// The URL is the publicly visible one, not visible in the chroot jail.
+// We need to map it to a jailed path and copy the file there.
+
+// user/doc/childId
+const auto jailPath = Poco::Path(JailedDocumentRoot, childId);
+
+Log::info("jailPath: " + jailPath.toString() + ", jailRoot: " + 
jailRoot);
+
+auto uriJailed = uriPublic;
+if (uriPublic.isRelative() || uriPublic.getScheme() == "file")
+{
+Log::info("Public URI [" + uriPublic.toString() + "] is a file.");
+std::unique_ptr storage(new LocalStorage(jailRoot, 
jailPath.toString(), uriPublic.getPath()));
+const auto localPath = storage->getLocalFilePathFromStorage();
+uriJailed = Poco::URI(Poco::URI("file://"), localPath);
+}
+else
+{
+Log::info("Public URI [" + uriPublic.toString() +
+  "] assuming cloud storage.");
+//TODO: Configure the storage to use. For now, assume it's WOPI.
+std::unique_ptr storage(new WopiStorage(jailRoot, 
jailPath.toString(), uriPublic.toString()));
+const auto localPath = storage->getLocalFilePathFromStorage();
+uriJailed = Poco::URI(Poco::URI("file://"), localPath);
+}
+
+auto document = 

[Libreoffice-commits] online.git: loolwsd/DocumentStoreManager.hpp loolwsd/Storage.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/DocumentStoreManager.hpp |   24 +---
 loolwsd/Storage.hpp  |   16 
 2 files changed, 25 insertions(+), 15 deletions(-)

New commits:
commit 9bf88691c693e34cb8eb866b1e789e5e523c56e0
Author: Ashod Nakashian 
Date:   Thu Mar 10 22:01:34 2016 -0500

loolwsd: DocumentStoreManager maintains Storage instance

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

diff --git a/loolwsd/DocumentStoreManager.hpp b/loolwsd/DocumentStoreManager.hpp
index 76ae479..9369730 100644
--- a/loolwsd/DocumentStoreManager.hpp
+++ b/loolwsd/DocumentStoreManager.hpp
@@ -95,11 +95,12 @@ public:
 Log::info("jailPath: " + jailPath.toString() + ", jailRoot: " + 
jailRoot);
 
 auto uriJailed = uriPublic;
+std::unique_ptr storage;
 if (uriPublic.isRelative() || uriPublic.getScheme() == "file")
 {
 Log::info("Public URI [" + uriPublic.toString() + "] is a file.");
-std::unique_ptr storage(new LocalStorage(jailRoot, 
jailPath.toString(), uriPublic.getPath()));
-const auto localPath = storage->getLocalFilePathFromStorage();
+storage.reset(new LocalStorage(jailRoot, jailPath.toString(), 
uriPublic.getPath()));
+const auto localPath = storage->loadStorageFileToLocal();
 uriJailed = Poco::URI(Poco::URI("file://"), localPath);
 }
 else
@@ -107,12 +108,12 @@ public:
 Log::info("Public URI [" + uriPublic.toString() +
   "] assuming cloud storage.");
 //TODO: Configure the storage to use. For now, assume it's WOPI.
-std::unique_ptr storage(new WopiStorage(jailRoot, 
jailPath.toString(), uriPublic.toString()));
-const auto localPath = storage->getLocalFilePathFromStorage();
+storage.reset(new WopiStorage(jailRoot, jailPath.toString(), 
uriPublic.toString()));
+const auto localPath = storage->loadStorageFileToLocal();
 uriJailed = Poco::URI(Poco::URI("file://"), localPath);
 }
 
-auto document = std::shared_ptr(new 
DocumentStoreManager(uriPublic, uriJailed, childId));
+auto document = std::shared_ptr(new 
DocumentStoreManager(uriPublic, uriJailed, childId, std::move(storage)));
 
 return document;
 }
@@ -122,6 +123,11 @@ public:
 Log::info("~DocumentStoreManager [" + _uriPublic.toString() + "] 
destroyed.");
 }
 
+bool save()
+{
+return _storage->saveLocalFileToStorage();
+}
+
 Poco::URI getPublicUri() const { return _uriPublic; }
 Poco::URI getJailedUri() const { return _uriJailed; }
 std::string getJailId() const { return _jailId; }
@@ -129,10 +135,12 @@ public:
 private:
 DocumentStoreManager(const Poco::URI& uriPublic,
  const Poco::URI& uriJailed,
- const std::string& jailId) :
+ const std::string& jailId,
+ std::unique_ptr storage) :
_uriPublic(uriPublic),
_uriJailed(uriJailed),
-   _jailId(jailId)
+   _jailId(jailId),
+   _storage(std::move(storage))
 {
 Log::info("DocumentStoreManager [" + _uriPublic.toString() + "] 
created.");
 }
@@ -141,6 +149,8 @@ private:
 const Poco::URI _uriPublic;
 const Poco::URI _uriJailed;
 const std::string _jailId;
+
+std::unique_ptr _storage;
 };
 
 #endif
diff --git a/loolwsd/Storage.hpp b/loolwsd/Storage.hpp
index 4e1133b..18a336a 100644
--- a/loolwsd/Storage.hpp
+++ b/loolwsd/Storage.hpp
@@ -56,10 +56,10 @@ public:
 
 /// Returns a local file path given a URI or ID.
 /// If necessary copies the file locally first.
-virtual std::string getLocalFilePathFromStorage() = 0;
+virtual std::string loadStorageFileToLocal() = 0;
 
 /// Writes the contents of the file back to the source.
-virtual bool restoreLocalFileToStorage() = 0;
+virtual bool saveLocalFileToStorage() = 0;
 
 protected:
 const std::string _localStorePath;
@@ -80,7 +80,7 @@ public:
 {
 }
 
-std::string getLocalFilePathFromStorage() override
+std::string loadStorageFileToLocal() override
 {
 const auto rootPath = getLocalRootPath();
 
@@ -119,7 +119,7 @@ public:
 return Poco::Path(_jailPath, filename).toString();
 }
 
-bool restoreLocalFileToStorage() override
+bool saveLocalFileToStorage() override
 {
 try
 {
@@ -155,7 +155,7 @@ public:
 }
 
 /// uri format: http://server/<...>/wopi*/files//content
-std::string getLocalFilePathFromStorage() override
+std::string loadStorageFileToLocal() override
 {
 Log::info("Downloading URI [" + _uri + "].");
 
@@ -192,7 +192,7 @@ public:
 return 

[Libreoffice-commits] online.git: loolwsd/LOOLWSD.hpp

2016-03-13 Thread Ashod Nakashian
 loolwsd/LOOLWSD.hpp |   64 ++--
 1 file changed, 52 insertions(+), 12 deletions(-)

New commits:
commit 0ee9119bc74ead040b3ee2cd793d4a9b86474875
Author: Ashod Nakashian 
Date:   Thu Mar 10 19:15:00 2016 -0500

loolwsd: refactored DocumentURI creation

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

diff --git a/loolwsd/LOOLWSD.hpp b/loolwsd/LOOLWSD.hpp
index c227587..d18ba1f 100644
--- a/loolwsd/LOOLWSD.hpp
+++ b/loolwsd/LOOLWSD.hpp
@@ -32,24 +32,65 @@ class DocumentURI
 public:
 
 static
-std::shared_ptr create(const std::string& url,
+Poco::URI getUri(std::string uri)
+{
+// The URI of the document is url-encoded
+// and passed in our URL.
+if (uri.size() > 1 && uri[0] == '/')
+{
+// Remove leading '/'.
+uri.erase(0, 1);
+}
+
+std::string decodedUri;
+Poco::URI::decode(uri, decodedUri);
+auto uriPublic = Poco::URI(decodedUri);
+
+if (uriPublic.isRelative() || uriPublic.getScheme() == "file")
+{
+// TODO: Validate and limit access to local paths!
+uriPublic.normalize();
+}
+
+Log::info("Public URI [" + uriPublic.toString() + "].");
+if (uriPublic.getPath().empty())
+{
+throw std::runtime_error("Invalid URI.");
+}
+
+return uriPublic;
+}
+
+static
+std::shared_ptr create(const std::string& uri,
 const std::string& jailRoot,
 const std::string& childId)
 {
-Log::info("DocumentURI: url: " + url + ", jailRoot: " + jailRoot + ", 
childId: " + childId);
+std::string decodedUri;
+Poco::URI::decode(uri, decodedUri);
+auto uriPublic = Poco::URI(decodedUri);
 
-// TODO: Sanitize the url and limit access!
-std::string decodedUrl;
-Poco::URI::decode(url, decodedUrl);
-auto uriPublic = Poco::URI(decodedUrl);
-Log::info("Public URI [" + uriPublic.toString() + "].");
+if (uriPublic.isRelative() || uriPublic.getScheme() == "file")
+{
+// TODO: Validate and limit access to local paths!
+uriPublic.normalize();
+}
 
+Log::info("Public URI [" + uriPublic.toString() + "].");
 if (uriPublic.getPath().empty())
-throw std::runtime_error("Invalid URL.");
+{
+throw std::runtime_error("Invalid URI.");
+}
+
+return create(uriPublic, jailRoot, childId);
+}
 
-// This lock could become a bottleneck.
-// In that case, we can use a pool and index by publicPath.
-std::unique_lock lock(DocumentURIMutex);
+static
+std::shared_ptr create(const Poco::URI& uriPublic,
+const std::string& jailRoot,
+const std::string& childId)
+{
+Log::info("DocumentURI: uri: " + uriPublic.toString() + ", jailRoot: " 
+ jailRoot + ", childId: " + childId);
 
 // The URL is the publicly visible one, not visible in the chroot jail.
 // We need to map it to a jailed path and copy the file there.
@@ -62,7 +103,6 @@ public:
 auto uriJailed = uriPublic;
 if (uriPublic.isRelative() || uriPublic.getScheme() == "file")
 {
-uriPublic.normalize();
 Log::info("Public URI [" + uriPublic.toString() + "] is a file.");
 std::unique_ptr storage(new LocalStorage(jailRoot, 
jailPath.toString(), uriPublic.getPath()));
 const auto localPath = storage->getLocalFilePathFromStorage();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2016-03-13 Thread Ashod Nakashian
 loleaflet/src/core/Socket.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ce702f72e83881448c1bb379ba369193bf5436c4
Author: Ashod Nakashian 
Date:   Wed Mar 9 23:17:57 2016 -0500

loleaflet: pass doc URI to WebSocket

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

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index d1d5ad9..b3e0e02 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -9,9 +9,9 @@ L.Socket = L.Class.extend({
initialize: function (map) {
this._map = map;
try {
-   this.socket = new WebSocket(map.options.server);
+   this.socket = new WebSocket(map.options.server + '/' + 
map.options.doc);
} catch (e) {
-   this.fire('error', {msg: _('Socket connection error'), 
cmd: 'socket', kind: 'failed', id: 3});
+   this.fire('error', {msg: _('Socket connection error: ' 
+ e), cmd: 'socket', kind: 'failed', id: 3});
return null;
}
this._msgQueue = [];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 98485] change the lable of a Button does not work

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98485

Jun Ma  changed:

   What|Removed |Added

 Status|NEEDINFO|UNCONFIRMED
 Ever confirmed|1   |0

--- Comment #3 from Jun Ma  ---
Please try these steps:
1. Create a new odt document and input some text
2. Click "File"- "Export..."
3. The Export dialog - the label of PUSHBUTTON_OK button is "Save"

Expect results:
The label of PUSHBUTTON_OK button should be "Export"

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 42496] Calc EDITING: improve functionality when Formula gets in a way while editing and prevents selection of the adjacent cell.

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=42496

--- Comment #4 from David  ---
This becomes more of an issue the longer your formulas are.  With some of the
formulas I am using, it can consume a large portion of the page, hiding many
cells I would like to be able to click on to add to the formula.  This forces
me to save the formula incomplete, lookup the cell addresses that I need to add
and re-edit the formula.  Since some of them requires 10 cells or more, this is
a major pain.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98610] Installation failed repeated download/install attempts

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98610

--- Comment #7 from Joe Bachofen, Sr.  ---
(In reply to Buovjaga from comment #5)
> Fig2 is speaking about a network resource that is unavailable.
> 
> You can try this tool from Microsoft:
> https://support.microsoft.com/en-us/mats/program_install_and_uninstall
> 
> Set to NEEDINFO.
> Change back to UNCONFIRMED, if the problem persists. Change to RESOLVED
> WORKSFORME, if the problem went away.

The link you provided does not support Windows 10; I'll look for one that does.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98610] Installation failed repeated download/install attempts

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98610

--- Comment #6 from Joe Bachofen, Sr.  ---
Thanks for the quick responses.  I am trying to install Libre Office 5.0.5.2 as
an update to V: 5.0.4.2 but the popup error says it can't find the install file
for V:4.4.5 which was never installed on my PC.  The second popup error reports
a failure to remove an older version of 5.0.5.2 but I'm trying to install
V:5.0.5.2
so there is no older version of it.  I did try to do a complete uninstall using
the built-in Microsoft uninstall but that failed with the same kind of error
reports.  The screen captures I provided show all the LibreOffice msi file that
exist on my PC and the permissions on the files and the folder containing them
are set to allow installs/uninstalls.  I have used LibreOffice for years
without these problems.  I updated to V:5.0.4.2 on this same Windows 10 PC
successfully and have done numerous updates on my Linux machine without any
problems.  Please look closely at the two figures I supplied earlier and tell
me if they make sense to you then tell me why it is trying to find files that I
never had and why it is trying to remove the version I am trying to install!(In
reply to tommy27 from comment #4)
> did you try doing a full uninstall of any previous LibO version installed on
> your PC?  Yes, with the same type of error reports.

(In reply to Buovjaga from comment #5)
> Fig2 is speaking about a network resource that is unavailable.
> 
> You can try this tool from Microsoft:
> https://support.microsoft.com/en-us/mats/program_install_and_uninstall
> 
> Set to NEEDINFO.
> Change back to UNCONFIRMED, if the problem persists. Change to RESOLVED
> WORKSFORME, if the problem went away.
I understand the error message but the "resource" it can't find has never been
on my PC.  The issue is why is the install sw looking for a file I don't have? 
I will try the Microsoft link you provided.  Thank you.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 97958] Sometimes, display of font goes badly wrong, depending on zoom factor

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=97958

--- Comment #5 from Luke Kendall  ---
Oh, and quitting LO and restarting (re-opening each document) fixed the font
display problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 97958] Sometimes, display of font goes badly wrong, depending on zoom factor

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=97958

--- Comment #4 from Luke Kendall  ---
I've been working heavily with 5.1.0.3 since Feb 20th, with no repeat of the
problem until today, when it became egregious. But this time it was obvious why
- I just accepted the installation of a whole swathe of package updates from
Ubuntu's Update Manager, and afterwards, everything was horrible. (Ubuntu
16.04.)

Also of possible interest was that after the update, I opened a new text
document and typed three letters, then changed the Text Body paragrpah style to
use Time New Roman 14pt, then zoomed the text, then dragged the bottom edge of
the window larger by about 1cm so I could see the whole page.  And with that
final operation, LO locked up completely, going approx. 100% CPU bound. 
Instead of panicking, though, I did soemthing else for 45mins and noticed that:
1) LO was responsive again
2) LO was far from CPU bound
3) Test was displaying with bizarre/random fonts

My guess is that some fonts or some font libraries were replaced, and that
perhaps LO went busy while it recalculated (and ruined) its font cache?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98482] PRINTING: Image Flip(vertically and horizontally) does not keep after print.

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98482

--- Comment #3 from HD  ---
Thank you for the confirmation.
I confirmed this problem with Windows7.

OS: Windows7 Professional
Version: 5.1.0.3
Build ID: 5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default;
Locale: ja-JP (ja_JP)

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98628] cells with boolean results but number formatted are in boolean format after save and reopen

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98628

m.a.riosv  changed:

   What|Removed |Added

 CC||miguelangelrv@libreoffice.o
   ||rg

--- Comment #6 from m.a.riosv  ---
I can't reproduce.
Win10x64
Version: 5.0.5.2
Build ID: 55b006a02d247b5f7215fc6ea0fde844b30035b3
TinderBox: Win-x86@62-merge-TDF, Branch:libreoffice-5-0, Time:
2016-03-07_09:00:12
Version: 5.1.1.3 (x64)
Build ID: 89f508ef3ecebd2cfb8e1def0f0ba9a803b88a6d
CPU Threads: 4; OS Version: Windows 6.19; UI Render: GL;

Please try resetting the user profile, sometimes solves strange issues.
https://wiki.documentfoundation.org/UserProfile
Usually it's enough renaming/deleting the file
"user/registrymodifications.xcu",  it affects all the options in
Menu/Tools/Options, and the files "user/basic/dialog.xlc" and "scrip.xlc" are
overwritten, additionally custom colors in "user/config/standard.soc" are lost.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 93553] Writer crashes or hangs

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=93553

--- Comment #12 from Ben  ---
Created attachment 123548
  --> https://bugs.documentfoundation.org/attachment.cgi?id=123548=edit
Test file used on Ubuntu

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 93553] Writer crashes or hangs

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=93553

--- Comment #11 from Ben  ---
Installed Virtual Box and Ubuntu that came with LibreOfice 5 on my Windows PC.
I appended formulas (1.1), (1.2), and (1.3), with %alpha, %beta%Gamma, and
%alpha%Gamma%delta, respectively. After each formula change, I tried to save
the file. Writer still crashed 2 out of 3 times and the last time I could not
even recover the file when I tried to open it after the crash. See attached
file which I started with to do the test

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98628] cells with boolean results but number formatted are in boolean format after save and reopen

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98628

--- Comment #5 from yves.masquel...@free.fr ---
you can see attached an exported PDF from V5.1.1.3 (french version) of the
spreadsheet with hash(es) in cells where there are results of formule
"XOR(cellX; cellY) or a copy of a cell that contains this result. When cells
are enlarged, words "VRAI" (true) or "FAUX" (false) are readable.

The spreadsheet was saved when all cells were formatted in number.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98628] cells with boolean results but number formatted are in boolean format after save and reopen

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98628

--- Comment #4 from yves.masquel...@free.fr ---
Created attachment 123547
  --> https://bugs.documentfoundation.org/attachment.cgi?id=123547=edit
PDF of the sheet and the application version

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98556] Reports docx files as corrupt if a writer is not installed.

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98556

--- Comment #4 from Matt  ---
(In reply to Buovjaga from comment #3)
> Is it possible for you to try with 5.1.1? Or does it even allow to install
> the applications separately?

I do not know how to install it separately if it is possible. Right now fedora
lets me install individual components. I only have calc and writer installed.
It looks like the rpm from the site will install everything.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


Dag Wieërs license statement

2016-03-13 Thread Dag Wieers

All of my past & future contributions to LibreOffice may be
licensed under the MPLv2/LGPLv3+ dual license.

--
Dag
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-bugs] [Bug 98565] FILEOPEN draw:transform="scale()" acts wrongly on line, polyline and path

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98565

--- Comment #5 from Regina Henschel  ---
Created attachment 123546
  --> https://bugs.documentfoundation.org/attachment.cgi?id=123546=edit
package with screenshots of correct rendering

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98489] The CTR-ALT-5 combination does NOT produce the €-sign any more

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98489

--- Comment #2 from R.H. Jamin  ---
Dear Robin

I do not exactly remember which was the last version of LibreOffice it was that
produced € on CTR-ALT-5, but I am certain all 4-versions did function
correctly.

My OS is W7.

I am afraid you eradicated a function from LO which is universal in all other
programs, regardless of OS.


mith kind regards,

Rob Jamin

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98620] Error in orientation after converting from ODT to docx

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98620

V Stuart Foote  changed:

   What|Removed |Added

 CC||vstuart.fo...@utsa.edu

--- Comment #5 from V Stuart Foote  ---
Can not confirm, the copy/paste unformatted and paste as HTML (without
comments) both format correctly into an .ODT docuemnts.  And, also when Save
copy as OOXML -- .docx

On Windows 10 Pro 64-bit en-US with
Version: 5.1.1.3 (x64)
Build ID: 89f508ef3ecebd2cfb8e1def0f0ba9a803b88a6d
CPU Threads: 8; OS Version: Windows 6.19; UI Render: GL; 
Locale: en-US (en_US)


I notice on your "Wine Configuartion-2" that your user profile looks to have
some unusual styles defined that appear to include an CTL font--and so you
receive Right justified formatting for that OOXML document.

Perhaps clear you user profile and see if you have a more reasonable result in
filter export/save-as in OOXML.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98640] New: gtk3 menus don't support context help

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98640

Bug ID: 98640
   Summary: gtk3 menus don't support context help
   Product: LibreOffice
   Version: 5.2.0.0.alpha0+ Master
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: enhancement
  Priority: medium
 Component: graphics stack
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: momonas...@gmail.com
CC: caol...@redhat.com

1. Highlight item in gtk3 menu.
2. Press F1.
3. Nothing happens. In VCL menus it opens the online help for the given
command. Would be really nice if it will be possible to implement for gtk3 too.
Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98639] New: Spacing to contents is broken after saving as docx

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98639

Bug ID: 98639
   Summary: Spacing to contents is broken after saving as docx
   Product: LibreOffice
   Version: 5.1.1.2 rc
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: UNCONFIRMED
  Severity: normal
  Priority: medium
 Component: Writer
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: ismelh...@ksat.cz

Created attachment 123545
  --> https://bugs.documentfoundation.org/attachment.cgi?id=123545=edit
incorrect position

1. create a blank odt document
2. create a paragraph with some value in "Spacing to contents"-"left" (for
better visualisation fill the area but it is not necessary)
3. Result is now as expected, i.e. paragraph area starts at page border and
first character starts at position paragraph area + set value of "Spacing to
contents"-"left"
4. Save the document in docx format
5. open the document in docx format
6. Result is now incorect, i.e. paragraph area starts at position of page
boarder minus "Spacing to contents"-"left" so that the first character starts
at page boarder

What makes this bug major is, that the formatting of the document is broken
irreversibly, i.e. even after saving again as odt and formatting a new
paragraph from scratch, the result is incorrect and the only workable solution,
I have found, is creating a new document and copy paste the content. Otherwise
alignment of all paragraph with non-zero value of "Spacing to contents"-"left"
is broken.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-commits] core.git: Branch 'feature/fixes18' - sw/source

2016-03-13 Thread László Németh
 sw/source/core/txtnode/txtedt.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 3baf635f041064c2ed9e1a094dfe69990e50978d
Author: László Németh 
Date:   Sun Mar 13 22:13:17 2016 +0100

Revert "Revert "test autocompletion word collection""

This reverts commit 0965dc4c8e96b7bc6de49bdab7b55fef5f099e21.

diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index 5064e00..fd912a5 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1556,6 +1556,10 @@ SwRect SwTextFrame::SmartTagScan( SwContentNode* 
/*pActNode*/, sal_Int32 /*nActP
 return aRet;
 }
 
+#if 1
+void SwTextFrame::CollectAutoCmplWrds( SwContentNode* , sal_Int32  )
+{}
+#else
 // Wird vom CollectAutoCmplWords gerufen
 void SwTextFrame::CollectAutoCmplWrds( SwContentNode* pActNode, sal_Int32 
nActPos )
 {
@@ -1605,7 +1609,7 @@ void SwTextFrame::CollectAutoCmplWrds( SwContentNode* 
pActNode, sal_Int32 nActPo
 if (!bACWDirty)
 pNode->SetAutoCompleteWordDirty( false );
 }
-
+#endif
 /** Findet den TextFrame und sucht dessen CalcHyph */
 bool SwTextNode::Hyphenate( SwInterHyphInfo  )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 98638] New: gtk3 context menus sometimes don't work in Impress

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98638

Bug ID: 98638
   Summary: gtk3 context menus sometimes don't work in Impress
   Product: LibreOffice
   Version: 5.2.0.0.alpha0+ Master
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: major
  Priority: medium
 Component: graphics stack
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: momonas...@gmail.com
CC: caol...@redhat.com

1. Start Impress with gtk3 vclplug.
2. Right click on the slide.
3. Nothing happens.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 92067] GtkSalMenu: menu File>Templates>Manage executes action from the wrong submenu

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=92067

Jean-Baptiste Faure  changed:

   What|Removed |Added

 Status|RESOLVED|VERIFIED

--- Comment #12 from Jean-Baptiste Faure  ---
Verified fixed in LO 5.1.2.0.0+.
Thank you very much.

Best regards. JBF

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-ux-advise] [Bug 93837] Allow customization of the Context Menus

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=93837

--- Comment #44 from Maxim Monastirsky  ---
(In reply to tommy27 from comment #43)
> outstanding new feature!!! thanks Maxim!!!
Glad you liked it!

> can we mark this a RESOLVED or there's still some work left to do?
There is still some work left in Impress/Draw and in Chart.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Libreoffice-ux-advise mailing list
Libreoffice-ux-advise@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-ux-advise


[Libreoffice-bugs] [Bug 90038] CMIS https never connect/timeout with self sign cert but http work (Debian amd64)

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=90038

--- Comment #15 from Christian Lohmaier  ---
(rpms also provided at the gdrivetest2 url
http://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@70-TDF/gdrivetest2/
- the package format doesn't matter for this bug)

Note that there's still bug#87938 (two-factor auth for gdrive not working) - so
if you want to test, you have to disable two-factor authentication temporarily.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[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-bugs] [Bug 98637] New: GtkSalMenu: Customization doesn't work

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98637

Bug ID: 98637
   Summary: GtkSalMenu: Customization doesn't work
   Product: LibreOffice
   Version: 5.2.0.0.alpha0+ Master
  Hardware: All
OS: Linux (All)
Status: UNCONFIRMED
  Severity: normal
  Priority: medium
 Component: graphics stack
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: momonas...@gmail.com
CC: caol...@redhat.com

1. Make sure you're using GtkSalMenu.
2. Customize main menu, e.g. in File move "Open..." above "New".
3. The menu still looks like before, but clicking "Open..." will execute the
"New" command.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98636] New: GtkSalMenu: Submenus state isn't fully updated when item becomes visible during status update

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98636

Bug ID: 98636
   Summary: GtkSalMenu: Submenus state isn't fully updated when
item becomes visible during status update
   Product: LibreOffice
   Version: 5.2.0.0.alpha0+ Master
  Hardware: All
OS: Linux (All)
Status: UNCONFIRMED
  Severity: normal
  Priority: medium
 Component: graphics stack
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: momonas...@gmail.com
CC: caol...@redhat.com

1. Make sure you're using GtkSalMenu (recent gtk3 or Ubuntu global menu).
2. Open Writer.
3. Look at Tools->Macros menu.
4. Enable macro recording.
5. Look again at Tools->Macros menu:
   - The 2nd item is now "Record Macro", but it still have the submenu.
   - The 3rd item "Organize Macros" has submenu as expected, but it's empty.
(The last part suggests that we do need recursive update, at least when an item
didn't have submenu and now has, unlike I hoped in
2abdcfd641883f246fe78f2fbe38499c9382c059)

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98022] LibreOffice freezes while saving large file

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98022

Bart Hengeveld  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|WORKSFORME  |---
 Ever confirmed|0   |1

--- Comment #13 from Bart Hengeveld  ---
Sorry, but same issue returned: freezes on saving large file.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


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

2016-03-13 Thread Caolán McNamara
 sc/source/core/tool/rangenam.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit e1c9efceaef0f706889aa987def592d7ae62285a
Author: Caolán McNamara 
Date:   Sun Mar 13 20:25:02 2016 +

loplugin:cstylecast

Change-Id: I2d03c5054ef1b863052b221c0740ed3bb993600e

diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index cc438f6..830980c 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -463,7 +463,8 @@ void ScRangeData::MakeValidName( OUString& rName )
 ScAddress::Details details( 
static_cast( nConv ) );
 // Don't check Parse on VALID, any partial only VALID may result in
 // #REF! during compile later!
-while ( (bool)aRange.Parse( rName, nullptr, details) || 
(bool)aAddr.Parse( rName, nullptr, details ) )
+while (aRange.Parse(rName, nullptr, details) != ScRefFlags::ZERO ||
+aAddr.Parse(rName, nullptr, details) != ScRefFlags::ZERO)
 {
 // Range Parse is partially valid also with invalid sheet name,
 // Address Parse dito, during compile name would generate a #REF!
@@ -498,8 +499,11 @@ bool ScRangeData::IsNameValid( const OUString& rName, 
ScDocument* pDoc )
 ScAddress::Details details( 
static_cast( nConv ) );
 // Don't check Parse on VALID, any partial only VALID may result in
 // #REF! during compile later!
-if ( (bool)aRange.Parse( rName, pDoc, details) || (bool)aAddr.Parse( 
rName, pDoc, details) )
+if (aRange.Parse(rName, pDoc, details) != ScRefFlags::ZERO ||
+ aAddr.Parse(rName, pDoc, details) != ScRefFlags::ZERO )
+{
 return false;
+}
 }
 return true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'refs/notes/commits' - 11/989be26fd48a084b58a7795ed3f2fae11401d7

2016-03-13 Thread Caolán McNamara
 11/989be26fd48a084b58a7795ed3f2fae11401d7 |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7b2f13f7f33a9e3cb3bff1aff1f0c616ef52a45c
Author: Caolán McNamara 
Date:   Sun Mar 13 20:30:06 2016 +

Notes added by 'git notes add'

diff --git a/11/989be26fd48a084b58a7795ed3f2fae11401d7 
b/11/989be26fd48a084b58a7795ed3f2fae11401d7
new file mode 100644
index 000..838ee51
--- /dev/null
+++ b/11/989be26fd48a084b58a7795ed3f2fae11401d7
@@ -0,0 +1 @@
+prefer: 
16aa073855da37d75d0f48e7fbdf92d14ef8c26416aa073855da37d75d0f48e7fbdf92d14ef8c264
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-13 Thread Markus Mohrhard
 sc/source/filter/excel/tokstack.cxx |   19 ++-
 sc/source/filter/inc/tokstack.hxx   |1 +
 2 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 3887e8439a6928d2f608315f7050d012be65d208
Author: Markus Mohrhard 
Date:   Sun Mar 13 19:15:16 2016 +0100

fix memory leak in array xls import

The ScMatrix instances are leaked because there is no DecRef called on
them when we Reset the TokenPool.

Change-Id: Ie5e1a10c6be94b45df784c04f6db744928f213ff
Reviewed-on: https://gerrit.libreoffice.org/23194
Reviewed-by: Kohei Yoshida 
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/filter/excel/tokstack.cxx 
b/sc/source/filter/excel/tokstack.cxx
index 1bafcfbc..31e8995 100644
--- a/sc/source/filter/excel/tokstack.cxx
+++ b/sc/source/filter/excel/tokstack.cxx
@@ -126,11 +126,7 @@ TokenPool::~TokenPool()
 delete ppP_Nlf[ n ];
 delete[] ppP_Nlf;
 
-for( n = 0 ; n < nP_Matrix ; n++ )
-{
-if( ppP_Matrix[ n ] )
-ppP_Matrix[ n ]->DecRef( );
-}
+ClearMatrix();
 delete[] ppP_Matrix;
 
 delete pScToken;
@@ -879,6 +875,7 @@ void TokenPool::Reset()
 maExtNames.clear();
 maExtCellRefs.clear();
 maExtAreaRefs.clear();
+ClearMatrix();
 }
 
 bool TokenPool::IsSingleOp( const TokenId& rId, const DefTokenId eId ) const
@@ -934,4 +931,16 @@ ScMatrix* TokenPool::GetMatrix( unsigned int n ) const
 return nullptr;
 }
 
+void TokenPool::ClearMatrix()
+{
+for(sal_uInt16 n = 0 ; n < nP_Matrix ; n++ )
+{
+if( ppP_Matrix[ n ] )
+{
+ppP_Matrix[ n ]->DecRef( );
+ppP_Matrix[n] = nullptr;
+}
+}
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/tokstack.hxx 
b/sc/source/filter/inc/tokstack.hxx
index 6a1ed79..9ceb2a4 100644
--- a/sc/source/filter/inc/tokstack.hxx
+++ b/sc/source/filter/inc/tokstack.hxx
@@ -182,6 +182,7 @@ private:
 boolGrowMatrix();
 boolGetElement( const sal_uInt16 nId );
 boolGetElementRek( const sal_uInt16 nId );
+voidClearMatrix();
 public:
 TokenPool( svl::SharedStringPool& rSPool );
 ~TokenPool();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 98482] PRINTING: Image Flip(vertically and horizontally) does not keep after print.

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98482

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||todven...@suomi24.fi
 Ever confirmed|0   |1

--- Comment #2 from Buovjaga  ---
Reproduced. I can see it in print preview, no need to print.

HD: which operating system are you using?

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 235411c9d47ecba88e46d859ea93bcecefb0c46e
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 11th 2016

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98485] change the lable of a Button does not work

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98485

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEEDINFO
 CC||todven...@suomi24.fi
 Ever confirmed|0   |1

--- Comment #2 from Buovjaga  ---
Tools - Customize - Toolbars. Toolbar - Text only or Icons & text to see
result.
Works for me.

Plz try with a newer version.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 235411c9d47ecba88e46d859ea93bcecefb0c46e
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 11th 2016

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98635] New: With LO closed, clicking a file starts LO, but then freezes. On mouse movement, load continues

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98635

Bug ID: 98635
   Summary: With LO closed, clicking a file starts LO, but then
freezes. On mouse movement, load continues
   Product: LibreOffice
   Version: unspecified
  Hardware: x86-64 (AMD64)
OS: Mac OS X (All)
Status: UNCONFIRMED
  Severity: normal
  Priority: medium
 Component: UI
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: lo-bugzi...@warth-fn.de

User-Agent:   Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3)
AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4
Build Identifier: LibreOffice 5.1.0 (maybe from 5.x.x on)

When LO is completly closed, the invocation of the program by clicking a file
in the finder stops after starting LO (LO "frame" is visible in the background,
but no further action happens. The window with the opened file doesn't show
up).
This situation lasts ("freezes") until a mouse / touchpad action is done. then
the window shows up

This annoying behaviour happens not with LO  4.4.7.2 or previous

Reproducible: Always

Steps to Reproduce:
1. If not, shut down LO completely
2. start a file (in my case it was an .ods) by clicking on it in the finder or
alternatively by searching with spotlight and "ENTER"
3. wait long enough (much longer than you expect the opening of a window in
this scenario)
4. move the mouse / trackpad

Actual Results:  
5. now the file loads 

Expected Results:  
- but my expectation is that the file loads already in step 3.

[Information automatically included from LibreOffice]
Locale: de
Module: StartModule
[Information guessed from browser]
OS: Mac OS X (All)
OS is 64bit: no


Reset User Profile?Yes, Not solved; i reverted to LO 4.4.7.2 solving this
problem

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 90038] CMIS https never connect/timeout with self sign cert but http work (Debian amd64)

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=90038

Giuseppe Castagno (aka beppec56)  changed:

   What|Removed |Added

 Status|NEEDINFO|NEW

--- Comment #14 from Giuseppe Castagno (aka beppec56) 
 ---
(In reply to Samuel Wolf from comment #13)

> You guess this fix the issue with the TDF .deb as well?
> That would be really good news!

Can you please download this:


?
It' a special version of master build specifally crested to check for  bug
98416.
For me it solved this as well.
A comfirmation will be appreciated.

Thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98487] autosave too long

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98487

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEEDINFO
 CC||todven...@suomi24.fi
 Ever confirmed|0   |1

--- Comment #1 from Buovjaga  ---
Autosave was disabled by default in 5.0 (bug 65509). Did you enable it in
expert configuration?

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98454] Visual corruption when viewing a document in web view, help documentation, and text based controls

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98454

Buovjaga  changed:

   What|Removed |Added

 CC||todven...@suomi24.fi

--- Comment #2 from Buovjaga  ---
Not seeing it myself.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 235411c9d47ecba88e46d859ea93bcecefb0c46e
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 11th 2016

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98490] Rulers that are off get turn on when opening a presentation with grids on

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98490

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||todven...@suomi24.fi
 Ever confirmed|0   |1
   Severity|normal  |minor

--- Comment #1 from Buovjaga  ---
Repro.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 235411c9d47ecba88e46d859ea93bcecefb0c46e
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 11th 2016

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98483] After enabling OpenGL Calc crashes on entering Options menu

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98483

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEEDINFO
 CC||todven...@suomi24.fi
 Ever confirmed|0   |1

--- Comment #3 from Buovjaga  ---
https://wiki.documentfoundation.org/QA/BugReport/Debug_Information#GNU.2FLinux
http://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@70-TDF-dbg/current/

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided further testing information.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98499] copy page from wiki to writer locked writer

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98499

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEEDINFO
 CC||todven...@suomi24.fi
 Ever confirmed|0   |1

--- Comment #1 from Buovjaga  ---
How did you copy it? Did you Ctrl-A select all first? Or only select the text
content?
I have no problem either way.

You did not specify the version and operating system used.

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 235411c9d47ecba88e46d859ea93bcecefb0c46e
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 11th 2016

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98267] Cannot change position of outline numbering

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98267

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #4 from Buovjaga  ---
Let's set to NEW and see what happens.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 235411c9d47ecba88e46d859ea93bcecefb0c46e
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 11th 2016

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98507] Formatting: Character format 'spills' forward to next line in MS .doc format on fileload of Microsoft

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98507

--- Comment #3 from Buovjaga  ---
Created attachment 123544
  --> https://bugs.documentfoundation.org/attachment.cgi?id=123544=edit
DOC for testing

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98507] Formatting: Character format 'spills' forward to next line in MS .doc format on fileload of Microsoft

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98507

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||todven...@suomi24.fi
 Ever confirmed|0   |1

--- Comment #2 from Buovjaga  ---
Reproduced.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 235411c9d47ecba88e46d859ea93bcecefb0c46e
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 11th 2016

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98267] Cannot change position of outline numbering

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98267

--- Comment #3 from andis.lazd...@gmail.com ---
Thank you for recommendation!

Outline numbering can be changed also through Format > Bullets and Numbering...
> Outline / Position / Options, but it was possible also through Tools >
Outline numbering dialogue in previous versions.

I guess it is some kind of regressions / mistakes

The easiest way would be to remove Outline numbering... from Tools to avoid
confusing situations.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98324] .bmp and .png images in .ods printed as black squares when "convert colors to grayscale" option is ticked

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98324

--- Comment #18 from Buovjaga  ---
Eion's log:
DriverVersion: 10.18.10.4276
DriverDate: 8-17-2015
DeviceID: PCI\VEN_8086_0166_05351028_09
AdapterVendorID: 0x8086
AdapterDeviceID: 0x0166
AdapterSubsysID: 0x05351028
DeviceKey:
System\CurrentControlSet\Control\Video\{A0FB39BB-498D-4F90-AFB0-F8B78EC06B63}\
DeviceString: Intel(R) HD Graphics 4000

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98517] FORMATTING : loss of format when backspacing

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98517

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEEDINFO
 CC||todven...@suomi24.fi
 Ever confirmed|0   |1

--- Comment #2 from Buovjaga  ---
We need an example document where this can be seen.

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the document.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98324] .bmp and .png images in .ods printed as black squares when "convert colors to grayscale" option is ticked

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98324

--- Comment #17 from Eion MacDonald  ---
Created attachment 123543
  --> https://bugs.documentfoundation.org/attachment.cgi?id=123543=edit
print file sample plus log

After downloading and updating 5.1.1.3 I printed sample bothwith and without
convert colours to greyscale ticked. Both versions printed ok. see sample witk
requested log inserted

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 92067] GtkSalMenu: menu File>Templates>Manage executes action from the wrong submenu

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=92067

--- Comment #11 from Commit Notification 
 ---
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f9b729dba5d1dd9a87241284a67ee4dfc91bee2f=libreoffice-5-1

Resolves: tdf#92067 with duplicate menu entries track which to activate

It will be available in 5.1.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 92067] GtkSalMenu: menu File>Templates>Manage executes action from the wrong submenu

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=92067

Commit Notification  changed:

   What|Removed |Added

 Whiteboard|target:5.2.0|target:5.2.0 target:5.1.2

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - vcl/inc vcl/unx

2016-03-13 Thread Caolán McNamara
 vcl/inc/unx/gtk/gtksalmenu.hxx |2 -
 vcl/unx/gtk/gtksalmenu.cxx |   42 ++---
 2 files changed, 36 insertions(+), 8 deletions(-)

New commits:
commit f9b729dba5d1dd9a87241284a67ee4dfc91bee2f
Author: Caolán McNamara 
Date:   Sat Mar 12 21:03:04 2016 +

Resolves: tdf#92067 with duplicate menu entries track which to activate

rather than just stick 2/3/4 at the end embed that this is a dup as the
prefix and strip that off at dispatch time and pass the dup index around
as a counter to how many dup candidates to dismiss to find the desired
one.

(cherry picked from commit e22618a355c0e506b8cfac9c52e9564db26949d2)

Change-Id: I81d97090a7e9b8c2995a3b27934f3ee5636d05fe
Reviewed-on: https://gerrit.libreoffice.org/23183
Tested-by: Jenkins 
Reviewed-by: Maxim Monastirsky 
Tested-by: Maxim Monastirsky 

diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 5d9c262..011c3e4 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -51,7 +51,7 @@ private:
 GMenuModel* mpMenuModel;
 GActionGroup*   mpActionGroup;
 
-GtkSalMenu* GetMenuForItemCommand( gchar* aCommand, 
gboolean bGetSubmenu );
+GtkSalMenu* GetMenuForItemCommand( gchar* aCommand, int& 
rDupsToSkip, gboolean bGetSubmenu );
 voidImplUpdate( gboolean bRecurse );
 voidActivateAllSubmenus(MenuBar* pMenuBar);
 
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 6b977fe..b6295fa 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -57,14 +57,14 @@ static gchar* GetCommandForItem( GtkSalMenuItem* 
pSalMenuItem, gchar* aCurrentCo
 aCommand = g_strdup( aCommandStr );
 
 // Some items could have duplicated commands. A new one should be 
generated.
-for ( sal_uInt16 i = 2; ; i++ )
+for ( sal_uInt16 i = 1; ; i++ )
 {
 if ( !g_action_group_has_action( pActionGroup, aCommand )
 || ( aCurrentCommand && g_strcmp0( aCurrentCommand, 
aCommand ) == 0 ) )
 break;
 
 g_free( aCommand );
-aCommand = g_strdup_printf("%s%d", aCommandStr, i);
+aCommand = g_strdup_printf("dup:%d:%s", i, aCommandStr);
 }
 
 g_free( aCommandStr );
@@ -630,7 +630,7 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
 g_variant_unref(pTarget);
 }
 
-GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand, gboolean 
bGetSubmenu )
+GtkSalMenu* GtkSalMenu::GetMenuForItemCommand(gchar* aCommand, int& 
rDupsToSkip, gboolean bGetSubmenu)
 {
 SolarMutexGuard aGuard;
 GtkSalMenu* pMenu = nullptr;
@@ -645,7 +645,13 @@ GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* 
aCommand, gboolean bGetSub
 OString aItemCommandOStr = OUStringToOString( aItemCommand, 
RTL_TEXTENCODING_UTF8 );
 gchar* aItemCommandStr = const_cast(aItemCommandOStr.getStr());
 
-if ( g_strcmp0( aItemCommandStr, aCommand ) == 0 )
+bool bFound = g_strcmp0( aItemCommandStr, aCommand ) == 0;
+if (bFound && rDupsToSkip)
+{
+--rDupsToSkip;
+bFound = false;
+}
+if (bFound)
 {
 pMenu = bGetSubmenu ? pSalItem->mpSubMenu : this;
 break;
@@ -653,7 +659,7 @@ GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* 
aCommand, gboolean bGetSub
 else
 {
 if ( pSalItem->mpSubMenu != nullptr )
-pMenu = pSalItem->mpSubMenu->GetMenuForItemCommand( aCommand, 
bGetSubmenu );
+pMenu = pSalItem->mpSubMenu->GetMenuForItemCommand(aCommand, 
rDupsToSkip, bGetSubmenu);
 
 if ( pMenu != nullptr )
break;
@@ -663,6 +669,24 @@ GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* 
aCommand, gboolean bGetSub
 return pMenu;
 }
 
+namespace
+{
+const gchar* DetermineDupIndex(const gchar *aCommand, int& rDupsToSkip)
+{
+if (g_str_has_prefix(aCommand, "dup:"))
+{
+aCommand = aCommand + strlen("dup:");
+gchar *endptr;
+rDupsToSkip = g_ascii_strtoll(aCommand, , 10);
+aCommand = endptr+1;
+}
+else
+rDupsToSkip = 0;
+
+return aCommand;
+}
+}
+
 void GtkSalMenu::DispatchCommand( gint itemId, const gchar *aCommand )
 {
 SolarMutexGuard aGuard;
@@ -670,7 +694,9 @@ void GtkSalMenu::DispatchCommand( gint itemId, const gchar 
*aCommand )
 if ( !mbMenuBar )
 return;
 
-GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( 
const_cast(aCommand), FALSE );
+int nDupsToSkip;
+aCommand = DetermineDupIndex(aCommand, nDupsToSkip);
+GtkSalMenu* 

[Libreoffice-bugs] [Bug 98634] Cutting or copying text from comments to document body brings comment formatting

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98634

Cor Nouws  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||c...@nouenoff.nl
 Ever confirmed|0   |1
 Whiteboard||TooBusyNowNeedsFurtherTesti
   ||ngForPossibleRegressionAndP
   ||ossibleDuplicates
   Severity|normal  |minor

--- Comment #1 from Cor Nouws  ---
Hi Nick,

Thanks, I confirm this. Tested in 5.0.5.2

It would be my expectation that pasting in a paragraph with text, pastes
without formatting. ANd pasting in an empty paragraph, with formatting.
As is common.

(In reply to Nick Bugs from comment #0)
> This can be a bit of a pain when using comments for writing bits of text
> that the user later may want to use within the main document, etc.

Ctrl+Shft+V .. paste as "Text only" does help here.

Cheers,
Cor

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98520] ODF Validator reported error: attribute "text:start-value" has a bad value: "0"

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98520

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||todven...@suomi24.fi
 Ever confirmed|0   |1

--- Comment #2 from Buovjaga  ---
Confirmed.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98506] Calc crashes randomly and frequently

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98506

--- Comment #7 from sviatos...@outlook.com ---
Created attachment 123542
  --> https://bugs.documentfoundation.org/attachment.cgi?id=123542=edit
backtrace

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98267] Cannot change position of outline numbering

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98267

Buovjaga  changed:

   What|Removed |Added

 CC||todven...@suomi24.fi

--- Comment #2 from Buovjaga  ---
Change styles - List styles - Numbering 1. Then select all the numbering lines
and double click the style Numbering 1. It applies.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98506] Calc crashes randomly and frequently

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98506

sviatos...@outlook.com changed:

   What|Removed |Added

 Status|NEEDINFO|UNCONFIRMED
 Ever confirmed|1   |0

--- Comment #6 from sviatos...@outlook.com ---
Followed all instructions. Applications crashed about 1 day after being
started. The crash was a different than before though, and this time I got an
error message first. Unfortunately I did not copy the error message but it said
something about threads and the message did not seem to be very user friendly,
had text like ::Threads or something along those lines.

I've attached the back trace, however it says that symbols are wrong, not sure
why, I followed all instructions carefully. Not sure how useful this document
will be.

Please provide further instructions to help identify the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98493] UI : "SCENARIO SELECTION IN NAVIGATOR (sheet group)" displaying wrong sheet after double-click on scenario

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98493

Buovjaga  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||todven...@suomi24.fi
 Ever confirmed|0   |1

--- Comment #4 from Buovjaga  ---
Confirmed.
Refer to this bug like tdf#98493 in your patch commit message.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 235411c9d47ecba88e46d859ea93bcecefb0c46e
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 11th 2016

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 98030] Gray rectangles appear in gup areas during copy from web to LO writer docx + wrong alignment

2016-03-13 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98030

--- Comment #17 from yousifjka...@yahoo.com ---
Hi all! Thank you for your kind attantion.

But please notice that many bugs that existing in LibreOffice on windows are
not existing on Linux. So, please test issue on windows OS.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


  1   2   3   >