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
31c4c834
Kaydet (Commit)
31c4c834
authored
May 28, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SwTextBoxHelper: extract getTextRectangle() from syncProperty()
Change-Id: I6265247593571ffba4cbda7f87bdde1e943aff51
üst
5ed755ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
textboxhelper.hxx
sw/inc/textboxhelper.hxx
+3
-0
textboxhelper.cxx
sw/source/core/doc/textboxhelper.cxx
+12
-5
No files found.
sw/inc/textboxhelper.hxx
Dosyayı görüntüle @
31c4c834
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
class
SdrPage
;
class
SdrPage
;
class
SwFrmFmt
;
class
SwFrmFmt
;
class
SwDoc
;
class
SwDoc
;
class
Rectangle
;
/**
/**
* A TextBox is a TextFrame, that is tied to a drawinglayer shape.
* A TextBox is a TextFrame, that is tied to a drawinglayer shape.
...
@@ -39,6 +40,8 @@ public:
...
@@ -39,6 +40,8 @@ public:
static
void
syncProperty
(
SwFrmFmt
*
pShape
,
sal_uInt16
nWID
,
sal_uInt8
nMemberID
,
const
OUString
&
rPropertyName
,
const
css
::
uno
::
Any
&
rValue
);
static
void
syncProperty
(
SwFrmFmt
*
pShape
,
sal_uInt16
nWID
,
sal_uInt8
nMemberID
,
const
OUString
&
rPropertyName
,
const
css
::
uno
::
Any
&
rValue
);
/// If we have an associated TextFrame, then return that.
/// If we have an associated TextFrame, then return that.
static
SwFrmFmt
*
findTextBox
(
SwFrmFmt
*
pShape
);
static
SwFrmFmt
*
findTextBox
(
SwFrmFmt
*
pShape
);
/// Return the textbox rectangle of a draw shape (absolute values, in twips).
static
Rectangle
getTextRectangle
(
SwFrmFmt
*
pShape
);
/// Look up TextFrames in a document, which are in fact TextBoxes.
/// Look up TextFrames in a document, which are in fact TextBoxes.
static
std
::
list
<
SwFrmFmt
*>
findTextBoxes
(
const
SwDoc
*
pDoc
);
static
std
::
list
<
SwFrmFmt
*>
findTextBoxes
(
const
SwDoc
*
pDoc
);
...
...
sw/source/core/doc/textboxhelper.cxx
Dosyayı görüntüle @
31c4c834
...
@@ -192,6 +192,16 @@ uno::Any SwTextBoxHelper::queryInterface(SwFrmFmt* pShape, const uno::Type& rTyp
...
@@ -192,6 +192,16 @@ uno::Any SwTextBoxHelper::queryInterface(SwFrmFmt* pShape, const uno::Type& rTyp
return
aRet
;
return
aRet
;
}
}
Rectangle
SwTextBoxHelper
::
getTextRectangle
(
SwFrmFmt
*
pShape
)
{
Rectangle
aRet
;
aRet
.
SetEmpty
();
SdrObjCustomShape
*
pCustomShape
=
dynamic_cast
<
SdrObjCustomShape
*>
(
pShape
->
FindRealSdrObject
());
if
(
pCustomShape
)
pCustomShape
->
GetTextBounds
(
aRet
);
return
aRet
;
}
void
SwTextBoxHelper
::
syncProperty
(
SwFrmFmt
*
pShape
,
sal_uInt16
nWID
,
sal_uInt8
nMemberId
,
const
OUString
&
rPropertyName
,
const
css
::
uno
::
Any
&
rValue
)
void
SwTextBoxHelper
::
syncProperty
(
SwFrmFmt
*
pShape
,
sal_uInt16
nWID
,
sal_uInt8
nMemberId
,
const
OUString
&
rPropertyName
,
const
css
::
uno
::
Any
&
rValue
)
{
{
// No shape yet? Then nothing to do, initial properties are set by create().
// No shape yet? Then nothing to do, initial properties are set by create().
...
@@ -260,12 +270,9 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8
...
@@ -260,12 +270,9 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8
// Position/size should be the text position/size, not the shape one as-is.
// Position/size should be the text position/size, not the shape one as-is.
if
(
bAdjustX
||
bAdjustY
||
bAdjustSize
)
if
(
bAdjustX
||
bAdjustY
||
bAdjustSize
)
{
{
SdrObjCustomShape
*
pCustomShape
=
dynamic_cast
<
SdrObjCustomShape
*>
(
pShape
->
FindRealSdrObject
()
);
Rectangle
aRect
=
getTextRectangle
(
pShape
);
if
(
pCustomShape
)
if
(
!
aRect
.
IsEmpty
()
)
{
{
Rectangle
aRect
;
pCustomShape
->
GetTextBounds
(
aRect
);
if
(
bAdjustX
||
bAdjustY
)
if
(
bAdjustX
||
bAdjustY
)
{
{
sal_Int32
nValue
;
sal_Int32
nValue
;
...
...
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