[Libreoffice-commits] core.git: external/graphite vcl/inc vcl/source

2015-09-16 Thread Martin Hosken
 external/graphite/StaticLibrary_graphite.mk |2 +-
 external/graphite/graphite2.win64.patch.1   |   11 +++
 vcl/inc/graphite_layout.hxx |2 +-
 vcl/source/glyphs/graphite_layout.cxx   |   16 +---
 4 files changed, 22 insertions(+), 9 deletions(-)

New commits:
commit 23b9febbd883f9db77ffb0216b050aaabc4c6510
Author: Martin Hosken 
Date:   Thu Sep 17 08:04:48 2015 +0700

Fix Graphite windows build static

Change-Id: I6feb3805e79f7cae4a8df7efa665fd97c56411c2
Reviewed-on: https://gerrit.libreoffice.org/18654
Tested-by: Jenkins 
Reviewed-by: Martin Hosken 

diff --git a/external/graphite/StaticLibrary_graphite.mk 
b/external/graphite/StaticLibrary_graphite.mk
index 0cfdb8f..ddbf995 100644
--- a/external/graphite/StaticLibrary_graphite.mk
+++ b/external/graphite/StaticLibrary_graphite.mk
@@ -20,7 +20,7 @@ $(eval $(call gb_StaticLibrary_set_include,graphite,\
 
 $(eval $(call gb_StaticLibrary_add_defs,graphite,\
-DGRAPHITE2_NTRACING \
-   -DGR2_STATIC \
+   -DGRAPHITE2_STATIC \
 ))
 
 ifeq ($(COM),GCC)
diff --git a/external/graphite/graphite2.win64.patch.1 
b/external/graphite/graphite2.win64.patch.1
index 5d409bb..0286126 100644
--- a/external/graphite/graphite2.win64.patch.1
+++ b/external/graphite/graphite2.win64.patch.1
@@ -1,3 +1,14 @@
+diff -ur graphite.org/src/inc/Main.h graphite/src/inc/Main.h
+--- graphite.org/src/inc/Main.h2015-09-07 20:09:25.572279671 +0700
+--- graphite/src/inc/Main.h2015-09-07 20:09:25.572279671 +0700
+@@ -25,6 +25,7 @@
+ of the License or (at your option) any later version.
+ */
+ #pragma once
++#pragma warning(disable: 4510 4610)
+ 
+ #include 
+ #include "graphite2/Types.h"
 diff -ur graphite.org/src/inc/json.h graphite/src/inc/json.h
 --- graphite.org/src/inc/json.h2015-02-03 14:49:24.408101900 +0100
 +++ graphite/src/inc/json.h2015-02-03 14:50:59.697552200 +0100
diff --git a/vcl/inc/graphite_layout.hxx b/vcl/inc/graphite_layout.hxx
index 1378f88..abb9acf 100644
--- a/vcl/inc/graphite_layout.hxx
+++ b/vcl/inc/graphite_layout.hxx
@@ -93,7 +93,7 @@ public:
 private:
 const gr_face * mpFace; // not owned by layout
 gr_font *   mpFont; // not owned by layout
-int mnSegCharOffset; // relative to 
ImplLayoutArgs::mpStr
+unsigned intmnSegCharOffset; // relative to 
ImplLayoutArgs::mpStr
 longmnWidth;
 std::vectormvChar2BaseGlyph;
 std::vectormvChar2Glyph;
diff --git a/vcl/source/glyphs/graphite_layout.cxx 
b/vcl/source/glyphs/graphite_layout.cxx
index 07d19cf..bf38a49 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -148,14 +148,14 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, 
ImplLayoutArgs &rArgs, float fSc
 for ( ; baseSlot; baseSlot = nextBaseSlot)
 {
 thisBoundary = nextBoundary;
-int firstChar = gr_slot_before(baseSlot) + mnSegCharOffset;
+int firstChar = gr_cinfo_base(gr_seg_cinfo(pSegment, 
gr_slot_before(baseSlot))) + mnSegCharOffset;
 nextBaseSlot = get_next_base(bRtl ? gr_slot_prev_in_segment(baseSlot) 
: gr_slot_next_in_segment(baseSlot), bRtl);
 nextBoundary = nextBaseSlot ? gr_slot_origin_X(nextBaseSlot) : 
gr_seg_advance_X(pSegment);
 if (firstChar < mnMinCharPos || firstChar >= mnEndCharPos)
 continue;
 // handle reordered clusters. Presumes reordered glyphs have monotonic 
opposite char index until the cluster base.
-bool isReordered = (nextBaseSlot && ((bRtl != 
(gr_slot_before(nextBaseSlot) < firstChar - mnSegCharOffset))
- || gr_slot_before(nextBaseSlot) 
== firstChar - mnSegCharOffset));
+bool isReordered = (nextBaseSlot && ((bRtl != 
(gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(nextBaseSlot))) < 
firstChar - mnSegCharOffset))
+ || 
gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(nextBaseSlot))) == 
firstChar - mnSegCharOffset));
 if (clusterStart >= 0 && !isReordered)  // we hit the base (end) 
of a reordered cluster
 {
 int clusterEnd = mvGlyphs.size();
@@ -189,7 +189,7 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, 
ImplLayoutArgs &rArgs, float fSc
 }
 
 int baseGlyph = mvGlyphs.size();
-mvCharBreaks[firstChar - mnMinCharPos] = 
gr_cinfo_break_weight(gr_seg_cinfo(pSegment, firstChar - mnSegCharOffset));
+mvCharBreaks[firstChar - mnMinCharPos] = 
gr_cinfo_break_weight(gr_seg_cinfo(pSegment, gr_slot_before(baseSlot)));
 mvChar2BaseGlyph[firstChar - mnMinCharPos] = baseGlyph;
 mvCharDxs[firstChar - mnMinCharPos] = static_cast((bRtl ? 
thisBoundary : nextBoundary) * fScaling) + mnWidth + nDxOffset;
 mvGlyph2Char[baseGlyph] = firstChar;
@@ -265,7 +265,7 @@ GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs 

[Libreoffice-commits] core.git: sc/inc sc/Library_sc.mk sc/source unusedcode.easy

2015-09-16 Thread Tor Lillqvist
 sc/Library_sc.mk |1 
 sc/inc/clkernelthread.hxx|   52 ---
 sc/inc/formulacell.hxx   |   11 
 sc/source/core/data/formulacell.cxx  |   64 
 sc/source/core/opencl/formulagroupcl.cxx |   28 
 sc/source/core/tool/clkernelthread.cxx   |   69 ---
 unusedcode.easy  |4 -
 7 files changed, 229 deletions(-)

New commits:
commit f2b93f2e314215d6342e0bd5727e6740cc15e29c
Author: Tor Lillqvist 
Date:   Tue Sep 8 14:35:37 2015 +0300

ENABLE_THREADED_OPENCL_KERNEL_COMPILATION has been zero for a long time

And I doubt we will try to turn it on again, so remove dead code.

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

diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 3fa8c74..52d17d1 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -214,7 +214,6 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
 sc/source/core/tool/chartpos \
 sc/source/core/tool/chgtrack \
 sc/source/core/tool/chgviset \
-sc/source/core/tool/clkernelthread \
 sc/source/core/tool/compare \
 sc/source/core/tool/compiler \
 sc/source/core/tool/consoli  \
diff --git a/sc/inc/clkernelthread.hxx b/sc/inc/clkernelthread.hxx
deleted file mode 100644
index d4d83ed..000
--- a/sc/inc/clkernelthread.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_SC_INC_CLKERNELTHREAD_HXX
-#define INCLUDED_SC_INC_CLKERNELTHREAD_HXX
-
-#include 
-
-#include 
-#include 
-
-#include 
-
-#include "scdllapi.h"
-#include "formulacell.hxx"
-
-namespace sc {
-
-struct CLBuildKernelWorkItem
-{
-enum { COMPILE, FINISH } meWhatToDo;
-ScFormulaCellGroupRef mxGroup;
-};
-
-class SC_DLLPUBLIC CLBuildKernelThread : public salhelper::Thread, 
boost::noncopyable
-{
-public:
-CLBuildKernelThread();
-virtual ~CLBuildKernelThread();
-
-osl::Condition maCompilationDoneCondition;
-
-protected:
-virtual void execute() SAL_OVERRIDE;
-
-private:
-osl::Mutex maQueueMutex;
-osl::Condition maQueueCondition;
-std::queue maQueue;
-};
-
-}
-
-#endif // INCLUDED_SC_INC_CLKERNELTHREAD_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 9579029..3deb9e3 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -34,11 +34,8 @@
 
 #include "formularesult.hxx"
 
-#define ENABLE_THREADED_OPENCL_KERNEL_COMPILATION 0
-
 namespace sc {
 
-class CLBuildKernelThread;
 class CompiledFormula;
 class StartListeningContext;
 class EndListeningContext;
@@ -78,9 +75,6 @@ public:
 
 ScFormulaCellGroup();
 ~ScFormulaCellGroup();
-#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
-void scheduleCompilation();
-#endif
 
 void setCode( const ScTokenArray& rCode );
 void setCode( ScTokenArray* pCode );
@@ -92,11 +86,6 @@ public:
 ScFormulaCell** ppTopCell, const ScRange& rRange, bool bStartFixed, 
bool bEndFixed );
 
 void endAllGroupListening( ScDocument& rDoc );
-
-#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
-static int snCount;
-static rtl::Reference sxCompilationThread;
-#endif
 };
 
 inline void intrusive_ptr_add_ref(const ScFormulaCellGroup *p)
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 14d3d44..07d19a3 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -44,7 +44,6 @@
 #include "editutil.hxx"
 #include "chgtrack.hxx"
 #include "tokenarray.hxx"
-#include "clkernelthread.hxx"
 
 #include 
 #include 
@@ -535,28 +534,6 @@ typedef boost::ptr_map AreaListen
 
 }
 
-#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
-//  The mutex to synchronize access to the OpenCL compilation thread.
-static osl::Mutex& getOpenCLCompilationThreadMutex()
-{
-static osl::Mutex* pMutex = NULL;
-if( !pMutex )
-{
-osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
-if( !pMutex )
-{
-static osl::Mutex aMutex;
-pMutex = &aMutex;
-}
-}
-
-return *pMutex;
-}
-
-int ScFormulaCellGroup::snCount = 0;
-rtl::Reference 
ScFormulaCellGroup::sxCompilationThread;
-#endif
-
 struct ScFormulaCellGroup::Impl
 {
 AreaListenersType maAreaListeners;
@@ -576,53 +553,16 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
 meKernelState(sc::OpenCLKernelNone)
 {
 SAL_INFO( "sc.core.formulacell", "ScFormulaCellGroup ctor this 

[Libreoffice-commits] core.git: include/vcl

2015-09-16 Thread Tor Lillqvist
 include/vcl/salbtype.hxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 9008c5365581733f3d54ee30ade5e418cd6e694b
Author: Tor Lillqvist 
Date:   Thu Sep 17 08:42:20 2015 +0300

WaE: this method can be declared static ColorMaskElement::CalcMaskShift

[loplugin:staticmethods].

And then 'const' makes no sense.

Also, fix fallout warning: calling static member function through
member call syntax, use 'ColorMaskElement::CalcMaskShift' instead
[loplugin:staticcall].

But actually I wonder if this should be a non-static member function
that operates on 'this' (and takes no parameter) instead? Also, the
return value is unused.

Change-Id: I24949b74bd43eb90499e3c881941b102a3622f92

diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index 4e0b4cd..eb3b6d3 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -194,7 +194,7 @@ struct VCL_DLLPUBLIC ColorMaskElement
 , mnOr(0)
 {
 }
-bool CalcMaskShift(ColorMaskElement &rElem) const
+static bool CalcMaskShift(ColorMaskElement &rElem)
 {
 if (rElem.mnMask == 0)
 return true;
@@ -608,9 +608,9 @@ inline ColorMask::ColorMask( sal_uInt32 nRedMask,
 , maB(nBlueMask)
 , mnAlphaChannel(nAlphaChannel)
 {
-maR.CalcMaskShift(maR);
-maG.CalcMaskShift(maG);
-maB.CalcMaskShift(maB);
+ColorMaskElement::CalcMaskShift(maR);
+ColorMaskElement::CalcMaskShift(maG);
+ColorMaskElement::CalcMaskShift(maB);
 }
 
 inline sal_uInt32 ColorMask::GetRedMask() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


search items screen

2015-09-16 Thread Rade Berbakov
 Hi

why I don't resize search items screen
in LibreOffice calc.
Example in attachment.

thanks and best regards

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


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/opengl

2015-09-16 Thread Tomaž Vajngerl
 vcl/opengl/salbmp.cxx |   58 +++---
 1 file changed, 46 insertions(+), 12 deletions(-)

New commits:
commit b12309df2dd529b1d23af4bcd10ed4421fcf92be
Author: Tomaž Vajngerl 
Date:   Wed Sep 16 14:02:23 2015 +0200

opengl: support reading back 1-bit masks from texture

Change-Id: Ibe8d9140f7a54016f2cd684198856ac27d880aa3
(cherry picked from commit b85d24e430051054e54602aa14bf00b164c3865b)
Reviewed-on: https://gerrit.libreoffice.org/18622
Reviewed-by: Michael Meeks 
Tested-by: Jan Holesovsky 

diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index f3f131b..3ba62fa 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -468,8 +468,6 @@ GLuint OpenGLSalBitmap::CreateTexture()
 bool OpenGLSalBitmap::ReadTexture()
 {
 sal_uInt8* pData = maUserBuffer.get();
-GLenum nFormat = GL_RGBA;
-GLenum nType = GL_UNSIGNED_BYTE;
 
 SAL_INFO( "vcl.opengl", "::ReadTexture " << mnWidth << "x" << mnHeight );
 
@@ -478,8 +476,8 @@ bool OpenGLSalBitmap::ReadTexture()
 
 if (mnBits == 8 || mnBits == 16 || mnBits == 24 || mnBits == 32)
 {
-// no conversion needed for truecolor
-pData = maUserBuffer.get();
+GLenum nFormat = GL_RGBA;
+GLenum nType = GL_UNSIGNED_BYTE;
 
 switch( mnBits )
 {
@@ -496,18 +494,54 @@ bool OpenGLSalBitmap::ReadTexture()
 nType = GL_UNSIGNED_BYTE;
 break;
 }
+
+makeCurrent();
+maTexture.Read(nFormat, nType, pData);
+mnBufWidth = mnWidth;
+mnBufHeight = mnHeight;
+return true;
 }
-else
-{
-return false;
+else if (mnBits == 1)
+{   // convert buffers from 24-bit RGB to 1-bit Mask
+std::vector aBuffer(mnWidth * mnHeight * 3);
+makeCurrent();
+sal_uInt8* pBuffer = aBuffer.data();
+maTexture.Read(GL_RGB, GL_UNSIGNED_BYTE, pBuffer);
+
+int nShift = 7;
+size_t nIndex = 0;
+
+sal_uInt8* pCurrent = pBuffer;
+
+for (size_t i = 0; i < aBuffer.size(); i += 3)
+{
+sal_uInt8 nR = *pCurrent++;
+sal_uInt8 nG = *pCurrent++;
+sal_uInt8 nB = *pCurrent++;
+
+if (nR > 0 && nG > 0 && nB > 0)
+{
+pData[nIndex] |= (1 << nShift);
+}
+nShift--;
+if (nShift < 0)
+{
+nShift = 7;
+nIndex++;
+pData[nIndex] = 0;
+}
+}
+
+mnBufWidth = mnWidth;
+mnBufHeight = mnHeight;
+return true;
 }
 
-makeCurrent();
-maTexture.Read( nFormat, nType, pData );
-mnBufWidth = mnWidth;
-mnBufHeight = mnHeight;
+SAL_WARN("vcl.opengl", "::ReadTexture - tx:" << maTexture.Id() << " @ "
+ << mnWidth << "x" << mnHeight << "- unimplemented bit depth: "
+ << mnBits);
+return false;
 
-return true;
 }
 
 sal_uInt16 OpenGLSalBitmap::GetBitCount() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Internal API for LO supported formats

2015-09-16 Thread SOS

found in the API samples from OO
hope it helps
greetz

Fernand

REM   *  BASIC  *
Sub  Main
   oFF=  createUnoService(  "com.sun.star.document.FilterFactory"  )
   oFilterNames=  oFF.getElementNames()
 
   ' Now print the filter names.

'   For i = LBound( oFilterNames ) To UBound( oFilterNames )
'  Print oFilterNames(i)
'   Next
 
   ' Create a Writer doc and save the filter names to it.

   oDoc=  StarDesktop.loadComponentFromURL(  
"private:factory/swriter","_blank",0, Array()  )
   oText=  oDoc.getText()
   oCursor=  oText.createTextCursor()
   oCursor.gotoEnd(  False  )
 
   ' Print the filter names into a Writer document.

   For  i=  LBound(  oFilterNames)  To  UBound(  oFilterNames)
  oText.insertString(  oCursor, oFilterNames(i),False  )
  oText.insertControlCharacter(  oCursor, 
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False  )
   Next
End  Sub


On 16/09/2015 17:45, Pranav Kant wrote:

Hi,

Just wondering what is the internal API to query LO to fetch supported 
document formats.


Would be great to have that exposed via LOK too.

--
Regards,
Pranav Kant
http://pranavk.me 


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


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


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

2015-09-16 Thread Michael Stahl
 slideshow/source/engine/slideview.cxx |   30 --
 1 file changed, 28 insertions(+), 2 deletions(-)

New commits:
commit afce2eee1d163d942385c7b33db4901b3c71135d
Author: Michael Stahl 
Date:   Wed Sep 16 21:49:47 2015 +0200

slideshow: fix mysterious crash with the gtk3 vclplug

For some reason with gtk3 events are handled a bit differently, and in
particular after the PresenterSlideShowView::Resize() sets the
mbIsForcedPaintPending = true, with gtk2 we get a
notifySlideAnimationsEnded event and then a notifyViewChanged event that
calls PresenterSlideShowView::clear() to reset the flag,
but with gtk3 the flag isn't reset and then
PresenterSlideShowView::ForceRepaint() destroys the SlideView,
while there are still events in the EventQueue with pointers to it.

Since i'm evidently too dumb to tell what of this event handling is
working correctly and what is buggy, avoid the crash by checking
that the SlideView is still alive in the event handlers.

Change-Id: Ib88e61536c21e9787cef8a436341bfbd89914f4b

diff --git a/slideshow/source/engine/slideview.cxx 
b/slideshow/source/engine/slideview.cxx
index 4aa348f..c688442 100644
--- a/slideshow/source/engine/slideview.cxx
+++ b/slideshow/source/engine/slideview.cxx
@@ -1038,6 +1038,30 @@ void SlideView::disposing( lang::EventObject const& evt )
 dispose();
 }
 
+// silly wrapper to check that event handlers don't touch dead SlideView
+struct WeakRefWrapper
+{
+SlideView & m_rObj;
+uno::WeakReference const m_wObj;
+std::function const m_func;
+
+WeakRefWrapper(SlideView & rObj, std::function const& 
func)
+: m_rObj(rObj)
+, m_wObj(static_cast<::cppu::OWeakObject*>(&rObj))
+, m_func(func)
+{
+}
+
+void operator()()
+{
+uno::Reference const xObj(m_wObj);
+if (xObj.is())
+{
+m_func(m_rObj);
+}
+}
+};
+
 // XModifyListener
 void SlideView::modified( const lang::EventObject& /*aEvent*/ )
 throw (uno::RuntimeException, std::exception)
@@ -1081,7 +1105,8 @@ void SlideView::modified( const lang::EventObject& 
/*aEvent*/ )
 // notify view change. Don't call EventMultiplexer directly, this
 // might not be the main thread!
 mrEventQueue.addEvent(
-makeEvent( [this] () { 
this->mrEventMultiplexer.notifyViewChanged(this->mxView); },
+makeEvent( WeakRefWrapper(*this,
+[] (SlideView & rThis) { 
rThis.mrEventMultiplexer.notifyViewChanged(rThis.mxView); }),
"EventMultiplexer::notifyViewChanged"));
 }
 
@@ -1096,7 +1121,8 @@ void SlideView::windowPaint( const awt::PaintEvent& /*e*/ 
)
 // notify view clobbering. Don't call EventMultiplexer directly,
 // this might not be the main thread!
 mrEventQueue.addEvent(
-makeEvent( [this] () { 
this->mrEventMultiplexer.notifyViewClobbered(this->mxView); },
+makeEvent( WeakRefWrapper(*this,
+[] (SlideView & rThis) { 
rThis.mrEventMultiplexer.notifyViewClobbered(rThis.mxView); }),
"EventMultiplexer::notifyViewClobbered") );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'refs/notes/commits' - 2 commits - 05/a8a6da38c8ec1149313bbbc6602aacf10a926f d7/7533d7315e254b931c9ce003fbdc13dbbbde92

2015-09-16 Thread Caolán McNamara
 05/a8a6da38c8ec1149313bbbc6602aacf10a926f |1 +
 d7/7533d7315e254b931c9ce003fbdc13dbbbde92 |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 3e79911143e59d737bbe9447f1129b6fe6c6bee1
Author: Caolán McNamara 
Date:   Wed Sep 16 21:11:45 2015 +0100

Notes added by 'git notes add'

diff --git a/d7/7533d7315e254b931c9ce003fbdc13dbbbde92 
b/d7/7533d7315e254b931c9ce003fbdc13dbbbde92
new file mode 100644
index 000..a5c0c77
--- /dev/null
+++ b/d7/7533d7315e254b931c9ce003fbdc13dbbbde92
@@ -0,0 +1 @@
+ignore: googletest
commit 5bae18c2e5dbb5878cb455d27c103ba45ba74f39
Author: Caolán McNamara 
Date:   Wed Sep 16 21:11:32 2015 +0100

Notes added by 'git notes add'

diff --git a/05/a8a6da38c8ec1149313bbbc6602aacf10a926f 
b/05/a8a6da38c8ec1149313bbbc6602aacf10a926f
new file mode 100644
index 000..a5c0c77
--- /dev/null
+++ b/05/a8a6da38c8ec1149313bbbc6602aacf10a926f
@@ -0,0 +1 @@
+ignore: googletest
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/vcl

2015-09-16 Thread Caolán McNamara
 include/vcl/salbtype.hxx |   67 ++-
 1 file changed, 32 insertions(+), 35 deletions(-)

New commits:
commit bb6031fbe14b1f4b2e2ca98f97e93efe3519baa7
Author: Caolán McNamara 
Date:   Tue Sep 15 21:23:28 2015 +0100

move CalcMaskShift to ColorMaskElement

Change-Id: I6ed7e9bfea8b4500724866214fabd179fba20f20
Reviewed-on: https://gerrit.libreoffice.org/18636
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index 547d9a2..4e0b4cd 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -194,6 +194,35 @@ struct VCL_DLLPUBLIC ColorMaskElement
 , mnOr(0)
 {
 }
+bool CalcMaskShift(ColorMaskElement &rElem) const
+{
+if (rElem.mnMask == 0)
+return true;
+
+// from which bit starts the mask?
+int nShift = 31;
+
+while( nShift >= 0 && !( rElem.mnMask & ( 1 << nShift ) ) )
+--nShift;
+
+rElem.mnShift = nShift - 7;
+int nLen = 0;
+
+// XXX determine number of bits set => walk right until null
+while( nShift >= 0 && ( rElem.mnMask & ( 1 << nShift ) ) )
+{
+nShift--;
+nLen++;
+}
+
+if (nLen > 8) // mask length must be 8 bits or less
+return false;
+
+rElem.mnOrShift = 8 - nLen;
+rElem.mnOr = static_cast( ( 0xFF >> nLen ) << 
rElem.mnOrShift );
+
+return true;
+}
 };
 
 // - ColorMask -
@@ -204,8 +233,6 @@ class VCL_DLLPUBLIC ColorMask
 ColorMaskElementmaB;
 sal_uInt32  mnAlphaChannel;
 
-SAL_DLLPRIVATE inline bool ImplCalcMaskShift(ColorMaskElement &rOut) const;
-
 public:
 
 inline  ColorMask( sal_uInt32 nRedMask = 0,
@@ -581,39 +608,9 @@ inline ColorMask::ColorMask( sal_uInt32 nRedMask,
 , maB(nBlueMask)
 , mnAlphaChannel(nAlphaChannel)
 {
-ImplCalcMaskShift(maR);
-ImplCalcMaskShift(maG);
-ImplCalcMaskShift(maB);
-}
-
-inline bool ColorMask::ImplCalcMaskShift(ColorMaskElement &rElem) const
-{
-if (rElem.mnMask == 0)
-return true;
-
-// from which bit starts the mask?
-int nShift = 31;
-
-while( nShift >= 0 && !( rElem.mnMask & ( 1 << nShift ) ) )
---nShift;
-
-rElem.mnShift = nShift - 7;
-int nLen = 0;
-
-// XXX determine number of bits set => walk right until null
-while( nShift >= 0 && ( rElem.mnMask & ( 1 << nShift ) ) )
-{
-nShift--;
-nLen++;
-}
-
-if (nLen > 8) // mask length must be 8 bits or less
-return false;
-
-rElem.mnOrShift = 8 - nLen;
-rElem.mnOr = static_cast( ( 0xFF >> nLen ) << rElem.mnOrShift );
-
-return true;
+maR.CalcMaskShift(maR);
+maG.CalcMaskShift(maG);
+maB.CalcMaskShift(maB);
 }
 
 inline sal_uInt32 ColorMask::GetRedMask() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - sfx2/CppunitTest_sfx2_metadatable.mk sfx2/GoogleTest_sfx2_metadatable.mk sfx2/Module_sfx2.mk sfx2/qa solenv/gbuild

2015-09-16 Thread Damjan Jovanovic
 sfx2/CppunitTest_sfx2_metadatable.mk |   48 ---
 sfx2/GoogleTest_sfx2_metadatable.mk  |   47 +++
 sfx2/Module_sfx2.mk  |4 
 sfx2/qa/cppunit/makefile.mk  |   66 --
 sfx2/qa/cppunit/test_metadatable.cxx |  231 ---
 sfx2/qa/cppunit/version.map  |   30 
 sfx2/qa/gtest/makefile.mk|   66 ++
 sfx2/qa/gtest/test_metadatable.cxx   |  231 +++
 solenv/gbuild/GoogleTest.mk  |   96 ++
 solenv/gbuild/TargetLocations.mk |2 
 solenv/gbuild/gbuild.mk  |1 
 solenv/gbuild/platform/freebsd.mk|   11 +
 solenv/gbuild/platform/linux.mk  |   11 +
 solenv/gbuild/platform/macosx.mk |   11 +
 solenv/gbuild/platform/os2.mk|   10 +
 solenv/gbuild/platform/solaris.mk|   11 +
 solenv/gbuild/platform/windows.mk|   10 +
 solenv/gbuild/platform/winmingw.mk   |9 +
 18 files changed, 511 insertions(+), 384 deletions(-)

New commits:
commit d77533d7315e254b931c9ce003fbdc13dbbbde92
Author: Damjan Jovanovic 
Date:   Wed Sep 16 19:00:22 2015 +

#i125003# migrate main/sfx2 to Google Test, using gbuild for the first time.

diff --git a/sfx2/CppunitTest_sfx2_metadatable.mk 
b/sfx2/GoogleTest_sfx2_metadatable.mk
old mode 100755
new mode 100644
similarity index 70%
rename from sfx2/CppunitTest_sfx2_metadatable.mk
rename to sfx2/GoogleTest_sfx2_metadatable.mk
index dc12b60..baa4dea
--- a/sfx2/CppunitTest_sfx2_metadatable.mk
+++ b/sfx2/GoogleTest_sfx2_metadatable.mk
@@ -21,28 +21,27 @@
 
 
 
-$(eval $(call gb_CppunitTest_CppunitTest,sfx2_metadatable))
+$(eval $(call gb_GoogleTest_GoogleTest,sfx2_metadatable))
 
-$(eval $(call gb_CppunitTest_add_exception_objects,sfx2_metadatable, \
-sfx2/qa/cppunit/test_metadatable \
+$(eval $(call gb_GoogleTest_add_exception_objects,sfx2_metadatable, \
+   sfx2/qa/gtest/test_metadatable \
 ))
 
-$(eval $(call gb_CppunitTest_add_linked_libs,sfx2_metadatable, \
+$(eval $(call gb_GoogleTest_add_linked_libs,sfx2_metadatable, \
 sal \
 sfx \
 stl \
 $(gb_STDLIBS) \
 ))
 
-$(eval $(call gb_CppunitTest_set_include,sfx2_metadatable,\
-$$(INCLUDE) \
--I$(OUTDIR)/inc/offuh \
--I$(OUTDIR)/inc \
+$(eval $(call gb_GoogleTest_set_include,sfx2_metadatable,\
+   $$(INCLUDE) \
+   -I$(OUTDIR)/inc/offuh \
+   -I$(OUTDIR)/inc \
 ))
 
-$(eval $(call gb_CppunitTest_set_ldflags,sfx2_metadatable,\
+$(eval $(call gb_GoogleTest_set_ldflags,sfx2_metadatable,\
 $$(LDFLAGS) \
--lcppunit \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sfx2/Module_sfx2.mk b/sfx2/Module_sfx2.mk
index b69c7ce..9e6e9b7 100755
--- a/sfx2/Module_sfx2.mk
+++ b/sfx2/Module_sfx2.mk
@@ -30,9 +30,9 @@ $(eval $(call gb_Module_add_targets,sfx2,\
 Package_sdi \
 ))
 
-ifeq ($(WITH_CPPUNIT),YES)
+ifeq ($(ENABLE_UNIT_TESTS),YES)
 $(eval $(call gb_Module_add_check_targets,sfx2,\
-CppunitTest_sfx2_metadatable \
+GoogleTest_sfx2_metadatable \
 ))
 endif
 
diff --git a/sfx2/qa/cppunit/version.map b/sfx2/qa/cppunit/version.map
deleted file mode 100644
index ec49c45..000
--- a/sfx2/qa/cppunit/version.map
+++ /dev/null
@@ -1,30 +0,0 @@
-#**
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-#**
-
-
-
-UDK_3_0_0 {
-global:
-cppunitTestPlugIn;
-
-local:
-*;
-};
diff --git a/sfx2/qa/cppunit/makefile.mk b/sfx2/qa/gtest/makefile.mk
similarity index 100%
rename from sfx2/qa/cppunit/makefile.mk
rename to sfx2/qa/gtest/makefile.mk
diff --git a/sfx2/qa/cppunit/test_metadatable.cxx 
b/sfx2/qa/gtest/test_metadatable.cxx
similarity index 100%
rename from sfx2/qa/cppunit/test_metadatable.cxx
rename to sfx2/qa/gtest/test_metadatable.cxx
commit 05a8a6da38c8ec1149313bbbc6602aacf10a926f
Author: Damjan Jovanovic 
Date:   Wed Sep 16 18:51:51 2015 +

#i125003# Provide gbuild integration for Google Test. Windows, Linux and 
FreeBSD have

been tested, the other platforms are educated guesses.

diff --git a/solenv/gbuild/GoogleTest.mk b/solenv/gbuild/GoogleTest.mk
new file mode 100644
index 000..b8c

[Libreoffice-commits] core.git: include/vcl

2015-09-16 Thread Caolán McNamara
 include/vcl/salbtype.hxx |   71 +++
 1 file changed, 35 insertions(+), 36 deletions(-)

New commits:
commit 71ca5e4acc4cf4706329b462acefc625f4cc53c7
Author: Caolán McNamara 
Date:   Tue Sep 15 21:22:05 2015 +0100

move mask into ColorMaskElement too

Change-Id: I1bd5e2ee71aba088ed8b395a31977e7b567d8b48
Reviewed-on: https://gerrit.libreoffice.org/18635
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index 6d04bba..547d9a2 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -183,11 +183,13 @@ public:
 
 struct VCL_DLLPUBLIC ColorMaskElement
 {
+sal_uInt32  mnMask;
 int mnShift;
 int mnOrShift;
 sal_uInt8   mnOr;
-ColorMaskElement()
-: mnShift(0)
+ColorMaskElement(sal_uInt32 nMask)
+: mnMask(nMask)
+, mnShift(0)
 , mnOrShift(0)
 , mnOr(0)
 {
@@ -197,15 +199,12 @@ struct VCL_DLLPUBLIC ColorMaskElement
 // - ColorMask -
 class VCL_DLLPUBLIC ColorMask
 {
-sal_uInt32  mnRMask;
-sal_uInt32  mnGMask;
-sal_uInt32  mnBMask;
-sal_uInt32  mnAlphaChannel;
 ColorMaskElementmaR;
 ColorMaskElementmaG;
 ColorMaskElementmaB;
+sal_uInt32  mnAlphaChannel;
 
-SAL_DLLPRIVATE inline bool ImplCalcMaskShift(sal_uInt32 nMask, 
ColorMaskElement &rOut) const;
+SAL_DLLPRIVATE inline bool ImplCalcMaskShift(ColorMaskElement &rOut) const;
 
 public:
 
@@ -577,32 +576,32 @@ inline ColorMask::ColorMask( sal_uInt32 nRedMask,
  sal_uInt32 nGreenMask,
  sal_uInt32 nBlueMask,
  sal_uInt32 nAlphaChannel )
-: mnRMask(nRedMask)
-, mnGMask(nGreenMask)
-, mnBMask(nBlueMask)
+: maR(nRedMask)
+, maG(nGreenMask)
+, maB(nBlueMask)
 , mnAlphaChannel(nAlphaChannel)
 {
-if (mnRMask)
-ImplCalcMaskShift(mnRMask, maR);
-if (mnGMask)
-ImplCalcMaskShift(mnGMask, maG);
-if (mnBMask)
-ImplCalcMaskShift(mnBMask, maB);
+ImplCalcMaskShift(maR);
+ImplCalcMaskShift(maG);
+ImplCalcMaskShift(maB);
 }
 
-inline bool ColorMask::ImplCalcMaskShift(sal_uInt32 nMask, ColorMaskElement 
&rOut) const
+inline bool ColorMask::ImplCalcMaskShift(ColorMaskElement &rElem) const
 {
+if (rElem.mnMask == 0)
+return true;
+
 // from which bit starts the mask?
 int nShift = 31;
 
-while( nShift >= 0 && !( nMask & ( 1 << nShift ) ) )
+while( nShift >= 0 && !( rElem.mnMask & ( 1 << nShift ) ) )
 --nShift;
 
-rOut.mnShift = nShift - 7;
+rElem.mnShift = nShift - 7;
 int nLen = 0;
 
 // XXX determine number of bits set => walk right until null
-while( nShift >= 0 && ( nMask & ( 1 << nShift ) ) )
+while( nShift >= 0 && ( rElem.mnMask & ( 1 << nShift ) ) )
 {
 nShift--;
 nLen++;
@@ -611,48 +610,48 @@ inline bool ColorMask::ImplCalcMaskShift(sal_uInt32 
nMask, ColorMaskElement &rOu
 if (nLen > 8) // mask length must be 8 bits or less
 return false;
 
-rOut.mnOrShift = 8 - nLen;
-rOut.mnOr = static_cast( ( 0xFF >> nLen ) << rOut.mnOrShift );
+rElem.mnOrShift = 8 - nLen;
+rElem.mnOr = static_cast( ( 0xFF >> nLen ) << rElem.mnOrShift );
 
 return true;
 }
 
 inline sal_uInt32 ColorMask::GetRedMask() const
 {
-return mnRMask;
+return maR.mnMask;
 }
 
 inline sal_uInt32 ColorMask::GetGreenMask() const
 {
-return mnGMask;
+return maG.mnMask;
 }
 
 inline sal_uInt32 ColorMask::GetBlueMask() const
 {
-return mnBMask;
+return maB.mnMask;
 }
 
 inline void ColorMask::GetColorFor8Bit( BitmapColor& rColor, const sal_uInt8* 
pPixel ) const
 {
 const sal_uInt32 nVal = *pPixel;
-MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, maR.mnShift, maG.mnShift, 
maR.mnShift, rColor );
+MASK_TO_COLOR( nVal, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, 
maG.mnShift, maR.mnShift, rColor );
 }
 
 inline void ColorMask::SetColorFor8Bit( const BitmapColor& rColor, sal_uInt8* 
pPixel ) const
 {
-*pPixel = (sal_uInt8) COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, 
maR.mnShift, maG.mnShift, maB.mnShift, mnAlphaChannel );
+*pPixel = (sal_uInt8) COLOR_TO_MASK( rColor, maR.mnMask, maG.mnMask, 
maB.mnMask, maR.mnShift, maG.mnShift, maB.mnShift, mnAlphaChannel );
 }
 
 inline void ColorMask::GetColorFor16BitMSB( BitmapColor& rColor, const 
sal_uInt8* pPixel ) const
 {
 const sal_uInt32 nVal = pPixel[ 1 ] | ( (sal_uInt32) pPixel[ 0 ] << 8UL );
 
-MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, maR.mnShift, maG.mnShift, 
maB.mnShift, rColor );
+MASK_TO_COLOR( nVal, maR.mnMask, maG.mnMask, maB.mnMask, maR.mnShift, 
maG.mnShift, maB.mnShift, rColor );
 }
 
 inline void ColorMask::SetColorFor16B

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - drawinglayer/source

2015-09-16 Thread Tomaž Vajngerl
 drawinglayer/source/processor2d/vclhelperbufferdevice.cxx |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 915d3ba9e453a19510f473bb2cdff6a7c5c3abfa
Author: Tomaž Vajngerl 
Date:   Wed Sep 16 19:54:34 2015 +0200

Revert "disable caching of virtual devices when OpenGL is enabled"

Not needed anymore..

This reverts commit 812e85a12c7e2c046113a72da9437982926bfb37.

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

diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx 
b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 0994646..93919c0 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -27,7 +27,6 @@
 #include 
 #include 
 
-#include 
 
 // buffered VDev usage
 
@@ -189,12 +188,7 @@ namespace
 maFreeBuffers.push_back(&rDevice);
 SAL_WARN_IF(maFreeBuffers.size() > 1000, "drawinglayer", "excessive 
cached buffers, "
 << maFreeBuffers.size() << " entries!");
-
-if (OpenGLWrapper::isVCLOpenGLEnabled())
-Invoke();
-else
-Start();
-
+Start();
 }
 
 void VDevBuffer::Invoke()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - include/vcl vcl/inc vcl/opengl vcl/source

2015-09-16 Thread Marco Cecchetti
 include/vcl/opengl/OpenGLContext.hxx |   18 +-
 include/vcl/opengl/OpenGLHelper.hxx  |7 
 vcl/inc/opengl/program.hxx   |3 
 vcl/inc/opengl/win/WinDeviceInfo.hxx |   45 +
 vcl/inc/opengl/x11/X11DeviceInfo.hxx |   26 +++
 vcl/opengl/program.cxx   |7 
 vcl/source/opengl/OpenGLContext.cxx  |   37 +---
 vcl/source/opengl/OpenGLHelper.cxx   |  267 ++-
 8 files changed, 369 insertions(+), 41 deletions(-)

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

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

Reviewed-on: https://gerrit.libreoffice.org/18555
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 
Signed-off-by: Michael Meeks 

Conflicts:
include/vcl/opengl/OpenGLContext.hxx
include/vcl/opengl/OpenGLHelper.hxx
vcl/inc/opengl/win/WinDeviceInfo.hxx
vcl/source/opengl/OpenGLContext.cxx

Change-Id: I21c844b47282f6b3eec443933a86421a074e24df
Reviewed-on: https://gerrit.libreoffice.org/18632
Reviewed-by: Jan Holesovsky 
Reviewed-by: Marco Cecchetti 
Tested-by: Jan Holesovsky 

diff --git a/include/vcl/opengl/OpenGLContext.hxx 
b/include/vcl/opengl/OpenGLContext.hxx
index e706df5..68d7209 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -56,9 +56,13 @@ class NSOpenGLView;
 #include 
 #include 
 #include 
+#include 
 #include 
 
+#include 
+#include 
 #include 
+#include 
 
 class OpenGLFramebuffer;
 class OpenGLProgram;
@@ -281,15 +285,15 @@ private:
 OpenGLFramebuffer* mpFirstFramebuffer;
 OpenGLFramebuffer* mpLastFramebuffer;
 
-struct ProgramKey
+struct ProgramHash
 {
-ProgramKey( const OUString& vertexShader, const OUString& 
fragmentShader, const OString& preamble );
-bool operator< ( const ProgramKey& other ) const;
-OUString vertexShader;
-OUString fragmentShader;
-OString preamble;
+size_t operator()( const rtl::OString& aDigest ) const
+{
+return (size_t)( rtl_crc32( 0, aDigest.getStr(), 
aDigest.getLength() ) );
+}
 };
-std::map > maPrograms;
+typedef std::unordered_map< rtl::OString, std::shared_ptr, 
ProgramHash > ProgramCollection;
+ProgramCollection maPrograms;
 OpenGLProgram* mpCurrentProgram;
 #ifdef DBG_UTIL
 std::set maParents;
diff --git a/include/vcl/opengl/OpenGLHelper.hxx 
b/include/vcl/opengl/OpenGLHelper.hxx
index 646a2d3..788b056 100644
--- a/include/vcl/opengl/OpenGLHelper.hxx
+++ b/include/vcl/opengl/OpenGLHelper.hxx
@@ -36,8 +36,13 @@
 
 class VCL_DLLPUBLIC OpenGLHelper
 {
+OpenGLHelper() SAL_DELETED_FUNCTION; // Should not be instantiated
+
 public:
-static GLint LoadShaders(const OUString& rVertexShaderName, const 
OUString& rFragmentShaderName, const OString& preamble = "" );
+
+static rtl::OString GetDigest(const OUString& rVertexShaderName, const 
OUString& rFragmentShaderName, const rtl::OString& preamble = "" );
+
+static GLint LoadShaders(const OUString& rVertexShaderName, const 
OUString& rFragmentShaderName, const rtl::OString& preamble = "", const 
rtl::OString& rDigest = "" );
 
 /**
  * The caller is responsible for allocate the memory for the RGBA buffer, 
before call
diff --git a/vcl/inc/opengl/program.hxx b/vcl/inc/opengl/program.hxx
index 7bdd43d..3a47512 100644
--- a/vcl/inc/opengl/program.hxx
+++ b/vcl/inc/opengl/program.hxx
@@ -50,7 +50,8 @@ public:
 OpenGLProgram();
 ~OpenGLProgram();
 
-bool Load( const OUString& rVertexShader, const OUString& rFragmentShader, 
const OString& preamble = "" );
+bool Load( const OUString& rVertexShader, const OUString& rFragmentShader,
+   const rtl::OString& preamble = "", const rtl::OString& rDigest 
= "" );
 bool Use();
 bool Clean();
 
diff --git a/vcl/inc/opengl/win/WinDeviceInfo.hxx 
b/vcl/inc/opengl/win/WinDeviceInfo.hxx
index 21f14d9..662967f 100644
--- a/vcl/inc/opengl/win/WinDeviceInfo.hxx
+++ b/vcl/inc/opengl/win/WinDeviceInfo.hxx
@@ -183,6 +183,51 @@ public:
 virtual ~WinOpenGLDeviceInfo();
 
 virtual bool isDeviceBlocked();
+
+const OUString& GetDriverVersion() const
+{
+return maDriverVersion;
+}
+
+const OUString& GetDriverDate() const
+{
+return maDriverDate;
+}
+
+const OUString& GetDeviceID() const
+{
+return maDeviceID;
+}
+
+const OUString& GetAdapterVendorID() const
+{
+return maAdapterVendorID;
+}
+
+const OUString& GetAdapterDeviceID() const
+{
+return maAdapterDeviceID;
+}
+
+const OUString& GetAdapterSubsysID() const
+{
+return maAdapterSubsysID;
+}
+const OUString& GetDeviceKey() const
+{
+return maDeviceKey;
+}
+
+const OUString& GetDeviceString() const
+{
+return maDeviceString;
+}

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - include/vcl vcl/inc vcl/opengl

2015-09-16 Thread Michael Meeks
 include/vcl/opengl/OpenGLContext.hxx |5 +
 vcl/inc/openglgdiimpl.hxx|3 +++
 vcl/opengl/gdiimpl.cxx   |7 +++
 vcl/opengl/win/gdiimpl.cxx   |2 +-
 vcl/opengl/x11/gdiimpl.cxx   |3 +--
 5 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit f4ae433fdda76dc4268de7499e1312e1737b0b64
Author: Michael Meeks 
Date:   Wed Sep 16 16:52:13 2015 +0100

tdf#94281 - don't mix legacy and VCL OpenGLContext's.

Each has rather different assumptions about how life should be.

Change-Id: I85fffc77d14f3a5335a077fcb541a2b31c372043
Reviewed-on: https://gerrit.libreoffice.org/18644
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit 464f49e0b88e13c132bcf9cfe250239a1e1b0f8d)
Reviewed-on: https://gerrit.libreoffice.org/18645
Reviewed-by: Tomaž Vajngerl 
Reviewed-by: Marco Cecchetti 

diff --git a/include/vcl/opengl/OpenGLContext.hxx 
b/include/vcl/opengl/OpenGLContext.hxx
index 98f9c61..e706df5 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -241,6 +241,11 @@ public:
 return mbInitialized;
 }
 
+bool requestedLegacy()
+{
+return mbRequestLegacyContext;
+}
+
 bool supportMultiSampling() const;
 
 static SystemWindowData generateWinData(vcl::Window* pParent, bool 
bRequestLegacyContext);
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index 55f2e70..e069349 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -59,6 +59,9 @@ protected:
 OpenGLFramebuffer* mpFramebuffer;
 OpenGLProgram* mpProgram;
 
+/// Is it someone else's context we shouldn't be fiddling with ?
+static bool IsForeignContext(const rtl::Reference 
&xContext);
+
 // clipping
 vcl::Region maClipRegion;
 bool mbUseScissor;
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index d452f5d..b2e047c 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1881,4 +1881,11 @@ OpenGLContext *OpenGLSalGraphicsImpl::beginPaint()
 return mpContext.get();
 }
 
+bool OpenGLSalGraphicsImpl::IsForeignContext(const 
rtl::Reference &xContext)
+{
+// so far a blunt heuristic: vcl uses shiny new contexts.
+return xContext->requestedLegacy();
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 517cff1..cc34d67 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -39,7 +39,7 @@ rtl::Reference 
WinOpenGLSalGraphicsImpl::CreateWinContext()
 
 bool WinOpenGLSalGraphicsImpl::UseContext( const rtl::Reference 
&pContext )
 {
-if( !pContext.is() || !pContext->isInitialized() )
+if( !pContext.is() || !pContext->isInitialized() || IsForeignContext( 
pContext ) )
 return false;
 if( IsOffscreen() )
 return true;
diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx
index 65b279b..fa47b27 100644
--- a/vcl/opengl/x11/gdiimpl.cxx
+++ b/vcl/opengl/x11/gdiimpl.cxx
@@ -62,9 +62,8 @@ bool X11OpenGLSalGraphicsImpl::UseContext( const 
rtl::Reference &
 {
 X11WindowProvider *pProvider = 
dynamic_cast(mrParent.m_pFrame);
 
-if( !pContext->isInitialized() )
+if( !pContext->isInitialized() || IsForeignContext( pContext ) )
 return false;
-
 if( !pProvider )
 return pContext->getOpenGLWindow().win != None;
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: add libreoffice extension when "Save" LibreOffice Calc

2015-09-16 Thread Oliver Brinzing
Hi,

> Anyone who knows how to invoke the code when saving the document? Thanks a 
> lot!

register a global event broadcaster could help:
https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Document_Events

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


[Libreoffice-commits] online.git: Branch 'distro/collabora/milestone-5' - 4 commits - loleaflet/Makefile loolwsd/configure.ac

2015-09-16 Thread Mihai Varga
 loleaflet/Makefile   |2 +-
 loolwsd/configure.ac |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 42d91ffbbaae23149870e8e05f849ce4d04ea870
Author: Mihai Varga 
Date:   Wed Sep 16 19:42:57 2015 +0300

loolwsd: bump version after tarball

diff --git a/loolwsd/configure.ac b/loolwsd/configure.ac
index 44972ef..bb46969 100644
--- a/loolwsd/configure.ac
+++ b/loolwsd/configure.ac
@@ -3,7 +3,7 @@
 
 AC_PREREQ([2.69])
 
-AC_INIT([loolwsd], [1.3.2], [libreoff...@collabora.com])
+AC_INIT([loolwsd], [1.3.3], [libreoff...@collabora.com])
 
 AM_INIT_AUTOMAKE([1.11 silent-rules])
 
commit d564832a63e1da12eaa7e902f70344346c918480
Author: Mihai Varga 
Date:   Wed Sep 16 19:42:41 2015 +0300

loolwsd: bump version before tarball

diff --git a/loolwsd/configure.ac b/loolwsd/configure.ac
index 2316aba..44972ef 100644
--- a/loolwsd/configure.ac
+++ b/loolwsd/configure.ac
@@ -3,7 +3,7 @@
 
 AC_PREREQ([2.69])
 
-AC_INIT([loolwsd], [1.3.1], [libreoff...@collabora.com])
+AC_INIT([loolwsd], [1.3.2], [libreoff...@collabora.com])
 
 AM_INIT_AUTOMAKE([1.11 silent-rules])
 
commit e9c51adc994a658015234eb1c40d0f2a5899d003
Author: Mihai Varga 
Date:   Wed Sep 16 18:47:04 2015 +0300

loleaflet: bump version after tarball

diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index b2b1fa0..d57379b 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -3,7 +3,7 @@
 # ("micro") part: Between releases odd, even for releases (no other
 # changes inbetween).
 
-VERSION=1.3.2
+VERSION=1.3.3
 
 # Version number of the bundled 'draw' thing
 DRAW_VERSION=0.2.4
commit ad24251d1c26033c978cf26297b639747bca51a0
Author: Mihai Varga 
Date:   Wed Sep 16 18:46:48 2015 +0300

loleaflet: bump version before tarball

diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index 6599877..b2b1fa0 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -3,7 +3,7 @@
 # ("micro") part: Between releases odd, even for releases (no other
 # changes inbetween).
 
-VERSION=1.3.1
+VERSION=1.3.2
 
 # Version number of the bundled 'draw' thing
 DRAW_VERSION=0.2.4
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/Makefile loolwsd/configure.ac

2015-09-16 Thread Mihai Varga
 loleaflet/Makefile   |2 +-
 loolwsd/configure.ac |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit eca5a95ecf6bf05940910e91fc83a566b03fbc9a
Author: Mihai Varga 
Date:   Wed Sep 16 18:40:37 2015 +0300

Bump 'minor' number in version

diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index 6599877..f8abdeb 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -3,7 +3,7 @@
 # ("micro") part: Between releases odd, even for releases (no other
 # changes inbetween).
 
-VERSION=1.3.1
+VERSION=1.4.1
 
 # Version number of the bundled 'draw' thing
 DRAW_VERSION=0.2.4
diff --git a/loolwsd/configure.ac b/loolwsd/configure.ac
index 2316aba..86ad875 100644
--- a/loolwsd/configure.ac
+++ b/loolwsd/configure.ac
@@ -3,7 +3,7 @@
 
 AC_PREREQ([2.69])
 
-AC_INIT([loolwsd], [1.3.1], [libreoff...@collabora.com])
+AC_INIT([loolwsd], [1.4.1], [libreoff...@collabora.com])
 
 AM_INIT_AUTOMAKE([1.11 silent-rules])
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - vcl/opengl

2015-09-16 Thread Tomaž Vajngerl
 vcl/opengl/texture.cxx |   22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

New commits:
commit 767b3eb47641ed135bee053519c9756f2931e74c
Author: Tomaž Vajngerl 
Date:   Wed Sep 16 13:47:47 2015 +0200

tdf#93666: use x,y coords when reading texture part + don't bind

Fixes shrinking shapes with gradients when the VirtualDev is
reused to create a alpha mask (and the texture is reused and
reading back from just one part of the texture which uses
glReadPixels code-path).

Binding texture is not necessary when we use and bind it to the
framebuffer.

Change-Id: Ie3994f749e1a2c17d4d3df44710b7453d7a4f45f
(cherry picked from commit 0165da09288b5f6573bda114af664a26557fad8a)
Reviewed-on: https://gerrit.libreoffice.org/18621
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/18631
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 
Reviewed-by: Jan Holesovsky 

diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx
index afb2b47..24a7c38 100644
--- a/vcl/opengl/texture.cxx
+++ b/vcl/opengl/texture.cxx
@@ -369,30 +369,32 @@ void OpenGLTexture::Read( GLenum nFormat, GLenum nType, 
sal_uInt8* pData )
 return;
 }
 
-Bind();
-glPixelStorei( GL_PACK_ALIGNMENT, 1 );
-
 VCL_GL_INFO( "vcl.opengl", "Reading texture " << Id() << " " << GetWidth() 
<< "x" << GetHeight() );
 
 if( GetWidth() == mpImpl->mnWidth && GetHeight() == mpImpl->mnHeight )
 {
+Bind();
+glPixelStorei( GL_PACK_ALIGNMENT, 1 );
 // XXX: Call not available with GLES 2.0
 glGetTexImage( GL_TEXTURE_2D, 0, nFormat, nType, pData );
+Unbind();
 }
 else
 {
+long nWidth = maRect.GetWidth();
+long nHeight = maRect.GetHeight();
+long nX = maRect.Left();
+long nY = mpImpl->mnHeight - maRect.Top() - nHeight;
+
 // Retrieve current context
 ImplSVData* pSVData = ImplGetSVData();
 rtl::Reference pContext = 
pSVData->maGDIData.mpLastContext;
-OpenGLFramebuffer* pFramebuffer;
-
-pFramebuffer = pContext->AcquireFramebuffer( *this );
-glReadPixels( maRect.Left(), mpImpl->mnHeight - maRect.Top(), 
GetWidth(), GetHeight(), nFormat, nType, pData );
-OpenGLContext::ReleaseFramebuffer( pFramebuffer );
-CHECK_GL_ERROR();
+OpenGLFramebuffer* pFramebuffer = pContext->AcquireFramebuffer(*this);
+glPixelStorei(GL_PACK_ALIGNMENT, 1);
+glReadPixels(nX, nY, nWidth, nHeight, nFormat, nType, pData);
+OpenGLContext::ReleaseFramebuffer(pFramebuffer);
 }
 
-Unbind();
 CHECK_GL_ERROR();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - include/vcl vcl/inc vcl/opengl vcl/source vcl/unx vcl/win

2015-09-16 Thread Michael Meeks
 include/vcl/outdev.hxx |   18 --
 vcl/inc/generic/genpspgraphics.h   |3 --
 vcl/inc/headless/svpgdi.hxx|3 --
 vcl/inc/openglgdiimpl.hxx  |3 --
 vcl/inc/quartz/salgdi.h|3 --
 vcl/inc/salgdi.hxx |3 --
 vcl/inc/salgdiimpl.hxx |4 +--
 vcl/inc/unx/salgdi.h   |3 --
 vcl/inc/win/salgdi.h   |3 --
 vcl/opengl/gdiimpl.cxx |   28 --
 vcl/source/opengl/OpenGLHelper.cxx |   46 -
 vcl/source/outdev/outdev.cxx   |   12 -
 vcl/source/window/paint.cxx|   16 +++-
 vcl/unx/generic/gdi/gdiimpl.hxx|3 --
 vcl/unx/generic/gdi/salgdi.cxx |7 -
 vcl/win/source/gdi/gdiimpl.hxx |3 --
 vcl/win/source/gdi/salgdi.cxx  |7 -
 17 files changed, 77 insertions(+), 88 deletions(-)

New commits:
commit a63cf335ab5445e2f7934ace95418b456ed937f0
Author: Michael Meeks 
Date:   Wed Sep 16 09:17:37 2015 +0100

GL paint-flushing guard re-work.

Unfortunately, since we can have 2x SalGraphics' on a OutputDevice,
and one of these can be a printer - things got very confused around
which context to glFlush. This de-tangles the various reference-counts.

Conflicts:
vcl/inc/generic/genpspgraphics.h
vcl/win/source/gdi/salgdi.cxx

Change-Id: I1062be0b02a91fc9009deaa3ec29c5dbb227df20
Reviewed-on: https://gerrit.libreoffice.org/18611
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/18630
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 
Reviewed-by: Jan Holesovsky 

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index f0057b3..dbd57e6 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -608,9 +608,21 @@ public:
 const Point& rSrcPt,  const Size& rSrcSize,
 bool bWindowInvalidate = false );
 
-// Call before and after a paint operation to reduce flushing
-voidBeginPaint();
-voidEndPaint();
+/**
+ * Instantiate across a paint operation to defer flushing
+ * to the end.
+ *
+ * NB. holding a handle avoids problems with
+ * the underlying SalGraphics and it's implementation
+ * changing.
+ */
+class PaintScope {
+void *pHandle;
+public:
+PaintScope(OutputDevice *);
+~PaintScope();
+void flush();
+};
 
 protected:
 
diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h
index 8b78faa..2049e26 100644
--- a/vcl/inc/generic/genpspgraphics.h
+++ b/vcl/inc/generic/genpspgraphics.h
@@ -208,9 +208,6 @@ public:
 virtual css::uno::Any   GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& 
rSurface, const basegfx::B2ISize& rSize) const SAL_OVERRIDE;
 
 virtual SystemFontData  GetSysFontData( int nFallbacklevel ) const 
SAL_OVERRIDE;
-
-virtual void BeginPaint() SAL_OVERRIDE { };
-virtual void EndPaint() SAL_OVERRIDE { };
 };
 
 #endif // INCLUDED_VCL_INC_GENERIC_GENPSPGRAPHICS_H
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 9b8a25a..f4503e8 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -215,9 +215,6 @@ public:
 voidclipRegion(cairo_t* cr);
 
 #endif // ENABLE_CAIRO_CANVAS
-
-virtual voidBeginPaint() SAL_OVERRIDE { };
-virtual voidEndPaint() SAL_OVERRIDE { };
 };
 
 #endif
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index e16dd61..55f2e70 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -326,8 +326,7 @@ public:
 
 virtual bool drawGradient(const tools::PolyPolygon& rPolygon, const 
Gradient& rGradient) SAL_OVERRIDE;
 
-virtual void beginPaint() SAL_OVERRIDE;
-virtual void endPaint() SAL_OVERRIDE;
+virtual OpenGLContext *beginPaint() SAL_OVERRIDE;
 private:
 };
 
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 12c3144..518390c 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -421,9 +421,6 @@ public:
 virtual css::uno::Any   GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& 
rSurface, const ::basegfx::B2ISize& rSize) const SAL_OVERRIDE;
 virtual SystemFontData  GetSysFontData( int /* nFallbacklevel */ ) const 
SAL_OVERRIDE;
 
-virtual voidBeginPaint() SAL_OVERRIDE { };
-virtual voidEndPaint() SAL_OVERRIDE { };
-
 private:
 // differences between VCL, Quartz and kHiThemeOrientation coordinate 
systems
 // make some graphics seem to be vertically-mirrored from a VCL perspective
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index f00aae4..afd3b42 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -433,8 +433,7 @@ public:
   

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - vcl/opengl

2015-09-16 Thread Michael Meeks
 vcl/opengl/gdiimpl.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 9617d1c6a299901b79618d657e31635e59eda007
Author: Michael Meeks 
Date:   Wed Sep 16 03:25:05 2015 +0100

tdf#94252 - avoid switching contexts un-necessarily to reduce flicker.

Change-Id: Id4ac387174fa03c5886a990d89fd53a4f18db11c
Reviewed-on: https://gerrit.libreoffice.org/18610
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/18629
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 
Reviewed-by: Jan Holesovsky 

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 37b21f3..9ea8a7c 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -77,8 +77,17 @@ bool OpenGLSalGraphicsImpl::AcquireContext( )
 {
 ImplSVData* pSVData = ImplGetSVData();
 
+// We always prefer to bind our VirtualDevice / offscreen graphics
+// to the current OpenGLContext - to avoid switching contexts.
+if (mpContext.is() && mbOffscreen)
+{
+if (OpenGLContext::hasCurrent() && !mpContext->isCurrent())
+mpContext.clear();
+}
+
 if( mpContext.is() )
 {
+// Check whether the context was reset underneath us.
 if( mpContext->isInitialized() )
 return true;
 mpContext.clear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - slideshow/source

2015-09-16 Thread Michael Meeks
 slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx |2 
++
 1 file changed, 2 insertions(+)

New commits:
commit bde953b84baed33098ae747c49a882e14a2bf7c7
Author: Michael Meeks 
Date:   Wed Sep 16 02:58:16 2015 +0100

tdf#94006 - need an explicit dispose for slideshow's GLContext.

Fixes crasher exiting slideshow.

Change-Id: I14b6a2c1abc946f590bf91cab19099753172fd95
Reviewed-on: https://gerrit.libreoffice.org/18609
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/18628
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 
Reviewed-by: Jan Holesovsky 

diff --git 
a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx 
b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index db50970..f296866 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -1325,6 +1325,8 @@ void OGLTransitionerImpl::impl_dispose()
 {
 impl_finishTransition();
 disposeTextures();
+if( mpContext.is() )
+mpContext->dispose();
 mpContext.clear();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - vcl/source

2015-09-16 Thread Michael Meeks
 vcl/source/window/event.cxx  |   10 +-
 vcl/source/window/status.cxx |6 ++
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 41c56c26285307eb451819d49c47d7623c4555e2
Author: Michael Meeks 
Date:   Tue Sep 15 23:42:52 2015 +0100

tdf#94213 - calc re-size flicker turns out to be the status bar.

Using vdev's associated with old contexts, is un-necessary and a
recipe for context switching & hence flicker.

Change-Id: I37ed967a7816e5ca0240908ab4793ce1e68570ee
Reviewed-on: https://gerrit.libreoffice.org/18602
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/18608
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/18627
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 
Reviewed-by: Jan Holesovsky 

diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 852cc0c..35c3e38 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -453,7 +454,14 @@ void Window::ImplCallResize()
 {
 mpWindowImpl->mbCallResize = false;
 
-if( GetBackground().IsGradient() )
+// OpenGL has a charming feature of black clearing the whole window
+// some legacy code eg. the app-menu has the beautiful feature of
+// avoiding re-paints when width doesn't change => invalidate all.
+if( OpenGLWrapper::isVCLOpenGLEnabled() )
+Invalidate();
+
+// Normally we avoid blanking on re-size unless people might notice:
+else if( GetBackground().IsGradient() )
 Invalidate();
 
 Resize();
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index e8e2aaf..76c2de3 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -731,6 +732,11 @@ void StatusBar::Paint(vcl::RenderContext& rRenderContext, 
const Rectangle&)
 // Do offscreen only when we are not recording layout..
 bool bOffscreen = !rRenderContext.ImplIsRecordLayout();
 
+// tdf#94213 - un-necessary virtual-device in GL mode
+// causes context switch & hence flicker during sizing.
+if( OpenGLWrapper::isVCLOpenGLEnabled() )
+bOffscreen = false;
+
 for (sal_uInt16 i = 0; i < nItemCount; i++)
 {
 ImplDrawItem(rRenderContext, bOffscreen, i, true, true);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - vcl/inc vcl/opengl vcl/source vcl/win

2015-09-16 Thread Michael Meeks
 vcl/inc/opengl/win/gdiimpl.hxx  |1 +
 vcl/opengl/gdiimpl.cxx  |9 +++--
 vcl/opengl/win/gdiimpl.cxx  |   19 ++-
 vcl/source/opengl/OpenGLContext.cxx |3 +++
 vcl/source/window/paint.cxx |8 
 vcl/win/source/window/salframe.cxx  |4 ++--
 6 files changed, 39 insertions(+), 5 deletions(-)

New commits:
commit d6698cca4e22341a81573d9926ade127230e12a6
Author: Michael Meeks 
Date:   Mon Sep 14 18:09:25 2015 +0100

tdf#94213 - defer glFlushing until we've re-rendered after a re-size.

Avoids a rather horrible flickering problem in GL mode.

Squashing:

tdf#94213 - release offscreen texture properly on re-size.

We need to ensure that we use an initialized context, and that
(when we re-parent) we DeInit and so reset the previous OpenGLContext.
Make UseContext more paranoid as well for good measure.

Squashing:

tdf#94213 - cleanup associated GL contexts properly when DCs released.

Change-Id: I6b9fb899777d8e460999ac3ff038a1302e434bb5
Reviewed-on: https://gerrit.libreoffice.org/18607
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/18626
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 
Reviewed-by: Jan Holesovsky 

diff --git a/vcl/inc/opengl/win/gdiimpl.hxx b/vcl/inc/opengl/win/gdiimpl.hxx
index 04bb151..5c91727 100644
--- a/vcl/inc/opengl/win/gdiimpl.hxx
+++ b/vcl/inc/opengl/win/gdiimpl.hxx
@@ -34,6 +34,7 @@ protected:
 virtual bool UseContext( const rtl::Reference &pContext ) 
SAL_OVERRIDE;
 
 public:
+virtual void Init() SAL_OVERRIDE;
 virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* 
pSrcGraphics ) SAL_OVERRIDE;
 
 
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 85c3a3a..37b21f3 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -115,7 +115,8 @@ void OpenGLSalGraphicsImpl::Init()
 // check if we can simply re-use the same context
 if( mpContext.is() )
 {
-if( !UseContext( mpContext ) )
+if( !mpContext->isInitialized() ||
+!UseContext( mpContext ) )
 ReleaseContext();
 }
 
@@ -124,8 +125,12 @@ void OpenGLSalGraphicsImpl::Init()
 maOffscreenTex.GetWidth()  != GetWidth() ||
 maOffscreenTex.GetHeight() != GetHeight() )
 {
-if( mpContext.is() ) // valid context
+if( maOffscreenTex && // don't work to release empty textures
+mpContext.is() )  // valid context
+{
+mpContext->makeCurrent();
 mpContext->ReleaseFramebuffer( maOffscreenTex );
+}
 maOffscreenTex = OpenGLTexture();
 }
 }
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 30088a9..517cff1 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -43,7 +43,24 @@ bool WinOpenGLSalGraphicsImpl::UseContext( const 
rtl::Reference &
 return false;
 if( IsOffscreen() )
 return true;
-return pContext->getOpenGLWindow().hWnd == mrParent.mhWnd;
+return pContext->getOpenGLWindow().hWnd == mrParent.mhWnd &&
+   pContext->getOpenGLWindow().hDC == mrParent.mhLocalDC;
+}
+
+void WinOpenGLSalGraphicsImpl::Init()
+{
+if ( !IsOffscreen() && mpContext.is() && mpContext->isInitialized() &&
+ ( mpContext->getOpenGLWindow().hWnd != mrParent.mhWnd ||
+   mpContext->getOpenGLWindow().hDC == mrParent.mhLocalDC ) )
+{
+// This can legitimiately happen, SalFrame keeps 2x
+// SalGraphics which share the same hWnd and hDC.
+// The shape 'Area' dialog does reparenting to trigger this.
+SAL_WARN("vcl.opengl", "Unusual: Windows handle / DC changed without 
DeInit");
+DeInit();
+}
+
+OpenGLSalGraphicsImpl::Init();
 }
 
 namespace
diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index ea9664e..2502a83 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1690,6 +1690,9 @@ void OpenGLContext::ReleaseFramebuffer( const 
OpenGLTexture& rTexture )
 {
 OpenGLZone aZone;
 
+if (!rTexture) // no texture to release.
+return;
+
 OpenGLFramebuffer* pFramebuffer = mpLastFramebuffer;
 
 while( pFramebuffer )
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 80de1a4..ae846ae 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -651,6 +651,8 @@ IMPL_LINK_NOARG_TYPED(Window, ImplHandlePaintHdl, Idle *, 
void)
 return;
 }
 
+BeginPaint();
+
 // save paint events until resizing or initial sizing done
 if (!ImplDoTiledRendering() && mpWindowImpl->mbFrame &&
 (mpWindowImpl->mpFrameData->maResizeIdle.IsActive() ||
@@ -662,12 +664,16 @@ IMPL_LINK_NOARG_TYPED(Window, ImplHandlePaintHdl, Idle *, 
void)
 {
 ImplCallOverlapPaint();
 }
+

[Libreoffice-commits] core.git: include/vcl

2015-09-16 Thread Caolán McNamara
 include/vcl/salbtype.hxx |   96 ---
 1 file changed, 51 insertions(+), 45 deletions(-)

New commits:
commit 1ddcb7a7fb304226b4b0e7284e01c4748df7d9c6
Author: Caolán McNamara 
Date:   Tue Sep 15 21:15:24 2015 +0100

split out shared rgb components into structs

Change-Id: I125e0525f918e68714c1027c5b7144d8f914a575
Reviewed-on: https://gerrit.libreoffice.org/18634
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index 2ad04bc..6d04bba 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -71,9 +71,9 @@ typedef const sal_uInt8*  ConstScanline;
 const sal_uInt8 _def_cR = static_cast( d_RS < 0 ? ( (d_nVal) & d_RM 
) << -d_RS : ( (d_nVal) & d_RM ) >> d_RS ); \
 const sal_uInt8 _def_cG = static_cast( d_GS < 0 ? ( (d_nVal) & d_GM 
) << -d_GS : ( (d_nVal) & d_GM ) >> d_GS ); \
 const sal_uInt8 _def_cB = static_cast( d_BS < 0 ? ( (d_nVal) & d_BM 
) << -d_BS : ( (d_nVal) & d_BM ) >> d_BS ); \
-d_Col = BitmapColor( (sal_uInt8) ( _def_cR | ( ( _def_cR & mnROr ) >> 
mnROrShift ) ),   \
- (sal_uInt8) ( _def_cG | ( ( _def_cG & mnGOr ) >> 
mnGOrShift ) ),   \
- (sal_uInt8) ( _def_cB | ( ( _def_cB & mnBOr ) >> 
mnBOrShift ) ) );
+d_Col = BitmapColor( (sal_uInt8) ( _def_cR | ( ( _def_cR & maR.mnOr ) >> 
maR.mnOrShift ) ),   \
+ (sal_uInt8) ( _def_cG | ( ( _def_cG & maG.mnOr ) >> 
maG.mnOrShift ) ),   \
+ (sal_uInt8) ( _def_cB | ( ( _def_cB & maB.mnOr ) >> 
maB.mnOrShift ) ) );
 
 
 
@@ -181,6 +181,19 @@ public:
 boolIsGreyPalette() const;
 };
 
+struct VCL_DLLPUBLIC ColorMaskElement
+{
+int mnShift;
+int mnOrShift;
+sal_uInt8   mnOr;
+ColorMaskElement()
+: mnShift(0)
+, mnOrShift(0)
+, mnOr(0)
+{
+}
+};
+
 // - ColorMask -
 class VCL_DLLPUBLIC ColorMask
 {
@@ -188,17 +201,11 @@ class VCL_DLLPUBLIC ColorMask
 sal_uInt32  mnGMask;
 sal_uInt32  mnBMask;
 sal_uInt32  mnAlphaChannel;
-int mnRShift;
-int mnGShift;
-int mnBShift;
-int mnROrShift;
-int mnGOrShift;
-int mnBOrShift;
-sal_uInt8   mnROr;
-sal_uInt8   mnGOr;
-sal_uInt8   mnBOr;
-
-SAL_DLLPRIVATE inline int ImplCalcMaskShift( sal_uInt32 nMask, sal_uInt8 
&rOr, int &rOrShift ) const;
+ColorMaskElementmaR;
+ColorMaskElementmaG;
+ColorMaskElementmaB;
+
+SAL_DLLPRIVATE inline bool ImplCalcMaskShift(sal_uInt32 nMask, 
ColorMaskElement &rOut) const;
 
 public:
 
@@ -569,24 +576,21 @@ inline sal_uInt16 BitmapPalette::GetBestIndex( const 
BitmapColor& rCol ) const
 inline ColorMask::ColorMask( sal_uInt32 nRedMask,
  sal_uInt32 nGreenMask,
  sal_uInt32 nBlueMask,
- sal_uInt32 nAlphaChannel ) :
-mnRMask( nRedMask ),
-mnGMask( nGreenMask ),
-mnBMask( nBlueMask ),
-mnAlphaChannel( nAlphaChannel ),
-mnROrShift( 0 ),
-mnGOrShift( 0 ),
-mnBOrShift( 0 ),
-mnROr( 0 ),
-mnGOr( 0 ),
-mnBOr( 0 )
+ sal_uInt32 nAlphaChannel )
+: mnRMask(nRedMask)
+, mnGMask(nGreenMask)
+, mnBMask(nBlueMask)
+, mnAlphaChannel(nAlphaChannel)
 {
-mnRShift = ( mnRMask ? ImplCalcMaskShift( mnRMask, mnROr, mnROrShift ) : 0 
);
-mnGShift = ( mnGMask ? ImplCalcMaskShift( mnGMask, mnGOr, mnGOrShift ) : 0 
);
-mnBShift = ( mnBMask ? ImplCalcMaskShift( mnBMask, mnBOr, mnBOrShift ) : 0 
);
+if (mnRMask)
+ImplCalcMaskShift(mnRMask, maR);
+if (mnGMask)
+ImplCalcMaskShift(mnGMask, maG);
+if (mnBMask)
+ImplCalcMaskShift(mnBMask, maB);
 }
 
-inline int ColorMask::ImplCalcMaskShift( sal_uInt32 nMask, sal_uInt8& rOr, 
int& rOrShift ) const
+inline bool ColorMask::ImplCalcMaskShift(sal_uInt32 nMask, ColorMaskElement 
&rOut) const
 {
 // from which bit starts the mask?
 int nShift = 31;
@@ -594,7 +598,7 @@ inline int ColorMask::ImplCalcMaskShift( sal_uInt32 nMask, 
sal_uInt8& rOr, int&
 while( nShift >= 0 && !( nMask & ( 1 << nShift ) ) )
 --nShift;
 
-const int nRet = nShift - 7;
+rOut.mnShift = nShift - 7;
 int nLen = 0;
 
 // XXX determine number of bits set => walk right until null
@@ -604,11 +608,13 @@ inline int ColorMask::ImplCalcMaskShift( sal_uInt32 
nMask, sal_uInt8& rOr, int&
 nLen++;
 }
 
-assert( nLen <= 8 ); // mask length must be 8 bits or less
-rOrShift = 8 - nLen;

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

2015-09-16 Thread Michael Meeks
 include/vcl/opengl/OpenGLContext.hxx |5 +
 vcl/inc/openglgdiimpl.hxx|3 +++
 vcl/opengl/gdiimpl.cxx   |7 +++
 vcl/opengl/win/gdiimpl.cxx   |2 +-
 vcl/opengl/x11/gdiimpl.cxx   |3 +--
 5 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 86fc660353e0cb73bee911f432f2f0b18de82363
Author: Michael Meeks 
Date:   Wed Sep 16 16:52:13 2015 +0100

tdf#94281 - don't mix legacy and VCL OpenGLContext's.

Each has rather different assumptions about how life should be.

Change-Id: I85fffc77d14f3a5335a077fcb541a2b31c372043

diff --git a/include/vcl/opengl/OpenGLContext.hxx 
b/include/vcl/opengl/OpenGLContext.hxx
index b2aaa17..e448be4 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -240,6 +240,11 @@ public:
 return mbInitialized;
 }
 
+bool requestedLegacy()
+{
+return mbRequestLegacyContext;
+}
+
 bool supportMultiSampling() const;
 
 static SystemWindowData generateWinData(vcl::Window* pParent, bool 
bRequestLegacyContext);
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index e3bec44..2e17790 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -59,6 +59,9 @@ protected:
 OpenGLFramebuffer* mpFramebuffer;
 OpenGLProgram* mpProgram;
 
+/// Is it someone else's context we shouldn't be fiddling with ?
+static bool IsForeignContext(const rtl::Reference 
&xContext);
+
 // clipping
 vcl::Region maClipRegion;
 bool mbUseScissor;
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index e92d864..83352ec 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1870,4 +1870,11 @@ OpenGLContext *OpenGLSalGraphicsImpl::beginPaint()
 return mpContext.get();
 }
 
+bool OpenGLSalGraphicsImpl::IsForeignContext(const 
rtl::Reference &xContext)
+{
+// so far a blunt heuristic: vcl uses shiny new contexts.
+return xContext->requestedLegacy();
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 517cff1..cc34d67 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -39,7 +39,7 @@ rtl::Reference 
WinOpenGLSalGraphicsImpl::CreateWinContext()
 
 bool WinOpenGLSalGraphicsImpl::UseContext( const rtl::Reference 
&pContext )
 {
-if( !pContext.is() || !pContext->isInitialized() )
+if( !pContext.is() || !pContext->isInitialized() || IsForeignContext( 
pContext ) )
 return false;
 if( IsOffscreen() )
 return true;
diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx
index 65b279b..fa47b27 100644
--- a/vcl/opengl/x11/gdiimpl.cxx
+++ b/vcl/opengl/x11/gdiimpl.cxx
@@ -62,9 +62,8 @@ bool X11OpenGLSalGraphicsImpl::UseContext( const 
rtl::Reference &
 {
 X11WindowProvider *pProvider = 
dynamic_cast(mrParent.m_pFrame);
 
-if( !pContext->isInitialized() )
+if( !pContext->isInitialized() || IsForeignContext( pContext ) )
 return false;
-
 if( !pProvider )
 return pContext->getOpenGLWindow().win != None;
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - include/vcl vcl/inc vcl/opengl

2015-09-16 Thread Michael Meeks
 include/vcl/opengl/OpenGLContext.hxx |5 +
 vcl/inc/openglgdiimpl.hxx|3 +++
 vcl/opengl/gdiimpl.cxx   |7 +++
 vcl/opengl/win/gdiimpl.cxx   |2 +-
 vcl/opengl/x11/gdiimpl.cxx   |3 +--
 5 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 464f49e0b88e13c132bcf9cfe250239a1e1b0f8d
Author: Michael Meeks 
Date:   Wed Sep 16 16:52:13 2015 +0100

tdf#94281 - don't mix legacy and VCL OpenGLContext's.

Each has rather different assumptions about how life should be.

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

diff --git a/include/vcl/opengl/OpenGLContext.hxx 
b/include/vcl/opengl/OpenGLContext.hxx
index 3e91f6f..68d7209 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -245,6 +245,11 @@ public:
 return mbInitialized;
 }
 
+bool requestedLegacy()
+{
+return mbRequestLegacyContext;
+}
+
 bool supportMultiSampling() const;
 
 static SystemWindowData generateWinData(vcl::Window* pParent, bool 
bRequestLegacyContext);
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index 55f2e70..e069349 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -59,6 +59,9 @@ protected:
 OpenGLFramebuffer* mpFramebuffer;
 OpenGLProgram* mpProgram;
 
+/// Is it someone else's context we shouldn't be fiddling with ?
+static bool IsForeignContext(const rtl::Reference 
&xContext);
+
 // clipping
 vcl::Region maClipRegion;
 bool mbUseScissor;
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index d452f5d..b2e047c 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1881,4 +1881,11 @@ OpenGLContext *OpenGLSalGraphicsImpl::beginPaint()
 return mpContext.get();
 }
 
+bool OpenGLSalGraphicsImpl::IsForeignContext(const 
rtl::Reference &xContext)
+{
+// so far a blunt heuristic: vcl uses shiny new contexts.
+return xContext->requestedLegacy();
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 517cff1..cc34d67 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -39,7 +39,7 @@ rtl::Reference 
WinOpenGLSalGraphicsImpl::CreateWinContext()
 
 bool WinOpenGLSalGraphicsImpl::UseContext( const rtl::Reference 
&pContext )
 {
-if( !pContext.is() || !pContext->isInitialized() )
+if( !pContext.is() || !pContext->isInitialized() || IsForeignContext( 
pContext ) )
 return false;
 if( IsOffscreen() )
 return true;
diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx
index 65b279b..fa47b27 100644
--- a/vcl/opengl/x11/gdiimpl.cxx
+++ b/vcl/opengl/x11/gdiimpl.cxx
@@ -62,9 +62,8 @@ bool X11OpenGLSalGraphicsImpl::UseContext( const 
rtl::Reference &
 {
 X11WindowProvider *pProvider = 
dynamic_cast(mrParent.m_pFrame);
 
-if( !pContext->isInitialized() )
+if( !pContext->isInitialized() || IsForeignContext( pContext ) )
 return false;
-
 if( !pProvider )
 return pContext->getOpenGLWindow().win != None;
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Internal API for LO supported formats

2015-09-16 Thread Pranav Kant
Hi,

Just wondering what is the internal API to query LO to fetch supported
document formats.

Would be great to have that exposed via LOK too.

-- 
Regards,
Pranav Kant
http://pranavk.me 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Libreoffice build : Chart not working in version 5.0.2.1, 5.0.3.0

2015-09-16 Thread Madhura Ravindra Palsule
Hello,
Thanks Andras, Michel and Christian for inputs, now spellchecker is working
fine.
But chart issue still exists.
As patch has been pushed to 5.0.2 RC1 on gerrit.
checked on gerrit and there this patch's corresponding project is core and
branch is 5.0
I tried to build using source code from
git clone http://anongit.freedesktop.org/git/libreoffice/core
tried with with branches 5-0 then  5.0.2.1 and 5.0.0.3
In all my builds chart crash issue exists.
In which branch can I get the patched version?

Thanks & Regards,
Madhura



On September 8, 2015 at 7:44 PM Michael Meeks 
wrote:
> Hi Madhura,
>
> On Tue, 2015-09-08 at 18:15 +0530, Madhura Ravindra Palsule wrote:
> > My OS version is Win 7.
> > trying to build using a patch updated.
>
> Ok ? you mean a patched version of some kind ? I've just pushed a patch
> to gerrit to fix your chart issue in 5.0.2 RC1
>
> > Struggling with spellcheck, unable to add dictionaries in build (tried
> > using flag --with-external-dict-dir = libo-core/dictionsries/en and
> > --with-myspell-dicts= libo-core/dictionsries/en ) But no use, giving
> > same output. No dictionary is copied to installed folder\extension
> > folder
> > How to include dictionaries form source in resulting msi?
>
> I guess Andras may have some ideas how to help you there - he'd be more
> of an expert for that.
>
> Incidentally - if CDAC are using LibreOffice, would they be interested
> in a long term supported version from Collabora for Windows ? I'm always
> on the look-out for promising new customers :-) by buying LibreOffice
> from Collabora you help to fund LibreOffice's development.
>
> All the best,
>
> Michael.
>
> --
> michael.me...@collabora.com <><, GM Collabora Productivity & Hacker
> Skype: mmeeks, Google Hangout: mejme...@gmail.com
> (M) +44 7795 666 147 - timezone usually UK / Europe
>
---
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
---

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


Re: Libreoffice build : Chart not working in version 5.0.2.1, 5.0.3.0

2015-09-16 Thread Madhura Ravindra Palsule
Instead of version 5.0.0.3 , it is 5.0.3.0 , which I tried to build. Sorry !

Regards,
Madhura

On September 16, 2015 at 3:11 PM Madhura Ravindra Palsule 
wrote:

>  Hello,
>  Thanks Andras, Michel and Christian for inputs, now spellchecker is working
> fine.
>  But chart issue still exists.
>  As patch has been pushed to 5.0.2 RC1 on gerrit.
>  checked on gerrit and there this patch's corresponding project is core and
> branch is 5.0
>  I tried to build using source code from
>  git clone http://anongit.freedesktop.org/git/libreoffice/core
>  tried with with branches 5-0 then  5.0.2.1 and 5.0.0.3
>  In all my builds chart crash issue exists.
>  In which branch can I get the patched version?
> 
>  Thanks & Regards,
>  Madhura
> 
> 
> 
>  On September 8, 2015 at 7:44 PM Michael Meeks 
> wrote:
>  > Hi Madhura,
>  >
>  > On Tue, 2015-09-08 at 18:15 +0530, Madhura Ravindra Palsule wrote:
>  > > My OS version is Win 7.
>  > > trying to build using a patch updated.
>  >
>  > Ok ? you mean a patched version of some kind ? I've just pushed a patch
>  > to gerrit to fix your chart issue in 5.0.2 RC1
>  >
>  > > Struggling with spellcheck, unable to add dictionaries in build (tried
>  > > using flag --with-external-dict-dir = libo-core/dictionsries/en and
>  > > --with-myspell-dicts= libo-core/dictionsries/en ) But no use, giving
>  > > same output. No dictionary is copied to installed folder\extension
>  > > folder
>  > > How to include dictionaries form source in resulting msi?
>  >
>  > I guess Andras may have some ideas how to help you there - he'd be more
>  > of an expert for that.
>  >
>  > Incidentally - if CDAC are using LibreOffice, would they be interested
>  > in a long term supported version from Collabora for Windows ? I'm always
>  > on the look-out for promising new customers :-) by buying LibreOffice
>  > from Collabora you help to fund LibreOffice's development.
>  >
>  > All the best,
>  >
>  > Michael.
>  >
>  > --
>  > michael.me...@collabora.com <><, GM Collabora Productivity & Hacker
>  > Skype: mmeeks, Google Hangout: mejme...@gmail.com
>  > (M) +44 7795 666 147 - timezone usually UK / Europe
>  >
> 

---
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
---

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


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

2015-09-16 Thread Jan Holesovsky
 vcl/inc/opengl/win/WinDeviceInfo.hxx |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 6a02e88b46ab424a221b41814f56a1dfd31b801d
Author: Jan Holesovsky 
Date:   Wed Sep 16 16:50:45 2015 +0200

Fix a merge problem.

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

diff --git a/vcl/inc/opengl/win/WinDeviceInfo.hxx 
b/vcl/inc/opengl/win/WinDeviceInfo.hxx
index 3b049fb..662967f 100644
--- a/vcl/inc/opengl/win/WinDeviceInfo.hxx
+++ b/vcl/inc/opengl/win/WinDeviceInfo.hxx
@@ -75,8 +75,15 @@ enum DeviceVendor {
 
 struct DriverInfo
 {
-DriverInfo(OperatingSystem os, const OUString& vendor, VersionComparisonOp 
op,
-uint64_t driverVersion, bool bWhiteListed = false, const char 
*suggestedVersion = nullptr);
+typedef std::vector DeviceFamilyVector;
+
+// If |ownDevices| is true, you are transferring ownership of the devices
+// array, and it will be deleted when this GfxDriverInfo is destroyed.
+
+DriverInfo(OperatingSystem os, const OUString& vendor, DeviceFamilyVector* 
devices,
+VersionComparisonOp op,
+uint64_t driverVersion, bool bWhiteListed = false, const char 
*suggestedVersion = nullptr,
+bool ownDevices = false);
 
 DriverInfo();
 DriverInfo(const DriverInfo&);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Tor Lillqvist
 include/opencl/openclwrapper.hxx |1 
 opencl/source/openclwrapper.cxx  |  151 +--
 sc/source/core/opencl/formulagroupcl.cxx |8 -
 3 files changed, 50 insertions(+), 110 deletions(-)

New commits:
commit 11e1c55ce05a78a486b0ea5668b1a424cd9c8f11
Author: Tor Lillqvist 
Date:   Wed Sep 16 17:48:43 2015 +0300

YAGNI

We use only one OpenCL device per context or program, so get rid of
half-implemented (or half-reverted?) "support" for multiple devices per
context.

Change-Id: I951f29e867e5b3f96f6e051567ee38d607bd7ecf

diff --git a/include/opencl/openclwrapper.hxx b/include/opencl/openclwrapper.hxx
index fe67772..1541739 100644
--- a/include/opencl/openclwrapper.hxx
+++ b/include/opencl/openclwrapper.hxx
@@ -43,7 +43,6 @@ struct GPUEnv
 cl_platform_id mpPlatformID;
 cl_device_type mDevType;
 cl_context mpContext;
-cl_device_id *mpArryDevsID;
 cl_device_id mpDevID;
 cl_command_queue mpCmdQueue[OPENCL_CMDQUEUE_SIZE];
 cl_program mpArryPrograms[MAX_CLFILE_NUM]; //one program object maps one 
kernel source file
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 79aabba..d99b131 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -148,32 +148,29 @@ std::vector > binaryGenerated( 
const char * clFileNam
 if(clStatus != CL_SUCCESS)
 return aGeneratedFiles;
 
-// grab the handles to all of the devices in the context.
-std::unique_ptr pArryDevsID(new cl_device_id[numDevices]);
+assert(numDevices == 1);
+
+// grab the handle to the device in the context.
+cl_device_id pDevID;
 clStatus = clGetContextInfo( context, CL_CONTEXT_DEVICES,
-sizeof( cl_device_id ) * numDevices, pArryDevsID.get(), NULL );
+sizeof( cl_device_id ), &pDevID, NULL );
 
 if(clStatus != CL_SUCCESS)
 return aGeneratedFiles;
 
-for ( size_t i = 0; i < numDevices; i++ )
+assert(pDevID == gpuEnv.mpDevID);
+
+OString fileName = createFileName(gpuEnv.mpDevID, clFileName);
+osl::File* pNewFile = new osl::File(rtl::OStringToOUString(fileName, 
RTL_TEXTENCODING_UTF8));
+if(pNewFile->open(osl_File_OpenFlag_Read) == osl::FileBase::E_None)
 {
-if ( pArryDevsID[i] != 0 )
-{
-OString fileName = createFileName(gpuEnv.mpArryDevsID[i], 
clFileName);
-osl::File* pNewFile = new 
osl::File(rtl::OStringToOUString(fileName, RTL_TEXTENCODING_UTF8));
-if(pNewFile->open(osl_File_OpenFlag_Read) == osl::FileBase::E_None)
-{
-
aGeneratedFiles.push_back(std::shared_ptr(pNewFile));
-SAL_INFO("opencl.file", "Opening binary file '" << fileName << 
"' for reading: success");
-}
-else
-{
-SAL_INFO("opencl.file", "Opening binary file '" << fileName << 
"' for reading: FAIL");
-delete pNewFile;
-break;
-}
-}
+aGeneratedFiles.push_back(std::shared_ptr(pNewFile));
+SAL_INFO("opencl.file", "Opening binary file '" << fileName << "' for 
reading: success");
+}
+else
+{
+SAL_INFO("opencl.file", "Opening binary file '" << fileName << "' for 
reading: FAIL");
+delete pNewFile;
 }
 
 return aGeneratedFiles;
@@ -206,59 +203,37 @@ bool generatBinFromKernelSource( cl_program program, 
const char * clFileName )
sizeof(numDevices), &numDevices, NULL );
 CHECK_OPENCL( clStatus, "clGetProgramInfo" );
 
-std::vector pArryDevsID(numDevices);
-/* grab the handles to all of the devices in the program. */
+assert(numDevices == 1);
+
+cl_device_id pDevID;
+/* grab the handle to the device in the program. */
 clStatus = clGetProgramInfo( program, CL_PROGRAM_DEVICES,
-   sizeof(cl_device_id) * numDevices, &pArryDevsID[0], NULL );
+   sizeof(cl_device_id), &pDevID, NULL );
 CHECK_OPENCL( clStatus, "clGetProgramInfo" );
 
-/* figure out the sizes of each of the binaries. */
-std::vector binarySizes(numDevices);
+/* figure out the size of the binary. */
+size_t binarySize;
 
 clStatus = clGetProgramInfo( program, CL_PROGRAM_BINARY_SIZES,
-   sizeof(size_t) * numDevices, &binarySizes[0], NULL );
+   sizeof(size_t), &binarySize, NULL );
 CHECK_OPENCL( clStatus, "clGetProgramInfo" );
 
-/* copy over all of the generated binaries. */
-std::unique_ptr binaries(new char*[numDevices]);
-
-for ( size_t i = 0; i < numDevices; i++ )
+/* copy over the generated binary. */
+if ( binarySize != 0 )
 {
-if ( binarySizes[i] != 0 )
-{
-binaries[i] = new char[binarySizes[i]];
-}
+char *binary = new char[binarySize];
+clStatus = clGetProgramInfo( program, CL_PROGRAM_BINARIES,
+  

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

2015-09-16 Thread Tomaž Vajngerl
 drawinglayer/source/processor2d/vclhelperbufferdevice.cxx |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 04b059ce0573ff560aa7a007b635336e1829
Author: Tomaž Vajngerl 
Date:   Wed Sep 16 16:36:36 2015 +0200

Revert "disable caching of virtual devices when OpenGL is enabled"

Not needed anymore as the bug in OpenGL is fixed..

This reverts commit 6eff03b7d8b77b797f57f2344163ff67a99631f9.

diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx 
b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 0994646..93919c0 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -27,7 +27,6 @@
 #include 
 #include 
 
-#include 
 
 // buffered VDev usage
 
@@ -189,12 +188,7 @@ namespace
 maFreeBuffers.push_back(&rDevice);
 SAL_WARN_IF(maFreeBuffers.size() > 1000, "drawinglayer", "excessive 
cached buffers, "
 << maFreeBuffers.size() << " entries!");
-
-if (OpenGLWrapper::isVCLOpenGLEnabled())
-Invoke();
-else
-Start();
-
+Start();
 }
 
 void VDevBuffer::Invoke()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'refs/notes/commits' - 2 commits - 64/d85c6662dc9fae9a1fe6882033a55ec395dfc4 8e/d50137cdccce22761160ed0395fee7b487c96f

2015-09-16 Thread Caolán McNamara
 64/d85c6662dc9fae9a1fe6882033a55ec395dfc4 |1 +
 8e/d50137cdccce22761160ed0395fee7b487c96f |1 +
 2 files changed, 2 insertions(+)

New commits:
commit e053b491f8bdd09ad4d24ef2ee0916fe63b94241
Author: Caolán McNamara 
Date:   Wed Sep 16 15:35:29 2015 +0100

Notes added by 'git notes add'

diff --git a/8e/d50137cdccce22761160ed0395fee7b487c96f 
b/8e/d50137cdccce22761160ed0395fee7b487c96f
new file mode 100644
index 000..8ebbe55
--- /dev/null
+++ b/8e/d50137cdccce22761160ed0395fee7b487c96f
@@ -0,0 +1 @@
+ignore: obsolete
commit 624098677e66a95dc618e678f8663eaf09490983
Author: Caolán McNamara 
Date:   Wed Sep 16 15:35:14 2015 +0100

Notes added by 'git notes add'

diff --git a/64/d85c6662dc9fae9a1fe6882033a55ec395dfc4 
b/64/d85c6662dc9fae9a1fe6882033a55ec395dfc4
new file mode 100644
index 000..a54a9ef
--- /dev/null
+++ b/64/d85c6662dc9fae9a1fe6882033a55ec395dfc4
@@ -0,0 +1 @@
+prefer: f9a687719960a6636186cbd2db917ad660139a11
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 3 commits - svtools/inc svtools/source svx/source toolkit/source vbahelper/source vcl/qa vcl/source writerperfect/qa writerperfect/source xmloff/inc xmloff/source xmlsc

2015-09-16 Thread Caolán McNamara
 svtools/inc/table/defaultinputhandler.hxx|4 -
 svtools/inc/table/gridtablerenderer.hxx  |4 -
 svtools/source/contnr/fileview.cxx   |4 -
 svtools/source/contnr/imivctl1.cxx   |6 +-
 svtools/source/control/calendar.cxx  |   12 ++--
 svtools/source/control/ruler.cxx |5 --
 svtools/source/filter/SvFilterOptionsDialog.cxx  |4 -
 svtools/source/graphic/descriptor.cxx|6 +-
 svtools/source/graphic/grfcache.cxx  |4 -
 svtools/source/graphic/grfmgr.cxx|6 +-
 svtools/source/graphic/provider.cxx  |8 +--
 svtools/source/misc/ehdl.cxx |6 +-
 svtools/source/misc/embedhlp.cxx |6 +-
 svtools/source/misc/imap.cxx |6 +-
 svtools/source/misc/transfer.cxx |8 +--
 svtools/source/table/cellvalueconversion.cxx |4 -
 svtools/source/table/cellvalueconversion.hxx |4 -
 svtools/source/toolpanel/paneltabbar.cxx |4 -
 svtools/source/uno/wizard/wizardshell.cxx|2 
 svtools/source/uno/wizard/wizardshell.hxx|6 --
 svx/source/core/extedit.cxx  |4 -
 svx/source/dialog/_bmpmask.cxx   |3 -
 svx/source/dialog/connctrl.cxx   |4 -
 svx/source/dialog/databaseregistrationui.cxx |4 -
 svx/source/dialog/grfflt.cxx |   14 ++---
 svx/source/dialog/hdft.cxx   |6 +-
 svx/source/dialog/imapdlg.cxx|6 +-
 svx/source/dialog/imapwnd.cxx|6 +-
 svx/source/dialog/imapwnd.hxx|4 -
 svx/source/dialog/measctrl.cxx   |4 -
 svx/source/dialog/srchdlg.cxx|9 +--
 svx/source/fmcomp/fmgridcl.cxx   |4 -
 svx/source/fmcomp/gridctrl.cxx   |5 --
 svx/source/form/fmscriptingenv.cxx   |8 +--
 svx/source/form/fmshell.cxx  |4 -
 svx/source/form/fmshimp.cxx  |8 +--
 svx/source/form/fmtextcontrolshell.cxx   |6 +-
 svx/source/gallery2/galbrws1.cxx |8 +--
 svx/source/gallery2/galbrws2.cxx |4 -
 svx/source/gallery2/galini.cxx   |4 -
 svx/source/gallery2/gallery1.cxx |6 +-
 svx/source/gallery2/galmisc.cxx  |4 -
 svx/source/gallery2/galobj.cxx   |4 -
 svx/source/gallery2/galtheme.cxx |   37 +++
 svx/source/sdr/contact/objectcontactofobjlistpainter.cxx |4 -
 svx/source/sdr/contact/objectcontactofpageview.cxx   |4 -
 svx/source/sdr/contact/viewcontactofe3dcube.cxx  |4 -
 svx/source/sdr/contact/viewcontactofe3dextrude.cxx   |4 -
 svx/source/sdr/contact/viewcontactofe3dlathe.cxx |4 -
 svx/source/sdr/contact/viewcontactofe3dpolygon.cxx   |4 -
 svx/source/sdr/contact/viewcontactofe3dsphere.cxx|4 -
 svx/source/sdr/overlay/overlaymanager.cxx|4 -
 svx/source/sdr/properties/e3dsceneproperties.cxx |4 -
 svx/source/sdr/properties/itemsettools.cxx   |4 -
 svx/source/svdraw/svdedtv2.cxx   |4 -
 svx/source/svdraw/svdedxv.cxx|4 -
 svx/source/svdraw/svdhdl.cxx |3 -
 svx/source/svdraw/svdobj.cxx |4 -
 svx/source/svdraw/svdograf.cxx   |6 +-
 svx/source/svdraw/svdomedia.cxx  |2 
 svx/source/svdraw/svdotxln.cxx   |4 -
 svx/source/svdraw/svdtext.cxx|4 -
 svx/source/table/tablertfimporter.cxx|   13 ++---
 svx/source/tbxctrls/fillctrl.cxx |6 +-
 svx/source/tbxctrls/fontworkgallery.cxx  |4 -
 svx/source/tbxctrls/linectrl.cxx |6 +-
 svx/source/tbxctrls/tbunocontroller.cxx  |4 -
 svx/source/unodraw/UnoGraphicExporter.cxx|   12 ++--
 svx/source/unodraw/UnoNameItemTable.cxx  |4 -
 svx/source/unodraw/unopool.cxx   |4 -
 svx/source/unodraw/unoshap2.cxx  |5 +-
 svx/source/unodraw/unoshape.cxx  |8 +--
 svx/source/unogallery/unogalitem.cxx |4 -
 svx/source/xml/xmleohlp.cxx  

[Libreoffice-commits] core.git: include/vcl

2015-09-16 Thread Stephan Bergmann
 include/vcl/checksum.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 21b2cb540aaa308ea1911af34dc4862a24dcb545
Author: Stephan Bergmann 
Date:   Wed Sep 16 16:30:38 2015 +0200

loplugin:cstylecast

Change-Id: I17fb91376839bd036be27546118dfdb794bf067a

diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx
index 21674a8..edf0e04 100644
--- a/include/vcl/checksum.hxx
+++ b/include/vcl/checksum.hxx
@@ -34,7 +34,7 @@ typedef sal_uInt8   
BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE];
 template< sal_uInt8 N = 0 >
 inline void BCToBCOA( BitmapChecksum n, BitmapChecksumOctetArray p )
 {
-  p[N] = (sal_uInt8)(n >> ( 8 * N ));
+  p[N] = static_cast(n >> ( 8 * N ));
   return BCToBCOA< N + 1 >( n, p );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Michael Meeks
 vcl/source/opengl/OpenGLHelper.cxx |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 0183c1746cd39393dc90b6f3370868bfe272bf5c
Author: Michael Meeks 
Date:   Wed Sep 16 13:11:59 2015 +0100

Add debugging helpers to binary shader loading.

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

diff --git a/vcl/source/opengl/OpenGLHelper.cxx 
b/vcl/source/opengl/OpenGLHelper.cxx
index 114251c..92bfe7d 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -377,20 +377,19 @@ GLint OpenGLHelper::LoadShaders(const OUString& 
rVertexShaderName,
 OString aVertexShaderSource = loadShader(rVertexShaderName);
 OString aFragmentShaderSource = loadShader(rFragmentShaderName);
 
-
-GLint BinaryResult = GL_FALSE;
+GLint bBinaryResult = GL_FALSE;
 if( GLEW_ARB_get_program_binary && !rDigest.isEmpty() )
 {
 OString aFileName =
 createFileName(rVertexShaderName, rFragmentShaderName, 
rDigest);
-BinaryResult = loadProgramBinary(ProgramID, aFileName);
+bBinaryResult = loadProgramBinary(ProgramID, aFileName);
+VCL_GL_INFO("vcl.opengl", "Load binary shader from '" << aFileName << 
"'" << bBinaryResult);
 CHECK_GL_ERROR();
 }
 
-if( BinaryResult != GL_FALSE )
+if( bBinaryResult != GL_FALSE )
 return ProgramID;
 
-
 VCL_GL_INFO("vcl.opengl", "Load shader: vertex " << rVertexShaderName << " 
fragment " << rFragmentShaderName);
 // Create the shaders
 GLuint VertexShaderID = glCreateShader(GL_VERTEX_SHADER);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/opengl

2015-09-16 Thread Tomaž Vajngerl
 vcl/opengl/framebuffer.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 980aa09d183da72d4fbfa6121a7aed6fd394b00a
Author: Tomaž Vajngerl 
Date:   Wed Sep 16 14:10:35 2015 +0200

opengl: check framebuffer completeness

Change-Id: Idd80b7390694038ab0913edab0e496593beb0e15
(cherry picked from commit 7993663cc559e2a2c72804f7b4fa553f8c7441c3)
Reviewed-on: https://gerrit.libreoffice.org/18625
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/vcl/opengl/framebuffer.cxx b/vcl/opengl/framebuffer.cxx
index b1135fc..403c379 100644
--- a/vcl/opengl/framebuffer.cxx
+++ b/vcl/opengl/framebuffer.cxx
@@ -68,8 +68,11 @@ void OpenGLFramebuffer::AttachTexture( const OpenGLTexture& 
rTexture )
 mnAttachedTexture = rTexture.Id();
 mnWidth = rTexture.GetWidth();
 mnHeight = rTexture.GetHeight();
-glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 
GL_TEXTURE_2D,
-mnAttachedTexture, 0 );
+glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 
GL_TEXTURE_2D, mnAttachedTexture, 0);
+if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
+{
+SAL_WARN("vcl.opengl", "Framebuffer incomplete");
+}
 CHECK_GL_ERROR();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Tomaž Vajngerl
 vcl/inc/opengl/salbmp.hxx |2 --
 vcl/opengl/scale.cxx  |   45 -
 2 files changed, 4 insertions(+), 43 deletions(-)

New commits:
commit f98252c515c02f2b30b21d086e081ba2c0fd4971
Author: Tomaž Vajngerl 
Date:   Fri Sep 11 12:25:35 2015 +0200

opengl: this doesn't really do anything as data is null anyway

Change-Id: Iacd75beecc14023173a9aa52a30298bbfe787d61
(cherry picked from commit 0eb9f13d401eb473338c7da2e4cfd0e366996aee)
Reviewed-on: https://gerrit.libreoffice.org/18623
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index 3dd31a2..99a819a 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -109,8 +109,6 @@ private:
 bool ImplScaleConvolution( const double& rScaleX, const double& rScaleY, 
const Kernel& aKernel );
 bool ImplScaleArea( double rScaleX, double rScaleY );
 
-bool getFormatAndType(GLenum& nFormat, GLenum& nType);
-
 public:
 
 bool ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag 
nScaleFlag );
diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index 6ddd299..48b92db 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -44,31 +44,6 @@ public:
 void GetSize( Size& rSize ) const SAL_OVERRIDE;
 };
 
-bool OpenGLSalBitmap::getFormatAndType(GLenum& nFormat, GLenum& nType)
-{
-switch(mnBits)
-{
-case  8:
-nFormat = GL_LUMINANCE;
-nType = GL_UNSIGNED_BYTE;
-break;
-case 16:
-nFormat = GL_RGB;
-nType = GL_UNSIGNED_SHORT_5_6_5;
-break;
-case 24:
-nFormat = GL_RGB;
-nType = GL_UNSIGNED_BYTE;
-break;
-case 32:
-default:
-nFormat = GL_RGBA;
-nType = GL_UNSIGNED_BYTE;
-break;
-}
-return true;
-}
-
 bool OpenGLSalBitmap::ImplScaleFilter(
 const double& rScaleX,
 const double& rScaleY,
@@ -85,11 +60,7 @@ bool OpenGLSalBitmap::ImplScaleFilter(
 if( !pProgram )
 return false;
 
-GLenum nFormat;
-GLenum nType;
-getFormatAndType(nFormat, nType);
-
-OpenGLTexture aNewTex = OpenGLTexture(nNewWidth, nNewHeight, nFormat, 
nType, nullptr);
+OpenGLTexture aNewTex(nNewWidth, nNewHeight);
 pFramebuffer = mpContext->AcquireFramebuffer( aNewTex );
 
 pProgram->SetTexture( "sampler", maTexture );
@@ -168,14 +139,10 @@ bool OpenGLSalBitmap::ImplScaleConvolution(
 if( pProgram == 0 )
 return false;
 
-GLenum nFormat;
-GLenum nType;
-getFormatAndType(nFormat, nType);
-
 // horizontal scaling in scratch texture
 if( mnWidth != nNewWidth )
 {
-OpenGLTexture aScratchTex = OpenGLTexture(nNewWidth, mnHeight, 
nFormat, nType, nullptr);
+OpenGLTexture aScratchTex(nNewWidth, nNewHeight);
 
 pFramebuffer = mpContext->AcquireFramebuffer( aScratchTex );
 
@@ -198,7 +165,7 @@ bool OpenGLSalBitmap::ImplScaleConvolution(
 // vertical scaling in final texture
 if( mnHeight != nNewHeight )
 {
-OpenGLTexture aScratchTex = OpenGLTexture(nNewWidth, nNewHeight, 
nFormat, nType, nullptr);
+OpenGLTexture aScratchTex(nNewWidth, nNewHeight);
 
 pFramebuffer = mpContext->AcquireFramebuffer( aScratchTex );
 
@@ -259,11 +226,7 @@ bool OpenGLSalBitmap::ImplScaleArea( double rScaleX, 
double rScaleY )
 if( pProgram == 0 )
 return false;
 
-GLenum nFormat;
-GLenum nType;
-getFormatAndType(nFormat, nType);
-
-OpenGLTexture aScratchTex = OpenGLTexture(nNewWidth, nNewHeight, nFormat, 
nType, nullptr);
+OpenGLTexture aScratchTex(nNewWidth, nNewHeight);
 
 OpenGLFramebuffer* pFramebuffer = mpContext->AcquireFramebuffer( 
aScratchTex );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - include/vcl vcl/inc vcl/opengl vcl/source

2015-09-16 Thread Marco Cecchetti
 include/vcl/opengl/OpenGLContext.hxx |   18 +-
 include/vcl/opengl/OpenGLHelper.hxx  |7 
 vcl/inc/opengl/program.hxx   |3 
 vcl/inc/opengl/win/WinDeviceInfo.hxx |   56 ++-
 vcl/inc/opengl/x11/X11DeviceInfo.hxx |   26 +++
 vcl/opengl/program.cxx   |7 
 vcl/source/opengl/OpenGLContext.cxx  |   37 +---
 vcl/source/opengl/OpenGLHelper.cxx   |  267 ++-
 8 files changed, 371 insertions(+), 50 deletions(-)

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

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

Reviewed-on: https://gerrit.libreoffice.org/18555
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 
Signed-off-by: Michael Meeks 

Conflicts:
include/vcl/opengl/OpenGLContext.hxx
include/vcl/opengl/OpenGLHelper.hxx
vcl/inc/opengl/win/WinDeviceInfo.hxx
vcl/source/opengl/OpenGLContext.cxx

Change-Id: I21c844b47282f6b3eec443933a86421a074e24df

diff --git a/include/vcl/opengl/OpenGLContext.hxx 
b/include/vcl/opengl/OpenGLContext.hxx
index 98f9c61..3e91f6f 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -56,9 +56,13 @@ class NSOpenGLView;
 #include 
 #include 
 #include 
+#include 
 #include 
 
+#include 
+#include 
 #include 
+#include 
 
 class OpenGLFramebuffer;
 class OpenGLProgram;
@@ -276,15 +280,15 @@ private:
 OpenGLFramebuffer* mpFirstFramebuffer;
 OpenGLFramebuffer* mpLastFramebuffer;
 
-struct ProgramKey
+struct ProgramHash
 {
-ProgramKey( const OUString& vertexShader, const OUString& 
fragmentShader, const OString& preamble );
-bool operator< ( const ProgramKey& other ) const;
-OUString vertexShader;
-OUString fragmentShader;
-OString preamble;
+size_t operator()( const rtl::OString& aDigest ) const
+{
+return (size_t)( rtl_crc32( 0, aDigest.getStr(), 
aDigest.getLength() ) );
+}
 };
-std::map > maPrograms;
+typedef std::unordered_map< rtl::OString, std::shared_ptr, 
ProgramHash > ProgramCollection;
+ProgramCollection maPrograms;
 OpenGLProgram* mpCurrentProgram;
 #ifdef DBG_UTIL
 std::set maParents;
diff --git a/include/vcl/opengl/OpenGLHelper.hxx 
b/include/vcl/opengl/OpenGLHelper.hxx
index 646a2d3..788b056 100644
--- a/include/vcl/opengl/OpenGLHelper.hxx
+++ b/include/vcl/opengl/OpenGLHelper.hxx
@@ -36,8 +36,13 @@
 
 class VCL_DLLPUBLIC OpenGLHelper
 {
+OpenGLHelper() SAL_DELETED_FUNCTION; // Should not be instantiated
+
 public:
-static GLint LoadShaders(const OUString& rVertexShaderName, const 
OUString& rFragmentShaderName, const OString& preamble = "" );
+
+static rtl::OString GetDigest(const OUString& rVertexShaderName, const 
OUString& rFragmentShaderName, const rtl::OString& preamble = "" );
+
+static GLint LoadShaders(const OUString& rVertexShaderName, const 
OUString& rFragmentShaderName, const rtl::OString& preamble = "", const 
rtl::OString& rDigest = "" );
 
 /**
  * The caller is responsible for allocate the memory for the RGBA buffer, 
before call
diff --git a/vcl/inc/opengl/program.hxx b/vcl/inc/opengl/program.hxx
index 7bdd43d..3a47512 100644
--- a/vcl/inc/opengl/program.hxx
+++ b/vcl/inc/opengl/program.hxx
@@ -50,7 +50,8 @@ public:
 OpenGLProgram();
 ~OpenGLProgram();
 
-bool Load( const OUString& rVertexShader, const OUString& rFragmentShader, 
const OString& preamble = "" );
+bool Load( const OUString& rVertexShader, const OUString& rFragmentShader,
+   const rtl::OString& preamble = "", const rtl::OString& rDigest 
= "" );
 bool Use();
 bool Clean();
 
diff --git a/vcl/inc/opengl/win/WinDeviceInfo.hxx 
b/vcl/inc/opengl/win/WinDeviceInfo.hxx
index 21f14d9..3b049fb 100644
--- a/vcl/inc/opengl/win/WinDeviceInfo.hxx
+++ b/vcl/inc/opengl/win/WinDeviceInfo.hxx
@@ -75,15 +75,8 @@ enum DeviceVendor {
 
 struct DriverInfo
 {
-typedef std::vector DeviceFamilyVector;
-
-// If |ownDevices| is true, you are transferring ownership of the devices
-// array, and it will be deleted when this GfxDriverInfo is destroyed.
-
-DriverInfo(OperatingSystem os, const OUString& vendor, DeviceFamilyVector* 
devices,
-VersionComparisonOp op,
-uint64_t driverVersion, bool bWhiteListed = false, const char 
*suggestedVersion = nullptr,
-bool ownDevices = false);
+DriverInfo(OperatingSystem os, const OUString& vendor, VersionComparisonOp 
op,
+uint64_t driverVersion, bool bWhiteListed = false, const char 
*suggestedVersion = nullptr);
 
 DriverInfo();
 DriverInfo(const DriverInfo&);
@@ -183,6 +176,51 @@ public:
 virtual ~WinOpenGLDeviceInfo();
 
 virtual bool isDeviceBlocked();
+
+const OUString& GetDriverVersion() const
+{
+return maDriverVersion;
+}
+
+const

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/opengl

2015-09-16 Thread Tomaž Vajngerl
 vcl/opengl/FixedTextureAtlas.cxx |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 50902f4d3bca92aefe0a3b663c3d175b60ecb25f
Author: Tomaž Vajngerl 
Date:   Fri Sep 11 12:27:45 2015 +0200

opengl: optimize search for a free slot in texture atlas

Change-Id: Ic853457871b914f9c1beb2f648bf7d9d18dce957
(cherry picked from commit 4823b6d4e989943c31e20027564ab4eca43f6f8d)
Reviewed-on: https://gerrit.libreoffice.org/18624
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/vcl/opengl/FixedTextureAtlas.cxx b/vcl/opengl/FixedTextureAtlas.cxx
index c8ca508..7a9b54e 100644
--- a/vcl/opengl/FixedTextureAtlas.cxx
+++ b/vcl/opengl/FixedTextureAtlas.cxx
@@ -36,15 +36,18 @@ OpenGLTexture FixedTextureAtlasManager::InsertBuffer(int 
nWidth, int nHeight, in
 {
 ImplOpenGLTexture* pTexture = nullptr;
 
-for (size_t i = 0; i < mpTextures.size(); i++)
+auto funFreeSlot = [] (std::unique_ptr& mpTexture)
 {
-if (mpTextures[i]->mnFreeSlots > 0)
-{
-pTexture = mpTextures[i].get();
-}
-}
+return mpTexture->mnFreeSlots > 0;
+};
+
+auto aIterator = std::find_if(mpTextures.begin(), mpTextures.end(), 
funFreeSlot);
 
-if (!pTexture)
+if (aIterator != mpTextures.end())
+{
+pTexture = (*aIterator).get();
+}
+else
 {
 CreateNewTexture();
 pTexture = mpTextures.back().get();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - include/clew include/opencl opencl/source sc/source

2015-09-16 Thread Tor Lillqvist
 include/clew/clew.h |1 
 include/opencl/openclwrapper.hxx|1 
 opencl/source/openclwrapper.cxx |5 +
 sc/source/core/data/formulacell.cxx |  136 ++--
 4 files changed, 123 insertions(+), 20 deletions(-)

New commits:
commit 88f4935640e02ec0cc884ee87a589083a1fc21aa
Author: Tor Lillqvist 
Date:   Thu Sep 10 21:58:28 2015 +0300

Split formula group for OpenCL up into smaller bits

Will make it less demanding on low-end hardware, where the device
driver is unresponsive for too long when a OpenCL kernel handling lots
of data is executing. This makes Windows restart it which is
problematic.

I tried several approaches of splitting, both at higher levels in sc
and at the lowest level just before creating and executing the OpenCL
kernel(s). This seems to be the most minimal and local approach. Doing
it at the lower level would have required too much poking into our
obscure OpenCL code, like passing an offset parameter to every kernel.

Use a simple heuristic to find out whether to split. On the
problematic low-end devices, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT is
4, while for more performant devices it is 1 or 8.

Change-Id: Ifd8ea9bae388ac9f1ca8cce2d8cc345d04184fca
Reviewed-on: https://gerrit.libreoffice.org/18614
Reviewed-by: Andras Timar 
Reviewed-by: László Németh 
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/include/clew/clew.h b/include/clew/clew.h
index 94b6c29..e5cfaf0 100644
--- a/include/clew/clew.h
+++ b/include/clew/clew.h
@@ -416,6 +416,7 @@ typedef struct _cl_image_format {
 
 // cl_device_info
 #define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002
+#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT  0x100A
 #define CL_DEVICE_MAX_CLOCK_FREQUENCY   0x100C
 #define CL_DEVICE_GLOBAL_MEM_SIZE   0x101F
 #define CL_DEVICE_NAME  0x102B
diff --git a/include/opencl/openclwrapper.hxx b/include/opencl/openclwrapper.hxx
index 75ecbc8..e3f967e 100644
--- a/include/opencl/openclwrapper.hxx
+++ b/include/opencl/openclwrapper.hxx
@@ -52,6 +52,7 @@ struct GPUEnv
 int mnCmdQueuePos;
 bool mnKhrFp64Flag;
 bool mnAmdFp64Flag;
+cl_uint mnPreferredVectorWidthFloat;
 };
 
 extern OPENCL_DLLPUBLIC GPUEnv gpuEnv;
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 5574d2c..9d03a27 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -501,6 +501,11 @@ bool initOpenCLRunEnv( GPUEnv *gpuInfo )
 gpuInfo->mnKhrFp64Flag = bKhrFp64;
 gpuInfo->mnAmdFp64Flag = bAmdFp64;
 
+gpuInfo->mnPreferredVectorWidthFloat = 0;
+
+clGetDeviceInfo(gpuInfo->mpArryDevsID[0], 
CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, sizeof(cl_uint),
+&gpuInfo->mnPreferredVectorWidthFloat, NULL);
+
 return false;
 }
 
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index eb2b374..b4ba29b 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include 
+#include 
 
 #include "formulacell.hxx"
 #include "grouptokenconverter.hxx"
@@ -54,6 +55,7 @@
 #include "types.hxx"
 #include "scopetools.hxx"
 #include "refupdatecontext.hxx"
+#include 
 #include 
 #include 
 #include 
@@ -3770,6 +3772,36 @@ ScFormulaCell::CompareState 
ScFormulaCell::CompareByTokenArray( ScFormulaCell& r
 return bInvariant ? EqualInvariant : EqualRelativeRef;
 }
 
+namespace {
+
+// Split N into optimally equal-sized pieces, each not larger than K.
+// Return value P is number of pieces. A returns the number of pieces
+// one larger than N/P, 0..P-1.
+
+int splitup(int N, int K, int& A)
+{
+assert(N > 0);
+assert(K > 0);
+
+A = 0;
+
+if (N <= K)
+return 1;
+
+const int ideal_num_parts = N / K;
+if (ideal_num_parts * K == N)
+return ideal_num_parts;
+
+const int num_parts = ideal_num_parts + 1;
+const int nominal_part_size = N / num_parts;
+
+A = N - num_parts * nominal_part_size;
+
+return num_parts;
+}
+
+} // anonymous namespace
+
 bool ScFormulaCell::InterpretFormulaGroup()
 {
 if (!officecfg::Office::Common::Misc::UseOpenCL::get())
@@ -3805,30 +3837,94 @@ bool ScFormulaCell::InterpretFormulaGroup()
 if (mxGroup->mbInvariant && false)
 return InterpretInvariantFormulaGroup();
 
-ScTokenArray aCode;
-ScAddress aTopPos = aPos;
-aTopPos.SetRow(mxGroup->mpTopCell->aPos.Row());
-ScGroupTokenConverter aConverter(aCode, *pDocument, *this, 
mxGroup->mpTopCell->aPos);
-std::vector aLoopControl;
-if (!aConverter.convert(*pCode, aLoopControl))
-{
-SAL_INFO("sc.opencl", "conversion of group " << this << " failed, 
disabling");
-mxGroup->meCalcState = sc::GroupCalcDisabled;
-return false;
-}
+int nMaxGroupLength 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/opengl

2015-09-16 Thread Tomaž Vajngerl
 vcl/opengl/texture.cxx |   22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

New commits:
commit 4833f5a9c88726a03666ee58c156746ba489b8a2
Author: Tomaž Vajngerl 
Date:   Wed Sep 16 13:47:47 2015 +0200

tdf#93666: use x,y coords when reading texture part + don't bind

Fixes shrinking shapes with gradients when the VirtualDev is
reused to create a alpha mask (and the texture is reused and
reading back from just one part of the texture which uses
glReadPixels code-path).

Binding texture is not necessary when we use and bind it to the
framebuffer.

Change-Id: Ie3994f749e1a2c17d4d3df44710b7453d7a4f45f
(cherry picked from commit 0165da09288b5f6573bda114af664a26557fad8a)
Reviewed-on: https://gerrit.libreoffice.org/18621
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx
index afb2b47..24a7c38 100644
--- a/vcl/opengl/texture.cxx
+++ b/vcl/opengl/texture.cxx
@@ -369,30 +369,32 @@ void OpenGLTexture::Read( GLenum nFormat, GLenum nType, 
sal_uInt8* pData )
 return;
 }
 
-Bind();
-glPixelStorei( GL_PACK_ALIGNMENT, 1 );
-
 VCL_GL_INFO( "vcl.opengl", "Reading texture " << Id() << " " << GetWidth() 
<< "x" << GetHeight() );
 
 if( GetWidth() == mpImpl->mnWidth && GetHeight() == mpImpl->mnHeight )
 {
+Bind();
+glPixelStorei( GL_PACK_ALIGNMENT, 1 );
 // XXX: Call not available with GLES 2.0
 glGetTexImage( GL_TEXTURE_2D, 0, nFormat, nType, pData );
+Unbind();
 }
 else
 {
+long nWidth = maRect.GetWidth();
+long nHeight = maRect.GetHeight();
+long nX = maRect.Left();
+long nY = mpImpl->mnHeight - maRect.Top() - nHeight;
+
 // Retrieve current context
 ImplSVData* pSVData = ImplGetSVData();
 rtl::Reference pContext = 
pSVData->maGDIData.mpLastContext;
-OpenGLFramebuffer* pFramebuffer;
-
-pFramebuffer = pContext->AcquireFramebuffer( *this );
-glReadPixels( maRect.Left(), mpImpl->mnHeight - maRect.Top(), 
GetWidth(), GetHeight(), nFormat, nType, pData );
-OpenGLContext::ReleaseFramebuffer( pFramebuffer );
-CHECK_GL_ERROR();
+OpenGLFramebuffer* pFramebuffer = pContext->AcquireFramebuffer(*this);
+glPixelStorei(GL_PACK_ALIGNMENT, 1);
+glReadPixels(nX, nY, nWidth, nHeight, nFormat, nType, pData);
+OpenGLContext::ReleaseFramebuffer(pFramebuffer);
 }
 
-Unbind();
 CHECK_GL_ERROR();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/opengl

2015-09-16 Thread Michael Meeks
 vcl/opengl/gdiimpl.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 3891bd40f6cf513a020ac6c87acfd0af7fc5ffd8
Author: Michael Meeks 
Date:   Wed Sep 16 03:25:05 2015 +0100

tdf#94252 - avoid switching contexts un-necessarily to reduce flicker.

Change-Id: Id4ac387174fa03c5886a990d89fd53a4f18db11c
Reviewed-on: https://gerrit.libreoffice.org/18610
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 37b21f3..9ea8a7c 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -77,8 +77,17 @@ bool OpenGLSalGraphicsImpl::AcquireContext( )
 {
 ImplSVData* pSVData = ImplGetSVData();
 
+// We always prefer to bind our VirtualDevice / offscreen graphics
+// to the current OpenGLContext - to avoid switching contexts.
+if (mpContext.is() && mbOffscreen)
+{
+if (OpenGLContext::hasCurrent() && !mpContext->isCurrent())
+mpContext.clear();
+}
+
 if( mpContext.is() )
 {
+// Check whether the context was reset underneath us.
 if( mpContext->isInitialized() )
 return true;
 mpContext.clear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - include/vcl vcl/inc vcl/opengl vcl/source vcl/unx vcl/win

2015-09-16 Thread Michael Meeks
 include/vcl/outdev.hxx |   18 --
 vcl/inc/generic/genpspgraphics.h   |3 --
 vcl/inc/headless/svpgdi.hxx|3 --
 vcl/inc/openglgdiimpl.hxx  |3 --
 vcl/inc/quartz/salgdi.h|3 --
 vcl/inc/salgdi.hxx |3 --
 vcl/inc/salgdiimpl.hxx |4 +--
 vcl/inc/unx/salgdi.h   |3 --
 vcl/inc/win/salgdi.h   |3 --
 vcl/opengl/gdiimpl.cxx |   28 --
 vcl/source/opengl/OpenGLHelper.cxx |   46 -
 vcl/source/outdev/outdev.cxx   |   12 -
 vcl/source/window/paint.cxx|   16 +++-
 vcl/unx/generic/gdi/gdiimpl.hxx|3 --
 vcl/unx/generic/gdi/salgdi.cxx |7 -
 vcl/win/source/gdi/gdiimpl.hxx |3 --
 vcl/win/source/gdi/salgdi.cxx  |7 -
 17 files changed, 77 insertions(+), 88 deletions(-)

New commits:
commit 5096dd689db9fdd97ae0399f78f95710196b7786
Author: Michael Meeks 
Date:   Wed Sep 16 09:17:37 2015 +0100

GL paint-flushing guard re-work.

Unfortunately, since we can have 2x SalGraphics' on a OutputDevice,
and one of these can be a printer - things got very confused around
which context to glFlush. This de-tangles the various reference-counts.

Conflicts:
vcl/inc/generic/genpspgraphics.h
vcl/win/source/gdi/salgdi.cxx

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

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index f0057b3..dbd57e6 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -608,9 +608,21 @@ public:
 const Point& rSrcPt,  const Size& rSrcSize,
 bool bWindowInvalidate = false );
 
-// Call before and after a paint operation to reduce flushing
-voidBeginPaint();
-voidEndPaint();
+/**
+ * Instantiate across a paint operation to defer flushing
+ * to the end.
+ *
+ * NB. holding a handle avoids problems with
+ * the underlying SalGraphics and it's implementation
+ * changing.
+ */
+class PaintScope {
+void *pHandle;
+public:
+PaintScope(OutputDevice *);
+~PaintScope();
+void flush();
+};
 
 protected:
 
diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h
index 8b78faa..2049e26 100644
--- a/vcl/inc/generic/genpspgraphics.h
+++ b/vcl/inc/generic/genpspgraphics.h
@@ -208,9 +208,6 @@ public:
 virtual css::uno::Any   GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& 
rSurface, const basegfx::B2ISize& rSize) const SAL_OVERRIDE;
 
 virtual SystemFontData  GetSysFontData( int nFallbacklevel ) const 
SAL_OVERRIDE;
-
-virtual void BeginPaint() SAL_OVERRIDE { };
-virtual void EndPaint() SAL_OVERRIDE { };
 };
 
 #endif // INCLUDED_VCL_INC_GENERIC_GENPSPGRAPHICS_H
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 9b8a25a..f4503e8 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -215,9 +215,6 @@ public:
 voidclipRegion(cairo_t* cr);
 
 #endif // ENABLE_CAIRO_CANVAS
-
-virtual voidBeginPaint() SAL_OVERRIDE { };
-virtual voidEndPaint() SAL_OVERRIDE { };
 };
 
 #endif
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index e16dd61..55f2e70 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -326,8 +326,7 @@ public:
 
 virtual bool drawGradient(const tools::PolyPolygon& rPolygon, const 
Gradient& rGradient) SAL_OVERRIDE;
 
-virtual void beginPaint() SAL_OVERRIDE;
-virtual void endPaint() SAL_OVERRIDE;
+virtual OpenGLContext *beginPaint() SAL_OVERRIDE;
 private:
 };
 
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 12c3144..518390c 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -421,9 +421,6 @@ public:
 virtual css::uno::Any   GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& 
rSurface, const ::basegfx::B2ISize& rSize) const SAL_OVERRIDE;
 virtual SystemFontData  GetSysFontData( int /* nFallbacklevel */ ) const 
SAL_OVERRIDE;
 
-virtual voidBeginPaint() SAL_OVERRIDE { };
-virtual voidEndPaint() SAL_OVERRIDE { };
-
 private:
 // differences between VCL, Quartz and kHiThemeOrientation coordinate 
systems
 // make some graphics seem to be vertically-mirrored from a VCL perspective
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index f00aae4..afd3b42 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -433,8 +433,7 @@ public:
 sal_uInt8 nTransparency,
 const OutputDevice *pOutDev );
 
-virtual void 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - slideshow/source

2015-09-16 Thread Michael Meeks
 slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx |2 
++
 1 file changed, 2 insertions(+)

New commits:
commit 0ff1cd30959b4e2eba9372cfb786c6bf3947bd38
Author: Michael Meeks 
Date:   Wed Sep 16 02:58:16 2015 +0100

tdf#94006 - need an explicit dispose for slideshow's GLContext.

Fixes crasher exiting slideshow.

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

diff --git 
a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx 
b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index db50970..f296866 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -1325,6 +1325,8 @@ void OGLTransitionerImpl::impl_dispose()
 {
 impl_finishTransition();
 disposeTextures();
+if( mpContext.is() )
+mpContext->dispose();
 mpContext.clear();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/inc vcl/opengl vcl/source vcl/win

2015-09-16 Thread Michael Meeks
 vcl/inc/opengl/win/gdiimpl.hxx  |1 +
 vcl/opengl/gdiimpl.cxx  |9 +++--
 vcl/opengl/win/gdiimpl.cxx  |   19 ++-
 vcl/source/opengl/OpenGLContext.cxx |3 +++
 vcl/source/window/paint.cxx |8 
 vcl/win/source/window/salframe.cxx  |4 ++--
 6 files changed, 39 insertions(+), 5 deletions(-)

New commits:
commit b62f83c88b725d936b09cdd28a5ab625ac7c6d3e
Author: Michael Meeks 
Date:   Mon Sep 14 18:09:25 2015 +0100

tdf#94213 - defer glFlushing until we've re-rendered after a re-size.

Avoids a rather horrible flickering problem in GL mode.

Squashing:

tdf#94213 - release offscreen texture properly on re-size.

We need to ensure that we use an initialized context, and that
(when we re-parent) we DeInit and so reset the previous OpenGLContext.
Make UseContext more paranoid as well for good measure.

Squashing:

tdf#94213 - cleanup associated GL contexts properly when DCs released.

Change-Id: I6b9fb899777d8e460999ac3ff038a1302e434bb5
Reviewed-on: https://gerrit.libreoffice.org/18607
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/inc/opengl/win/gdiimpl.hxx b/vcl/inc/opengl/win/gdiimpl.hxx
index 04bb151..5c91727 100644
--- a/vcl/inc/opengl/win/gdiimpl.hxx
+++ b/vcl/inc/opengl/win/gdiimpl.hxx
@@ -34,6 +34,7 @@ protected:
 virtual bool UseContext( const rtl::Reference &pContext ) 
SAL_OVERRIDE;
 
 public:
+virtual void Init() SAL_OVERRIDE;
 virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* 
pSrcGraphics ) SAL_OVERRIDE;
 
 
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 85c3a3a..37b21f3 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -115,7 +115,8 @@ void OpenGLSalGraphicsImpl::Init()
 // check if we can simply re-use the same context
 if( mpContext.is() )
 {
-if( !UseContext( mpContext ) )
+if( !mpContext->isInitialized() ||
+!UseContext( mpContext ) )
 ReleaseContext();
 }
 
@@ -124,8 +125,12 @@ void OpenGLSalGraphicsImpl::Init()
 maOffscreenTex.GetWidth()  != GetWidth() ||
 maOffscreenTex.GetHeight() != GetHeight() )
 {
-if( mpContext.is() ) // valid context
+if( maOffscreenTex && // don't work to release empty textures
+mpContext.is() )  // valid context
+{
+mpContext->makeCurrent();
 mpContext->ReleaseFramebuffer( maOffscreenTex );
+}
 maOffscreenTex = OpenGLTexture();
 }
 }
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 30088a9..517cff1 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -43,7 +43,24 @@ bool WinOpenGLSalGraphicsImpl::UseContext( const 
rtl::Reference &
 return false;
 if( IsOffscreen() )
 return true;
-return pContext->getOpenGLWindow().hWnd == mrParent.mhWnd;
+return pContext->getOpenGLWindow().hWnd == mrParent.mhWnd &&
+   pContext->getOpenGLWindow().hDC == mrParent.mhLocalDC;
+}
+
+void WinOpenGLSalGraphicsImpl::Init()
+{
+if ( !IsOffscreen() && mpContext.is() && mpContext->isInitialized() &&
+ ( mpContext->getOpenGLWindow().hWnd != mrParent.mhWnd ||
+   mpContext->getOpenGLWindow().hDC == mrParent.mhLocalDC ) )
+{
+// This can legitimiately happen, SalFrame keeps 2x
+// SalGraphics which share the same hWnd and hDC.
+// The shape 'Area' dialog does reparenting to trigger this.
+SAL_WARN("vcl.opengl", "Unusual: Windows handle / DC changed without 
DeInit");
+DeInit();
+}
+
+OpenGLSalGraphicsImpl::Init();
 }
 
 namespace
diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index ea9664e..2502a83 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1690,6 +1690,9 @@ void OpenGLContext::ReleaseFramebuffer( const 
OpenGLTexture& rTexture )
 {
 OpenGLZone aZone;
 
+if (!rTexture) // no texture to release.
+return;
+
 OpenGLFramebuffer* pFramebuffer = mpLastFramebuffer;
 
 while( pFramebuffer )
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 80de1a4..ae846ae 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -651,6 +651,8 @@ IMPL_LINK_NOARG_TYPED(Window, ImplHandlePaintHdl, Idle *, 
void)
 return;
 }
 
+BeginPaint();
+
 // save paint events until resizing or initial sizing done
 if (!ImplDoTiledRendering() && mpWindowImpl->mbFrame &&
 (mpWindowImpl->mpFrameData->maResizeIdle.IsActive() ||
@@ -662,12 +664,16 @@ IMPL_LINK_NOARG_TYPED(Window, ImplHandlePaintHdl, Idle *, 
void)
 {
 ImplCallOverlapPaint();
 }
+
+EndPaint();
 }
 
 IMPL_LINK_NOARG_TYPED(Window, ImplHandleResizeTimerHdl, Idle *, void)
 {
 if( mpWindowImpl->mbReallyVisible )
 {
+  

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-16 Thread Michael Meeks
 vcl/source/window/event.cxx  |   10 +-
 vcl/source/window/status.cxx |6 ++
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit f7554e3e6ff17c850f444bd58767e68e8741387a
Author: Michael Meeks 
Date:   Tue Sep 15 23:42:52 2015 +0100

tdf#94213 - calc re-size flicker turns out to be the status bar.

Using vdev's associated with old contexts, is un-necessary and a
recipe for context switching & hence flicker.

Change-Id: I37ed967a7816e5ca0240908ab4793ce1e68570ee
Reviewed-on: https://gerrit.libreoffice.org/18602
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/18608
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 852cc0c..35c3e38 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -453,7 +454,14 @@ void Window::ImplCallResize()
 {
 mpWindowImpl->mbCallResize = false;
 
-if( GetBackground().IsGradient() )
+// OpenGL has a charming feature of black clearing the whole window
+// some legacy code eg. the app-menu has the beautiful feature of
+// avoiding re-paints when width doesn't change => invalidate all.
+if( OpenGLWrapper::isVCLOpenGLEnabled() )
+Invalidate();
+
+// Normally we avoid blanking on re-size unless people might notice:
+else if( GetBackground().IsGradient() )
 Invalidate();
 
 Resize();
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index e8e2aaf..76c2de3 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -731,6 +732,11 @@ void StatusBar::Paint(vcl::RenderContext& rRenderContext, 
const Rectangle&)
 // Do offscreen only when we are not recording layout..
 bool bOffscreen = !rRenderContext.ImplIsRecordLayout();
 
+// tdf#94213 - un-necessary virtual-device in GL mode
+// causes context switch & hence flicker during sizing.
+if( OpenGLWrapper::isVCLOpenGLEnabled() )
+bOffscreen = false;
+
 for (sal_uInt16 i = 0; i < nItemCount; i++)
 {
 ImplDrawItem(rRenderContext, bOffscreen, i, true, true);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 5 commits - vcl/inc vcl/opengl

2015-09-16 Thread Tomaž Vajngerl
 vcl/inc/opengl/salbmp.hxx|2 -
 vcl/opengl/FixedTextureAtlas.cxx |   17 ++-
 vcl/opengl/framebuffer.cxx   |7 +++-
 vcl/opengl/salbmp.cxx|   58 ++-
 vcl/opengl/scale.cxx |   45 ++
 vcl/opengl/texture.cxx   |   22 --
 6 files changed, 77 insertions(+), 74 deletions(-)

New commits:
commit 7993663cc559e2a2c72804f7b4fa553f8c7441c3
Author: Tomaž Vajngerl 
Date:   Wed Sep 16 14:10:35 2015 +0200

opengl: check framebuffer completeness

Change-Id: Idd80b7390694038ab0913edab0e496593beb0e15

diff --git a/vcl/opengl/framebuffer.cxx b/vcl/opengl/framebuffer.cxx
index b1135fc..403c379 100644
--- a/vcl/opengl/framebuffer.cxx
+++ b/vcl/opengl/framebuffer.cxx
@@ -68,8 +68,11 @@ void OpenGLFramebuffer::AttachTexture( const OpenGLTexture& 
rTexture )
 mnAttachedTexture = rTexture.Id();
 mnWidth = rTexture.GetWidth();
 mnHeight = rTexture.GetHeight();
-glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 
GL_TEXTURE_2D,
-mnAttachedTexture, 0 );
+glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 
GL_TEXTURE_2D, mnAttachedTexture, 0);
+if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
+{
+SAL_WARN("vcl.opengl", "Framebuffer incomplete");
+}
 CHECK_GL_ERROR();
 }
 
commit b85d24e430051054e54602aa14bf00b164c3865b
Author: Tomaž Vajngerl 
Date:   Wed Sep 16 14:02:23 2015 +0200

opengl: support reading back 1-bit masks from texture

Change-Id: Ibe8d9140f7a54016f2cd684198856ac27d880aa3

diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 05c1000..286c463 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -469,8 +469,6 @@ GLuint OpenGLSalBitmap::CreateTexture()
 bool OpenGLSalBitmap::ReadTexture()
 {
 sal_uInt8* pData = maUserBuffer.get();
-GLenum nFormat = GL_RGBA;
-GLenum nType = GL_UNSIGNED_BYTE;
 
 SAL_INFO( "vcl.opengl", "::ReadTexture " << mnWidth << "x" << mnHeight );
 
@@ -479,8 +477,8 @@ bool OpenGLSalBitmap::ReadTexture()
 
 if (mnBits == 8 || mnBits == 16 || mnBits == 24 || mnBits == 32)
 {
-// no conversion needed for truecolor
-pData = maUserBuffer.get();
+GLenum nFormat = GL_RGBA;
+GLenum nType = GL_UNSIGNED_BYTE;
 
 switch( mnBits )
 {
@@ -497,18 +495,54 @@ bool OpenGLSalBitmap::ReadTexture()
 nType = GL_UNSIGNED_BYTE;
 break;
 }
+
+makeCurrent();
+maTexture.Read(nFormat, nType, pData);
+mnBufWidth = mnWidth;
+mnBufHeight = mnHeight;
+return true;
 }
-else
-{
-return false;
+else if (mnBits == 1)
+{   // convert buffers from 24-bit RGB to 1-bit Mask
+std::vector aBuffer(mnWidth * mnHeight * 3);
+makeCurrent();
+sal_uInt8* pBuffer = aBuffer.data();
+maTexture.Read(GL_RGB, GL_UNSIGNED_BYTE, pBuffer);
+
+int nShift = 7;
+size_t nIndex = 0;
+
+sal_uInt8* pCurrent = pBuffer;
+
+for (size_t i = 0; i < aBuffer.size(); i += 3)
+{
+sal_uInt8 nR = *pCurrent++;
+sal_uInt8 nG = *pCurrent++;
+sal_uInt8 nB = *pCurrent++;
+
+if (nR > 0 && nG > 0 && nB > 0)
+{
+pData[nIndex] |= (1 << nShift);
+}
+nShift--;
+if (nShift < 0)
+{
+nShift = 7;
+nIndex++;
+pData[nIndex] = 0;
+}
+}
+
+mnBufWidth = mnWidth;
+mnBufHeight = mnHeight;
+return true;
 }
 
-makeCurrent();
-maTexture.Read( nFormat, nType, pData );
-mnBufWidth = mnWidth;
-mnBufHeight = mnHeight;
+SAL_WARN("vcl.opengl", "::ReadTexture - tx:" << maTexture.Id() << " @ "
+ << mnWidth << "x" << mnHeight << "- unimplemented bit depth: "
+ << mnBits);
+return false;
 
-return true;
 }
 
 sal_uInt16 OpenGLSalBitmap::GetBitCount() const
commit 0165da09288b5f6573bda114af664a26557fad8a
Author: Tomaž Vajngerl 
Date:   Wed Sep 16 13:47:47 2015 +0200

tdf#93666: use x,y coords when reading texture part + don't bind

Fixes shrinking shapes with gradients when the VirtualDev is
reused to create a alpha mask (and the texture is reused and
reading back from just one part of the texture which uses
glReadPixels code-path).

Binding texture is not necessary when we use and bind it to the
framebuffer.

Change-Id: Ie3994f749e1a2c17d4d3df44710b7453d7a4f45f

diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx
index 9b3c605..c0373cc 100644
--- a/vcl/opengl/texture.cxx
+++ b/vcl/opengl/texture.cxx
@@ -361,30 +361,32 @@ void OpenGLTexture::Read( GLenum nFormat, GLenum nType, 
sal_uInt8* pData )
 return;
 }
 
-Bind();
-   

[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - 4 commits - desktop/qa desktop/source include/LibreOfficeKit include/sfx2 include/vcl libreofficekit/source sfx2/source sw/inc sw/sourc

2015-09-16 Thread Miklos Vajna
 desktop/qa/desktop_lib/test_desktop_lib.cxx |   12 +--
 desktop/source/lib/init.cxx |   47 +---
 include/LibreOfficeKit/LibreOfficeKit.h |9 +++--
 include/LibreOfficeKit/LibreOfficeKit.hxx   |   38 --
 include/sfx2/lokhelper.hxx  |   13 ---
 include/vcl/ITiledRenderable.hxx|8 
 libreofficekit/source/gtk/lokdocview.cxx|   21 +++-
 sfx2/source/view/lokhelper.cxx  |   41 ++--
 sw/inc/unotxdoc.hxx |2 -
 sw/source/uibase/uno/unotxdoc.cxx   |5 --
 10 files changed, 129 insertions(+), 67 deletions(-)

New commits:
commit 711598801a3ccd7d7564929b1917cdb64754a942
Author: Miklos Vajna 
Date:   Wed Sep 16 14:14:04 2015 +0200

LOK: make getViews() be a member function of Document

Just to be consistent, as all other view-related member functions are
there, too.

No real impact, as only the unit test uses this so far, and it always
works with a single document.

Change-Id: I46f1ed8265ab95017986ab45c1b510e961192241

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 7ad8127..0cd88ce 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -134,10 +134,10 @@ void DesktopLOKTest::testGetFonts()
 void DesktopLOKTest::testCreateView()
 {
 LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
-CPPUNIT_ASSERT_EQUAL(1, SfxLokHelper::getViews());
+CPPUNIT_ASSERT_EQUAL(1, pDocument->m_pDocumentClass->getViews(pDocument));
 
 int nId = pDocument->m_pDocumentClass->createView(pDocument);
-CPPUNIT_ASSERT_EQUAL(2, SfxLokHelper::getViews());
+CPPUNIT_ASSERT_EQUAL(2, pDocument->m_pDocumentClass->getViews(pDocument));
 
 // Make sure the created view is the active one, then switch to the old
 // one.
@@ -146,7 +146,7 @@ void DesktopLOKTest::testCreateView()
 CPPUNIT_ASSERT_EQUAL(0, pDocument->m_pDocumentClass->getView(pDocument));
 
 pDocument->m_pDocumentClass->destroyView(pDocument, nId);
-CPPUNIT_ASSERT_EQUAL(1, SfxLokHelper::getViews());
+CPPUNIT_ASSERT_EQUAL(1, pDocument->m_pDocumentClass->getViews(pDocument));
 closeDoc();
 }
 
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index eba9c0b..4f17cb7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -249,6 +249,7 @@ static int doc_createView(LibreOfficeKitDocument* pThis);
 static void doc_destroyView(LibreOfficeKitDocument* pThis, int nId);
 static void doc_setView(LibreOfficeKitDocument* pThis, int nId);
 static int doc_getView(LibreOfficeKitDocument* pThis);
+static int doc_getViews(LibreOfficeKitDocument* pThis);
 
 LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
 &xComponent) :
 mxComponent( xComponent )
@@ -284,6 +285,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
destroyView = doc_destroyView;
 m_pDocumentClass->setView = doc_setView;
 m_pDocumentClass->getView = doc_getView;
+m_pDocumentClass->getViews = doc_getViews;
 
 gDocumentClass = m_pDocumentClass;
 }
@@ -311,8 +313,6 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions  
(LibreOfficeKit* pThi
 static voidlo_registerCallback (LibreOfficeKit* pThis,
 LibreOfficeKitCallback 
pCallback,
 void* pData);
-static int lo_getViews(LibreOfficeKit* pThis);
-
 struct LibLibreOffice_Impl : public _LibreOfficeKit
 {
 OUString maLastExceptionMsg;
@@ -335,7 +335,6 @@ struct LibLibreOffice_Impl : public _LibreOfficeKit
 m_pOfficeClass->getError = lo_getError;
 m_pOfficeClass->documentLoadWithOptions = 
lo_documentLoadWithOptions;
 m_pOfficeClass->registerCallback = lo_registerCallback;
-m_pOfficeClass->getViews = lo_getViews;
 
 gOfficeClass = m_pOfficeClass;
 }
@@ -453,11 +452,6 @@ static void lo_registerCallback (LibreOfficeKit* pThis,
 pLib->mpCallbackData = pData;
 }
 
-static int lo_getViews(LibreOfficeKit* /*pThis*/)
-{
-return SfxLokHelper::getViews();
-}
-
 static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const 
char* pFormat, const char* pFilterOptions)
 {
 LibLODocument_Impl* pDocument = static_cast(pThis);
@@ -1019,6 +1013,13 @@ static int doc_getView(LibreOfficeKitDocument* /*pThis*/)
 return SfxLokHelper::getView();
 }
 
+static int doc_getViews(LibreOfficeKitDocument* /*pThis*/)
+{
+SolarMutexGuard aGuard;
+
+return SfxLokHelper::getViews();
+}
+
 static char* lo_getError (LibreOfficeKit *pThis)
 {
 LibLibreOffice_Impl* pLib = static_cast(pThis);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 18f4b3e..f

[Bug 94272] Reduce copy'n'pasta code in Impress unit tests (sd/qa)

2015-09-16 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=94272

Katarina Behrens (CIB)  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||libreoffice@lists.freedeskt
   ||op.org
 Ever confirmed|0   |1
 Whiteboard||EasyHack
   ||DifficultyInteresting
   ||SkillCpp SkillUno
   ||TopicCleanup

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


license statement

2015-09-16 Thread Lera
All of my past & future contributions to LibreOffice may be licensed under the 
MPLv2/LGPLv3+ dual license.

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


Re: Impact of merging feature/chained-text-boxes to master

2015-09-16 Thread Thorsten Behrens
Matteo Campanelli wrote:
> this is to describe some changes (in code and behavior) that should occur
> merging branch  "feature/chained-text-boxes" to master.
>
Hi Matteo,

thanks a lot for the heads-up -

> What may/will be affected
> ---
> NOTE: The vast majority of the code above should only affect  LO behavior
> for docs that have the tag in (4) set to something sensible.
> 
Yep - so I'd like to switch that live on master, but possibly disable
it / make it experimental-only if we hit issues getting closer to 5.1.

> commit 54b576c3b3bf3d67c5ffd4ae391f6c03e3647dc1
> Author: matteocam 
> Date:   Mon Sep 7 20:01:35 2015 +0200
> 
> Handle chaining for cutting and pasting
> 
That at least works for me. ;)

> commit 731000696b282f457a7e003297d4f158849825d4
> Author: matteocam 
> Date:   Mon Sep 7 19:58:16 2015 +0200
> 
> Handle DEL key for chaining
> 
Same there - almost impossible to unwind why those things were not
uniformly done ...

> commit 1a86da45320faf5f644c1a82c07bd9b522a2a351
> Author: matteocam 
> Date:   Mon Sep 7 16:37:56 2015 +0200
> 
> Enable chaining after a key is pressed
> 
That looks innocent if no chaining happens.

> commit 3748019d58154b2851999c3ea9f2ab223c8e3bc3
> Author: matteocam 
> Date:   Mon Sep 7 12:44:37 2015 +0200
> 
> Change EndTextEdit behavior to support recursive overflow
> 
Can't see any harm in that one either.

Unless there are objections in the ESC tomorrow, let's merge this (I
have one or two smallish cleanups still on my list), and then notify
QA with a similar heads-up, outlining the areas this affects (all
EditEngine clients - most prominently Calc, but also text in draw
shapes inside Writer). Let's hope there's no need for a whiteboard
keyword. ;)

Cheers,

-- Thorsten


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


[Libreoffice-commits] core.git: 4 commits - sw/inc sw/qa sw/source

2015-09-16 Thread Michael Stahl
 sw/inc/ToxLinkProcessor.hxx |7 +++--
 sw/inc/fmtclds.hxx  |5 ++--
 sw/inc/tblafmt.hxx  |4 +--
 sw/qa/core/test_ToxLinkProcessor.cxx|   24 ++--
 sw/source/core/doc/tblafmt.cxx  |   38 +---
 sw/source/core/inc/UndoCore.hxx |   21 +
 sw/source/core/layout/atrfrm.cxx|   21 +++--
 sw/source/core/tox/ToxLinkProcessor.cxx |   25 +++--
 sw/source/core/undo/undobj.cxx  |   12 +-
 sw/source/ui/table/tautofmt.cxx |   11 +
 10 files changed, 88 insertions(+), 80 deletions(-)

New commits:
commit bf2116353a89c402bf19b79d49eadf4454103423
Author: Michael Stahl 
Date:   Wed Sep 16 12:48:57 2015 +0200

sw: replace boost::ptr_vector with std::vector

Change-Id: I4abd8fcbbe8ef439097eed7c2b20584450182cd5

diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
index 545b80b..c3e219e 100644
--- a/sw/source/core/inc/UndoCore.hxx
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -25,7 +25,8 @@
 #include 
 #include 
 
-#include 
+#include 
+#include 
 
 class SfxItemSet;
 class SwFormatColl;
@@ -65,17 +66,17 @@ public:
 
 class SwRedlineSaveDatas {
 private:
-boost::ptr_vector mvData;
+std::vector> m_Data;
 
 public:
-SwRedlineSaveDatas() : mvData() {}
-
-void clear() { mvData.clear(); }
-bool empty() const { return mvData.empty(); }
-size_t size() const { return mvData.size(); }
-void push_back (SwRedlineSaveData* value) { mvData.push_back(value); }
-const SwRedlineSaveData& operator[]( size_t nIdx ) const { return mvData[ 
nIdx ]; }
-SwRedlineSaveData& operator[]( size_t nIdx ) { return mvData[ nIdx ]; }
+SwRedlineSaveDatas() : m_Data() {}
+
+void clear() { m_Data.clear(); }
+bool empty() const { return m_Data.empty(); }
+size_t size() const { return m_Data.size(); }
+void push_back(std::unique_ptr pNew) { 
m_Data.push_back(std::move(pNew)); }
+const SwRedlineSaveData& operator[](size_t const nIdx) const { return 
*m_Data[ nIdx ]; }
+SwRedlineSaveData& operator[](size_t const nIdx) { return *m_Data[ nIdx ]; 
}
 };
 
 namespace sw {
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 3683060..cfa249a 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -979,7 +979,6 @@ bool SwUndo::FillSaveData(
 {
 rSData.clear();
 
-SwRedlineSaveData* pNewData;
 const SwPosition* pStt = rRange.Start();
 const SwPosition* pEnd = rRange.End();
 const SwRedlineTable& rTable = 
rRange.GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
@@ -996,8 +995,9 @@ bool SwUndo::FillSaveData(
  && eCmpPos != POS_COLLIDE_END
  && eCmpPos != POS_COLLIDE_START )
 {
-pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl, 
bCopyNext );
-rSData.push_back( pNewData );
+std::unique_ptr pNewData(
+new SwRedlineSaveData(eCmpPos, *pStt, *pEnd, *pRedl, 
bCopyNext));
+rSData.push_back(std::move(pNewData));
 }
 }
 if( !rSData.empty() && bDelRange )
@@ -1013,7 +1013,6 @@ bool SwUndo::FillSaveDataForFormat(
 {
 rSData.clear();
 
-SwRedlineSaveData* pNewData;
 const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End();
 const SwRedlineTable& rTable = 
rRange.GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
 sal_uInt16 n = 0;
@@ -1029,8 +1028,9 @@ bool SwUndo::FillSaveDataForFormat(
  && eCmpPos != POS_COLLIDE_END
  && eCmpPos != POS_COLLIDE_START )
 {
-pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, 
*pRedl, true );
-rSData.push_back( pNewData );
+std::unique_ptr pNewData(
+new SwRedlineSaveData(eCmpPos, *pStt, *pEnd, *pRedl, 
true));
+rSData.push_back(std::move(pNewData));
 }
 
 }
commit 0a601a0cb14dc0f60e00eb46929f53eebe59a6af
Author: Michael Stahl 
Date:   Wed Sep 16 12:40:14 2015 +0200

sw: replace boost::ptr_vector with std::vector

Change-Id: I3bfb0933d5233b89f24773500f07fdc92d0011e9

diff --git a/sw/inc/ToxLinkProcessor.hxx b/sw/inc/ToxLinkProcessor.hxx
index 3887121..699c0ec 100644
--- a/sw/inc/ToxLinkProcessor.hxx
+++ b/sw/inc/ToxLinkProcessor.hxx
@@ -13,7 +13,8 @@
 #include "fmtinfmt.hxx"
 #include "rtl/ustring.hxx"
 
-#include 
+#include 
+#include 
 
 class SwTextNode;
 
@@ -76,9 +77,9 @@ private:
 sal_Int32 mEndTextPos;
 };
 
-boost::ptr_vector mClosedLinks;
+std::vector> m_ClosedLinks;
 
-boost::ptr_vector mStartedLinks;
+std::vector> m_StartedLinks;
 
 friend class ::ToxLinkProcessorTest;
 };
diff --git a/sw/qa/core/test_ToxLinkProcessor.cxx 
b/sw/qa/core/test_ToxLinkProcessor.cxx
index 660d745..03c8550 100644
--- a/sw/qa/core/tes

[Bug 94228] replace BOOST_PP macros with C++11 variadic templates where possible

2015-09-16 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=94228

Commit Notification  changed:

   What|Removed |Added

 Whiteboard|EasyHack|EasyHack
   |DifficultyInteresting   |DifficultyInteresting
   |SkillScript SkillCpp|SkillScript SkillCpp
   ||target:5.1.0

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


[Bug 94228] replace BOOST_PP macros with C++11 variadic templates where possible

2015-09-16 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=94228

--- Comment #1 from Commit Notification 
 ---
Daniel Robertson committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=54045cc813c79e53abe608cc1a8d35ee7177465e

tdf#94228 vcl: replace BOOST_PP with templates

It will be available in 5.1.0.

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 on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: include/vcl svtools/source

2015-09-16 Thread Daniel Robertson
 include/vcl/checksum.hxx|   19 +--
 svtools/source/graphic/grfcache.cxx |2 +-
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 54045cc813c79e53abe608cc1a8d35ee7177465e
Author: Daniel Robertson 
Date:   Tue Sep 15 14:51:26 2015 -0400

tdf#94228 vcl: replace BOOST_PP with templates

Replace BOOST_PP macros in Bitmap Checksum to Bitmap Checksum Octet
Array with templates.

Change-Id: Ia7cbc20c90b4d99d54760580e3db10afac9020f3
Reviewed-on: https://gerrit.libreoffice.org/18597
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx
index 7e1076f..21674a8 100644
--- a/include/vcl/checksum.hxx
+++ b/include/vcl/checksum.hxx
@@ -26,23 +26,22 @@
 #include 
 #include 
 
-#include 
-#include 
-#include 
-
 #define BITMAP_CHECKSUM_SIZE 8
-#define BITMAP_CHECKSUM_BITS BOOST_PP_MUL(BITMAP_CHECKSUM_SIZE, 8)
 
 typedef sal_uInt64   BitmapChecksum;
 typedef sal_uInt8   BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE];
 
-#define BITMAP_CHECKSUM_SET_OCTET(z, i, unused) \
-p[i] = (sal_uInt8)(n >> BOOST_PP_MUL(8, i));
-
+template< sal_uInt8 N = 0 >
+inline void BCToBCOA( BitmapChecksum n, BitmapChecksumOctetArray p )
+{
+  p[N] = (sal_uInt8)(n >> ( 8 * N ));
+  return BCToBCOA< N + 1 >( n, p );
+}
 
-inline void BCToBCOA( BitmapChecksum n , BitmapChecksumOctetArray p )
+template<>
+inline void BCToBCOA< BITMAP_CHECKSUM_SIZE >( BitmapChecksum, 
BitmapChecksumOctetArray )
 {
-BOOST_PP_REPEAT(BITMAP_CHECKSUM_SIZE , BITMAP_CHECKSUM_SET_OCTET, unused)
+return;
 }
 
 #ifdef __cplusplus
diff --git a/svtools/source/graphic/grfcache.cxx 
b/svtools/source/graphic/grfcache.cxx
index ccc2440..2e29e31 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -134,7 +134,7 @@ OString GraphicID::GetIDString() const
 for( nShift = 28; nShift >= 0; nShift -= 4 )
 aHexStr[nIndex++] = aHexData[ ( mnID3 >> (sal_uInt32) nShift ) & 0xf ];
 
-for( nShift = BITMAP_CHECKSUM_BITS - 4; nShift >= 0; nShift -= 4 )
+for( nShift = ( 8 * BITMAP_CHECKSUM_SIZE ) - 4; nShift >= 0; nShift -= 4 )
 aHexStr[nIndex++] = aHexData[ ( mnID4 >> (sal_uInt32) nShift ) & 0xf ];
 
 return aHexStr.makeStringAndClear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - include/clew include/opencl opencl/source sc/source

2015-09-16 Thread Tor Lillqvist
 include/clew/clew.h |1 
 include/opencl/openclwrapper.hxx|1 
 opencl/source/openclwrapper.cxx |5 +
 sc/source/core/data/formulacell.cxx |  136 ++--
 4 files changed, 123 insertions(+), 20 deletions(-)

New commits:
commit dbdfdd88831a64558f3cd5e0396c15576a744a6f
Author: Tor Lillqvist 
Date:   Thu Sep 10 21:58:28 2015 +0300

Split formula group for OpenCL up into smaller bits

Will make it less demanding on low-end hardware, where the device
driver is unresponsive for too long when a OpenCL kernel handling lots
of data is executing. This makes Windows restart it which is
problematic.

I tried several approaches of splitting, both at higher levels in sc
and at the lowest level just before creating and executing the OpenCL
kernel(s). This seems to be the most minimal and local approach. Doing
it at the lower level would have required too much poking into our
obscure OpenCL code, like passing an offset parameter to every kernel.

Use a simple heuristic to find out whether to split. On the
problematic low-end devices, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT is
4, while for more performant devices it is 1 or 8.

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

diff --git a/include/clew/clew.h b/include/clew/clew.h
index 94b6c29..e5cfaf0 100644
--- a/include/clew/clew.h
+++ b/include/clew/clew.h
@@ -416,6 +416,7 @@ typedef struct _cl_image_format {
 
 // cl_device_info
 #define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002
+#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT  0x100A
 #define CL_DEVICE_MAX_CLOCK_FREQUENCY   0x100C
 #define CL_DEVICE_GLOBAL_MEM_SIZE   0x101F
 #define CL_DEVICE_NAME  0x102B
diff --git a/include/opencl/openclwrapper.hxx b/include/opencl/openclwrapper.hxx
index 75ecbc8..e3f967e 100644
--- a/include/opencl/openclwrapper.hxx
+++ b/include/opencl/openclwrapper.hxx
@@ -52,6 +52,7 @@ struct GPUEnv
 int mnCmdQueuePos;
 bool mnKhrFp64Flag;
 bool mnAmdFp64Flag;
+cl_uint mnPreferredVectorWidthFloat;
 };
 
 extern OPENCL_DLLPUBLIC GPUEnv gpuEnv;
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 5574d2c..9d03a27 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -501,6 +501,11 @@ bool initOpenCLRunEnv( GPUEnv *gpuInfo )
 gpuInfo->mnKhrFp64Flag = bKhrFp64;
 gpuInfo->mnAmdFp64Flag = bAmdFp64;
 
+gpuInfo->mnPreferredVectorWidthFloat = 0;
+
+clGetDeviceInfo(gpuInfo->mpArryDevsID[0], 
CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, sizeof(cl_uint),
+&gpuInfo->mnPreferredVectorWidthFloat, NULL);
+
 return false;
 }
 
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index eb2b374..b4ba29b 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include 
+#include 
 
 #include "formulacell.hxx"
 #include "grouptokenconverter.hxx"
@@ -54,6 +55,7 @@
 #include "types.hxx"
 #include "scopetools.hxx"
 #include "refupdatecontext.hxx"
+#include 
 #include 
 #include 
 #include 
@@ -3770,6 +3772,36 @@ ScFormulaCell::CompareState 
ScFormulaCell::CompareByTokenArray( ScFormulaCell& r
 return bInvariant ? EqualInvariant : EqualRelativeRef;
 }
 
+namespace {
+
+// Split N into optimally equal-sized pieces, each not larger than K.
+// Return value P is number of pieces. A returns the number of pieces
+// one larger than N/P, 0..P-1.
+
+int splitup(int N, int K, int& A)
+{
+assert(N > 0);
+assert(K > 0);
+
+A = 0;
+
+if (N <= K)
+return 1;
+
+const int ideal_num_parts = N / K;
+if (ideal_num_parts * K == N)
+return ideal_num_parts;
+
+const int num_parts = ideal_num_parts + 1;
+const int nominal_part_size = N / num_parts;
+
+A = N - num_parts * nominal_part_size;
+
+return num_parts;
+}
+
+} // anonymous namespace
+
 bool ScFormulaCell::InterpretFormulaGroup()
 {
 if (!officecfg::Office::Common::Misc::UseOpenCL::get())
@@ -3805,30 +3837,94 @@ bool ScFormulaCell::InterpretFormulaGroup()
 if (mxGroup->mbInvariant && false)
 return InterpretInvariantFormulaGroup();
 
-ScTokenArray aCode;
-ScAddress aTopPos = aPos;
-aTopPos.SetRow(mxGroup->mpTopCell->aPos.Row());
-ScGroupTokenConverter aConverter(aCode, *pDocument, *this, 
mxGroup->mpTopCell->aPos);
-std::vector aLoopControl;
-if (!aConverter.convert(*pCode, aLoopControl))
-{
-SAL_INFO("sc.opencl", "conversion of group " << this << " failed, 
disabling");
-mxGroup->meCalcState = sc::GroupCalcDisabled;
-return false;
-}
+int nMaxGroupLength = INT_MAX;
+
+#ifdef WNT
+// Heuristic: Certain old low-end 

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

2015-09-16 Thread Eike Rathke
 sc/inc/sharedformula.hxx  |3 ++-
 sc/source/core/data/column.cxx|8 
 sc/source/core/data/column3.cxx   |8 
 sc/source/core/tool/sharedformula.cxx |   15 +++
 4 files changed, 21 insertions(+), 13 deletions(-)

New commits:
commit e4a8ae0bf54476e9a0c9e1f5348c05f3cd838899
Author: Eike Rathke 
Date:   Wed Sep 16 12:38:06 2015 +0200

Resolves: tdf#94249 do not remove broadcasters while iterators are in use

EndListeningContext holds BroadcasterStoreType iterators in its
ColumnBlockPositionSet and collects broadcasters to purge them at the
end. Removing broadcasters from ScColumn::maBroadcasters in between
invalidates the iterators. Hence calling the "normal" EndListening()
that removes a broadcaster when all listeners are gone while an
EndListeningContext is in use is bad.

Change-Id: Ibdd88469e91e6173ceff1f391c23ef7cb7c6f596

diff --git a/sc/inc/sharedformula.hxx b/sc/inc/sharedformula.hxx
index e4b25bb..33a2d48 100644
--- a/sc/inc/sharedformula.hxx
+++ b/sc/inc/sharedformula.hxx
@@ -64,8 +64,9 @@ public:
  * specified position is not a formula cell.
  *
  * @param aPos position of cell to examine.
+ * @param pCxt context to be used, if any, may be nullptr.
  */
-static void splitFormulaCellGroup(const CellStoreType::position_type& 
aPos);
+static void splitFormulaCellGroup(const CellStoreType::position_type& 
aPos, sc::EndListeningContext* pCxt);
 
 /**
  * Split existing shared formula ranges at specified row positions.
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index c7d71e3..7b1e410 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1908,15 +1908,15 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, 
ScColumn& rCol)
 
 // Split the formula grouping at the top and bottom boundaries.
 sc::CellStoreType::position_type aPos = maCells.position(nStartRow);
-sc::SharedFormulaUtil::splitFormulaCellGroup(aPos);
+sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr);
 aPos = maCells.position(aPos.first, nEndRow+1);
-sc::SharedFormulaUtil::splitFormulaCellGroup(aPos);
+sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr);
 
 // Do the same with the destination column.
 aPos = rCol.maCells.position(nStartRow);
-sc::SharedFormulaUtil::splitFormulaCellGroup(aPos);
+sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr);
 aPos = rCol.maCells.position(aPos.first, nEndRow+1);
-sc::SharedFormulaUtil::splitFormulaCellGroup(aPos);
+sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr);
 
 // Move the broadcasters to the destination column.
 maBroadcasters.transfer(nStartRow, nEndRow, rCol.maBroadcasters, 
nStartRow);
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 0bcc206..c39c295 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -327,13 +327,13 @@ void ScColumn::DetachFormulaCells(
 const sc::CellStoreType::position_type& aPos, size_t nLength )
 {
 // Split formula grouping at the top and bottom boundaries.
-sc::SharedFormulaUtil::splitFormulaCellGroup(aPos);
+sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr);
 size_t nRow = aPos.first->position + aPos.second;
 size_t nNextTopRow = nRow + nLength; // start row of next formula group.
 if (ValidRow(nNextTopRow))
 {
 sc::CellStoreType::position_type aPos2 = maCells.position(aPos.first, 
nNextTopRow);
-sc::SharedFormulaUtil::splitFormulaCellGroup(aPos2);
+sc::SharedFormulaUtil::splitFormulaCellGroup(aPos2, nullptr);
 }
 
 if (pDocument->IsClipOrUndo())
@@ -368,11 +368,11 @@ void ScColumn::DetachFormulaCells( 
sc::EndListeningContext& rCxt, SCROW nRow1, S
 sc::CellStoreType::iterator it = aPos.first;
 
 // Split formula grouping at the top and bottom boundaries.
-sc::SharedFormulaUtil::splitFormulaCellGroup(aPos);
+sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, &rCxt);
 if (ValidRow(nRow2+1))
 {
 aPos = maCells.position(it, nRow2+1);
-sc::SharedFormulaUtil::splitFormulaCellGroup(aPos);
+sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, &rCxt);
 }
 
 if (pDocument->IsClipOrUndo())
diff --git a/sc/source/core/tool/sharedformula.cxx 
b/sc/source/core/tool/sharedformula.cxx
index a3fd1ae..8e84ac0 100644
--- a/sc/source/core/tool/sharedformula.cxx
+++ b/sc/source/core/tool/sharedformula.cxx
@@ -16,7 +16,7 @@
 
 namespace sc {
 
-void SharedFormulaUtil::splitFormulaCellGroup(const 
CellStoreType::position_type& aPos)
+void SharedFormulaUtil::splitFormulaCellGroup(const 
CellStoreType::position_type& aPos, sc::EndListeningContext* pCxt)
 {
 SCROW nRow = aPos.first->position + aPos.second;
 
@@ -61,7 +61,14 @@ void SharedFormulaUtil::splitFormulaCellGroup(const 
CellStoreType::posi

add libreoffice extension when "Save" LibreOffice Calc

2015-09-16 Thread Zhang, William
Hello Team,

I want to add an extension to do additional thing when saving LibreOffice Calc 
document.
Anyone who knows how to invoke the code when saving the document? Thanks a lot!

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


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - ucb/source

2015-09-16 Thread Stephan Bergmann
 ucb/source/ucp/gio/gio_content.cxx |7 ---
 ucb/source/ucp/gio/gio_inputstream.cxx |   25 ++---
 ucb/source/ucp/gio/gio_inputstream.hxx |   16 +++-
 3 files changed, 13 insertions(+), 35 deletions(-)

New commits:
commit 3c5292e95a26ddc56741c25908df5fef85b42037
Author: Stephan Bergmann 
Date:   Wed Sep 16 10:17:56 2015 +0200

Related rhbz#1259746: Buffer file content read from GIO UCP

...for one, this avoids sending seek requests down the GIO/GVFS stack, 
which can
silently fail with corrupt data read from certain broken servers for current
versions of the GIO/GVFS stack; for another, it should considerably speed up
loading documents via the GIO UCP, as LO's document type detection is 
notorious
for issuing lots of seek and (small-chunk and/or re-) read operations on a 
file.

(This issue has become more relevant after
51e0d789c344547956764c3b5f0ef5a304f4e0aa "rhbz#1134285: Access dav, davs 
URLs
via GVFS," where the old route via the WebDAV UCP was apparently not 
affected by
those broken servers, so happened to start affecting opening certain remote
files in LO via Nautilus.)

Change-Id: I91f91128b2d1a16f976eafeacf216a91747f4df1
(cherry picked from commit 93a0696e74e96e5a5ca821f33cb791b87e876f49)

diff --git a/ucb/source/ucp/gio/gio_content.cxx 
b/ucb/source/ucp/gio/gio_content.cxx
index 96c7c4b..6a432f8 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -59,6 +59,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -846,9 +847,9 @@ bool Content::feedSink( uno::Reference< uno::XInterface > 
xSink,
 if (!pStream)
convertToException(pError, static_cast< cppu::OWeakObject * >(this));
 
-uno::Reference< io::XInputStream > xIn = new ::gio::InputStream(pStream);
-if ( !xIn.is() )
-return false;
+uno::Reference< io::XInputStream > xIn(
+new comphelper::OSeekableInputWrapper(
+new ::gio::InputStream(pStream), m_xContext));
 
 if ( xOut.is() )
 copyData( xIn, xOut );
diff --git a/ucb/source/ucp/gio/gio_inputstream.cxx 
b/ucb/source/ucp/gio/gio_inputstream.cxx
index 6d11bc3..e2c19e1 100644
--- a/ucb/source/ucp/gio/gio_inputstream.cxx
+++ b/ucb/source/ucp/gio/gio_inputstream.cxx
@@ -29,7 +29,7 @@ using namespace com::sun::star;
 namespace gio
 {
 
-InputStream::InputStream(GFileInputStream *pStream) : 
Seekable(G_SEEKABLE(pStream)), mpStream(pStream)
+InputStream::InputStream(GFileInputStream *pStream): mpStream(pStream)
 {
 if (!mpStream)
 throw io::NotConnectedException();
@@ -57,16 +57,11 @@ void SAL_CALL InputStream::skipBytes( sal_Int32 
nBytesToSkip )
 throw( io::NotConnectedException, io::BufferSizeExceededException,
   io::IOException, uno::RuntimeException, std::exception )
 {
-if (!mpStream)
-throw io::NotConnectedException();
-
-if (!g_seekable_can_seek(G_SEEKABLE(mpStream)))
-throw io::IOException("Seek unsupported",
-static_cast< cppu::OWeakObject * >(this));
-
-GError *pError=NULL;
-if (!g_seekable_seek(G_SEEKABLE(mpStream), nBytesToSkip, G_SEEK_CUR, NULL, 
&pError))
-convertToIOException(pError, static_cast< cppu::OWeakObject * >(this));
+// Conservatively call readBytes and discard the read data, but given this
+// InputStream will always be wrapped in comphelper::OSeekableInputWrapper,
+// this function will never be called anyway:
+css::uno::Sequence data;
+readBytes(data, nBytesToSkip);
 }
 
 sal_Int32 SAL_CALL InputStream::readBytes( uno::Sequence< sal_Int8 >& aData, 
sal_Int32 nBytesToRead )
@@ -100,14 +95,6 @@ sal_Int32 SAL_CALL InputStream::readSomeBytes( 
uno::Sequence< sal_Int8 >& aData,
 return readBytes(aData, nMaxBytesToRead);
 }
 
-uno::Any InputStream::queryInterface( const uno::Type &type ) throw( 
uno::RuntimeException, std::exception )
-{
-uno::Any aRet = ::cppu::queryInterface ( type,
-static_cast< XInputStream * >( this ) );
-
-return aRet.hasValue() ? aRet : Seekable::queryInterface( type );
-}
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/gio/gio_inputstream.hxx 
b/ucb/source/ucp/gio/gio_inputstream.hxx
index bb821f2..24dea01 100644
--- a/ucb/source/ucp/gio/gio_inputstream.hxx
+++ b/ucb/source/ucp/gio/gio_inputstream.hxx
@@ -22,20 +22,16 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include 
-#include 
-#include 
 
-#include "gio_seekable.hxx"
+#include 
 
 namespace gio
 {
 
-class InputStream :
-public ::com::sun::star::io::XInputStream,
-public Seekable
+class InputStream: public cppu::WeakImplHelper
 {
 private:
 GFileInputStream *mpStream;
@@ -44,12 +40,6 @@ public:
 InputStream ( GFileInputStream *pStream );
 virtual ~InputStream();
 
-// XInterface
-virtual com::sun::star::uno::Any SAL_CALL queryInterface(const 
::com::sun::star::uno::Type & type )
-

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

2015-09-16 Thread Mihai Varga
 loleaflet/spec/loadtest/LoadTestSpec.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c164163a8c58f6cc877c0f47bfb7040750adc16a
Author: Mihai Varga 
Date:   Wed Sep 16 12:57:33 2015 +0300

loleaflet: load test update

diff --git a/loleaflet/spec/loadtest/LoadTestSpec.js 
b/loleaflet/spec/loadtest/LoadTestSpec.js
index 4c6efaf..e4e9984 100644
--- a/loleaflet/spec/loadtest/LoadTestSpec.js
+++ b/loleaflet/spec/loadtest/LoadTestSpec.js
@@ -57,7 +57,7 @@ describe('LoadTest', function () {
});
map.scrollTop(y / 2);
checkTimeOut = setTimeout(function () {
-   
expect(map._docLayer._emptyTilesCount).to.eql(1);
+   
expect(map._docLayer._emptyTilesCount).to.eql(0);
done();
}, 2000);
});
@@ -71,7 +71,7 @@ describe('LoadTest', function () {
});
map.scrollTop(y);
checkTimeOut = setTimeout(function () {
-   
expect(map._docLayer._emptyTilesCount).to.eql(1);
+   
expect(map._docLayer._emptyTilesCount).to.eql(0);
done();
}, 2000);
});
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Mihai Varga
 loleaflet/spec/loadtest/LoadTestSpec.js |   13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 12b1bf2b6ed25250ea162df752b3b2bddc753357
Author: Mihai Varga 
Date:   Wed Sep 16 12:51:16 2015 +0300

loleaflet: loadtest.html fix

diff --git a/loleaflet/spec/loadtest/LoadTestSpec.js 
b/loleaflet/spec/loadtest/LoadTestSpec.js
index 7d8c811..4c6efaf 100644
--- a/loleaflet/spec/loadtest/LoadTestSpec.js
+++ b/loleaflet/spec/loadtest/LoadTestSpec.js
@@ -11,17 +11,14 @@ describe('LoadTest', function () {
x = 0,
y = 0;
 
+   var docPath = '';
before(function() {
-   if (docPath === 'file:///PATH') {
-   throw new Error('Document file path not set');
-   }
-   else if (docPath[docPath.length - 1] !== '/') {
-   docPath += '/';
-   }
+   var htmlPath = window.location.pathname;
+   var dir = htmlPath.substring(0, htmlPath.lastIndexOf('/'));
+   docPath = 'file://' + dir + '/data/';
});
 
-   var docPath = 'file:///PATH';
-   var docs = ['eval.odt'];
+   var docs = ['eval.odt', 'eval.odp', 'eval.ods', 'eval.odg'];
 
docs.forEach(function (testDoc) {
testsRan += 1;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/opengl vcl/source vcl/unx vcl/win

2015-09-16 Thread Michael Meeks
 include/vcl/outdev.hxx |   18 --
 vcl/inc/generic/genpspgraphics.h   |3 --
 vcl/inc/headless/svpgdi.hxx|3 --
 vcl/inc/openglgdiimpl.hxx  |3 --
 vcl/inc/quartz/salgdi.h|3 --
 vcl/inc/salgdi.hxx |3 --
 vcl/inc/salgdiimpl.hxx |4 +--
 vcl/inc/unx/salgdi.h   |3 --
 vcl/inc/win/salgdi.h   |3 --
 vcl/opengl/gdiimpl.cxx |   28 --
 vcl/source/opengl/OpenGLHelper.cxx |   46 -
 vcl/source/outdev/outdev.cxx   |   12 -
 vcl/source/window/paint.cxx|   16 +++-
 vcl/unx/generic/gdi/gdiimpl.hxx|3 --
 vcl/unx/generic/gdi/salgdi.cxx |7 -
 vcl/win/source/gdi/gdiimpl.hxx |3 --
 vcl/win/source/gdi/salgdi.cxx  |7 -
 17 files changed, 77 insertions(+), 88 deletions(-)

New commits:
commit bfceb557efcd607ef018ae35fc73f8d61a9b9a4e
Author: Michael Meeks 
Date:   Wed Sep 16 09:17:37 2015 +0100

GL paint-flushing guard re-work.

Unfortunately, since we can have 2x SalGraphics' on a OutputDevice,
and one of these can be a printer - things got very confused around
which context to glFlush. This de-tangles the various reference-counts.

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

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index c8ba06a..20bd81a 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -606,9 +606,21 @@ public:
 const Point& rSrcPt,  const Size& rSrcSize,
 bool bWindowInvalidate = false );
 
-// Call before and after a paint operation to reduce flushing
-voidBeginPaint();
-voidEndPaint();
+/**
+ * Instantiate across a paint operation to defer flushing
+ * to the end.
+ *
+ * NB. holding a handle avoids problems with
+ * the underlying SalGraphics and it's implementation
+ * changing.
+ */
+class PaintScope {
+void *pHandle;
+public:
+PaintScope(OutputDevice *);
+~PaintScope();
+void flush();
+};
 
 protected:
 
diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h
index baa6b1d..68bc0fb 100644
--- a/vcl/inc/generic/genpspgraphics.h
+++ b/vcl/inc/generic/genpspgraphics.h
@@ -214,9 +214,6 @@ public:
 
 virtual SystemFontData  GetSysFontData( int nFallbacklevel ) const 
SAL_OVERRIDE;
 #endif // ENABLE_CAIRO_CANVAS
-
-virtual void BeginPaint() SAL_OVERRIDE { };
-virtual void EndPaint() SAL_OVERRIDE { };
 };
 
 #endif // INCLUDED_VCL_INC_GENERIC_GENPSPGRAPHICS_H
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 0903d6e..6e98ff3 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -212,9 +212,6 @@ public:
 voidclipRegion(cairo_t* cr);
 
 #endif // ENABLE_CAIRO_CANVAS
-
-virtual voidBeginPaint() SAL_OVERRIDE { };
-virtual voidEndPaint() SAL_OVERRIDE { };
 };
 
 #endif
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index 71a9e80..e3bec44 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -320,8 +320,7 @@ public:
 
 virtual bool drawGradient(const tools::PolyPolygon& rPolygon, const 
Gradient& rGradient) SAL_OVERRIDE;
 
-virtual void beginPaint() SAL_OVERRIDE;
-virtual void endPaint() SAL_OVERRIDE;
+virtual OpenGLContext *beginPaint() SAL_OVERRIDE;
 private:
 };
 
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 72cd424..98ebd87 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -413,9 +413,6 @@ public:
 virtual SystemGraphicsData
 GetGraphicsData() const SAL_OVERRIDE;
 
-virtual voidBeginPaint() SAL_OVERRIDE { };
-virtual voidEndPaint() SAL_OVERRIDE { };
-
 private:
 // differences between VCL, Quartz and kHiThemeOrientation coordinate 
systems
 // make some graphics seem to be vertically-mirrored from a VCL perspective
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index 0334049..0c284bd3 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -438,8 +438,7 @@ public:
 sal_uInt8 nTransparency,
 const OutputDevice *pOutDev );
 
-virtual voidBeginPaint() = 0;
-virtual voidEndPaint() = 0;
+virtual OpenGLContext  *BeginPaint() { return NULL; }
 
 virtual SystemGraphicsData  GetGraphicsData() const = 0;
 
diff --git a/vcl/inc/salgdiimpl.hxx b/vcl/inc/salgdiimpl.hxx
index 15dd11b..86575a4 100644
--- a/vcl/inc/salgdiimpl.hxx
+++ b/vcl/inc/salg

[Libreoffice-commits] core.git: Branch 'feature/fixes10' - include/vcl slideshow/source vcl/inc vcl/opengl vcl/source vcl/unx vcl/win

2015-09-16 Thread Michael Meeks
 include/vcl/outdev.hxx |   18 
+++
 slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx |2 
 vcl/inc/generic/genpspgraphics.h   |3 
 vcl/inc/headless/svpgdi.hxx|3 
 vcl/inc/openglgdiimpl.hxx  |3 
 vcl/inc/quartz/salgdi.h|3 
 vcl/inc/salgdi.hxx |3 
 vcl/inc/salgdiimpl.hxx |4 
 vcl/inc/unx/salgdi.h   |3 
 vcl/inc/win/salgdi.h   |3 
 vcl/opengl/gdiimpl.cxx |   37 
+++-
 vcl/opengl/win/gdiimpl.cxx |1 
 vcl/source/opengl/OpenGLHelper.cxx |   46 
+-
 vcl/source/outdev/outdev.cxx   |   12 
--
 vcl/source/window/paint.cxx|   16 
---
 vcl/unx/generic/gdi/gdiimpl.hxx|3 
 vcl/unx/generic/gdi/salgdi.cxx |7 -
 vcl/win/source/gdi/gdiimpl.hxx |3 
 vcl/win/source/gdi/salgdi.cxx  |7 -
 vcl/win/source/window/salframe.cxx |2 
 20 files changed, 90 insertions(+), 89 deletions(-)

New commits:
commit 60d91a56430f55128003f2a5331db5390fcd2663
Author: Michael Meeks 
Date:   Wed Sep 16 09:13:11 2015 +0100

Squash 4x patches for quicker testing.

tdf#94213 - cleanup associated GL contexts properly when DCs released.

Change-Id: I6b9fb899777d8e460999ac3ff038a1302e434bb5

tdf#94006 - need an explicit dispose for slideshow's GLContext.
Fixes crasher exiting slideshow.

Change-Id: I14b6a2c1abc946f590bf91cab19099753172fd95

tdf#94252 - avoid switching contexts un-necessarily to reduce flicker.

Change-Id: Id4ac387174fa03c5886a990d89fd53a4f18db11c

GL paint-flushing guard re-work.

Unfortunately, since we can have 2x SalGraphics' on a OutputDevice,
and one of these can be a printer - things got very confused around
which context to glFlush. This de-tangles the various reference-counts.

Change-Id: I1062be0b02a91fc9009deaa3ec29c5dbb227df20

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index f0057b3..dbd57e6 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -608,9 +608,21 @@ public:
 const Point& rSrcPt,  const Size& rSrcSize,
 bool bWindowInvalidate = false );
 
-// Call before and after a paint operation to reduce flushing
-voidBeginPaint();
-voidEndPaint();
+/**
+ * Instantiate across a paint operation to defer flushing
+ * to the end.
+ *
+ * NB. holding a handle avoids problems with
+ * the underlying SalGraphics and it's implementation
+ * changing.
+ */
+class PaintScope {
+void *pHandle;
+public:
+PaintScope(OutputDevice *);
+~PaintScope();
+void flush();
+};
 
 protected:
 
diff --git 
a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx 
b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index f468f87..e57ed70 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -1324,6 +1324,8 @@ void OGLTransitionerImpl::impl_dispose()
 {
 impl_finishTransition();
 disposeTextures();
+if( mpContext.is() )
+mpContext->dispose();
 mpContext.clear();
 }
 
diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h
index 8b78faa..2049e26 100644
--- a/vcl/inc/generic/genpspgraphics.h
+++ b/vcl/inc/generic/genpspgraphics.h
@@ -208,9 +208,6 @@ public:
 virtual css::uno::Any   GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& 
rSurface, const basegfx::B2ISize& rSize) const SAL_OVERRIDE;
 
 virtual SystemFontData  GetSysFontData( int nFallbacklevel ) const 
SAL_OVERRIDE;
-
-virtual void BeginPaint() SAL_OVERRIDE { };
-virtual void EndPaint() SAL_OVERRIDE { };
 };
 
 #endif // INCLUDED_VCL_INC_GENERIC_GENPSPGRAPHICS_H
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 9b8a25a..f4503e8 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -215,9 +215,6 @@ public:
 voidclipRegion(cairo_t* cr);
 
 #endif // ENABLE_CAIRO_CANVAS
-
-virtual void 

[Libreoffice-commits] online.git: Changes to 'distro/collabora/milestone-5'

2015-09-16 Thread Mihai Varga
New branch 'distro/collabora/milestone-5' available with the following commits:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/opengl vcl/win

2015-09-16 Thread Michael Meeks
 vcl/opengl/win/gdiimpl.cxx |1 +
 vcl/win/source/window/salframe.cxx |2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4af40495b7dcdac3add67c634dde75c896e370d9
Author: Michael Meeks 
Date:   Wed Sep 16 09:13:11 2015 +0100

tdf#94213 - cleanup associated GL contexts properly when DCs released.

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

diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 3ba2694..517cff1 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -57,6 +57,7 @@ void WinOpenGLSalGraphicsImpl::Init()
 // SalGraphics which share the same hWnd and hDC.
 // The shape 'Area' dialog does reparenting to trigger this.
 SAL_WARN("vcl.opengl", "Unusual: Windows handle / DC changed without 
DeInit");
+DeInit();
 }
 
 OpenGLSalGraphicsImpl::Init();
diff --git a/vcl/win/source/window/salframe.cxx 
b/vcl/win/source/window/salframe.cxx
index d2bb240..5cb863f 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -1046,7 +1046,7 @@ void WinSalFrame::ReleaseGraphics( SalGraphics* pGraphics 
)
 SalData* pSalData = GetSalData();
 if ( mpGraphics2->getDefPal() )
 SelectPalette( mpGraphics2->getHDC(), 
mpGraphics2->getDefPal(), TRUE );
-mpGraphics2->InitGraphics();
+mpGraphics2->DeInitGraphics();
 SendMessageW( pSalData->mpFirstInstance->mhComWnd,
  SAL_MSG_RELEASEDC,
  (WPARAM)mhWnd,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/fixes10' - sc/source

2015-09-16 Thread Tor Lillqvist
 sc/source/core/tool/calcconfig.cxx |   70 +++--
 1 file changed, 36 insertions(+), 34 deletions(-)

New commits:
commit 41931af38f27885670267c221f87852b64f19ffe
Author: Tor Lillqvist 
Date:   Wed Sep 16 12:03:19 2015 +0300

Use C++11 initializer list

Change-Id: Ibb46bfa9bf641a2c1a71bbd15d702520cb7a485b
(cherry picked from commit 18c092dd9ca752c88bcbab9ed5877c6a1e78b805)

diff --git a/sc/source/core/tool/calcconfig.cxx 
b/sc/source/core/tool/calcconfig.cxx
index 868ddd1..d5c1907 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -33,46 +33,48 @@ ScCalcConfig::ScCalcConfig() :
 
 void ScCalcConfig::setOpenCLConfigToDefault()
 {
+// Keep in order of opcode value, is that clearest? (Random order,
+// at least, would make no sense at all.)
+static const OpCodeSet aDefaultOpenCLSubsetOpCodes {
+ocAdd,
+ocSub,
+ocMul,
+ocDiv,
+ocRandom,
+ocSin,
+ocCos,
+ocTan,
+ocArcTan,
+ocExp,
+ocLn,
+ocSqrt,
+ocStdNormDist,
+ocSNormInv,
+ocRound,
+ocPower,
+ocSumProduct,
+ocMin,
+ocMax,
+ocSum,
+ocProduct,
+ocAverage,
+ocCount,
+ocVar,
+ocNormDist,
+ocVLookup,
+ocCorrel,
+ocCovar,
+ocPearson,
+ocSlope,
+ocSumIfs};
+
 // Note that these defaults better be kept in sync with those in
 // officecfg/registry/schema/org/openoffice/Office/Calc.xcs.
 // Crazy.
 mbOpenCLSubsetOnly = true;
 mbOpenCLAutoSelect = true;
 mnOpenCLMinimumFormulaGroupSize = 100;
-
-// Keep in order of opcode value, is that clearest? (Random order,
-// at least, would make no sense at all.)
-maOpenCLSubsetOpCodes.insert(ocAdd);
-maOpenCLSubsetOpCodes.insert(ocSub);
-maOpenCLSubsetOpCodes.insert(ocMul);
-maOpenCLSubsetOpCodes.insert(ocDiv);
-maOpenCLSubsetOpCodes.insert(ocRandom);
-maOpenCLSubsetOpCodes.insert(ocSin);
-maOpenCLSubsetOpCodes.insert(ocCos);
-maOpenCLSubsetOpCodes.insert(ocTan);
-maOpenCLSubsetOpCodes.insert(ocArcTan);
-maOpenCLSubsetOpCodes.insert(ocExp);
-maOpenCLSubsetOpCodes.insert(ocLn);
-maOpenCLSubsetOpCodes.insert(ocSqrt);
-maOpenCLSubsetOpCodes.insert(ocStdNormDist);
-maOpenCLSubsetOpCodes.insert(ocSNormInv);
-maOpenCLSubsetOpCodes.insert(ocRound);
-maOpenCLSubsetOpCodes.insert(ocPower);
-maOpenCLSubsetOpCodes.insert(ocSumProduct);
-maOpenCLSubsetOpCodes.insert(ocMin);
-maOpenCLSubsetOpCodes.insert(ocMax);
-maOpenCLSubsetOpCodes.insert(ocSum);
-maOpenCLSubsetOpCodes.insert(ocProduct);
-maOpenCLSubsetOpCodes.insert(ocAverage);
-maOpenCLSubsetOpCodes.insert(ocCount);
-maOpenCLSubsetOpCodes.insert(ocVar);
-maOpenCLSubsetOpCodes.insert(ocNormDist);
-maOpenCLSubsetOpCodes.insert(ocVLookup);
-maOpenCLSubsetOpCodes.insert(ocCorrel);
-maOpenCLSubsetOpCodes.insert(ocCovar);
-maOpenCLSubsetOpCodes.insert(ocPearson);
-maOpenCLSubsetOpCodes.insert(ocSlope);
-maOpenCLSubsetOpCodes.insert(ocSumIfs);
+maOpenCLSubsetOpCodes = aDefaultOpenCLSubsetOpCodes;
 }
 
 void ScCalcConfig::reset()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Mihai Varga
 loleaflet/src/control/Control.Fonts.js |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 7d43fbeaa5f3905a4b64063e0b836d84a4c862da
Author: Mihai Varga 
Date:   Wed Sep 16 12:05:25 2015 +0300

loleaflet: empty font size when selecting multiple font sizes

diff --git a/loleaflet/src/control/Control.Fonts.js 
b/loleaflet/src/control/Control.Fonts.js
index 2c6944e..96c0104 100644
--- a/loleaflet/src/control/Control.Fonts.js
+++ b/loleaflet/src/control/Control.Fonts.js
@@ -126,6 +126,9 @@ L.Control.Fonts = L.Control.extend({
this._fontSelect.value = e.state;
}
else if (e.commandName === '.uno:FontHeight') {
+   if (e.state === '0') {
+   e.state = '';
+   }
this._setFontSize(e.state);
}
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Tor Lillqvist
 sc/source/core/tool/calcconfig.cxx |   70 +++--
 1 file changed, 36 insertions(+), 34 deletions(-)

New commits:
commit 18c092dd9ca752c88bcbab9ed5877c6a1e78b805
Author: Tor Lillqvist 
Date:   Wed Sep 16 12:03:19 2015 +0300

Use C++11 initializer list

Change-Id: Ibb46bfa9bf641a2c1a71bbd15d702520cb7a485b

diff --git a/sc/source/core/tool/calcconfig.cxx 
b/sc/source/core/tool/calcconfig.cxx
index 868ddd1..d5c1907 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -33,46 +33,48 @@ ScCalcConfig::ScCalcConfig() :
 
 void ScCalcConfig::setOpenCLConfigToDefault()
 {
+// Keep in order of opcode value, is that clearest? (Random order,
+// at least, would make no sense at all.)
+static const OpCodeSet aDefaultOpenCLSubsetOpCodes {
+ocAdd,
+ocSub,
+ocMul,
+ocDiv,
+ocRandom,
+ocSin,
+ocCos,
+ocTan,
+ocArcTan,
+ocExp,
+ocLn,
+ocSqrt,
+ocStdNormDist,
+ocSNormInv,
+ocRound,
+ocPower,
+ocSumProduct,
+ocMin,
+ocMax,
+ocSum,
+ocProduct,
+ocAverage,
+ocCount,
+ocVar,
+ocNormDist,
+ocVLookup,
+ocCorrel,
+ocCovar,
+ocPearson,
+ocSlope,
+ocSumIfs};
+
 // Note that these defaults better be kept in sync with those in
 // officecfg/registry/schema/org/openoffice/Office/Calc.xcs.
 // Crazy.
 mbOpenCLSubsetOnly = true;
 mbOpenCLAutoSelect = true;
 mnOpenCLMinimumFormulaGroupSize = 100;
-
-// Keep in order of opcode value, is that clearest? (Random order,
-// at least, would make no sense at all.)
-maOpenCLSubsetOpCodes.insert(ocAdd);
-maOpenCLSubsetOpCodes.insert(ocSub);
-maOpenCLSubsetOpCodes.insert(ocMul);
-maOpenCLSubsetOpCodes.insert(ocDiv);
-maOpenCLSubsetOpCodes.insert(ocRandom);
-maOpenCLSubsetOpCodes.insert(ocSin);
-maOpenCLSubsetOpCodes.insert(ocCos);
-maOpenCLSubsetOpCodes.insert(ocTan);
-maOpenCLSubsetOpCodes.insert(ocArcTan);
-maOpenCLSubsetOpCodes.insert(ocExp);
-maOpenCLSubsetOpCodes.insert(ocLn);
-maOpenCLSubsetOpCodes.insert(ocSqrt);
-maOpenCLSubsetOpCodes.insert(ocStdNormDist);
-maOpenCLSubsetOpCodes.insert(ocSNormInv);
-maOpenCLSubsetOpCodes.insert(ocRound);
-maOpenCLSubsetOpCodes.insert(ocPower);
-maOpenCLSubsetOpCodes.insert(ocSumProduct);
-maOpenCLSubsetOpCodes.insert(ocMin);
-maOpenCLSubsetOpCodes.insert(ocMax);
-maOpenCLSubsetOpCodes.insert(ocSum);
-maOpenCLSubsetOpCodes.insert(ocProduct);
-maOpenCLSubsetOpCodes.insert(ocAverage);
-maOpenCLSubsetOpCodes.insert(ocCount);
-maOpenCLSubsetOpCodes.insert(ocVar);
-maOpenCLSubsetOpCodes.insert(ocNormDist);
-maOpenCLSubsetOpCodes.insert(ocVLookup);
-maOpenCLSubsetOpCodes.insert(ocCorrel);
-maOpenCLSubsetOpCodes.insert(ocCovar);
-maOpenCLSubsetOpCodes.insert(ocPearson);
-maOpenCLSubsetOpCodes.insert(ocSlope);
-maOpenCLSubsetOpCodes.insert(ocSumIfs);
+maOpenCLSubsetOpCodes = aDefaultOpenCLSubsetOpCodes;
 }
 
 void ScCalcConfig::reset()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Mihai Varga
 loleaflet/src/control/Control.Fonts.js |   34 ++---
 loleaflet/src/layer/tile/TileLayer.js  |   13 ++--
 2 files changed, 30 insertions(+), 17 deletions(-)

New commits:
commit efaba387ad0dd296a4aee47539e982176c50f7bb
Author: Mihai Varga 
Date:   Wed Sep 16 11:57:11 2015 +0300

loleaflet: handle multiple a multiple font selection

diff --git a/loleaflet/src/control/Control.Fonts.js 
b/loleaflet/src/control/Control.Fonts.js
index 4695011..2c6944e 100644
--- a/loleaflet/src/control/Control.Fonts.js
+++ b/loleaflet/src/control/Control.Fonts.js
@@ -79,6 +79,7 @@ L.Control.Fonts = L.Control.extend({
 
_updateSizeList: function (font) {
var container = this._sizeSelect;
+   var oldSize = this._sizeSelect.value;
for (var i = container.options.length - 1; i >= 0; i--) {
container.remove(i);
}
@@ -90,6 +91,22 @@ L.Control.Fonts = L.Control.extend({
item.value = size;
item.innerHTML = size;
});
+   this._setFontSize(oldSize);
+   },
+
+   _setFontSize: function (fontSize) {
+   for (i = 0; i < this._sizeSelect.length; i++) {
+   var value = this._sizeSelect[i].value;
+   if (value === fontSize) {
+   this._sizeSelect.value = fontSize;
+   return;
+   }
+   }
+   // we have a new font size, like 18.2
+   var item = L.DomUtil.create('option', '', this._sizeSelect);
+   item.value = fontSize;
+   item.innerHTML = fontSize;
+   this._sizeSelect.value = fontSize;
},
 
_onStateChange: function (e) {
@@ -99,22 +116,17 @@ L.Control.Fonts = L.Control.extend({
if (value && value.toLowerCase() === 
e.state.toLowerCase()) {
this._fontSelect.value = value;
this._updateSizeList(value);
-   }
-   }
-   }
-   else if (e.commandName === '.uno:FontHeight') {
-   for (i = 0; i < this._sizeSelect.length; i++) {
-   var value = this._sizeSelect[i].value;
-   if (value === e.state) {
-   this._sizeSelect.value = e.state;
return;
}
}
-   // we have a new font size, like 18.2
-   var item = L.DomUtil.create('option', '', 
this._sizeSelect);
+   // we have a new font name
+   var item = L.DomUtil.create('option', '', 
this._fontSelect);
item.value = e.state;
item.innerHTML = e.state;
-   this._sizeSelect.value = e.state;
+   this._fontSelect.value = e.state;
+   }
+   else if (e.commandName === '.uno:FontHeight') {
+   this._setFontSize(e.state);
}
}
 });
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index a78dc23..71d5b77 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -300,14 +300,15 @@ L.TileLayer = L.GridLayer.extend({
 
_onStateChangedMsg: function (textMsg) {
var unoMsg = textMsg.substr(14).split('=');
-   if (unoMsg.length < 2) {
-   return;
+   var commandName = '',
+   state = '';
+   if (unoMsg.length > 0) {
+   commandName = unoMsg[0];
}
-   var commandName = unoMsg[0];
-   var state = unoMsg[1];
-   if (commandName && state) {
-   this._map.fire('commandstatechanged', {commandName : 
commandName, state : state});
+   if (unoMsg.length > 1) {
+   state = unoMsg[1];
}
+   this._map.fire('commandstatechanged', {commandName : 
commandName, state : state});
},
 
_onStatusIndicatorMsg: function (textMsg) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Niklas Johansson
 sw/source/core/access/accportions.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 64bf04de183a63d32fddf9376307b7f991a4519a
Author: Niklas Johansson 
Date:   Tue Sep 8 08:38:48 2015 +0200

tdf#93139 Orca Screen Reader does not read bullet

To make Orca read bullet lists lets not suppress it
from the accessible text. This has a downside on Windows
when using NVDA which due to a hack in NVDA now reads
the bullet twice. This hack is done because of this
bug so I think we should fix it.

Change-Id: Ibc11c1e0545f8cde4cd3d4a0d665ea47d645a61d
Reviewed-on: https://gerrit.libreoffice.org/18398
Tested-by: Jenkins 
Reviewed-by: Jacobo Aragunde Pérez 

diff --git a/sw/source/core/access/accportions.cxx 
b/sw/source/core/access/accportions.cxx
index 9713574..c0a6073 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -154,7 +154,6 @@ void SwAccessiblePortionData::Special(
 sDisplay = OUString(sal_Unicode(0xfffc));
 break;
 case POR_GRFNUM:
-case POR_BULLET:
 break;
 case POR_FLD:
 case POR_HIDDEN:
@@ -180,6 +179,7 @@ void SwAccessiblePortionData::Special(
 }
 break;
 case POR_NUMBER:
+case POR_BULLET:
 {
 sDisplay = rText + " ";
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Andras Timar
 setup_native/source/packinfo/packinfo_office.txt |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 036741bc209a620f05a4fd45461d717f801056c2
Author: Andras Timar 
Date:   Wed Sep 16 10:35:21 2015 +0200

cp#1000138 obsolete the kde integration package, which we don't build any 
more

Change-Id: Ifab30a0af8b9cca342b3d392c14c30beb4c18b25

diff --git a/setup_native/source/packinfo/packinfo_office.txt 
b/setup_native/source/packinfo/packinfo_office.txt
index c17c4c7..f908cd2 100644
--- a/setup_native/source/packinfo/packinfo_office.txt
+++ b/setup_native/source/packinfo/packinfo_office.txt
@@ -84,7 +84,7 @@ Start
 module = "gid_Module_Root"
 solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core"
 packagename = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core"
-linuxreplaces = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core01, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core02, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core03, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core04, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core05, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core06, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core07"
+linuxreplaces = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core01, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core02, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core03, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core04, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core05, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core06, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-core07, 
%BASISPACKAGEPREFIX%PRODUCTVERSION-kde-integration"
 requires = "%UREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure %PACKAGEVERSION 
%PACKAGEVERSION-%PACKAGEREVISION"
 solarisrequires = "SUNWcar, SUNWkvm, SUNWcsr, SUNWcsu, SUNWcsd, SUNWcsl, 
SUNWxwrtl, SUNWxwplt, SUNWlibC, %SOLSUREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure"
 freebsdrequires = ""
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Stephan Bergmann
 ucb/source/ucp/gio/gio_content.cxx |7 ---
 ucb/source/ucp/gio/gio_inputstream.cxx |   25 ++---
 ucb/source/ucp/gio/gio_inputstream.hxx |   16 +++-
 3 files changed, 13 insertions(+), 35 deletions(-)

New commits:
commit 93a0696e74e96e5a5ca821f33cb791b87e876f49
Author: Stephan Bergmann 
Date:   Wed Sep 16 10:17:56 2015 +0200

Related rhbz#1259746: Buffer file content read from GIO UCP

...for one, this avoids sending seek requests down the GIO/GVFS stack, 
which can
silently fail with corrupt data read from certain broken servers for current
versions of the GIO/GVFS stack; for another, it should considerably speed up
loading documents via the GIO UCP, as LO's document type detection is 
notorious
for issuing lots of seek and (small-chunk and/or re-) read operations on a 
file.

(This issue has become more relevant after
51e0d789c344547956764c3b5f0ef5a304f4e0aa "rhbz#1134285: Access dav, davs 
URLs
via GVFS," where the old route via the WebDAV UCP was apparently not 
affected by
those broken servers, so happened to start affecting opening certain remote
files in LO via Nautilus.)

Change-Id: I91f91128b2d1a16f976eafeacf216a91747f4df1

diff --git a/ucb/source/ucp/gio/gio_content.cxx 
b/ucb/source/ucp/gio/gio_content.cxx
index 83b07fc..70f7fd1 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -59,6 +59,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -846,9 +847,9 @@ bool Content::feedSink( uno::Reference< uno::XInterface > 
xSink,
 if (!pStream)
convertToException(pError, static_cast< cppu::OWeakObject * >(this));
 
-uno::Reference< io::XInputStream > xIn = new ::gio::InputStream(pStream);
-if ( !xIn.is() )
-return false;
+uno::Reference< io::XInputStream > xIn(
+new comphelper::OSeekableInputWrapper(
+new ::gio::InputStream(pStream), m_xContext));
 
 if ( xOut.is() )
 copyData( xIn, xOut );
diff --git a/ucb/source/ucp/gio/gio_inputstream.cxx 
b/ucb/source/ucp/gio/gio_inputstream.cxx
index 6d11bc3..e2c19e1 100644
--- a/ucb/source/ucp/gio/gio_inputstream.cxx
+++ b/ucb/source/ucp/gio/gio_inputstream.cxx
@@ -29,7 +29,7 @@ using namespace com::sun::star;
 namespace gio
 {
 
-InputStream::InputStream(GFileInputStream *pStream) : 
Seekable(G_SEEKABLE(pStream)), mpStream(pStream)
+InputStream::InputStream(GFileInputStream *pStream): mpStream(pStream)
 {
 if (!mpStream)
 throw io::NotConnectedException();
@@ -57,16 +57,11 @@ void SAL_CALL InputStream::skipBytes( sal_Int32 
nBytesToSkip )
 throw( io::NotConnectedException, io::BufferSizeExceededException,
   io::IOException, uno::RuntimeException, std::exception )
 {
-if (!mpStream)
-throw io::NotConnectedException();
-
-if (!g_seekable_can_seek(G_SEEKABLE(mpStream)))
-throw io::IOException("Seek unsupported",
-static_cast< cppu::OWeakObject * >(this));
-
-GError *pError=NULL;
-if (!g_seekable_seek(G_SEEKABLE(mpStream), nBytesToSkip, G_SEEK_CUR, NULL, 
&pError))
-convertToIOException(pError, static_cast< cppu::OWeakObject * >(this));
+// Conservatively call readBytes and discard the read data, but given this
+// InputStream will always be wrapped in comphelper::OSeekableInputWrapper,
+// this function will never be called anyway:
+css::uno::Sequence data;
+readBytes(data, nBytesToSkip);
 }
 
 sal_Int32 SAL_CALL InputStream::readBytes( uno::Sequence< sal_Int8 >& aData, 
sal_Int32 nBytesToRead )
@@ -100,14 +95,6 @@ sal_Int32 SAL_CALL InputStream::readSomeBytes( 
uno::Sequence< sal_Int8 >& aData,
 return readBytes(aData, nMaxBytesToRead);
 }
 
-uno::Any InputStream::queryInterface( const uno::Type &type ) throw( 
uno::RuntimeException, std::exception )
-{
-uno::Any aRet = ::cppu::queryInterface ( type,
-static_cast< XInputStream * >( this ) );
-
-return aRet.hasValue() ? aRet : Seekable::queryInterface( type );
-}
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/gio/gio_inputstream.hxx 
b/ucb/source/ucp/gio/gio_inputstream.hxx
index a37c2b8..709ae5d 100644
--- a/ucb/source/ucp/gio/gio_inputstream.hxx
+++ b/ucb/source/ucp/gio/gio_inputstream.hxx
@@ -22,20 +22,16 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include 
-#include 
-#include 
 
-#include "gio_seekable.hxx"
+#include 
 
 namespace gio
 {
 
-class InputStream :
-public ::com::sun::star::io::XInputStream,
-public Seekable
+class InputStream: public cppu::WeakImplHelper
 {
 private:
 GFileInputStream *mpStream;
@@ -44,12 +40,6 @@ public:
 explicit InputStream ( GFileInputStream *pStream );
 virtual ~InputStream();
 
-// XInterface
-virtual com::sun::star::uno::Any SAL_CALL queryInterface(const 
::com::sun::star::uno::Type & type )
-throw( ::com::sun::star::uno::RuntimeException, std::exc

[Libreoffice-commits] core.git: sw/uiconfig

2015-09-16 Thread Andras Timar
 sw/uiconfig/swriter/ui/documentfontspage.ui |   28 
 1 file changed, 28 deletions(-)

New commits:
commit ec237c94ca01ad4c497f79d69db91dcb0564ce77
Author: Andras Timar 
Date:   Wed Sep 16 08:39:10 2015 +0200

unused .ui file

Change-Id: I796be2353dc00c02746fb80fcc870dbddae397ff
Reviewed-on: https://gerrit.libreoffice.org/18603
Tested-by: Jenkins 
Reviewed-by: Andras Timar 

diff --git a/sw/uiconfig/swriter/ui/documentfontspage.ui 
b/sw/uiconfig/swriter/ui/documentfontspage.ui
deleted file mode 100644
index 67f2e80..000
--- a/sw/uiconfig/swriter/ui/documentfontspage.ui
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-  
-  
-True
-False
-6
-12
-18
-
-  
-_Embed fonts in the 
document
-True
-True
-False
-True
-0
-True
-  
-  
-0
-0
-1
-1
-  
-
-  
-
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Error when trying --enable-lto on Windows

2015-09-16 Thread Tor Lillqvist
>
>
> I could try see what happens if I also turn it on. (After all, if LTO
> worked, it would be used specifically in "production" builds, where
> mergedlibs is also used, so in case the error for some reason goes away
> when mergedlibs is used, fixing it would be only of academic interest.)
>

Perhaps not surprisingly, the (32-bit) link.exe (which in the LTO case
before linking also runs the compiler's code-generating phases) runs out of
memory, error C1002, when building mergedlo.dll.

Oh well, will try again once 64-bit builds (which as far as I know use a
toolchain that itself is 64-bit) are the norm.

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


[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - 7 commits - include/LibreOfficeKit libreofficekit/qa libreofficekit/source

2015-09-16 Thread Miklos Vajna
 include/LibreOfficeKit/LibreOfficeKitGtk.h  |2 
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |  256 +++-
 libreofficekit/source/gtk/lokdocview.cxx|  112 ++--
 3 files changed, 232 insertions(+), 138 deletions(-)

New commits:
commit d4c2efba8601f202376156438961f4ab0eb1dcbe
Author: Miklos Vajna 
Date:   Wed Sep 16 09:22:17 2015 +0200

gtktiledviewer: add setupWidgetAndCreateWindow() to avoid copy&paste

Change-Id: Ibbbaaa1c148cfd4578ad37e0f99b62ab885a1a83

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 74a4649..b16993b 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -79,6 +79,7 @@ static std::map g_aWindows;
 
 static void setupDocView(GtkWidget* pDocView);
 static GtkWidget* createWindow(TiledWindow& rWindow);
+static void openDocumentCallback (GObject* source_object, GAsyncResult* res, 
gpointer userdata);
 
 static TiledWindow& lcl_getTiledWindow(GtkWidget* pWidget)
 {
@@ -192,17 +193,34 @@ static void toggleFindbar(GtkWidget* pButton, gpointer 
/*pItem*/)
 }
 }
 
-/// Calls lok::Document::createView().
-static void createView(GtkWidget* pButton, gpointer /*pItem*/)
+/// Common initialization, regardless if it's just a new view or a full init.
+static void setupWidgetAndCreateWindow(GtkWidget* pDocView)
 {
-TiledWindow& rWindow = lcl_getTiledWindow(pButton);
-GtkWidget* pDocView = 
lok_doc_view_new_from_widget(LOK_DOC_VIEW(rWindow.m_pDocView));
 setupDocView(pDocView);
 TiledWindow aWindow;
 aWindow.m_pDocView = pDocView;
 createWindow(aWindow);
 }
 
+/// Creates a new view, i.e. no LOK init or document load.
+static void createView(GtkWidget* pButton, gpointer /*pItem*/)
+{
+TiledWindow& rWindow = lcl_getTiledWindow(pButton);
+GtkWidget* pDocView = 
lok_doc_view_new_from_widget(LOK_DOC_VIEW(rWindow.m_pDocView));
+
+setupWidgetAndCreateWindow(pDocView);
+}
+
+/// Creates a new model, i.e. LOK init and document load, one view implicitly.
+static void createModelAndView(const char* pLOPath, const char* pDocPath)
+{
+GtkWidget* pDocView = lok_doc_view_new(pLOPath, 0, 0);
+
+setupWidgetAndCreateWindow(pDocView);
+
+lok_doc_view_open_document(LOK_DOC_VIEW(pDocView), pDocPath, 0, 
openDocumentCallback, pDocView);
+}
+
 /// Our GtkClipboardGetFunc implementation for HTML.
 static void htmlGetFunc(GtkClipboard* /*pClipboard*/, GtkSelectionData* 
pSelectionData, guint /*info*/, gpointer pUserData)
 {
@@ -751,12 +769,7 @@ int main( int argc, char* argv[] )
 
 gtk_init( &argc, &argv );
 
-GtkWidget* pDocView = lok_doc_view_new(argv[1], NULL, NULL);
-setupDocView(pDocView);
-TiledWindow aWindow;
-aWindow.m_pDocView = pDocView;
-createWindow(aWindow);
-lok_doc_view_open_document(LOK_DOC_VIEW(pDocView), argv[2], NULL, 
openDocumentCallback, pDocView);
+createModelAndView(argv[1], argv[2]);
 
 gtk_main();
 
commit 5f8cdcec441093dd90d65cdbe72012d7a19a2dc7
Author: Miklos Vajna 
Date:   Tue Sep 15 15:41:46 2015 +0200

lokdocview: set up the widget in all windows

With this finally the number of GTK+ windows always match the number
returned by SfxLokHelper::getViews().

Change-Id: Ia45bef7dea86b80cfac00e2ad7c1a16d7f5b507b

diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index ff9b2cd..271625f 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1850,8 +1850,15 @@ lok_doc_view_new (const gchar* pPath, GCancellable 
*cancellable, GError **error)
 SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new_from_widget(LOKDocView* 
pLOKDocView)
 {
 LOKDocViewPrivate* priv = 
static_cast(lok_doc_view_get_instance_private(pLOKDocView));
-return GTK_WIDGET(g_initable_new(LOK_TYPE_DOC_VIEW, /*cancellable=*/0, 
/*error=*/0,
- "lopath", priv->m_aLOPath, "lopointer", 
priv->m_pOffice, "docpointer", priv->m_pDocument, NULL));
+GtkWidget* pDocView = GTK_WIDGET(g_initable_new(LOK_TYPE_DOC_VIEW, 
/*cancellable=*/0, /*error=*/0,
+"lopath", priv->m_aLOPath, 
"lopointer", priv->m_pOffice, "docpointer", priv->m_pDocument, NULL));
+
+// No documentLoad(), just a createView().
+LibreOfficeKitDocument* pDocument = 
lok_doc_view_get_document(LOK_DOC_VIEW(pDocView));
+pDocument->pClass->createView(pDocument);
+
+postDocumentLoad(pDocView);
+return pDocView;
 }
 
 /**
commit d6b6ccd16f11a6c0dac5aa94359fb53048eb6aef
Author: Miklos Vajna 
Date:   Tue Sep 15 15:36:51 2015 +0200

lokdocview: avoid GTK+ calls in openDocumentInThread()

GTK+ calls should be made from the main thread.

Change-Id: Idcfa46d427d6e35fc544246a691bafc72f75a74c

diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libre

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

2015-09-16 Thread Szymon Kłos
 vcl/unx/gtk/window/gtksalframe.cxx |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit fae0437caa6a1c51a0c4ab9595069fb8db890ea3
Author: Szymon Kłos 
Date:   Thu Jul 23 10:54:44 2015 +0200

Resolves: tdf#93778 fixed crash

While opening folders in SvtFileView using doubleclick,
sometimes GtkSalFrame::gestureLongPress method is
executed with a null frame pointer and LO crashes.
I noticed this only with remote dirs, probably this
bug occurs only when the doubleclick handler routine
takes a lot of time.

(cherry picked from commit db33c7853e12e9593a530ce2327e9662bcab1480)

Change-Id: I432046994b3e1662bd7e499681bd20e9696b2d52
Reviewed-on: https://gerrit.libreoffice.org/18572
Reviewed-by: Tomaž Vajngerl 
Reviewed-by: Michael Stahl 
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx 
b/vcl/unx/gtk/window/gtksalframe.cxx
index 7f8570e..347497c 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -3541,15 +3541,18 @@ void GtkSalFrame::gestureLongPress(GtkGestureLongPress* 
gesture, gpointer frame)
 {
 GtkSalFrame* pThis = static_cast(frame);
 
-SalLongPressEvent aEvent;
+if(pThis)
+{
+SalLongPressEvent aEvent;
 
-gdouble x, y;
-GdkEventSequence *sequence = 
gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture));
-gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y);
-aEvent.mnX = x;
-aEvent.mnY = y;
+gdouble x, y;
+GdkEventSequence *sequence = 
gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture));
+gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y);
+aEvent.mnX = x;
+aEvent.mnY = y;
 
-pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent);
+pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent);
+}
 }
 
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-2' - svtools/source

2015-09-16 Thread László Németh
 svtools/source/control/ruler.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 1bd52dd711cd4a563b08cc682ffa9d02b201e632
Author: László Németh 
Date:   Fri Sep 11 17:20:29 2015 +0200

tdf#92145: Writer table rows/columns can't be resized

with disabled rulers. (This fix was suggested by Tomaž Vajngerl.)

(Cherry-picked from the commit ed031895f6f5b3616811b53c6f2b9cfc3e23)

Conflicts:
svtools/source/control/ruler.cxx

Change-Id: I161237cdb4941c0eaf934223b078acd94d72e21d
Reviewed-on: https://gerrit.libreoffice.org/18507
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 00379a83cad8a016c54b3d90fef472a2ca6aeb96)
Reviewed-on: https://gerrit.libreoffice.org/18563
Reviewed-by: Jan Holesovsky 
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index d4b9374..2d4486c 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -2344,6 +2344,12 @@ bool Ruler::StartDocDrag( const MouseEvent& rMEvt, 
RulerType eDragType )
 // update ruler
 if ( mbFormat )
 {
+if (!IsReallyVisible())
+{
+// set mpData for ImplDocHitTest()
+ImplFormat(*this);
+}
+
 Invalidate(INVALIDATE_NOERASE);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-16 Thread Miklos Vajna
 sw/source/uibase/dbui/dbtree.cxx |   40 +++
 1 file changed, 20 insertions(+), 20 deletions(-)

New commits:
commit e7b9aa1b75eaca6f41b9c64f05c705de9769932a
Author: Miklos Vajna 
Date:   Wed Sep 16 09:06:30 2015 +0200

sw: prefix members of SwDBTreeList_Impl

Change-Id: Id828ffe75943c7f6e194b310486d51a068eead1c

diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index 290aa7f..cd48b83 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -72,13 +72,13 @@ typedef boost::ptr_vector SwConnectionArr;
 
 class SwDBTreeList_Impl : public cppu::WeakImplHelper < XContainerListener >
 {
-Reference< XDatabaseContext > xDBContext;
-SwConnectionArr aConnections;
-SwWrtShell* pWrtSh;
+Reference< XDatabaseContext > m_xDatabaseContext;
+SwConnectionArr m_aConnections;
+SwWrtShell* m_pWrtShell;
 
 public:
 explicit SwDBTreeList_Impl(SwWrtShell* pShell)
-: pWrtSh(pShell)
+: m_pWrtShell(pShell)
 {
 }
 virtual ~SwDBTreeList_Impl();
@@ -89,21 +89,21 @@ class SwDBTreeList_Impl : public cppu::WeakImplHelper < 
XContainerListener >
 virtual void SAL_CALL disposing( const EventObject& Source ) throw 
(RuntimeException, std::exception) SAL_OVERRIDE;
 
 boolHasContext();
-SwWrtShell* GetWrtShell() { return pWrtSh;}
-voidSetWrtShell(SwWrtShell& rSh) { pWrtSh = &rSh;}
-ReferenceGetContext() const {return xDBContext;}
+SwWrtShell* GetWrtShell() { return m_pWrtShell;}
+voidSetWrtShell(SwWrtShell& rSh) { m_pWrtShell = 
&rSh;}
+ReferenceGetContext() const {return 
m_xDatabaseContext;}
 Reference  GetConnection(const OUString& rSourceName);
 };
 
 SwDBTreeList_Impl::~SwDBTreeList_Impl()
 {
-if(xDBContext.is())
+if(m_xDatabaseContext.is())
 {
 m_refCount++;
 //block necessary due to solaris' compiler behaviour to
 //remove temporaries at the block's end
 {
-xDBContext->removeContainerListener( this );
+m_xDatabaseContext->removeContainerListener( this );
 }
 m_refCount--;
 }
@@ -119,11 +119,11 @@ void SwDBTreeList_Impl::elementRemoved( const 
ContainerEvent& rEvent ) throw (Ru
 SolarMutexGuard aGuard;
 OUString sSource;
 rEvent.Accessor >>= sSource;
-for(SwConnectionArr::iterator i = aConnections.begin(); i != 
aConnections.end(); ++i)
+for(SwConnectionArr::iterator i = m_aConnections.begin(); i != 
m_aConnections.end(); ++i)
 {
 if(i->sSourceName == sSource)
 {
-aConnections.erase(i);
+m_aConnections.erase(i);
 break;
 }
 }
@@ -131,7 +131,7 @@ void SwDBTreeList_Impl::elementRemoved( const 
ContainerEvent& rEvent ) throw (Ru
 
 void SwDBTreeList_Impl::disposing( const EventObject&  ) throw 
(RuntimeException, std::exception)
 {
-xDBContext = 0;
+m_xDatabaseContext = 0;
 }
 
 void SwDBTreeList_Impl::elementReplaced( const ContainerEvent& rEvent ) throw 
(RuntimeException, std::exception)
@@ -141,19 +141,19 @@ void SwDBTreeList_Impl::elementReplaced( const 
ContainerEvent& rEvent ) throw (R
 
 bool SwDBTreeList_Impl::HasContext()
 {
-if(!xDBContext.is())
+if(!m_xDatabaseContext.is())
 {
 Reference< XComponentContext > xContext( 
::comphelper::getProcessComponentContext() );
-xDBContext = DatabaseContext::create(xContext);
-xDBContext->addContainerListener( this );
+m_xDatabaseContext = DatabaseContext::create(xContext);
+m_xDatabaseContext->addContainerListener( this );
 }
-return xDBContext.is();
+return m_xDatabaseContext.is();
 }
 
 Reference  SwDBTreeList_Impl::GetConnection(const OUString& 
rSourceName)
 {
 Reference xRet;
-for(SwConnectionArr::const_iterator i = aConnections.begin(); i != 
aConnections.end(); ++i)
+for(SwConnectionArr::const_iterator i = m_aConnections.begin(); i != 
m_aConnections.end(); ++i)
 {
 if(i->sSourceName == rSourceName)
 {
@@ -161,12 +161,12 @@ Reference  
SwDBTreeList_Impl::GetConnection(const OUString& rSource
 break;
 }
 }
-if(!xRet.is() && xDBContext.is() && pWrtSh)
+if(!xRet.is() && m_xDatabaseContext.is() && m_pWrtShell)
 {
 SwConnectionData* pPtr = new SwConnectionData();
 pPtr->sSourceName = rSourceName;
-xRet = pWrtSh->GetDBManager()->RegisterConnection(pPtr->sSourceName);
-aConnections.push_back(pPtr);
+xRet = 
m_pWrtShell->GetDBManager()->RegisterConnection(pPtr->sSourceName);
+m_aConnections.push_back(pPtr);
 }
 return xRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/list