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
336ace7c
Kaydet (Commit)
336ace7c
authored
Nis 24, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert CUSTOMSHAPE_HANDLE_ constants to scoped enum
Change-Id: I4cbbf9d2e42ef5e361449fff8bc9280ac337720e
üst
45ba5f2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
27 deletions
+36
-27
svdoashp.hxx
include/svx/svdoashp.hxx
+16
-7
svdoashp.cxx
svx/source/svdraw/svdoashp.cxx
+20
-20
No files found.
include/svx/svdoashp.hxx
Dosyayı görüntüle @
336ace7c
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <com/sun/star/drawing/XCustomShapeEngine.hpp>
#include <com/sun/star/drawing/XCustomShapeEngine.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <svx/svxdllapi.h>
#include <svx/svxdllapi.h>
#include <o3tl/typed_flags_set.hxx>
// Initial Declarations
// Initial Declarations
...
@@ -57,18 +58,26 @@ class SdrAShapeObjGeoData : public SdrTextObjGeoData
...
@@ -57,18 +58,26 @@ class SdrAShapeObjGeoData : public SdrTextObjGeoData
aAdjustmentSeq
;
aAdjustmentSeq
;
};
};
#define CUSTOMSHAPE_HANDLE_RESIZE_FIXED 1
enum
class
CustomShapeHandleModes
#define CUSTOMSHAPE_HANDLE_CREATE_FIXED 2
{
#define CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_X 4
NONE
=
0
,
#define CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_Y 8
RESIZE_FIXED
=
1
,
#define CUSTOMSHAPE_HANDLE_MOVE_SHAPE 16
CREATE_FIXED
=
2
,
#define CUSTOMSHAPE_HANDLE_ORTHO4 32
RESIZE_ABSOLUTE_X
=
4
,
RESIZE_ABSOLUTE_Y
=
8
,
MOVE_SHAPE
=
16
,
ORTHO4
=
32
,
};
namespace
o3tl
{
template
<>
struct
typed_flags
<
CustomShapeHandleModes
>
:
is_typed_flags
<
CustomShapeHandleModes
,
63
>
{};
}
struct
SdrCustomShapeInteraction
struct
SdrCustomShapeInteraction
{
{
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
drawing
::
XCustomShapeHandle
>
xInteraction
;
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
drawing
::
XCustomShapeHandle
>
xInteraction
;
com
::
sun
::
star
::
awt
::
Point
aPosition
;
com
::
sun
::
star
::
awt
::
Point
aPosition
;
sal_Int32
nMode
;
CustomShapeHandleModes
nMode
;
};
};
...
...
svx/source/svdraw/svdoashp.cxx
Dosyayı görüntüle @
336ace7c
...
@@ -619,15 +619,15 @@ std::vector< SdrCustomShapeInteraction > SdrObjCustomShape::GetInteractionHandle
...
@@ -619,15 +619,15 @@ std::vector< SdrCustomShapeInteraction > SdrObjCustomShape::GetInteractionHandle
aSdrCustomShapeInteraction
.
xInteraction
=
xInteractionHandles
[
i
];
aSdrCustomShapeInteraction
.
xInteraction
=
xInteractionHandles
[
i
];
aSdrCustomShapeInteraction
.
aPosition
=
xInteractionHandles
[
i
]
->
getPosition
();
aSdrCustomShapeInteraction
.
aPosition
=
xInteractionHandles
[
i
]
->
getPosition
();
sal_Int32
nMode
=
0
;
CustomShapeHandleModes
nMode
=
CustomShapeHandleModes
::
NONE
;
switch
(
ImpGetCustomShapeType
(
*
this
)
)
switch
(
ImpGetCustomShapeType
(
*
this
)
)
{
{
case
mso_sptAccentBorderCallout90
:
// 2 ortho
case
mso_sptAccentBorderCallout90
:
// 2 ortho
{
{
if
(
i
==
0
)
if
(
i
==
0
)
nMode
|=
C
USTOMSHAPE_HANDLE_RESIZE_FIXED
|
CUSTOMSHAPE_HANDLE_
CREATE_FIXED
;
nMode
|=
C
ustomShapeHandleModes
::
RESIZE_FIXED
|
CustomShapeHandleModes
::
CREATE_FIXED
;
else
if
(
i
==
1
)
else
if
(
i
==
1
)
nMode
|=
C
USTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_X
|
CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_Y
|
CUSTOMSHAPE_HANDLE_MOVE_SHAPE
|
CUSTOMSHAPE_HANDLE_
ORTHO4
;
nMode
|=
C
ustomShapeHandleModes
::
RESIZE_ABSOLUTE_X
|
CustomShapeHandleModes
::
RESIZE_ABSOLUTE_Y
|
CustomShapeHandleModes
::
MOVE_SHAPE
|
CustomShapeHandleModes
::
ORTHO4
;
}
}
break
;
break
;
...
@@ -637,24 +637,24 @@ std::vector< SdrCustomShapeInteraction > SdrObjCustomShape::GetInteractionHandle
...
@@ -637,24 +637,24 @@ std::vector< SdrCustomShapeInteraction > SdrObjCustomShape::GetInteractionHandle
case
mso_sptWedgeEllipseCallout
:
case
mso_sptWedgeEllipseCallout
:
{
{
if
(
i
==
0
)
if
(
i
==
0
)
nMode
|=
C
USTOMSHAPE_HANDLE_
RESIZE_FIXED
;
nMode
|=
C
ustomShapeHandleModes
::
RESIZE_FIXED
;
}
}
break
;
break
;
case
mso_sptBorderCallout1
:
// 2 diag
case
mso_sptBorderCallout1
:
// 2 diag
{
{
if
(
i
==
0
)
if
(
i
==
0
)
nMode
|=
C
USTOMSHAPE_HANDLE_RESIZE_FIXED
|
CUSTOMSHAPE_HANDLE_
CREATE_FIXED
;
nMode
|=
C
ustomShapeHandleModes
::
RESIZE_FIXED
|
CustomShapeHandleModes
::
CREATE_FIXED
;
else
if
(
i
==
1
)
else
if
(
i
==
1
)
nMode
|=
C
USTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_X
|
CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_Y
|
CUSTOMSHAPE_HANDLE_
MOVE_SHAPE
;
nMode
|=
C
ustomShapeHandleModes
::
RESIZE_ABSOLUTE_X
|
CustomShapeHandleModes
::
RESIZE_ABSOLUTE_Y
|
CustomShapeHandleModes
::
MOVE_SHAPE
;
}
}
break
;
break
;
case
mso_sptBorderCallout2
:
// 3
case
mso_sptBorderCallout2
:
// 3
{
{
if
(
i
==
0
)
if
(
i
==
0
)
nMode
|=
C
USTOMSHAPE_HANDLE_RESIZE_FIXED
|
CUSTOMSHAPE_HANDLE_
CREATE_FIXED
;
nMode
|=
C
ustomShapeHandleModes
::
RESIZE_FIXED
|
CustomShapeHandleModes
::
CREATE_FIXED
;
else
if
(
i
==
2
)
else
if
(
i
==
2
)
nMode
|=
C
USTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_X
|
CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_Y
|
CUSTOMSHAPE_HANDLE_
MOVE_SHAPE
;
nMode
|=
C
ustomShapeHandleModes
::
RESIZE_ABSOLUTE_X
|
CustomShapeHandleModes
::
RESIZE_ABSOLUTE_Y
|
CustomShapeHandleModes
::
MOVE_SHAPE
;
}
}
break
;
break
;
case
mso_sptCallout90
:
case
mso_sptCallout90
:
...
@@ -672,7 +672,7 @@ std::vector< SdrCustomShapeInteraction > SdrObjCustomShape::GetInteractionHandle
...
@@ -672,7 +672,7 @@ std::vector< SdrCustomShapeInteraction > SdrObjCustomShape::GetInteractionHandle
case
mso_sptAccentBorderCallout3
:
case
mso_sptAccentBorderCallout3
:
{
{
if
(
i
==
0
)
if
(
i
==
0
)
nMode
|=
C
USTOMSHAPE_HANDLE_RESIZE_FIXED
|
CUSTOMSHAPE_HANDLE_
CREATE_FIXED
;
nMode
|=
C
ustomShapeHandleModes
::
RESIZE_FIXED
|
CustomShapeHandleModes
::
CREATE_FIXED
;
}
}
break
;
break
;
default
:
break
;
default
:
break
;
...
@@ -1603,14 +1603,14 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, co
...
@@ -1603,14 +1603,14 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, co
{
{
try
try
{
{
if
(
aIter
->
nMode
&
C
USTOMSHAPE_HANDLE_
RESIZE_FIXED
)
if
(
aIter
->
nMode
&
C
ustomShapeHandleModes
::
RESIZE_FIXED
)
aIter
->
xInteraction
->
setControllerPosition
(
aIter
->
aPosition
);
aIter
->
xInteraction
->
setControllerPosition
(
aIter
->
aPosition
);
if
(
aIter
->
nMode
&
C
USTOMSHAPE_HANDLE_
RESIZE_ABSOLUTE_X
)
if
(
aIter
->
nMode
&
C
ustomShapeHandleModes
::
RESIZE_ABSOLUTE_X
)
{
{
sal_Int32
nX
=
(
aIter
->
aPosition
.
X
-
aOld
.
Left
()
)
+
maRect
.
Left
();
sal_Int32
nX
=
(
aIter
->
aPosition
.
X
-
aOld
.
Left
()
)
+
maRect
.
Left
();
aIter
->
xInteraction
->
setControllerPosition
(
com
::
sun
::
star
::
awt
::
Point
(
nX
,
aIter
->
xInteraction
->
getPosition
().
Y
)
);
aIter
->
xInteraction
->
setControllerPosition
(
com
::
sun
::
star
::
awt
::
Point
(
nX
,
aIter
->
xInteraction
->
getPosition
().
Y
)
);
}
}
if
(
aIter
->
nMode
&
C
USTOMSHAPE_HANDLE_
RESIZE_ABSOLUTE_Y
)
if
(
aIter
->
nMode
&
C
ustomShapeHandleModes
::
RESIZE_ABSOLUTE_Y
)
{
{
sal_Int32
nY
=
(
aIter
->
aPosition
.
Y
-
aOld
.
Top
()
)
+
maRect
.
Top
();
sal_Int32
nY
=
(
aIter
->
aPosition
.
Y
-
aOld
.
Top
()
)
+
maRect
.
Top
();
aIter
->
xInteraction
->
setControllerPosition
(
com
::
sun
::
star
::
awt
::
Point
(
aIter
->
xInteraction
->
getPosition
().
X
,
nY
)
);
aIter
->
xInteraction
->
setControllerPosition
(
com
::
sun
::
star
::
awt
::
Point
(
aIter
->
xInteraction
->
getPosition
().
X
,
nY
)
);
...
@@ -2022,9 +2022,9 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect )
...
@@ -2022,9 +2022,9 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect )
{
{
try
try
{
{
if
(
aIter
->
nMode
&
C
USTOMSHAPE_HANDLE_
RESIZE_FIXED
)
if
(
aIter
->
nMode
&
C
ustomShapeHandleModes
::
RESIZE_FIXED
)
aIter
->
xInteraction
->
setControllerPosition
(
aIter
->
aPosition
);
aIter
->
xInteraction
->
setControllerPosition
(
aIter
->
aPosition
);
if
(
aIter
->
nMode
&
C
USTOMSHAPE_HANDLE_
RESIZE_ABSOLUTE_X
)
if
(
aIter
->
nMode
&
C
ustomShapeHandleModes
::
RESIZE_ABSOLUTE_X
)
{
{
sal_Int32
nX
;
sal_Int32
nX
;
if
(
bOldMirroredX
)
if
(
bOldMirroredX
)
...
@@ -2045,7 +2045,7 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect )
...
@@ -2045,7 +2045,7 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect )
}
}
aIter
->
xInteraction
->
setControllerPosition
(
com
::
sun
::
star
::
awt
::
Point
(
nX
,
aIter
->
xInteraction
->
getPosition
().
Y
)
);
aIter
->
xInteraction
->
setControllerPosition
(
com
::
sun
::
star
::
awt
::
Point
(
nX
,
aIter
->
xInteraction
->
getPosition
().
Y
)
);
}
}
if
(
aIter
->
nMode
&
C
USTOMSHAPE_HANDLE_
RESIZE_ABSOLUTE_Y
)
if
(
aIter
->
nMode
&
C
ustomShapeHandleModes
::
RESIZE_ABSOLUTE_Y
)
{
{
sal_Int32
nY
;
sal_Int32
nY
;
if
(
bOldMirroredY
)
if
(
bOldMirroredY
)
...
@@ -2086,7 +2086,7 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point& rDestination,
...
@@ -2086,7 +2086,7 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point& rDestination,
try
try
{
{
com
::
sun
::
star
::
awt
::
Point
aPt
(
rDestination
.
X
(),
rDestination
.
Y
()
);
com
::
sun
::
star
::
awt
::
Point
aPt
(
rDestination
.
X
(),
rDestination
.
Y
()
);
if
(
aInteractionHandle
.
nMode
&
C
USTOMSHAPE_HANDLE_
MOVE_SHAPE
&&
bMoveCalloutRectangle
)
if
(
aInteractionHandle
.
nMode
&
C
ustomShapeHandleModes
::
MOVE_SHAPE
&&
bMoveCalloutRectangle
)
{
{
sal_Int32
nXDiff
=
aPt
.
X
-
aInteractionHandle
.
aPosition
.
X
;
sal_Int32
nXDiff
=
aPt
.
X
-
aInteractionHandle
.
aPosition
.
X
;
sal_Int32
nYDiff
=
aPt
.
Y
-
aInteractionHandle
.
aPosition
.
Y
;
sal_Int32
nYDiff
=
aPt
.
Y
-
aInteractionHandle
.
aPosition
.
Y
;
...
@@ -2100,7 +2100,7 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point& rDestination,
...
@@ -2100,7 +2100,7 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point& rDestination,
for
(
std
::
vector
<
SdrCustomShapeInteraction
>::
const_iterator
aIter
(
aInteractionHandles
.
begin
()
),
aEnd
(
aInteractionHandles
.
end
()
)
;
for
(
std
::
vector
<
SdrCustomShapeInteraction
>::
const_iterator
aIter
(
aInteractionHandles
.
begin
()
),
aEnd
(
aInteractionHandles
.
end
()
)
;
aIter
!=
aEnd
;
++
aIter
)
aIter
!=
aEnd
;
++
aIter
)
{
{
if
(
aIter
->
nMode
&
C
USTOMSHAPE_HANDLE_
RESIZE_FIXED
)
if
(
aIter
->
nMode
&
C
ustomShapeHandleModes
::
RESIZE_FIXED
)
{
{
if
(
aIter
->
xInteraction
.
is
()
)
if
(
aIter
->
xInteraction
.
is
()
)
aIter
->
xInteraction
->
setControllerPosition
(
aIter
->
aPosition
);
aIter
->
xInteraction
->
setControllerPosition
(
aIter
->
aPosition
);
...
@@ -2190,7 +2190,7 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
...
@@ -2190,7 +2190,7 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
{
{
try
try
{
{
if
(
aIter
->
nMode
&
C
USTOMSHAPE_HANDLE_
CREATE_FIXED
)
if
(
aIter
->
nMode
&
C
ustomShapeHandleModes
::
CREATE_FIXED
)
aIter
->
xInteraction
->
setControllerPosition
(
awt
::
Point
(
rStat
.
GetStart
().
X
(),
rStat
.
GetStart
().
Y
()
)
);
aIter
->
xInteraction
->
setControllerPosition
(
awt
::
Point
(
rStat
.
GetStart
().
X
(),
rStat
.
GetStart
().
Y
()
)
);
}
}
catch
(
const
uno
::
RuntimeException
&
)
catch
(
const
uno
::
RuntimeException
&
)
...
@@ -2526,7 +2526,7 @@ bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
...
@@ -2526,7 +2526,7 @@ bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
{
{
try
try
{
{
if
(
aIter
->
nMode
&
C
USTOMSHAPE_HANDLE_
RESIZE_FIXED
)
if
(
aIter
->
nMode
&
C
ustomShapeHandleModes
::
RESIZE_FIXED
)
aIter
->
xInteraction
->
setControllerPosition
(
aIter
->
aPosition
);
aIter
->
xInteraction
->
setControllerPosition
(
aIter
->
aPosition
);
}
}
catch
(
const
uno
::
RuntimeException
&
)
catch
(
const
uno
::
RuntimeException
&
)
...
@@ -2558,7 +2558,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
...
@@ -2558,7 +2558,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
{
{
try
try
{
{
if
(
aIter
->
nMode
&
C
USTOMSHAPE_HANDLE_
RESIZE_FIXED
)
if
(
aIter
->
nMode
&
C
ustomShapeHandleModes
::
RESIZE_FIXED
)
aIter
->
xInteraction
->
setControllerPosition
(
aIter
->
aPosition
);
aIter
->
xInteraction
->
setControllerPosition
(
aIter
->
aPosition
);
}
}
catch
(
const
uno
::
RuntimeException
&
)
catch
(
const
uno
::
RuntimeException
&
)
...
...
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