Hey everyone,
I've been meaning to do an easy hack ever since LibreOffice announced.
Not to get to political, but recently AOOo and the efforts of it's
backers has riled me up enough to push through the build issues I was
having and put my money (time) where my mouth is.
I've followed Michael Meek's blog over the years via planet GNOME, but
this post struck a chord with me:
http://mail-archives.apache.org/mod_mbox/incubator-ooo-dev/201110.mbox/%3C1319628345.22078.111.camel%40linux-yjtf.site%3E
So here I am with me first contribution.
I was thinking of an easy hack, but I had to submit a brief summary
recently where word count was limited and it was a pain to have to
continuously open the word count dialog.
I couldn't find a LO bug on this, but there is an OOo one from 2005:
http://openoffice.org/bugzilla/show_bug.cgi?id=46785
I thought it would be easier than it turned out to be, and expect some
changes may need to be made, but here it is, a fix for a 6 year old bug.
Patch licensed under LGPLv3+/MPL.
Thanks!
From e55b1ebaf7c21bcf532e571717626be2eebfb8cf Mon Sep 17 00:00:00 2001
From: Matt Pratt mattpratt...@gmail.com
Date: Tue, 1 Nov 2011 22:47:33 -0600
Subject: [PATCH] Word count dialog modeless
---
sw/Library_sw.mk |1 +
sw/inc/swabstdlg.hxx | 12 -
sw/source/ui/app/swmodule.cxx|2 +
sw/source/ui/dialog/swdlgfact.cxx| 45 +++--
sw/source/ui/dialog/swdlgfact.hxx| 15 +--
sw/source/ui/dialog/wordcountdialog.cxx | 56 +-
sw/source/ui/dialog/wordcountdialog.hrc |1 +
sw/source/ui/dialog/wordcountdialog.src | 12 +-
sw/source/ui/dialog/wordcountwrapper.cxx | 64 ++
sw/source/ui/docvw/edtwin.cxx| 16 +++
sw/source/ui/inc/wordcountdialog.hxx | 38 +-
sw/source/ui/shells/annotsh.cxx | 23 ---
sw/source/ui/shells/drawsh.cxx | 22 --
sw/source/ui/shells/drwtxtex.cxx | 22 --
sw/source/ui/shells/frmsh.cxx| 22 --
sw/source/ui/shells/textsh.cxx |1 +
sw/source/ui/shells/textsh1.cxx | 24 ---
17 files changed, 280 insertions(+), 96 deletions(-)
create mode 100644 sw/source/ui/dialog/wordcountwrapper.cxx
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index b2ce776..a8ee383 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -615,6 +615,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/ui/frmdlg/frmmgr \
sw/source/ui/globdoc/globdoc \
sw/source/ui/index/idxmrk \
+sw/source/ui/dialog/wordcountwrapper \
sw/source/ui/index/toxmgr \
sw/source/ui/lingu/hhcwrp \
sw/source/ui/lingu/hyp \
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index b928169..a8fc6ef 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -200,10 +200,11 @@ public:
virtual void SetSectionData(SwSectionData const rSect) = 0;
};
-class AbstractSwWordCountDialog : public VclAbstractDialog
+class AbstractSwWordCountFloatDlg : public VclAbstractDialog
{
public:
-virtual voidSetValues(const SwDocStat rCurrent, const SwDocStat rDoc) = 0;
+virtual voidUpdateCounts() = 0;
+virtual Window *GetWindow() = 0; //this method is added for return a Window type pointer
};
class AbstractSwInsertAbstractDlg : public VclAbstractDialog// add for SwInsertAbstractDlg
@@ -353,7 +354,12 @@ public:
const ::com::sun::star::uno::Reference ::com::sun::star::frame::XFrame _rxFrame,
sal_uInt32 nResId
) = 0;
-virtual AbstractSwWordCountDialog* CreateSwWordCountDialog( Window* pWindow ) = 0;
+virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(int nResId,
+SfxBindings* pBindings,
+ SfxChildWindow* pChild,
+ Window *pParent,
+SfxChildWinInfo* pInfo) = 0;
+
virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg ( Window* pParent, int nResId) = 0; // add for SwInsertAbstractDlg
virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell rDocSh,
SvStream* pStream, int nResId ) = 0;// add for SwAsciiFilterDlg
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 4a66362..e1bdf64 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -122,6 +122,7 @@
#include sfx2/appuno.hxx
#include swatrset.hxx
#include idxmrk.hxx
+#include wordcountdialog.hxx