diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-01-25 12:57:14 -0500 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-01-27 00:58:42 +0000 |
commit | c4820200312e3d50a12d3605147772759938bcf6 (patch) | |
tree | 043fd7a14afb2e6537eb93b3ac1f4d3bbe1a8c8a /sc/source/core | |
parent | 04f2233c6c8a503147105af86ad447f70d33ec71 (diff) |
fdo#59056: Re-calculate cell anchor position of a pasted drawing object.
Else it would re-use the anchor position of the original one (minus the
sheet index which is correctly adjusted).
Change-Id: I52d11eb9953ee7539c9d5da41edd7dd28604587c
Reviewed-on: https://gerrit.libreoffice.org/1869
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 76d67944a161..8ea4fcaa4b9f 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -1787,6 +1787,13 @@ void ScDrawLayer::UpdateCellAnchorFromPositionEnd( SdrObject &rObj, const ScDocu pAnchor->maEndOffset.X() = aCellRect.Right()-aObjRect.Left(); } +bool ScDrawLayer::IsCellAnchored( const SdrObject& rObj ) +{ + // Cell anchored object always has a user data, to store the anchor cell + // info. If it doesn't then it's page-anchored. + return GetFirstUserDataOfType(&rObj, SC_UD_OBJDATA) != NULL; +} + void ScDrawLayer::SetPageAnchored( SdrObject &rObj ) { DeleteFirstUserDataOfType(&rObj, SC_UD_OBJDATA); |