summaryrefslogtreecommitdiff
path: root/sw/source/core/crsr
diff options
context:
space:
mode:
authorBjoern Michaelsen <b_michaelsen@openoffice.org>2010-02-09 14:41:17 +0100
committerBjoern Michaelsen <b_michaelsen@openoffice.org>2010-02-09 14:41:17 +0100
commit4b2be0beb412d9ebeaa33aea07265c3581e70eff (patch)
tree0f27a923d7cac592def1ee6dc52e7ad19cccfb2a /sw/source/core/crsr
parent8e5ce7a3a0703fb3af27da7ffea023830a340b04 (diff)
parentb36241988ea99ba2a9d290ec838a3557d0333d63 (diff)
cbosdo02: merging changesets up to DEV300_m71
Diffstat (limited to 'sw/source/core/crsr')
-rw-r--r--sw/source/core/crsr/bookmrk.cxx20
-rw-r--r--sw/source/core/crsr/crsrsh.cxx6
2 files changed, 19 insertions, 7 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index dd467185a9f8..385d4fb85f04 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -42,7 +42,7 @@
#include <svx/linkmgr.hxx>
#include <swtypes.hxx>
#include <undobj.hxx>
-#include <unoobj.hxx>
+#include <unobookmark.hxx>
#include <rtl/random.h>
#include <xmloff/odffields.hxx>
@@ -50,6 +50,7 @@
SV_IMPL_REF( SwServerObject )
using namespace ::sw::mark;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
namespace
@@ -166,6 +167,16 @@ namespace sw { namespace mark
}
+ void MarkBase::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+ {
+ SwModify::Modify(pOld, pNew);
+ if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
+ { // invalidate cached uno object
+ SetXBookmark(uno::Reference<text::XTextContent>(0));
+ }
+ }
+
+
NavigatorReminder::NavigatorReminder(const SwPaM& rPaM)
: MarkBase(rPaM, our_sNamePrefix)
{ }
@@ -258,8 +269,7 @@ namespace sw { namespace mark
return !pDoc->IsInHeaderFooter( SwNodeIndex(GetMarkPos().nNode) );
}
- ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable >
- Bookmark::MakeUnoObject()
+ uno::Reference< rdf::XMetadatable > Bookmark::MakeUnoObject()
{
// re-use existing SwXBookmark
SwClientIter iter( *this );
@@ -275,7 +285,9 @@ namespace sw { namespace mark
// create new SwXBookmark
SwDoc *const pDoc( GetMarkPos().GetDoc() );
OSL_ENSURE(pDoc, "Bookmark::MakeUnoObject: no doc?");
- return new SwXBookmark(this, pDoc);
+ const uno::Reference< rdf::XMetadatable> xMeta(
+ SwXBookmark::CreateXBookmark(*pDoc, *this), uno::UNO_QUERY);
+ return xMeta;
}
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 3637cc19354d..b816b7c24205 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -66,7 +66,7 @@
#include <mdiexp.hxx> // ...Percent()
#include <fmteiro.hxx>
#include <wrong.hxx> // SMARTTAGS
-#include <unoobj.hxx> // SMARTTAGS
+#include <unotextrange.hxx> // SMARTTAGS
#include <vcl/svapp.hxx>
#include <numrule.hxx>
#include <IGrammarContact.hxx>
@@ -3372,8 +3372,8 @@ void lcl_FillTextRange( uno::Reference<text::XTextRange>& rRange,
SwPosition aEndPos( aStartPos );
aEndPos.nContent = nBegin + nLen;
- uno::Reference<text::XTextRange> xRange =
- SwXTextRange::CreateTextRangeFromPosition( rNode.GetDoc(), aStartPos, &aEndPos);
+ const uno::Reference<text::XTextRange> xRange =
+ SwXTextRange::CreateXTextRange(*rNode.GetDoc(), aStartPos, &aEndPos);
rRange = xRange;
}