[Libreoffice-commits] core.git: 38 commits - android/source compilerplugins/clang connectivity/source dbaccess/source external/coinmp external/libetonyek external/libfreehand external/libmwaw external/libodfgen external/libwpd external/libwpg external/libwps external/libxslt external/redland framework/source include/LibreOfficeKit include/vcl libreofficekit/qa libreofficekit/source oox/source qadevOOo/tests RepositoryExternal.mk sc/qa sc/source sd/qa sfx2/source solenv/gbuild svtools/uiconfig sw/inc sw/source vcl/inc vcl/opengl vcl/qa vcl/source vcl/unx
Eike Rathke
erack at redhat.com
Fri Jun 12 11:42:14 PDT 2015
RepositoryExternal.mk | 2
android/source/res/layout/activity_document_browser.xml | 47 -
android/source/res/values/strings.xml | 3
android/source/src/java/org/libreoffice/storage/DocumentProviderFactory.java | 2
android/source/src/java/org/libreoffice/storage/local/LocalDocumentsDirectoryProvider.java | 3
android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java | 68 ++
compilerplugins/clang/vclwidgets.cxx | 19
connectivity/source/drivers/file/FResultSet.cxx | 124 ----
connectivity/source/drivers/file/FStatement.cxx | 5
connectivity/source/drivers/file/fanalyzer.cxx | 53 -
connectivity/source/inc/file/FResultSet.hxx | 5
connectivity/source/inc/file/FStatement.hxx | 2
connectivity/source/inc/file/fanalyzer.hxx | 4
dbaccess/source/ui/relationdesign/RelationTableView.cxx | 2
external/coinmp/ExternalProject_coinmp.mk | 3
external/coinmp/UnpackedTarball_coinmp.mk | 3
external/coinmp/rpath.patch | 50 +
external/libetonyek/ExternalProject_libetonyek.mk | 3
external/libetonyek/UnpackedTarball_libetonyek.mk | 1
external/libetonyek/rpath.patch | 10
external/libfreehand/UnpackedTarball_libfreehand.mk | 10
external/libfreehand/ubsan-visibility.patch | 11
external/libmwaw/ExternalProject_libmwaw.mk | 3
external/libmwaw/UnpackedTarball_libmwaw.mk | 6
external/libmwaw/rpath.patch | 10
external/libodfgen/ExternalProject_libodfgen.mk | 3
external/libodfgen/UnpackedTarball_libodfgen.mk | 6
external/libodfgen/rpath.patch | 10
external/libwpd/ExternalProject_libwpd.mk | 3
external/libwpd/UnpackedTarball_libwpd.mk | 3
external/libwpd/rpath.patch | 10
external/libwpg/ExternalProject_libwpg.mk | 3
external/libwpg/UnpackedTarball_libwpg.mk | 6
external/libwpg/rpath.patch | 10
external/libwps/ExternalProject_libwps.mk | 3
external/libwps/UnpackedTarball_libwps.mk | 1
external/libwps/rpath.patch.0 | 10
external/libxslt/UnpackedTarball_xslt.mk | 1
external/libxslt/rpath.patch.0 | 10
external/redland/UnpackedTarball_raptor.mk | 1
external/redland/UnpackedTarball_rasqal.mk | 3
external/redland/UnpackedTarball_redland.mk | 3
external/redland/raptor/rpath.patch | 21
external/redland/rasqal/rpath.patch | 21
external/redland/redland/rpath.patch | 10
framework/source/uifactory/uielementfactorymanager.cxx | 4
include/LibreOfficeKit/LibreOfficeKitGtk.h | 24
include/vcl/idle.hxx | 1
include/vcl/scheduler.hxx | 39 -
include/vcl/timer.hxx | 2
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 44 +
libreofficekit/source/gtk/lokdocview.cxx | 286 +++++-----
libreofficekit/source/gtk/tilebuffer.hxx | 2
oox/source/export/shapes.cxx | 3
qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java | 2
qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java | 2
sc/qa/unit/data/xlsx/matrix-multiplication.xlsx |binary
sc/qa/unit/subsequent_export-test.cxx | 31 +
sc/source/core/data/table3.cxx | 12
sc/source/core/tool/compiler.cxx | 2
sc/source/core/tool/token.cxx | 20
sc/source/filter/excel/xetable.cxx | 64 +-
sc/source/filter/oox/stylesbuffer.cxx | 9
sc/source/ui/src/scfuncs.src | 2
sd/qa/unit/data/tdf92001.odp |binary
sd/qa/unit/data/xml/tdf92001_0.xml | 44 +
sd/qa/unit/import-tests.cxx | 1
sfx2/source/appl/appinit.cxx | 2
solenv/gbuild/Helper.mk | 4
solenv/gbuild/platform/IOS_ARM_GCC.mk | 2
solenv/gbuild/platform/android.mk | 2
solenv/gbuild/platform/com_MSC_class.mk | 2
solenv/gbuild/platform/macosx.mk | 2
solenv/gbuild/platform/mingw.mk | 3
solenv/gbuild/platform/solaris.mk | 2
solenv/gbuild/platform/unxgcc.mk | 2
svtools/uiconfig/ui/graphicexport.ui | 64 --
sw/inc/swtypes.hxx | 7
sw/inc/viewsh.hxx | 7
sw/source/core/layout/pagechg.cxx | 1
sw/source/core/layout/paintfrm.cxx | 1
sw/source/core/txtnode/atrflyin.cxx | 21
sw/source/core/txtnode/thints.cxx | 39 -
sw/source/ui/envelp/labprt.cxx | 2
sw/source/uibase/docvw/FrameControlsManager.cxx | 59 +-
sw/source/uibase/docvw/HeaderFooterWin.cxx | 13
sw/source/uibase/docvw/PageBreakWin.cxx | 13
sw/source/uibase/docvw/edtwin.cxx | 11
sw/source/uibase/inc/FrameControl.hxx | 71 +-
sw/source/uibase/inc/HeaderFooterWin.hxx | 5
sw/source/uibase/inc/PageBreakWin.hxx | 8
sw/source/uibase/inc/edtwin.hxx | 8
sw/source/uibase/wrtsh/wrtsh1.cxx | 2
vcl/inc/opengl/x11/salvd.hxx | 3
vcl/inc/svdata.hxx | 2
vcl/opengl/x11/salvd.cxx | 7
vcl/qa/cppunit/lifecycle.cxx | 6
vcl/qa/cppunit/timer.cxx | 1
vcl/source/app/idle.cxx | 1
vcl/source/app/scheduler.cxx | 219 ++++---
vcl/source/app/svdata.cxx | 3
vcl/source/app/svmain.cxx | 3
vcl/source/app/timer.cxx | 11
vcl/source/opengl/OpenGLContext.cxx | 7
vcl/unx/generic/gdi/salvd.cxx | 6
vcl/unx/gtk/app/gtkinst.cxx | 9
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 28
107 files changed, 1134 insertions(+), 706 deletions(-)
New commits:
commit 15f18d1bb6e76ea934a461031b2784564f9d00c1
Author: Eike Rathke <erack at redhat.com>
Date: Fri Jun 12 18:28:26 2015 +0200
do not adjust RPN named expressions relative references, tdf#91842 follow-up
Change-Id: I5a991d3b86fec0a3800d8243f73eb764789c8c69
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index f814352..727a3d6 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -138,7 +138,25 @@ namespace
// Handle all tokens in RPN, and code tokens only if they have a
// reference count of 1, which means they are not referenced in
// RPN.
- return i == 0 && (*pp)->GetRef() > 1;
+ if (i == 0)
+ return (*pp)->GetRef() > 1;
+
+ // Skip (do not adjust) relative references resulting from named
+ // expressions.
+ switch ((*pp)->GetType())
+ {
+ case svSingleRef:
+ return (*pp)->GetSingleRef()->IsRelName();
+ case svDoubleRef:
+ {
+ const ScComplexRefData& rRef = *(*pp)->GetDoubleRef();
+ return rRef.Ref1.IsRelName() || rRef.Ref2.IsRelName();
+ }
+ default:
+ ; // nothing
+ }
+
+ return false;
}
};
commit d5cebdd22465d020e1c83223a416c0ffafedbbcc
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Jun 11 16:57:36 2015 +0100
Make SwFrameControlManager an EditWin ptr member to reduce re-compiles.
Change-Id: Ic2491948aa555fa71f9e14af554bdf204c12247d
Reviewed-on: https://gerrit.libreoffice.org/16236
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index b724fbd..33b7876 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -283,6 +283,13 @@ enum PrepareHint
PREP_END // END.
};
+enum FrameControlType
+{
+ PageBreak,
+ Header,
+ Footer
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 4d34d5a..cb7f1a3 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -85,13 +85,6 @@ namespace vcl
class OldStylePrintAdaptor;
}
-enum FrameControlType
-{
- PageBreak,
- Header,
- Footer
-};
-
// Define for flags needed in ctor or layers below.
// Currently the Preview flag is needed for DrawPage.
#define VSHELLFLAG_ISPREVIEW ((long)0x1)
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 4dd76a0..8a070d8 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -42,6 +42,7 @@
#include <IDocumentFieldsAccess.hxx>
#include "dcontact.hxx"
#include "hints.hxx"
+#include <FrameControlsManager.hxx>
#include "ftnidx.hxx"
#include "bodyfrm.hxx"
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 95493a1..9f1393d 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -70,6 +70,7 @@
#include <ndole.hxx>
#include <PostItMgr.hxx>
+#include <FrameControlsManager.hxx>
#include <vcl/settings.hxx>
#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index db26491..cbee466 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -22,6 +22,7 @@
#include <PageBreakWin.hxx>
#include <pagefrm.hxx>
#include <PostItMgr.hxx>
+#include <FrameControlsManager.hxx>
#include <uiitems.hxx>
#include <view.hxx>
#include <viewopt.hxx>
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 95e8b37..427faaf 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -143,6 +143,7 @@
#include <xmloff/odffields.hxx>
#include <PostItMgr.hxx>
+#include <FrameControlsManager.hxx>
#include <algorithm>
#include <vector>
@@ -4933,7 +4934,7 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView):
m_bObjectSelect(false),
m_nKS_NUMDOWN_Count(0),
m_nKS_NUMINDENTINC_Count(0),
- m_aFrameControlsManager( this )
+ m_pFrameControlsManager(new SwFrameControlsManager(this))
{
SetHelpId(HID_EDIT_WIN);
EnableChildTransparentMode();
@@ -4974,6 +4975,7 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView):
SwEditWin::~SwEditWin()
{
disposeOnce();
+ delete m_pFrameControlsManager;
}
void SwEditWin::dispose()
@@ -5000,7 +5002,7 @@ void SwEditWin::dispose()
delete m_pAnchorMarker;
m_pAnchorMarker = NULL;
- m_aFrameControlsManager.dispose();
+ m_pFrameControlsManager->dispose();
vcl::Window::dispose();
}
@@ -6305,4 +6307,9 @@ void SwEditWin::SetGraphicTwipPosition(bool bStart, const Point& rPosition)
}
}
+SwFrameControlsManager& SwEditWin::GetFrameControlsManager()
+{
+ return *m_pFrameControlsManager;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx
index ed65f1e..44eead6 100644
--- a/sw/source/uibase/inc/edtwin.hxx
+++ b/sw/source/uibase/inc/edtwin.hxx
@@ -19,8 +19,6 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_EDTWIN_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_EDTWIN_HXX
-#include <FrameControlsManager.hxx>
-
#include <sot/exchange.hxx>
#include <svx/svdobj.hxx>
#include <tools/link.hxx>
@@ -29,6 +27,7 @@
#include <vcl/window.hxx>
#include <svtools/transfer.hxx>
#include <swevent.hxx>
+#include <swtypes.hxx>
class SwWrtShell;
class SwView;
@@ -44,6 +43,7 @@ class SwPaM;
struct SwApplyTemplate;
struct QuickHelpData;
class SdrDropMarkerOverlay;
+class SwFrameControlsManager;
// input window
@@ -138,7 +138,7 @@ friend void PageNumNotify( SwViewShell* pVwSh,
sal_uInt16 m_nKS_NUMDOWN_Count; // #i23725#
sal_uInt16 m_nKS_NUMINDENTINC_Count;
- SwFrameControlsManager m_aFrameControlsManager;
+ SwFrameControlsManager *m_pFrameControlsManager;
void LeaveArea(const Point &);
void JustifyAreaTimer();
@@ -291,7 +291,7 @@ public:
*/
OUString ClipLongToolTip(const OUString& rText);
- SwFrameControlsManager& GetFrameControlsManager() { return m_aFrameControlsManager; }
+ SwFrameControlsManager& GetFrameControlsManager();
SwEditWin(vcl::Window *pParent, SwView &);
virtual ~SwEditWin();
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index dcf28a8..31315ec 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -102,6 +102,8 @@
#include <sfx2/viewfrm.hxx>
#include "PostItMgr.hxx"
+#include "FrameControlsManager.hxx"
+
#include <sfx2/msgpool.hxx>
#include <boost/scoped_ptr.hpp>
commit bf34b812a75add89a912df36761ec9dd77a479b0
Author: Noel Grandin <noel at peralex.com>
Date: Mon Jun 8 10:09:34 2015 +0100
New VclPtr clang plugin to catch potential problems.
Change-Id: I2571c4384e4c2dbe411e171325e10d57a0afe5a0
Reviewed-on: https://gerrit.libreoffice.org/16235
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx
index fd79241..7487fbf 100644
--- a/compilerplugins/clang/vclwidgets.cxx
+++ b/compilerplugins/clang/vclwidgets.cxx
@@ -46,6 +46,7 @@ public:
bool VisitCallExpr(const CallExpr *);
bool VisitDeclRefExpr(const DeclRefExpr* pDeclRefExpr);
+ bool VisitCXXConstructExpr( const CXXConstructExpr* expr );
private:
bool isDisposeCallingSuperclassDispose(const CXXMethodDecl* pMethodDecl);
bool mbCheckingMemcpy = false;
@@ -581,6 +582,24 @@ bool VCLWidgets::VisitDeclRefExpr(const DeclRefExpr* pDeclRefExpr)
return true;
}
+bool VCLWidgets::VisitCXXConstructExpr( const CXXConstructExpr* constructExpr )
+{
+ if (ignoreLocation(constructExpr)) {
+ return true;
+ }
+ if (constructExpr->getConstructionKind() != CXXConstructExpr::CK_Complete) {
+ return true;
+ }
+ const CXXConstructorDecl* pConstructorDecl = constructExpr->getConstructor();
+ const CXXRecordDecl* recordDecl = pConstructorDecl->getParent();
+ if (isDerivedFromWindow(recordDecl)) {
+ report(
+ DiagnosticsEngine::Warning,
+ "Calling constructor of a Window-derived type directly. All such creation should go via VclPtr<>::Create",
+ constructExpr->getExprLoc());
+ }
+ return true;
+}
loplugin::Plugin::Registration< VCLWidgets > X("vclwidgets");
commit 93da9ecd9de9a1d0ae3aafaded815ee179fb0f30
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Mon Jun 8 15:34:12 2015 +0100
Writer FrameControl lifecycle and management cleanup.
We can't derive from a VclPtr base-class, and also another base,
and then use boost::shared_ptr for that; re-factor to use a boost_ptr
to hold a VclPtr<> for now. Also fix leaking envelope dialog.
Change-Id: I2e1efbfaee3b6051e38ff7a14903a83ccd75136b
Reviewed-on: https://gerrit.libreoffice.org/16160
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index ae81bbe..59e3e06 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -91,7 +91,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
VclPtrInstance< PrinterSetupDialog > pDlg(this);
pDlg->SetPrinter(pPrinter);
pDlg->Execute();
- pDlg.reset();
+ pDlg.disposeAndClear();
GrabFocus();
m_pPrinterInfo->SetText(pPrinter->GetName());
return 0;
diff --git a/sw/source/uibase/docvw/FrameControlsManager.cxx b/sw/source/uibase/docvw/FrameControlsManager.cxx
index e168096..262388c 100644
--- a/sw/source/uibase/docvw/FrameControlsManager.cxx
+++ b/sw/source/uibase/docvw/FrameControlsManager.cxx
@@ -117,7 +117,9 @@ void SwFrameControlsManager::SetHeaderFooterControl( const SwPageFrm* pPageFrm,
pControl = lb->second;
else
{
- SwFrameControlPtr pNewControl( new SwHeaderFooterWin( m_pEditWin, pPageFrm, bHeader ) );
+ SwFrameControlPtr pNewControl(
+ new SwFrameControl( VclPtr<SwHeaderFooterWin>::Create(
+ m_pEditWin, pPageFrm, bHeader ).get() ) );
const SwViewOption* pViewOpt = m_pEditWin->GetView().GetWrtShell().GetViewOptions();
pNewControl->SetReadonly( pViewOpt->IsReadonly() );
rControls.insert(lb, make_pair(pPageFrm, pNewControl));
@@ -126,11 +128,12 @@ void SwFrameControlsManager::SetHeaderFooterControl( const SwPageFrm* pPageFrm,
Rectangle aPageRect = m_pEditWin->LogicToPixel( pPageFrm->Frm().SVRect() );
- SwHeaderFooterWin& rHFWin = dynamic_cast<SwHeaderFooterWin&>(*pControl.get());
- assert(rHFWin.IsHeader() == bHeader);
- rHFWin.SetOffset( aOffset, aPageRect.Left(), aPageRect.Right() );
+ SwHeaderFooterWin* pWin = dynamic_cast<SwHeaderFooterWin *>(pControl->GetWindow());
+ assert( pWin != NULL) ;
+ assert( pWin->IsHeader() == bHeader );
+ pWin->SetOffset( aOffset, aPageRect.Left(), aPageRect.Right() );
- if (!rHFWin.IsVisible())
+ if (!pWin->IsVisible())
pControl->ShowAll( true );
}
@@ -146,7 +149,8 @@ void SwFrameControlsManager::SetPageBreakControl( const SwPageFrm* pPageFrm )
pControl = lb->second;
else
{
- SwFrameControlPtr pNewControl( new SwPageBreakWin( m_pEditWin, pPageFrm ) );
+ SwFrameControlPtr pNewControl( new SwFrameControl(
+ VclPtr<SwPageBreakWin>::Create( m_pEditWin, pPageFrm ).get() ) );
const SwViewOption* pViewOpt = m_pEditWin->GetView().GetWrtShell().GetViewOptions();
pNewControl->SetReadonly( pViewOpt->IsReadonly() );
@@ -155,10 +159,47 @@ void SwFrameControlsManager::SetPageBreakControl( const SwPageFrm* pPageFrm )
pControl.swap( pNewControl );
}
- SwPageBreakWin& rWin = dynamic_cast<SwPageBreakWin&>(*pControl.get());
- rWin.UpdatePosition();
- if (!rWin.IsVisible())
+ SwPageBreakWin* pWin = dynamic_cast<SwPageBreakWin *>(pControl->GetWindow());
+ assert (pWin != NULL);
+ pWin->UpdatePosition();
+ if (!pWin->IsVisible())
pControl->ShowAll( true );
}
+SwFrameMenuButtonBase::SwFrameMenuButtonBase( SwEditWin* pEditWin, const SwFrm* pFrm ) :
+ MenuButton( pEditWin, WB_DIALOGCONTROL ),
+ m_pEditWin( pEditWin ),
+ m_pFrm( pFrm )
+{
+}
+
+const SwPageFrm* SwFrameMenuButtonBase::GetPageFrame()
+{
+ return static_cast< const SwPageFrm * >( m_pFrm );
+}
+
+void SwFrameMenuButtonBase::dispose()
+{
+ m_pEditWin.clear();
+ m_pFrm = NULL;
+ MenuButton::dispose();
+}
+
+SwFrameControl::SwFrameControl( const VclPtr<vcl::Window> &pWindow )
+{
+ assert( pWindow != NULL );
+ mxWindow.reset( pWindow );
+ mpIFace = dynamic_cast<ISwFrameControl *>( pWindow.get() );
+}
+
+SwFrameControl::~SwFrameControl()
+{
+ mpIFace = NULL;
+ mxWindow.disposeAndClear();
+}
+
+ISwFrameControl::~ISwFrameControl()
+{
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 4884a08..5533fd6 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -124,10 +124,8 @@ namespace
}
}
-SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm, bool bHeader ) :
- MenuButton( pEditWin, WB_DIALOGCONTROL ),
- SwFrameControl( pEditWin, pPageFrm ),
- m_sLabel( ),
+SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwFrm *pFrm, bool bHeader ) :
+ SwFrameMenuButtonBase( pEditWin, pFrm ),
m_bIsHeader( bHeader ),
m_pPopupMenu( NULL ),
m_pLine( NULL ),
@@ -175,12 +173,7 @@ void SwHeaderFooterWin::dispose()
{
delete m_pPopupMenu;
m_pLine.disposeAndClear();
- MenuButton::dispose();
-}
-
-const SwPageFrm* SwHeaderFooterWin::GetPageFrame( )
-{
- return static_cast< const SwPageFrm * >( GetFrame( ) );
+ SwFrameMenuButtonBase::dispose();
}
void SwHeaderFooterWin::SetOffset(Point aOffset, long nXLineStart, long nXLineEnd)
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 879ebd4..db26491 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -90,9 +90,8 @@ namespace
}
}
-SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm ) :
- MenuButton( pEditWin, WB_DIALOGCONTROL ),
- SwFrameControl( pEditWin, pPageFrm ),
+SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwFrm *pFrm ) :
+ SwFrameMenuButtonBase( pEditWin, pFrm ),
m_pPopupMenu( NULL ),
m_pLine( NULL ),
m_bIsAppearing( false ),
@@ -132,7 +131,7 @@ void SwPageBreakWin::dispose()
delete m_pMousePt;
m_pMousePt = NULL;
- MenuButton::dispose();
+ SwFrameMenuButtonBase::dispose();
}
void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
@@ -412,11 +411,6 @@ bool SwPageBreakWin::Contains( const Point &rDocPt ) const
return false;
}
-const SwPageFrm* SwPageBreakWin::GetPageFrame( )
-{
- return static_cast< const SwPageFrm * >( GetFrame( ) );
-}
-
void SwPageBreakWin::SetReadonly( bool bReadonly )
{
ShowAll( !bReadonly );
diff --git a/sw/source/uibase/inc/FrameControl.hxx b/sw/source/uibase/inc/FrameControl.hxx
index 936be2a..5787b23 100644
--- a/sw/source/uibase/inc/FrameControl.hxx
+++ b/sw/source/uibase/inc/FrameControl.hxx
@@ -10,42 +10,61 @@
#define INCLUDED_SW_SOURCE_UIBASE_INC_FRAMECONTROL_HXX
class SwEditWin;
+class SwPageFrm;
class SwFrm;
class Point;
-/** Class representing a control linked to a SwFrm.
- */
-class SwFrameControl
+/// Abstract interface to be implemented by writer FrameControls
+class ISwFrameControl
{
- VclPtr<SwEditWin> m_pEditWin;
- const SwFrm* m_pFrm;
-
public:
- SwFrameControl( SwEditWin* pEditWin, const SwFrm* pFrm ) :
- m_pEditWin( pEditWin ), m_pFrm( pFrm ) {};
- virtual ~SwFrameControl( ) {};
-
- SwFrameControl( const SwFrameControl& rCopy ) :
- m_pEditWin( rCopy.m_pEditWin ),
- m_pFrm( rCopy.m_pFrm )
- {
- }
-
- const SwFrameControl& operator=( const SwFrameControl& rCopy )
- {
- m_pEditWin = rCopy.m_pEditWin;
- m_pFrm = rCopy.m_pFrm;
- return *this;
- }
-
- const SwFrm* GetFrame( ) { return m_pFrm; }
- SwEditWin* GetEditWin( ) { return m_pEditWin; }
-
+ virtual ~ISwFrameControl();
virtual void SetReadonly( bool bReadonly ) = 0;
virtual void ShowAll( bool bShow ) = 0;
/// Returns true if the point is inside the control.
virtual bool Contains( const Point &rDocPt ) const = 0;
+
+ virtual const SwFrm* GetFrame() = 0;
+ virtual SwEditWin* GetEditWin() = 0;
+};
+
+class SwFrameControl
+{
+ VclPtr<vcl::Window> mxWindow;
+ ISwFrameControl *mpIFace;
+public:
+ SwFrameControl( const VclPtr<vcl::Window> &pWindow );
+ virtual ~SwFrameControl();
+
+ const SwFrm* GetFrame() { return mpIFace->GetFrame(); }
+ SwEditWin* GetEditWin() { return mpIFace->GetEditWin(); }
+ vcl::Window* GetWindow() { return mxWindow.get(); }
+
+ void SetReadonly( bool bReadonly ) { mpIFace->SetReadonly( bReadonly ); }
+ void ShowAll( bool bShow ) { mpIFace->ShowAll( bShow ); }
+ bool Contains( const Point &rDocPt ) const { return mpIFace->Contains( rDocPt ); }
+};
+
+#include <vcl/menubtn.hxx>
+
+/** Class sharing some MenuButton code
+ */
+class SwFrameMenuButtonBase : public MenuButton, public ISwFrameControl
+{
+ VclPtr<SwEditWin> m_pEditWin;
+ const SwFrm* m_pFrm;
+
+protected:
+ virtual ~SwFrameMenuButtonBase() {}
+ virtual void dispose() SAL_OVERRIDE;
+
+public:
+ SwFrameMenuButtonBase( SwEditWin* pEditWin, const SwFrm* pFrm );
+
+ virtual const SwFrm* GetFrame() SAL_OVERRIDE { return m_pFrm; }
+ virtual SwEditWin* GetEditWin() SAL_OVERRIDE { return m_pEditWin; }
+ const SwPageFrm* GetPageFrame();
};
#endif
diff --git a/sw/source/uibase/inc/HeaderFooterWin.hxx b/sw/source/uibase/inc/HeaderFooterWin.hxx
index b9fa86e..a96423f 100644
--- a/sw/source/uibase/inc/HeaderFooterWin.hxx
+++ b/sw/source/uibase/inc/HeaderFooterWin.hxx
@@ -18,7 +18,7 @@
This control is showing the header / footer style name and provides
a few useful actions to the user.
*/
-class SwHeaderFooterWin : public MenuButton, public SwFrameControl
+class SwHeaderFooterWin : public SwFrameMenuButtonBase
{
OUString m_sLabel;
bool m_bIsHeader;
@@ -29,7 +29,7 @@ class SwHeaderFooterWin : public MenuButton, public SwFrameControl
Timer m_aFadeTimer;
public:
- SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm, bool bHeader );
+ SwHeaderFooterWin( SwEditWin *pEditWin, const SwFrm *pFrm, bool bHeader );
virtual ~SwHeaderFooterWin( );
virtual void dispose() SAL_OVERRIDE;
@@ -44,7 +44,6 @@ public:
bool IsHeader() { return m_bIsHeader; };
bool IsEmptyHeaderFooter( );
- const SwPageFrm* GetPageFrame( );
void ExecuteCommand(sal_uInt16 nSlot);
diff --git a/sw/source/uibase/inc/PageBreakWin.hxx b/sw/source/uibase/inc/PageBreakWin.hxx
index 6efb632..34d1b4c 100644
--- a/sw/source/uibase/inc/PageBreakWin.hxx
+++ b/sw/source/uibase/inc/PageBreakWin.hxx
@@ -20,7 +20,7 @@ class SwPageFrm;
This control shows a line indicating a manual page break and a
button providing a few actions on that page break.
*/
-class SwPageBreakWin : public MenuButton, public SwFrameControl
+class SwPageBreakWin : public SwFrameMenuButtonBase
{
PopupMenu* m_pPopupMenu;
VclPtr<vcl::Window> m_pLine;
@@ -33,8 +33,8 @@ class SwPageBreakWin : public MenuButton, public SwFrameControl
const Point* m_pMousePt;
public:
- SwPageBreakWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm );
- virtual ~SwPageBreakWin( );
+ SwPageBreakWin( SwEditWin* pEditWin, const SwFrm *pFrm );
+ virtual ~SwPageBreakWin();
virtual void dispose() SAL_OVERRIDE;
virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect ) SAL_OVERRIDE;
@@ -47,8 +47,6 @@ public:
virtual void ShowAll( bool bShow ) SAL_OVERRIDE;
virtual bool Contains( const Point &rDocPt ) const SAL_OVERRIDE;
- const SwPageFrm* GetPageFrame( );
-
void SetReadonly( bool bReadonly ) SAL_OVERRIDE;
void Fade( bool bFadeIn );
commit fae87e03ea3829718ec0381ed3b04ceb52c23720
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jun 12 17:04:45 2015 +0200
tdf#91228: need to check the format's IsLockModified(), not the node's
commit 9f01951b858453684f2622541af0eb85d4544fc6 also did the extra
Remove/Add for Draw fly objects, and it turns out that that's actually
wrong because SwTextFlyCnt::SetAnchor() will set the anchor without
locking anything if it's a Draw object. Replace it with a different
hack in SetAnchor() that applies only if it calls LockModify().
Thanks to Varun Dhall for creating a reproducer document.
Not sure if the LockModify() could be replaced completely, perhaps it's
just an optimization to avoid re-creating layout frames for the fly.
Change-Id: Ib3236f289c2c4202d48ac378a53ce02130d4ce2c
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index ee67fa2..7894854 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -150,13 +150,19 @@ void SwTextFlyCnt::SetAnchor( const SwTextNode *pNode )
SwPosition aPos( *pNode->StartOfSectionNode(), aIdx );
SwFrameFormat* pFormat = GetFlyCnt().GetFrameFormat();
SwFormatAnchor aAnchor( pFormat->GetAnchor() );
+ SwNode *const pOldNode(aAnchor.GetContentAnchor()
+ ? &aAnchor.GetContentAnchor()->nNode.GetNode()
+ : nullptr);
- if( !aAnchor.GetContentAnchor() ||
- !aAnchor.GetContentAnchor()->nNode.GetNode().GetNodes().IsDocNodes() ||
- &aAnchor.GetContentAnchor()->nNode.GetNode() != static_cast<SwNode const *>(pNode) )
+ if (!pOldNode || !pOldNode->GetNodes().IsDocNodes() ||
+ pOldNode != static_cast<SwNode const *>(pNode))
+ {
aPos.nNode = *pNode;
+ }
else
- aPos.nNode = aAnchor.GetContentAnchor()->nNode;
+ {
+ aPos.nNode = *pOldNode;
+ }
aAnchor.SetType( FLY_AS_CHAR ); // default!
aAnchor.SetAnchor( &aPos );
@@ -186,10 +192,17 @@ void SwTextFlyCnt::SetAnchor( const SwTextNode *pNode )
{
pFormat->LockModify();
pFormat->SetFormatAttr( aAnchor ); // nur den Anker neu setzen
+ // tdf#91228 must notify the anchor nodes despite LockModify
+ assert(pOldNode);
+ pOldNode->RemoveAnchoredFly(pFormat);
+ aPos.nNode.GetNode().AddAnchoredFly(pFormat);
pFormat->UnlockModify();
}
else
+ {
+ assert(!pFormat->IsModifyLocked()); // need to notify anchor node
pFormat->SetFormatAttr( aAnchor ); // nur den Anker neu setzen
+ }
// Am Node haengen u.a. abhaengige CntFrms.
// Fuer jeden CntFrm wird ein SwFlyInCntFrm angelegt.
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 54c8ab2..669ab94 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1276,45 +1276,19 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, const SetAttrMode nMode )
{
SwTextFlyCnt *pFly = static_cast<SwTextFlyCnt *>(pAttr);
SwFrameFormat* pFormat = pAttr->GetFlyCnt().GetFrameFormat();
-
- // In order to maintain data coherency, if the hint is a fly
- // moved from a text node to another, we have to remove it from
- // the first textnode then to add it to the new (this) textnode
- const SwFormatAnchor* pAnchor = 0;
- pFormat->GetItemState( RES_ANCHOR, false,
- reinterpret_cast<const SfxPoolItem**>(&pAnchor) );
-
- SwIndex aIdx( this, pAttr->GetStart() );
-
- bool bChangeFlyParentNode( false );
- if (pAnchor &&
- pAnchor->GetAnchorId() == FLY_AS_CHAR &&
- pAnchor->GetContentAnchor() &&
- pAnchor->GetContentAnchor()->nNode != *this)
- {
- assert(pAnchor->GetContentAnchor()->nNode.GetNode().IsTextNode());
- SwTextNode* textNode = pAnchor->GetContentAnchor()->nNode.GetNode().GetTextNode();
-
- if ( textNode->IsModifyLocked() )
- {
- // Fly parent has changed but the FlyFormat is locked, so it will
- // not be updated by SetAnchor (that calls Modify that updates
- // relationships)
- textNode->RemoveAnchoredFly( pFormat );
- bChangeFlyParentNode = true;
- }
- }
-
if( !(SetAttrMode::NOTXTATRCHR & nInsMode) )
{
-
// Wir muessen zuerst einfuegen, da in SetAnchor()
// dem FlyFrm GetStart() uebermittelt wird.
//JP 11.05.98: falls das Anker-Attribut schon richtig
// gesetzt ist, dann korrigiere dieses nach dem Einfuegen
// des Zeichens. Sonst muesste das immer ausserhalb
// erfolgen (Fehleranfaellig !)
+ const SwFormatAnchor* pAnchor = 0;
+ pFormat->GetItemState( RES_ANCHOR, false,
+ reinterpret_cast<const SfxPoolItem**>(&pAnchor) );
+ SwIndex aIdx( this, pAttr->GetStart() );
const OUString c(GetCharOfTextAttr(*pAttr));
OUString const ins( InsertText(c, aIdx, nInsertFlags) );
if (ins.isEmpty())
@@ -1378,11 +1352,6 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, const SetAttrMode nMode )
return false;
}
}
-
- // Finish relationships update now that SetAnchor has fixed part of it.
- if (bChangeFlyParentNode)
- AddAnchoredFly( pFormat );
-
break;
}
commit fd29a623e7c7b4d859c55f1f04463b5705ad47bf
Author: Antoine Cœur <coeur at gmx.fr>
Date: Thu Jun 11 01:42:51 2015 +0200
spelling
Change-Id: I5ccbb5a2b31192cea96fbb0f4ab926af86e94c9d
Reviewed-on: https://gerrit.libreoffice.org/16223
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Philippe Jung <phil.jung at free.fr>
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index fd345a0..9227509 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -216,7 +216,7 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const
}
catch(const Exception&)
{
- OSL_FAIL("ORelationTableView::AddConnection: Exception oocured!");
+ OSL_FAIL("ORelationTableView::AddConnection: Exception occurred!");
}
}
}
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java
index 956be36..cd47c96 100644
--- a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterGroupManager.java
@@ -33,7 +33,7 @@ public class _XFilterGroupManager extends MultiMethodTest {
/**
* Appends a new FilterGroup (for extension 'txt'). <p>
- * Has <b>OK</b> status if no runtime exceptions occured.
+ * Has <b>OK</b> status if no runtime exceptions occurred.
*/
public void _appendFilterGroup() {
boolean res = true;
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java
index aa92f5d..d9eb5a5 100644
--- a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilterManager.java
@@ -39,7 +39,7 @@ public class _XFilterManager extends MultiMethodTest {
/**
* Appends a new filter (for extension 'txt'). <p>
- * Has <b>OK</b> status if no runtime exceptions occured.
+ * Has <b>OK</b> status if no runtime exceptions occurred.
*/
public void _appendFilter() {
boolean res = true;
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 92773b6..5e2d1a4 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1911,7 +1911,7 @@ typedef struct lcl_ScTable_DoSubTotals_RowEntry
} RowEntry;
// new intermediate results
-// rParam.nRow2 is changed !
+// rParam.nRow2 is changed!
bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
{
@@ -1942,7 +1942,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
// With (blank) as a separate category, subtotal rows from
// the other columns must always be tested
- // (previously only when a column occured more than once)
+ // (previously only when a column occurred more than once)
bool bTestPrevSub = ( nLevelCount > 1 );
OUString aSubString;
@@ -1950,7 +1950,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
bool bIgnoreCase = !rParam.bCaseSens;
- OUString *pCompString[MAXSUBTOTAL]; // Pointer due to compiler problemens
+ OUString *pCompString[MAXSUBTOTAL]; // Pointer due to compiler problems
for (i=0; i<MAXSUBTOTAL; i++)
pCompString[i] = new OUString;
@@ -1959,7 +1959,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
ScStyleSheet* pStyle = static_cast<ScStyleSheet*>(pDocument->GetStyleSheetPool()->Find(
ScGlobal::GetRscString(STR_STYLENAME_RESULT), SFX_STYLE_FAMILY_PARA ));
- bool bSpaceLeft = true; // Succsess when inserting?
+ bool bSpaceLeft = true; // Success when inserting?
// For performance reasons collect formula entries so their
// references don't have to be tested for updates each time a new row is
@@ -2006,7 +2006,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
GetString( nGroupCol[i], nRow, aString );
if (bIgnoreCase)
aString = ScGlobal::pCharClass->uppercase(aString);
- // when sorting, blanks are seperate group
+ // when sorting, blanks are separate group
// otherwise blak cells are allowed below
bChanged = ( ( !aString.isEmpty() || rParam.bDoSort ) &&
aString != *pCompString[i] );
@@ -2151,7 +2151,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
}
- //TODO: according to setting, shift intermediate-sum rows up ?
+ //TODO: according to setting, shift intermediate-sum rows up?
//TODO: create Outlines directly?
commit 1289d3c42af66990a2c8e5a7a38e51b6cd51c7eb
Author: Juergen Funk <juergen.funk_ml at cib.de>
Date: Wed Jun 3 09:23:44 2015 +0200
std::list for Scheduler
Re-factor the scheduler to use std::list
Because
- ImplSchedulerData
- remove: mbInScheduler, mnUpdateTime, mnUpdateStack
that is scheduler stuff
- this struct is only a container for the scheduler-list
- UpdateMinPeriod
- the scheduler is the pure-virtual-class then
the idle-class must override this method
- ImplDeInitScheduler(bool All=true)
- this patch 2e29a518b04250b5f9cc9d0d77da3df076834d60 remove
all scheduler tasks and the scheduler, but after that,
the scheduler is using, then crash.
With this fix, only delete the scheduler-list, but not the
scheduler
The next steps
- split the scheduler from the scheduler-list-handling
the scheduler-list-handling need a static class
- remove the scheduler from the timer-handling staff
Change-Id: I8d4d4f27b2bc9684a48c2afafd0b3edd0716c71d
Reviewed-on: https://gerrit.libreoffice.org/16148
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/include/vcl/idle.hxx b/include/vcl/idle.hxx
index 2e853b7..3d235a5 100644
--- a/include/vcl/idle.hxx
+++ b/include/vcl/idle.hxx
@@ -28,6 +28,7 @@ class VCL_DLLPUBLIC Idle : public Scheduler
protected:
Link<Idle *, void> maIdleHdl; // Callback Link
+
public:
Idle( const sal_Char *pDebugName = NULL );
Idle( const Idle& rIdle );
diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index 6c4e211..6b27e05 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -21,23 +21,18 @@
#define INCLUDED_VCL_SCHEDULER_HXX
#include <vcl/dllapi.h>
+#include <list>
+
-struct ImplSVData;
class Scheduler;
struct ImplSchedulerData
{
- ImplSchedulerData* mpNext; // Pointer to the next element in list
- Scheduler* mpScheduler; // Pointer to VCL Scheduler instance
- bool mbDelete; // Destroy this scheduler?
- bool mbInScheduler; // Scheduler currently processed?
- sal_uInt64 mnUpdateTime; // Last Update Time
- sal_uInt32 mnUpdateStack; // Update Stack
-
- void Invoke();
-
- static ImplSchedulerData *GetMostImportantTask( bool bTimer );
+ bool mbDelete; // Destroy this scheduler?
+ Scheduler* mpScheduler; // Pointer to VCL Scheduler instance
};
+#define MAX_TIMER_PERIOD SAL_MAX_UINT64
+
enum class SchedulerPriority {
HIGHEST = 0,
HIGH = 1,
@@ -56,6 +51,7 @@ protected:
const sal_Char *mpDebugName; /// Useful for debugging
SchedulerPriority mePriority; /// Scheduler priority
bool mbActive; /// Currently in the scheduler
+ sal_uInt64 mnUpdateTime; /// Last Update Time
friend struct ImplSchedulerData;
virtual void SetDeletionFlags();
@@ -82,15 +78,28 @@ public:
bool IsActive() const { return mbActive; }
void SetInActive() { mbActive = false; }
- Scheduler& operator=( const Scheduler& rScheduler );
- static void ImplDeInitScheduler();
+ Scheduler& operator=( const Scheduler& rScheduler );
+ static void ImplDeInitScheduler(bool bAll=true);
+ static void ImplInitScheduler();
- // Process one pending Timer with highhest priority
+ // Process one pending Timer with highest priority
static void CallbackTaskScheduling( bool ignore );
- /// Process one pending task ahead of time with highhest priority.
+ /// Process one pending task ahead of time with highest priority.
static void ProcessTaskScheduling( bool bTimer );
+
+private:
+ bool mbInScheduler; // Scheduler currently processed?
+ sal_uInt32 mnUpdateStack; // Update Stack
+
+ bool ImplHandleTaskScheduling(sal_uInt64& nMinPeriod, sal_uInt64 nTime);
+ void ImplInvoke(sal_uInt64 nTime);
+ static Scheduler* ImplGetHighestPrioTask( bool bTimer );
+ bool ImplIsScheduleReady(sal_uInt32 nUpdateStack);
+ void ImplDispose();
};
+typedef ::std::list< ImplSchedulerData* > ImplScheduler_t;
+
#endif // INCLUDED_VCL_SCHEDULER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/timer.hxx b/include/vcl/timer.hxx
index 8835291..f6f3dea 100644
--- a/include/vcl/timer.hxx
+++ b/include/vcl/timer.hxx
@@ -23,6 +23,8 @@
#include <tools/link.hxx>
#include <vcl/scheduler.hxx>
+struct ImplSVData;
+
class VCL_DLLPUBLIC Timer : public Scheduler
{
protected:
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index d6315d2..1d577c7 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -109,7 +109,7 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a
// Timers may access the SfxApplication and are only deleted in
// Application::Quit(), which is asynchronous (PostUserEvent) - disable!
- Scheduler::ImplDeInitScheduler();
+ Scheduler::ImplDeInitScheduler(false); // false only delete the list
SfxApplication* pApp = SfxGetpApp();
pApp->Broadcast( SfxSimpleHint( SFX_HINT_DEINITIALIZING ) );
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 595812a..1261b28 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -313,7 +313,7 @@ struct ImplSVData
bool mbDeInit; // Is VCL deinitializing
sal_uLong mnThreadCount; // is VCL MultiThread enabled
ImplConfigData* mpFirstConfigData; // pointer to the first config block
- ImplSchedulerData* mpFirstSchedulerData; // list of all running tasks
+ ImplScheduler_t* maSchedulers; // list of all running tasks
SalTimer* mpSalTimer; // interface to sal event loop/timers
SalI18NImeStatus* mpImeStatus; // interface to ime status window
SalSystem* mpSalSystem; // SalSystem interface
diff --git a/vcl/source/app/idle.cxx b/vcl/source/app/idle.cxx
index 0dd8593..e2fa915 100644
--- a/vcl/source/app/idle.cxx
+++ b/vcl/source/app/idle.cxx
@@ -62,5 +62,4 @@ sal_uInt64 Idle::UpdateMinPeriod( sal_uInt64 /* nMinPeriod */, sal_uInt64 /* nTi
return 1;
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index c3cea78..a440045 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -21,85 +21,88 @@
#include <tools/time.hxx>
#include <vcl/scheduler.hxx>
#include <vcl/timer.hxx>
+#include <algorithm>
#include <saltimer.hxx>
-#define MAX_TIMER_PERIOD SAL_MAX_UINT64
-
-void ImplSchedulerData::Invoke()
+void Scheduler::ImplInvoke(sal_uInt64 nTime)
{
- if (mbDelete || mbInScheduler )
+ mnUpdateTime = nTime;
+
+ if (mpSchedulerData->mbDelete || mbInScheduler )
return;
// prepare Scheduler Object for deletion after handling
- mpScheduler->SetDeletionFlags();
+ SetDeletionFlags();
// invoke it
mbInScheduler = true;
- mpScheduler->Invoke();
+ Invoke();
mbInScheduler = false;
}
-ImplSchedulerData *ImplSchedulerData::GetMostImportantTask( bool bTimer )
+Scheduler* Scheduler::ImplGetHighestPrioTask( bool bTimer )
{
- ImplSVData* pSVData = ImplGetSVData();
- ImplSchedulerData *pMostUrgent = NULL;
+ ImplSVData* pSVData = ImplGetSVData();
+ Scheduler * pMostUrgent = NULL;
- for ( ImplSchedulerData *pSchedulerData = pSVData->mpFirstSchedulerData; pSchedulerData; pSchedulerData = pSchedulerData->mpNext )
+ std::for_each(pSVData->maSchedulers->begin(), pSVData->maSchedulers->end(),
+ [&pSVData, bTimer, &pMostUrgent] (ImplSchedulerData *rScheduler)
{
- if ( !pSchedulerData->mpScheduler || pSchedulerData->mbDelete || pSchedulerData->mnUpdateStack >= pSVData->mnUpdateStack
- || !pSchedulerData->mpScheduler->ReadyForSchedule( bTimer ) || !pSchedulerData->mpScheduler->IsActive())
- continue;
- if (!pMostUrgent)
- pMostUrgent = pSchedulerData;
- else
+ if ( rScheduler->mpScheduler &&
+ rScheduler->mpScheduler->ImplIsScheduleReady(pSVData->mnUpdateStack) &&
+ rScheduler->mpScheduler->ReadyForSchedule( bTimer ) &&
+ rScheduler->mpScheduler->IsActive() )
{
- // Find the highest priority.
- // If the priority of the current task is higher (numerical value is lower) than
- // the priority of the most urgent, the current task gets the new most urgent.
- if ( pSchedulerData->mpScheduler->GetPriority() < pMostUrgent->mpScheduler->GetPriority() )
- pMostUrgent = pSchedulerData;
+ if (!pMostUrgent)
+ pMostUrgent = rScheduler->mpScheduler;
+ else
+ {
+ // Find the highest priority.
+ // If the priority of the current task is higher (numerical value is lower) than
+ // the priority of the most urgent, the current task gets the new most urgent.
+ if ( rScheduler->mpScheduler->GetPriority() < pMostUrgent->GetPriority() )
+ pMostUrgent = rScheduler->mpScheduler;
+ }
}
- }
+ });
return pMostUrgent;
}
void Scheduler::SetDeletionFlags()
{
- mpSchedulerData->mbDelete = true;
- mbActive = false;
+ Stop();
}
-void Scheduler::ImplDeInitScheduler()
+void Scheduler::ImplDeInitScheduler(bool bAll /*=true*/)
{
- ImplSVData* pSVData = ImplGetSVData();
- ImplSchedulerData* pSchedulerData = pSVData->mpFirstSchedulerData;
+ ImplSVData* pSVData = ImplGetSVData();
+
if (pSVData->mpSalTimer)
{
pSVData->mpSalTimer->Stop();
}
- if ( pSchedulerData )
+ pSVData->maSchedulers->remove_if( [] (ImplSchedulerData *rSchedulerData)
{
- do
+ if(rSchedulerData->mpScheduler != NULL)
{
- ImplSchedulerData* pTempSchedulerData = pSchedulerData;
- if ( pSchedulerData->mpScheduler )
- {
- pSchedulerData->mpScheduler->mbActive = false;
- pSchedulerData->mpScheduler->mpSchedulerData = NULL;
- }
- pSchedulerData = pSchedulerData->mpNext;
- delete pTempSchedulerData;
+ rSchedulerData->mpScheduler->ImplDispose();
}
- while ( pSchedulerData );
+ else
+ delete rSchedulerData;
+
+ return true;
+ });
- pSVData->mpFirstSchedulerData = NULL;
- pSVData->mnTimerPeriod = 0;
+ if(bAll)
+ {
+ delete pSVData->maSchedulers;
+ pSVData->maSchedulers = NULL;
}
delete pSVData->mpSalTimer;
- pSVData->mpSalTimer = 0;
+ pSVData->mpSalTimer = NULL;
}
void Scheduler::CallbackTaskScheduling(bool ignore)
@@ -113,52 +116,30 @@ void Scheduler::ProcessTaskScheduling( bool bTimer )
{
// process all pending Tasks
// if bTimer True, only handle timer
- ImplSchedulerData* pSchedulerData = NULL;
- ImplSchedulerData* pPrevSchedulerData = NULL;
- ImplSVData* pSVData = ImplGetSVData();
- sal_uInt64 nTime = tools::Time::GetSystemTicks();
- sal_uInt64 nMinPeriod = MAX_TIMER_PERIOD;
+ Scheduler* pScheduler = NULL;
+ ImplSVData* pSVData = ImplGetSVData();
+ sal_uInt64 nTime = tools::Time::GetSystemTicks();
+ sal_uInt64 nMinPeriod = MAX_TIMER_PERIOD;
+
pSVData->mnUpdateStack++;
// tdf#91727 - NB. bTimer is ultimately not used
- if ((pSchedulerData = ImplSchedulerData::GetMostImportantTask(bTimer)))
- {
- pSchedulerData->mnUpdateTime = nTime;
- pSchedulerData->Invoke();
- }
+ if ((pScheduler = Scheduler::ImplGetHighestPrioTask(bTimer)) != NULL)
+ pScheduler->ImplInvoke(nTime);
- pSchedulerData = pSVData->mpFirstSchedulerData;
- while ( pSchedulerData )
+ pSVData->maSchedulers->remove_if( [&nMinPeriod, nTime, pSVData] (ImplSchedulerData *rSchedulerData)
{
- if( pSchedulerData->mbInScheduler )
- {
- pPrevSchedulerData = pSchedulerData;
- pSchedulerData = pSchedulerData->mpNext;
- }
- // Should Task be released from scheduling?
- else if ( pSchedulerData->mbDelete )
- {
- if ( pPrevSchedulerData )
- pPrevSchedulerData->mpNext = pSchedulerData->mpNext;
- else
- pSVData->mpFirstSchedulerData = pSchedulerData->mpNext;
- if ( pSchedulerData->mpScheduler )
- pSchedulerData->mpScheduler->mpSchedulerData = NULL;
- ImplSchedulerData* pTempSchedulerData = pSchedulerData;
- pSchedulerData = pSchedulerData->mpNext;
- delete pTempSchedulerData;
- }
+ if (rSchedulerData->mpScheduler)
+ return rSchedulerData->mpScheduler->ImplHandleTaskScheduling(nMinPeriod, nTime);
else
{
- pSchedulerData->mnUpdateStack = 0;
- nMinPeriod = pSchedulerData->mpScheduler->UpdateMinPeriod( nMinPeriod, nTime );
- pPrevSchedulerData = pSchedulerData;
- pSchedulerData = pSchedulerData->mpNext;
+ delete rSchedulerData;
+ return true;
}
- }
+ });
// delete clock if no more timers available
- if ( !pSVData->mpFirstSchedulerData )
+ if ( pSVData->maSchedulers->empty() )
{
if ( pSVData->mpSalTimer )
pSVData->mpSalTimer->Stop();
@@ -168,6 +149,7 @@ void Scheduler::ProcessTaskScheduling( bool bTimer )
{
Timer::ImplStartTimer( pSVData, nMinPeriod );
}
+
pSVData->mnUpdateStack--;
}
@@ -178,34 +160,22 @@ void Scheduler::SetPriority( SchedulerPriority ePriority )
void Scheduler::Start()
{
+ ImplSVData* pSVData = ImplGetSVData();
// Mark timer active
mbActive = true;
- ImplSVData* pSVData = ImplGetSVData();
if ( !mpSchedulerData )
{
+ mpSchedulerData = new ImplSchedulerData;
+ mpSchedulerData->mpScheduler = this;
// insert Scheduler
- mpSchedulerData = new ImplSchedulerData;
- mpSchedulerData->mpScheduler = this;
- mpSchedulerData->mbInScheduler = false;
-
- // insert last due to SFX!
- ImplSchedulerData* pPrev = NULL;
- ImplSchedulerData* pData = pSVData->mpFirstSchedulerData;
- while ( pData )
- {
- pPrev = pData;
- pData = pData->mpNext;
- }
- mpSchedulerData->mpNext = NULL;
- if ( pPrev )
- pPrev->mpNext = mpSchedulerData;
- else
- pSVData->mpFirstSchedulerData = mpSchedulerData;
+ mbInScheduler = false;
+ pSVData->maSchedulers->push_back(mpSchedulerData);
}
- mpSchedulerData->mbDelete = false;
- mpSchedulerData->mnUpdateTime = tools::Time::GetSystemTicks();
- mpSchedulerData->mnUpdateStack = pSVData->mnUpdateStack;
+
+ mpSchedulerData->mbDelete = false;
+ mnUpdateTime = tools::Time::GetSystemTicks();
+ mnUpdateStack = pSVData->mnUpdateStack;
}
void Scheduler::Stop()
@@ -221,7 +191,7 @@ Scheduler& Scheduler::operator=( const Scheduler& rScheduler )
if ( IsActive() )
Stop();
- mbActive = false;
+ mbActive = false;
mePriority = rScheduler.mePriority;
if ( rScheduler.IsActive() )
@@ -233,16 +203,18 @@ Scheduler& Scheduler::operator=( const Scheduler& rScheduler )
Scheduler::Scheduler(const sal_Char *pDebugName):
mpSchedulerData(NULL),
mpDebugName(pDebugName),
- mePriority(SchedulerPriority::HIGH),
- mbActive(false)
+ mePriority(SchedulerPriority::HIGH),
+ mbActive(false),
+ mnUpdateTime(0)
{
}
Scheduler::Scheduler( const Scheduler& rScheduler ):
mpSchedulerData(NULL),
mpDebugName(rScheduler.mpDebugName),
- mePriority(rScheduler.mePriority),
- mbActive(false)
+ mePriority(SchedulerPriority::HIGH),
+ mbActive(false),
+ mnUpdateTime(0)
{
if ( rScheduler.IsActive() )
Start();
@@ -257,3 +229,44 @@ Scheduler::~Scheduler()
}
}
+bool Scheduler::ImplIsScheduleReady(sal_uInt32 nUpdateStack)
+{
+ return !mpSchedulerData->mbDelete && (mnUpdateStack <= nUpdateStack);
+}
+
+void Scheduler::ImplDispose()
+{
+ mpSchedulerData->mpScheduler = NULL;
+ delete mpSchedulerData;
+ mpSchedulerData = NULL;
+}
+
+void Scheduler::ImplInitScheduler()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+
+ if(pSVData->maSchedulers == NULL)
+ pSVData->maSchedulers = new ImplScheduler_t;
+}
+
+
+bool Scheduler::ImplHandleTaskScheduling(sal_uInt64 &nMinPeriod, sal_uInt64 nTime)
+{
+ // process all pending Tasks
+ if( !mbInScheduler )
+ {
+ // Should Task be released from scheduling?
+ if ( !mpSchedulerData->mbDelete )
+ {
+ mnUpdateStack = 0;
+ nMinPeriod = UpdateMinPeriod( nMinPeriod, nTime );
+ }
+ else
+ {
+ ImplDispose();
+ return true;
+ }
+ }
+
+ return false;
+}
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 8b1a2a6..a7c184a 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -81,7 +81,8 @@ SalSystem* ImplGetSalSystem()
ImplSVData::ImplSVData()
{
// init global instance data
- memset( this, 0, sizeof( ImplSVData ) );
+ memset( this, 0, sizeof( ImplSVData ));
+
maHelpData.mbAutoHelpId = true;
maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT );
}
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 3f9026e..dda1e29 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -251,6 +251,8 @@ bool InitVCL()
// remember Main-Thread-Id
pSVData->mnMainThreadId = ::osl::Thread::getCurrentIdentifier();
+ Scheduler::ImplInitScheduler();
+
// Initialize Sal
pSVData->mpDefInst = CreateSalInstance();
if ( !pSVData->mpDefInst )
@@ -371,6 +373,7 @@ void DeInitVCL()
if ( pSVData->maAppData.mpIdleMgr )
delete pSVData->maAppData.mpIdleMgr;
+
Scheduler::ImplDeInitScheduler();
if ( pSVData->maWinData.mpMsgBoxImgList )
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx
index 7d92283..b6c2aba 100644
--- a/vcl/source/app/timer.cxx
+++ b/vcl/source/app/timer.cxx
@@ -23,7 +23,6 @@
#include <svdata.hxx>
#include <salinst.hxx>
-#define MAX_TIMER_PERIOD SAL_MAX_UINT64
void Timer::ImplStartTimer( ImplSVData* pSVData, sal_uInt64 nMS )
{
@@ -45,23 +44,23 @@ void Timer::SetDeletionFlags()
// if no AutoTimer than stop
if ( !mbAuto )
{
- mpSchedulerData->mbDelete = true;
- mbActive = false;
+ Scheduler::SetDeletionFlags();
}
}
bool Timer::ReadyForSchedule( bool bTimer )
{
(void)bTimer;
- return (mpSchedulerData->mnUpdateTime + mnTimeout) <= tools::Time::GetSystemTicks();
+ return (mnUpdateTime + mnTimeout) <= tools::Time::GetSystemTicks();
}
sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime )
{
sal_uInt64 nNewTime = tools::Time::GetSystemTicks();
sal_uInt64 nDeltaTime;
+
//determine smallest time slot
- if( mpSchedulerData->mnUpdateTime == nTime )
+ if( mnUpdateTime == nTime )
{
nDeltaTime = mnTimeout;
if( nDeltaTime < nMinPeriod )
@@ -69,7 +68,7 @@ sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime )
}
else
{
- nDeltaTime = mpSchedulerData->mnUpdateTime + mnTimeout;
+ nDeltaTime = mnUpdateTime + mnTimeout;
if( nDeltaTime < nNewTime )
nMinPeriod = 1;
else
commit beb8e2830dc9e1c771e196fcaf08cdfd6bf3dde3
Author: yogesh.bharate001 <yogesh.bharate at synerzip.com>
Date: Tue Jun 2 16:39:09 2015 +0530
tdf#61908:XLSX formula cell range is not exported for MMULT.
Problem Description:
- Matrix multiplication cell formula range is not exported after roundtrip.
XML Difference:
Original : <f t="array" ref="G5:G6">MMULT(A1:C2,E1:E3)</f>
Roundtrip : <f aca="false">MMULT(A1:C2,E1:E3)</f>
Solution : Added formula cell range support for matrix multiplication.
Change-Id: Ic871f064a98a324bc16a4253b633c97417c3f900
Reviewed-on: https://gerrit.libreoffice.org/16033
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
diff --git a/sc/qa/unit/data/xlsx/matrix-multiplication.xlsx b/sc/qa/unit/data/xlsx/matrix-multiplication.xlsx
new file mode 100644
index 0000000..f79d6b6
Binary files /dev/null and b/sc/qa/unit/data/xlsx/matrix-multiplication.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index c194e31..ef9053d 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -147,6 +147,8 @@ public:
void testHiddenShape();
void testHyperlinkXLSX();
void testMoveCellAnchoredShapes();
+ void testMatrixMultiplication();
+
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
@@ -203,6 +205,8 @@ public:
CPPUNIT_TEST(testHiddenShape);
CPPUNIT_TEST(testHyperlinkXLSX);
CPPUNIT_TEST(testMoveCellAnchoredShapes);
+ CPPUNIT_TEST(testMatrixMultiplication);
+
CPPUNIT_TEST_SUITE_END();
@@ -2647,7 +2651,6 @@ void ScExportTest::testHiddenShape()
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor/xdr:sp[1]/xdr:nvSpPr/xdr:cNvPr", "hidden", "1");
}
-
void ScExportTest::testHyperlinkXLSX()
{
ScDocShellRef xDocSh = loadDoc("hyperlink.", XLSX);
@@ -2821,6 +2824,32 @@ void ScExportTest::testMoveCellAnchoredShapes()
xDocSh2->DoClose();
}
+void ScExportTest::testMatrixMultiplication()
+{
+ ScDocShellRef xShell = loadDoc("matrix-multiplication.", XLSX);
+ CPPUNIT_ASSERT(xShell.Is());
+
+ ScDocShellRef xDocSh = saveAndReload(&(*xShell), XLSX);
+ CPPUNIT_ASSERT(xDocSh.Is());
+
+ xmlDocPtr pDoc = XPathHelper::parseExport(&(*xDocSh), m_xSFactory, "xl/worksheets/sheet1.xml", XLSX);
+ CPPUNIT_ASSERT(pDoc);
+
+ OUString CellFormulaRange = getXPath(pDoc,
+ "/x:worksheet/x:sheetData/x:row[4]/x:c/x:f","ref");
+
+ // make sure that the CellFormulaRange is G5:G6.
+ CPPUNIT_ASSERT_EQUAL(OUString("G5:G6"), CellFormulaRange);
+
+ OUString CellFormulaType = getXPath(pDoc,
+ "/x:worksheet/x:sheetData/x:row[4]/x:c/x:f","t");
+
+ // make sure that the CellFormulaType is array.
+ CPPUNIT_ASSERT_EQUAL(OUString("array"), CellFormulaType);
+
+ xDocSh->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 2ce7195..38bb673 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -932,23 +932,59 @@ void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm )
// OOXTODO: XML_cm, XML_vm, XML_ph
FSEND );
- rWorksheet->startElement( XML_f,
- // OOXTODO: XML_t, ST_CellFormulaType
- XML_aca, XclXmlUtils::ToPsz( (mxTokArr && mxTokArr->IsVolatile()) || (mxAddRec && mxAddRec->IsVolatile()) ),
- // OOXTODO: XML_ref, ST_Ref
- // OOXTODO: XML_dt2D, bool
- // OOXTODO: XML_dtr, bool
- // OOXTODO: XML_del1, bool
- // OOXTODO: XML_del2, bool
- // OOXTODO: XML_r1, ST_CellRef
- // OOXTODO: XML_r2, ST_CellRef
- // OOXTODO: XML_ca, bool
- // OOXTODO: XML_si, uint
- // OOXTODO: XML_bx bool
- FSEND );
+ ScAddress aScPos( static_cast< SCCOL >( GetXclPos().mnCol ), static_cast< SCROW >( GetXclPos().mnRow ), rStrm.GetRoot().GetCurrScTab() );
+
+ if ( mrScFmlaCell.GetMatrixFlag() == MM_FORMULA)
+ {
+ // origin of the matrix - find the used matrix range
+ SCCOL nMatWidth;
+ SCROW nMatHeight;
+ mrScFmlaCell.GetMatColsRows( nMatWidth, nMatHeight );
+ OSL_ENSURE( nMatWidth && nMatHeight, "XclExpFormulaCell::XclExpFormulaCell - empty matrix" );
+ ScRange aMatScRange( aScPos );
+ ScAddress& rMatEnd = aMatScRange.aEnd;
+ rMatEnd.IncCol( static_cast< SCsCOL >( nMatWidth - 1 ) );
+ rMatEnd.IncRow( static_cast< SCsROW >( nMatHeight - 1 ) );
+ // reduce to valid range (range keeps valid, because start position IS valid
+ rStrm.GetRoot().GetAddressConverter().ValidateRange( aMatScRange, true );
+
+ OStringBuffer sFmlaCellRange;
+ if (ValidRange(aMatScRange))
+ {
+ // calculate the cell range.
+ sFmlaCellRange.append(XclXmlUtils::ToOString( rStrm.GetRoot().GetStringBuf(), aMatScRange.aStart ).getStr());
+ sFmlaCellRange.append(":");
+ sFmlaCellRange.append(XclXmlUtils::ToOString( rStrm.GetRoot().GetStringBuf(), aMatScRange.aEnd ).getStr());
+ }
+
+ if (aMatScRange.aStart.Col() == GetXclPos().mnCol && aMatScRange.aEnd.Row() > static_cast< SCROW >(GetXclPos().mnRow))
+ {
+ rWorksheet->startElement( XML_f,
+ XML_aca, XclXmlUtils::ToPsz( (mxTokArr && mxTokArr->IsVolatile()) || (mxAddRec && mxAddRec->IsVolatile()) ),
+ XML_t, mxAddRec ? "array" : NULL,
+ XML_ref, !sFmlaCellRange.isEmpty()? sFmlaCellRange.getStr() : NULL,
+ // OOXTODO: XML_dt2D, bool
+ // OOXTODO: XML_dtr, bool
+ // OOXTODO: XML_del1, bool
+ // OOXTODO: XML_del2, bool
+ // OOXTODO: XML_r1, ST_CellRef
+ // OOXTODO: XML_r2, ST_CellRef
+ // OOXTODO: XML_ca, bool
+ // OOXTODO: XML_si, uint
+ // OOXTODO: XML_bx bool
+ FSEND );
+ }
+ }
+ else
+ {
+ rWorksheet->startElement( XML_f,
+ XML_aca, XclXmlUtils::ToPsz( (mxTokArr && mxTokArr->IsVolatile()) || (mxAddRec && mxAddRec->IsVolatile()) ),
+ FSEND );
+ }
rWorksheet->writeEscaped( XclXmlUtils::ToOUString(
rStrm.GetRoot().GetCompileFormulaContext(), mrScFmlaCell.aPos, mrScFmlaCell.GetCode()));
rWorksheet->endElement( XML_f );
+
if( strcmp( sType, "inlineStr" ) == 0 )
{
rWorksheet->startElement( XML_is, FSEND );
commit 5afa25c62c73b84e3f334ce7fdd4d9fa260574d0
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jun 12 16:26:25 2015 +0200
mysqlcppconn library ends up in an extension, not in layer NONE
(so fix its Linux RPATH from "$ORIGIN/../Library" to none)
Change-Id: Ie58e8e07cb08cdf12546f8bb7b92aa9e83815748
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 5b8b3a2..4bf24f7 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -369,7 +369,7 @@ endef
else
-$(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE,\
+$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OXT,\
mysqlcppconn \
))
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index 253d6db..bdc8e30 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -99,8 +99,8 @@ gb_Executable_VALIDGROUPS_INSTALLED := UREBIN SDK OOO
gb_Executable_VALIDGROUPS_NOTINSTALLED := NONE
gb_Executable_VALIDGROUPS := UREBIN SDK OOO NONE
gb_Library_VALIDGROUPS_INSTALLED := OOOLIBS PLAINLIBS_URE PLAINLIBS_OOO PRIVATELIBS_URE RTVERLIBS UNOVERLIBS PLAINLIBS_SHLXTHDL
-gb_Library_VALIDGROUPS_NOTINSTALLED := PLAINLIBS_NONE EXTENSIONLIBS
-gb_Library_VALIDGROUPS := OOOLIBS PLAINLIBS_URE PLAINLIBS_OOO PRIVATELIBS_URE RTVERLIBS UNOVERLIBS PLAINLIBS_SHLXTHDL PLAINLIBS_NONE EXTENSIONLIBS
+gb_Library_VALIDGROUPS_NOTINSTALLED := PLAINLIBS_NONE PLAINLIBS_OXT EXTENSIONLIBS
+gb_Library_VALIDGROUPS := OOOLIBS PLAINLIBS_URE PLAINLIBS_OOO PRIVATELIBS_URE RTVERLIBS UNOVERLIBS PLAINLIBS_SHLXTHDL PLAINLIBS_NONE PLAINLIBS_OXT EXTENSIONLIBS
gb_Jar_VALIDGROUPS_INSTALLED := URE OOO
gb_Jar_VALIDGROUPS_NOTINSTALLED := OXT NONE
gb_Jar_VALIDGROUPS := URE OOO OXT NONE
diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk
index df1a03a..4828564 100644
--- a/solenv/gbuild/platform/IOS_ARM_GCC.mk
+++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk
@@ -158,6 +158,7 @@ gb_Library_FILENAMES := \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
@@ -168,6 +169,7 @@ gb_Library_LAYER := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):OOO) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
diff --git a/solenv/gbuild/platform/android.mk b/solenv/gbuild/platform/android.mk
index 4dbb29f..ae1a9ea 100644
--- a/solenv/gbuild/platform/android.mk
+++ b/solenv/gbuild/platform/android.mk
@@ -82,12 +82,14 @@ gb_Library_FILENAMES := \
ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_Library_FILENAMES += \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \
gb_Library_LAYER := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):OOO) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 4064527..b5ee0bc 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -237,6 +237,7 @@ gb_Library_LAYER := \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
@@ -259,6 +260,7 @@ gb_Library_FILENAMES :=\
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(lib)$(gb_Library_DLLEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_SHLXTHDL),$(lib):$(lib)$(gb_Library_DLLEXT)) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(lib)$(gb_Library_OOOEXT)) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 27e0a91..9b4f6a6 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -198,6 +198,7 @@ gb_Library_FILENAMES := \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT).$(gb_Library_UDK_MAJORVER)) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT).$(gb_Library_UDK_MAJORVER)) \
@@ -208,6 +209,7 @@ gb_Library_LAYER := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
diff --git a/solenv/gbuild/platform/mingw.mk b/solenv/gbuild/platform/mingw.mk
index b65e1e7..7a22dff 100644
--- a/solenv/gbuild/platform/mingw.mk
+++ b/solenv/gbuild/platform/mingw.mk
@@ -181,6 +181,7 @@ gb_Library_LAYER := \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \
$(foreach lib,$(gb_Library_PLAINLIBS_SHLXTHDL),$(lib):SHLXTHDL) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
@@ -192,6 +193,7 @@ gb_Library_ILIBFILENAMES :=\
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_SHLXTHDL),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTVEREXT)) \
@@ -204,6 +206,7 @@ gb_Library_FILENAMES :=\
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(lib)$(gb_Library_DLLEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_SHLXTHDL),$(lib):$(lib)$(gb_Library_DLLEXT)) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(lib)$(gb_Library_OOODLLEXT)) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVERDLLEXT)) \
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index d66345e..5103169 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -197,6 +197,7 @@ gb_Library_FILENAMES := \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT).$(gb_Library_UDK_MAJORVER)) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT).$(gb_Library_UDK_MAJORVER)) \
@@ -207,6 +208,7 @@ gb_Library_LAYER := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 41bdef0..bc269b3 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -192,6 +192,7 @@ gb_Library_FILENAMES := \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT).$(gb_Library_UDK_MAJORVER)) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT).$(gb_Library_UDK_MAJORVER)) \
@@ -202,6 +203,7 @@ gb_Library_LAYER := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \
$(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
commit 4764958607d8360091edf5a548509e7627df7aa8
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jun 12 15:52:51 2015 +0200
For Clang -fsanitize=vptr use -fvisibility-ms-compat, not -fvisibility=hidden
...same as f0aa1a78fb209310e8baef53c02f365fca518d11
Change-Id: I35c1e6928dd4b29ef0ab448a181a5af7fb0640ab
diff --git a/external/libfreehand/UnpackedTarball_libfreehand.mk b/external/libfreehand/UnpackedTarball_libfreehand.mk
index a6cf1c7..de07ef5 100644
--- a/external/libfreehand/UnpackedTarball_libfreehand.mk
+++ b/external/libfreehand/UnpackedTarball_libfreehand.mk
@@ -11,4 +11,14 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libfreehand))
$(eval $(call gb_UnpackedTarball_set_tarball,libfreehand,$(FREEHAND_TARBALL)))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libfreehand,0))
+
+ifeq ($(COM_GCC_IS_CLANG),TRUE)
+ifneq ($(filter -fsanitize=%,$(CC)),)
+$(eval $(call gb_UnpackedTarball_add_patches,libfreehand, \
+ external/libfreehand/ubsan-visibility.patch \
+))
+endif
+endif
+
# vim: set noet sw=4 ts=4:
diff --git a/external/libfreehand/ubsan-visibility.patch b/external/libfreehand/ubsan-visibility.patch
new file mode 100644
index 0000000..dff5cdb
--- /dev/null
+++ b/external/libfreehand/ubsan-visibility.patch
@@ -0,0 +1,11 @@
+--- configure
++++ configure
+@@ -18369,7 +18369,7 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fvisibility=hidden compiler flag" >&5
+ $as_echo_n "checking for -fvisibility=hidden compiler flag... " >&6; }
+ saved_CXXFLAGS="$CXXFLAGS"
+- CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
++ CXXFLAGS="$CXXFLAGS -fvisibility-ms-compat"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
commit e6c37fdee5ddd35460aacca401bf581d021384d9
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Jun 12 15:45:16 2015 +0200
Fix RHEL5 build
Change-Id: I9a71ee85d2d28aed5bd3f4d1f6e91261a9228d04
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 4f74583..2ce541d 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -135,6 +135,7 @@ static void toggleFindbar(GtkWidget* /*pButton*/, gpointer /*pItem*/)
/// Get the visible area of the scrolled window
static void getVisibleAreaTwips(GdkRectangle* pArea)
{
+#if GTK_CHECK_VERSION(2,14,0) // we need gtk_adjustment_get_page_size()
GtkAdjustment* pHAdjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(pScrolledWindow));
GtkAdjustment* pVAdjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(pScrolledWindow));
@@ -146,6 +147,7 @@ static void getVisibleAreaTwips(GdkRectangle* pArea)
gtk_adjustment_get_page_size(pHAdjustment));
pArea->height = lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView),
gtk_adjustment_get_page_size(pVAdjustment));
+#endif
}
commit e6a1956034c98204e30b0ca40330249d6f6f8155
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri Jun 12 15:36:03 2015 +0200
tdf#91301: Don't cache incomplete tabs.
After introduction of the Idle processing, something has changed so
that the underlying GetGdkWindow() does not update its size fast enough;
even though the gtk_window_resize() is called before the Window::Erase()
(that actually paints the background) etc.
The consequence of the not-yet-updated gdkDrawable is that we cache
something that has the correct background in the top left 200x200
pixels, but the rest is just copied from the screen.
Let's for now just not cache when the GetGdkWindow() is smaller than
what we actually paint; TODO find the root cause.
Change-Id: Ib6092668eb4613899f665bb0f12fc1eb15484e13
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 463d9fe..365dba8 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -2914,11 +2914,31 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
}
END_CACHE_PIXMAP_RENDER( pixmapRect, pixmap, mask )
+ // tdf#91301 workaround
+ //
+ // After introduction of the Idle processing, something has changed so
+ // that the underlying GetGdkWindow() does not update its size fast enough;
+ // even though the gtk_window_resize is called before the Window::Erase()
+ // (that actually paints the background) etc.
+ //
+ // The consequence of the not-yet-updated gdkDrawable is that we cache
+ // something that has the correct background in the top left 200x200
+ // pixels, but the rest is just copied from the screen.
+ //
+ // Let's for now just not cache when the GetGdkWindow() is smaller than
+ // what we actually paint; TODO find the root cause.
+ gint width, height;
+ gdk_drawable_get_size(GetGdkWindow(), &width, &height);
+ bool bAllowCaching = (pixmapRect.Right() < width) && (pixmapRect.Bottom() < height);
+
// cache data
- if( nType == CTRL_TAB_ITEM )
- aCacheItems.Fill( nType, nState, pixmapRect, pixmap, mask );
- else
- aCachePage.Fill( nType, nState, pixmapRect, pixmap, mask );
+ if (bAllowCaching)
+ {
+ if (nType == CTRL_TAB_ITEM)
+ aCacheItems.Fill(nType, nState, pixmapRect, pixmap, mask);
+ else
+ aCachePage.Fill(nType, nState, pixmapRect, pixmap, mask);
+ }
return true;
}
commit fbfee1dd45c85a85f692f50a790f1ce757149b0d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Jun 5 13:59:22 2015 +0200
make it easier to find missing sidebar components
Change-Id: Id962fbc20d12db59818dfca421843c674755e36c
Reviewed-on: https://gerrit.libreoffice.org/16101
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx
index 9e47837..d2b6645 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -505,8 +505,10 @@ throw ( RuntimeException, std::exception )
if ( !aServiceSpecifier.isEmpty() ) try
{
- return Reference< XUIElementFactory >(m_xContext->getServiceManager()->
+ Reference< XUIElementFactory > xFactory(m_xContext->getServiceManager()->
createInstanceWithContext(aServiceSpecifier, m_xContext), UNO_QUERY);
+ SAL_WARN_IF(!xFactory.is(), "fwk.uielement", "could not create factory: " << aServiceSpecifier);
+ return xFactory;
}
catch ( const css::loader::CannotActivateFactoryException& )
{
commit b6d0c53e514565bf9fbe8500800f0c6ece40806e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Jun 12 02:45:54 2015 +0200
get rid of a few thousand unnecessary OpenGL calls
For each iteration of the (gtk) main loop we are dropping the yield
mutext which results in calling OpenGLContext::clearCurrent. That method
calls OpenGLContext::ReleaseFramebuffers which would call in the end
glBindFramebuffer for each framebuffer related to that context.
This would easily grow into the thousand OpenGL calls without doing any
work.
Change-Id: I209cc534fe58a5e11ef7df7f850a787916b8bd43
Reviewed-on: https://gerrit.libreoffice.org/16241
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 0c713bd..ab8ba12 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1581,8 +1581,11 @@ void OpenGLContext::ReleaseFramebuffers()
OpenGLFramebuffer* pFramebuffer = mpLastFramebuffer;
while( pFramebuffer )
{
- BindFramebuffer( pFramebuffer );
- pFramebuffer->DetachTexture();
+ if (!pFramebuffer->IsFree())
+ {
+ BindFramebuffer( pFramebuffer );
+ pFramebuffer->DetachTexture();
+ }
pFramebuffer = pFramebuffer->mpPrevFramebuffer;
}
}
commit 7b2e70f0c83dc333f3ad2e4584703c306269f466
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Jun 12 02:26:01 2015 +0200
that case can't happen anymore
Change-Id: If488a6aa6769ad45f08ad78de35402f676abe784
Reviewed-on: https://gerrit.libreoffice.org/16240
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/vcl/opengl/x11/salvd.cxx b/vcl/opengl/x11/salvd.cxx
index 9e9986f..0b42c11 100644
--- a/vcl/opengl/x11/salvd.cxx
+++ b/vcl/opengl/x11/salvd.cxx
@@ -42,6 +42,7 @@ X11OpenGLSalVirtualDevice::X11OpenGLSalVirtualDevice( SalGraphics* pGraphics,
mbGraphics( false ),
mnXScreen( 0 )
{
+ assert(mpGraphics);
// TODO Do we really need the requested bit count?
if( !nBitCount && pGraphics )
nBitCount = pGraphics->GetBitCount();
@@ -55,11 +56,6 @@ X11OpenGLSalVirtualDevice::X11OpenGLSalVirtualDevice( SalGraphics* pGraphics,
vcl_sal::getSalDisplay(GetGenericData())->GetDefaultXScreen();
mnWidth = nDX;
mnHeight = nDY;
- if (!mpGraphics)
- {
- mpGraphics = new X11SalGraphics();
- mpGraphics->SetLayout( SalLayoutFlags::NONE );
- }
mpGraphics->Init( this );
}
commit c4f63de0eebf8ba5c58e269c9a3763c42448424e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Jun 12 02:23:09 2015 +0200
Revert "Fix LibreOffice running with SAL_ENABLEGL=1"
This reverts commit 6bf39b2f4ea4e880d8414b04269405e6b48efe23.
Change-Id: I97619740f34cf0046f89352553dba73723f35a6f
Reviewed-on: https://gerrit.libreoffice.org/16239
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index 357d24c..11a18e5 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -322,12 +322,9 @@ SalVirtualDevice* GtkInstance::CreateVirtualDevice( SalGraphics *pG,
return pNew;
#else
GtkSalGraphics *pGtkSalGraphics = dynamic_cast<GtkSalGraphics*>(pG);
-
- GtkSalGraphics *pNewGraphics = NULL;
- if (pGtkSalGraphics)
- pNewGraphics = new GtkSalGraphics(pGtkSalGraphics->GetGtkFrame(), pGtkSalGraphics->GetGtkWidget());
-
- return CreateX11VirtualDevice(pG, nDX, nDY, nBitCount, pGd, pNewGraphics);
+ assert(pGtkSalGraphics);
+ return CreateX11VirtualDevice(pG, nDX, nDY, nBitCount, pGd,
+ new GtkSalGraphics(pGtkSalGraphics->GetGtkFrame(), pGtkSalGraphics->GetGtkWidget()));
#endif
}
commit 7a9dc7fd35168e1f44fb0aa23c984f90163db621
Author: Pranav Kant <pranavk at gnome.org>
Date: Wed Jun 10 16:10:19 2015 +0530
lokdocview: Create LOK context inside of lok_doc_view_new
Change-Id: I675192d6bd6d10e6c7974a5de6f488f9a087ac32
diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 24c577e..bdd2e9a 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -46,7 +46,7 @@ struct _LOKDocViewClass
GType lok_doc_view_get_type (void) G_GNUC_CONST;
-GtkWidget* lok_doc_view_new (LibreOfficeKit* pOffice );
+GtkWidget* lok_doc_view_new (const char* pPath);
gboolean lok_doc_view_open_document (LOKDocView* pDocView,
char* pPath);
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index c8b47f7..4f74583 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -19,7 +19,6 @@
#include <gtk/gtk.h>
#include <LibreOfficeKit/LibreOfficeKitGtk.h>
-#include <LibreOfficeKit/LibreOfficeKitInit.h>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#ifndef g_info
@@ -53,8 +52,6 @@ GtkWidget* pFindbar;
GtkWidget* pFindbarEntry;
GtkWidget* pFindbarLabel;
-static LibreOfficeKit* pOffice;
-
static void lcl_registerToolItem(GtkToolItem* pItem, const std::string& rName)
{
g_aToolItemCommandNames[pItem] = rName;
@@ -361,10 +358,6 @@ int main( int argc, char* argv[] )
return 1;
}
- pOffice = lok_init( argv[1] );
- if ( pOffice == NULL )
- return 1;
-
gtk_init( &argc, &argv );
GtkWidget *pWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL );
@@ -469,7 +462,9 @@ int main( int argc, char* argv[] )
gtk_box_pack_end(GTK_BOX(pVBox), pFindbar, FALSE, FALSE, 0);
// Docview
- pDocView = lok_doc_view_new( pOffice );
+ pDocView = lok_doc_view_new(argv[1]);
+ if (pDocView == NULL)
+ g_error ("Error while creating LOKDocView widget");
g_signal_connect(pDocView, "edit-changed", G_CALLBACK(signalEdit), NULL);
g_signal_connect(pDocView, "command-changed", G_CALLBACK(signalCommand), NULL);
g_signal_connect(pDocView, "search-not-found", G_CALLBACK(signalSearch), NULL);
@@ -492,7 +487,7 @@ int main( int argc, char* argv[] )
int bOpened = lok_doc_view_open_document( LOK_DOC_VIEW(pDocView), argv[2] );
if (!bOpened)
- g_error("main: lok_doc_view_open_document() failed with '%s'", pOffice->pClass->getError(pOffice));
+ g_error("main: lok_doc_view_open_document() failed");
assert(lok_doc_view_get_document(LOK_DOC_VIEW(pDocView)));
// GtkComboBox requires gtk 2.24 or later
@@ -507,8 +502,6 @@ int main( int argc, char* argv[] )
gtk_main();
- pOffice->pClass->destroy( pOffice );
-
return 0;
}
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index d3d14a2..44398c4 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -18,6 +18,7 @@
#include <com/sun/star/awt/Key.hpp>
#define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKit.h>
+#include <LibreOfficeKit/LibreOfficeKitInit.h>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <LibreOfficeKit/LibreOfficeKitGtk.h>
#include <rsc/rsc-vcl-shared-types.hxx>
@@ -308,7 +309,10 @@ LOKDocView_Impl::~LOKDocView_Impl()
{
if (m_pDocument)
m_pDocument->pClass->destroy(m_pDocument);
+ if (m_pOffice)
+ m_pOffice->pClass->destroy(m_pOffice);
m_pDocument = 0;
+ m_pOffice = 0;
}
void LOKDocView_Impl::destroy(LOKDocView* pDocView, gpointer /*pData*/)
@@ -1177,14 +1181,16 @@ static void lok_doc_view_init (LOKDocView* pDocView)
/**
* lok_doc_view_new:
- * @pOffice: The LibreOfficeKit context.
+ * @pPath: LibreOffice install path.
*
* Returns: The #LOKDocView widget instance.
*/
-SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new( LibreOfficeKit* pOffice )
+SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new(const char* pPath)
{
- LOKDocView* pDocView = LOK_DOC_VIEW(gtk_type_new(lok_doc_view_get_type()));
- pDocView->m_pImpl->m_pOffice = pOffice;
+ LOKDocView* pDocView = LOK_DOC_VIEW(g_object_new(LOK_TYPE_DOC_VIEW, NULL));
+ pDocView->m_pImpl->m_pOffice = lok_init (pPath);
+ if (pDocView->m_pImpl->m_pOffice == NULL)
+ return NULL;
return GTK_WIDGET( pDocView );
}
commit 97c9a87ac88b18e7bbb72ad218e5ed5cf4f4b2ed
Author: Pranav Kant <pranavk at gnome.org>
Date: Tue Jun 9 18:08:59 2015 +0530
lokdocview: Make this GObject class introspectable
... so that this widget can be used from other languages.
Change-Id: Icd7d6df6aa587ffdb018af0b911300dc81ec6560
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 5f642d9..d3d14a2 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -121,7 +121,7 @@ struct LOKDocView_Impl
static void onExposed(GtkWidget *widget, GdkEventExpose *event, gpointer user_data);
/// Receives a key press or release event.
void signalKey(GdkEventKey* pEvent);
- /**
+ /*
* The user drags the handle, which is below the cursor, but wants to move the
* cursor accordingly.
*
@@ -144,7 +144,7 @@ struct LOKDocView_Impl
gboolean renderOverlayImpl(GtkWidget* pEventBox);
/// Is rRectangle empty?
static bool isEmptyRectangle(const GdkRectangle& rRectangle);
- /**
+ /*
* Renders pHandle below an rCursor rectangle on pCairo.
* @param rRectangle output parameter, the rectangle that contains the rendered handle.
*/
@@ -1175,6 +1175,12 @@ static void lok_doc_view_init (LOKDocView* pDocView)
g_signal_connect(G_OBJECT(pDocView), "destroy", G_CALLBACK(LOKDocView_Impl::destroy), 0);
}
+/**
+ * lok_doc_view_new:
+ * @pOffice: The LibreOfficeKit context.
+ *
+ * Returns: The #LOKDocView widget instance.
+ */
SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new( LibreOfficeKit* pOffice )
{
LOKDocView* pDocView = LOK_DOC_VIEW(gtk_type_new(lok_doc_view_get_type()));
@@ -1182,6 +1188,13 @@ SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new( LibreOfficeKit* pOffice )
return GTK_WIDGET( pDocView );
}
+/**
+ * lok_doc_view_open_document:
+ * @pDocView: The #LOKDocView instance
+ * @pPath: The path of the document that #LOKDocView widget should try to open
+ *
+ * Returns: %TRUE if the document is loaded succesfully, %FALSE otherwise
+ */
SAL_DLLPUBLIC_EXPORT gboolean lok_doc_view_open_document( LOKDocView* pDocView, char* pPath )
{
if ( pDocView->m_pImpl->m_pDocument )
@@ -1226,11 +1239,24 @@ SAL_DLLPUBLIC_EXPORT gboolean lok_doc_view_open_document( LOKDocView* pDocView,
return TRUE;
}
+/**
+ * lok_doc_view_get_document:
+ * @pDocView: The #LOKDocView instance
+ *
+ * Returns: The #LibreOfficeKitDocument instance the widget is currently showing
+ */
SAL_DLLPUBLIC_EXPORT LibreOfficeKitDocument* lok_doc_view_get_document(LOKDocView* pDocView)
{
return pDocView->m_pImpl->m_pDocument;
}
+/**
+ * lok_doc_view_set_zoom:
+ * @pDocView: The #LOKDocView instance
+ * @fZoom: The new zoom level that pDocView must set it into.
+ *
+ * Sets the new zoom level for the widget.
+ */
SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_zoom ( LOKDocView* pDocView, float fZoom )
{
pDocView->m_pImpl->m_fZoom = fZoom;
@@ -1246,6 +1272,12 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_zoom ( LOKDocView* pDocView, float fZ
nDocumentHeightPixels);
}
+/**
+ * lok_doc_view_get_zoom:
+ * @pDocView: The #LOKDocView instance
+ *
+ * Returns: The current zoom factor value in float for pDocView
+ */
SAL_DLLPUBLIC_EXPORT float lok_doc_view_get_zoom ( LOKDocView* pDocView )
{
return pDocView->m_pImpl->m_fZoom;
@@ -1277,6 +1309,13 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_partmode( LOKDocView* pDocView,
pDocView->m_pImpl->m_pDocument->pClass->setPartMode( pDocView->m_pImpl->m_pDocument, nPartMode );
}
+/**
+ * lok_doc_view_set_edit:
+ * @pDocView: The #LOKDocView instance
+ * @bEdit: %TRUE if the pDocView should go in edit mode, %FALSE otherwise
+ *
+ * Sets the edit-mode for pDocView
+ */
SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_edit( LOKDocView* pDocView,
gboolean bEdit )
{
@@ -1294,6 +1333,12 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_edit( LOKDocView* pDocView,
gtk_widget_queue_draw(GTK_WIDGET(pDocView));
}
+/**
+ * lok_doc_view_get_edit:
+ * @pDocView: The #LOKDocView instance
+ *
+ * Returns: %TRUE if the given pDocView is in edit mode.
+ */
SAL_DLLPUBLIC_EXPORT gboolean lok_doc_view_get_edit(LOKDocView* pDocView)
{
return pDocView->m_pImpl->m_bEdit;
@@ -1310,11 +1355,29 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_post_key(GtkWidget* /*pWidget*/, GdkEvent
pDocView->m_pImpl->signalKey(pEvent);
}
+/**
+ * lok_doc_view_pixel_to_twip:
+ * @pDocView: The #LOKDocView instance
+ * @fInput: The value in pixels to convert to twips
+ *
+ * Converts the value in pixels to twips according to zoom level.
+ *
+ * Returns: The corresponding value in twips
+ */
SAL_DLLPUBLIC_EXPORT float lok_doc_view_pixel_to_twip(LOKDocView* pDocView, float fInput)
{
return pixelToTwip(fInput, pDocView->m_pImpl->m_fZoom);
}
+/**
+ * lok_doc_view_twip_to_pixel:
+ * @pDocView: The #LOKDocView instance
+ * @fInput: The value in twips to convert to pixels
+ *
+ * Converts the value in twips to pixels according to zoom level.
+ *
+ * Returns: The corresponding value in pixels
+ */
SAL_DLLPUBLIC_EXPORT float lok_doc_view_twip_to_pixel(LOKDocView* pDocView, float fInput)
{
return twipToPixel(fInput, pDocView->m_pImpl->m_fZoom);
commit 8d0b34c3a6292ce9c5a081ef95890ae0c5e07ac7
Author: Pranav Kant <pranavk at gnome.org>
Date: Tue Jun 9 16:27:37 2015 +0530
lokdocview: Change parent class to GtkDrawingArea
It is not the job of the widget to provide the scroll bars.
Change-Id: Iafc5724ed5b21717d711bb8f7e1a076dd1288b76
diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index e84feee..24c577e 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -31,21 +31,23 @@ typedef struct _LOKDocViewClass LOKDocViewClass;
struct _LOKDocView
{
- GtkScrolledWindow aScrollWindow;
+ GtkDrawingArea aDrawingArea;
struct LOKDocView_Impl* m_pImpl;
};
struct _LOKDocViewClass
{
- GtkScrolledWindowClass parent_class;
- void (* edit_changed) (LOKDocView* pView, gboolean was_edit);
- void (* command_changed) (LOKDocView* pView, char* new_state);
- void (* search_not_found) (LOKDocView* pView, char* new_state);
- void (* part_changed) (LOKDocView* pView, int new_part);
+ GtkDrawingAreaClass parent_class;
+ void (* edit_changed) (LOKDocView* pView, gboolean was_edit);
+ void (* command_changed) (LOKDocView* pView, char* new_state);
+ void (* search_not_found) (LOKDocView* pView, char* new_state);
+ void (* part_changed) (LOKDocView* pView, int new_part);
};
GType lok_doc_view_get_type (void) G_GNUC_CONST;
+
GtkWidget* lok_doc_view_new (LibreOfficeKit* pOffice );
+
gboolean lok_doc_view_open_document (LOKDocView* pDocView,
char* pPath);
@@ -80,9 +82,11 @@ void lok_doc_view_post_key (GtkWidget* p
GdkEventKey* pEvent,
gpointer pData);
-/// Get the visible area of the document (in twips).
-void lok_doc_view_get_visarea (LOKDocView* pThis,
- GdkRectangle* pArea);
+float lok_doc_view_pixel_to_twip (LOKDocView* pDocView,
+ float fInput);
+
+float lok_doc_view_twip_to_pixel (LOKDocView* pDocView,
+ float fInput);
G_END_DECLS
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 38b29ee..c8b47f7 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -38,6 +38,7 @@ static GtkToolItem* pBold;
static GtkToolItem* pItalic;
static GtkToolItem* pUnderline;
static GtkToolItem* pStrikethrough;
+static GtkWidget* pScrolledWindow;
std::map<GtkToolItem*, std::string> g_aToolItemCommandNames;
std::map<std::string, GtkToolItem*> g_aCommandNameToolItems;
bool g_bToolItemBroadcast = true;
@@ -134,6 +135,23 @@ static void toggleFindbar(GtkWidget* /*pButton*/, gpointer /*pItem*/)
#endif
}
+/// Get the visible area of the scrolled window
+static void getVisibleAreaTwips(GdkRectangle* pArea)
+{
+ GtkAdjustment* pHAdjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(pScrolledWindow));
+ GtkAdjustment* pVAdjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(pScrolledWindow));
+
+ pArea->x = lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView),
+ gtk_adjustment_get_value(pHAdjustment));
+ pArea->y = lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView),
+ gtk_adjustment_get_value(pVAdjustment));
+ pArea->width = lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView),
+ gtk_adjustment_get_page_size(pHAdjustment));
+ pArea->height = lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView),
+ gtk_adjustment_get_page_size(pVAdjustment));
+}
+
+
/// Handles the key-press-event of the window.
static gboolean signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointer pData)
{
@@ -161,7 +179,7 @@ static void doSearch(bool bBackwards)
LOKDocView* pLOKDocView = LOK_DOC_VIEW(pDocView);
GdkRectangle aArea;
- lok_doc_view_get_visarea(pLOKDocView, &aArea);
+ getVisibleAreaTwips(&aArea);
aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchStartPointX/type", '/'), "long");
aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchStartPointX/value", '/'), aArea.x);
aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchStartPointY/type", '/'), "long");
@@ -461,7 +479,12 @@ int main( int argc, char* argv[] )
g_signal_connect(pWindow, "key-press-event", G_CALLBACK(signalKey), pDocView);
g_signal_connect(pWindow, "key-release-event", G_CALLBACK(signalKey), pDocView);
- gtk_container_add( GTK_CONTAINER(pVBox), pDocView );
+ // Scrolled window for DocView
+ pScrolledWindow = gtk_scrolled_window_new(0, 0);
+ gtk_container_add(GTK_CONTAINER(pVBox), pScrolledWindow);
+
+ // DocView doesn't have scrolling capability, so need a viewport
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(pScrolledWindow), pDocView);
gtk_widget_show_all( pWindow );
// Hide the findbar by default.
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index ed3fc5c..5f642d9 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -41,7 +41,6 @@
struct LOKDocView_Impl
{
LOKDocView* m_pDocView;
- GtkWidget *m_pDrawingArea;
TileBuffer m_aTileBuffer;
float m_fZoom;
@@ -119,7 +118,7 @@ struct LOKDocView_Impl
/// Connected to the destroy signal of LOKDocView, deletes its LOKDocView_Impl.
static void destroy(LOKDocView* pDocView, gpointer pData);
/// Connected to the expose-event of the GtkDrawingArea
- static void on_exposed(GtkWidget *widget, GdkEvent *event, gpointer user_data);
+ static void onExposed(GtkWidget *widget, GdkEventExpose *event, gpointer user_data);
/// Receives a key press or release event.
void signalKey(GdkEventKey* pEvent);
/**
@@ -156,16 +155,8 @@ struct LOKDocView_Impl
static gboolean handleTimeout(gpointer pData);
/// Implementation of the timeout handler, invoked by handleTimeout().
gboolean handleTimeoutImpl();
- /**
- * Renders the document to a number of visible tiles.
- *
- * This method is invoked only manually, not when some Gtk signal is
- * emitted.
- *
- * @param pPartial if 0, then the full visible document is rendered, otherwise only
- * the tiles that intersect with pPartial.
- */
- void renderDocument(GdkRectangle* pPartial);
+ /// Implementation of expose event handler, invoked by onExposed().
+ void onExposedImpl(GdkEventExpose* event);
/// Returns the GdkRectangle of a x,y,width,height string.
GdkRectangle payloadToRectangle(const char* pPayload);
/// Returns the GdkRectangles of a x1,y1,w1,h1;x2,y2,w2,h2;... string.
@@ -213,7 +204,7 @@ SAL_DLLPUBLIC_EXPORT GType lok_doc_view_get_type();
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
-G_DEFINE_TYPE(LOKDocView, lok_doc_view, GTK_TYPE_SCROLLED_WINDOW)
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list