Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
55f0c9e0
Kaydet (Commit)
55f0c9e0
authored
Ock 25, 2013
tarafından
Noel Power
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
import page/cell anchoring for xlsx drawing objects fdo#58360
Change-Id: I5f6cf9c5f28e8176c1057d50e39c67202bf1f143
üst
1f41546e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
11 deletions
+31
-11
drawingbase.hxx
sc/source/filter/inc/drawingbase.hxx
+11
-9
drawingbase.cxx
sc/source/filter/oox/drawingbase.cxx
+11
-2
drawingfragment.cxx
sc/source/filter/oox/drawingfragment.cxx
+9
-0
No files found.
sc/source/filter/inc/drawingbase.hxx
Dosyayı görüntüle @
55f0c9e0
...
...
@@ -79,6 +79,14 @@ struct AnchorClientDataModel
class
ShapeAnchor
:
public
WorksheetHelper
{
public
:
enum
AnchorType
{
ANCHOR_INVALID
,
/// Anchor type is unknown.
ANCHOR_ABSOLUTE
,
/// Absolute anchor (top-left corner and size in absolute units).
ANCHOR_ONECELL
,
/// One-cell anchor (top-left corner at cell, size in absolute units).
ANCHOR_TWOCELL
,
/// Two-cell anchor (top-left and bottom-right corner at cell).
ANCHOR_VML
};
explicit
ShapeAnchor
(
const
WorksheetHelper
&
rHelper
);
/** Imports the shape anchor (one of the elements xdr:absoluteAnchor, xdr:oneCellAnchor, xdr:twoCellAnchor). */
...
...
@@ -100,19 +108,13 @@ public:
/** Calculates the resulting shape anchor in 1/100 mm. */
::
com
::
sun
::
star
::
awt
::
Rectangle
calcAnchorRectHmm
(
const
::
com
::
sun
::
star
::
awt
::
Size
&
rPageSizeHmm
)
const
;
AnchorType
getEditAs
()
const
{
return
meEditAs
;
}
private
:
/** Converts the passed anchor to an absolute position in EMUs. */
::
oox
::
drawingml
::
EmuPoint
calcCellAnchorEmu
(
const
CellAnchorModel
&
rModel
)
const
;
private
:
enum
AnchorType
{
ANCHOR_INVALID
,
/// Anchor type is unknown.
ANCHOR_ABSOLUTE
,
/// Absolute anchor (top-left corner and size in absolute units).
ANCHOR_ONECELL
,
/// One-cell anchor (top-left corner at cell, size in absolute units).
ANCHOR_TWOCELL
,
/// Two-cell anchor (top-left and bottom-right corner at cell).
ANCHOR_VML
};
/** Specifies how cell positions from CellAnchorModel have to be processed. */
enum
CellAnchorType
...
...
@@ -129,7 +131,7 @@ private:
CellAnchorModel
maFrom
;
/// Top-left position, if anchor is not of type absolute.
CellAnchorModel
maTo
;
/// Bottom-right position, if anchor is of type two-cell.
AnchorClientDataModel
maClientData
;
/// Shape client data.
sal_Int32
mn
EditAs
;
/// Anchor mode as shown in the UI.
AnchorType
me
EditAs
;
/// Anchor mode as shown in the UI.
};
// ============================================================================
...
...
sc/source/filter/oox/drawingbase.cxx
Dosyayı görüntüle @
55f0c9e0
...
...
@@ -79,7 +79,7 @@ ShapeAnchor::ShapeAnchor( const WorksheetHelper& rHelper ) :
WorksheetHelper
(
rHelper
),
meAnchorType
(
ANCHOR_INVALID
),
meCellAnchorType
(
CELLANCHOR_EMU
),
m
nEditAs
(
XML_twoCell
)
m
eEditAs
(
ANCHOR_TWOCELL
)
{
}
...
...
@@ -94,8 +94,17 @@ void ShapeAnchor::importAnchor( sal_Int32 nElement, const AttributeList& rAttrib
meAnchorType
=
ANCHOR_ONECELL
;
break
;
case
XDR_TOKEN
(
twoCellAnchor
):
{
meAnchorType
=
ANCHOR_TWOCELL
;
mnEditAs
=
rAttribs
.
getToken
(
XML_editAs
,
XML_twoCell
);
OUString
sEditAs
=
rAttribs
.
getXString
(
XML_editAs
,
OUString
()
);
if
(
!
sEditAs
.
isEmpty
()
)
{
if
(
sEditAs
.
equalsIgnoreAsciiCaseAscii
(
"absolute"
)
)
meEditAs
=
ANCHOR_ABSOLUTE
;
else
if
(
sEditAs
.
equalsIgnoreAsciiCaseAscii
(
"oneCell"
)
)
meEditAs
=
ANCHOR_ONECELL
;
}
}
break
;
default
:
OSL_ENSURE
(
false
,
"ShapeAnchor::importAnchor - unexpected element"
);
...
...
sc/source/filter/oox/drawingfragment.cxx
Dosyayı görüntüle @
55f0c9e0
...
...
@@ -289,6 +289,15 @@ void DrawingFragment::onEndElement()
convertEmuToHmm
(
aShapeRectEmu
.
X
),
convertEmuToHmm
(
aShapeRectEmu
.
Y
),
convertEmuToHmm
(
aShapeRectEmu
.
Width
),
convertEmuToHmm
(
aShapeRectEmu
.
Height
)
);
extendShapeBoundingBox
(
aShapeRectHmm
);
// set cell Anchoring
if
(
mxAnchor
->
getEditAs
()
!=
ShapeAnchor
::
ANCHOR_ABSOLUTE
)
{
SdrObject
*
pObj
=
SdrObject
::
getSdrObjectFromXShape
(
mxShape
->
getXShape
()
);
if
(
pObj
)
{
ScDrawLayer
::
SetCellAnchoredFromPosition
(
*
pObj
,
getScDocument
(),
static_cast
<
SCTAB
>
(
getSheetIndex
()
)
);
}
}
}
}
mxShape
.
reset
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment