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
7c7520ba
Kaydet (Commit)
7c7520ba
authored
Ock 16, 2013
tarafından
Cédric Bosdonnat
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Template Manager: show names on several lines
Change-Id: I6990bb6ac52889de36f3ec2cce33e4dc2f3da2ea
üst
34856077
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
76 deletions
+70
-76
thumbnailviewitem.hxx
sfx2/inc/sfx2/thumbnailviewitem.hxx
+2
-0
templatecontaineritem.cxx
sfx2/source/control/templatecontaineritem.cxx
+1
-17
templatelocalview.cxx
sfx2/source/control/templatelocalview.cxx
+0
-18
templateviewitem.cxx
sfx2/source/control/templateviewitem.cxx
+2
-25
thumbnailviewitem.cxx
sfx2/source/control/thumbnailviewitem.cxx
+65
-16
No files found.
sfx2/inc/sfx2/thumbnailviewitem.hxx
Dosyayı görüntüle @
7c7520ba
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <osl/mutex.hxx>
#include <osl/mutex.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bitmapex.hxx>
#include "sfx2/dllapi.h"
#include "sfx2/dllapi.h"
...
@@ -106,6 +107,7 @@ public:
...
@@ -106,6 +107,7 @@ public:
virtual
void
Paint
(
drawinglayer
::
processor2d
::
BaseProcessor2D
*
pProcessor
,
virtual
void
Paint
(
drawinglayer
::
processor2d
::
BaseProcessor2D
*
pProcessor
,
const
ThumbnailItemAttributes
*
pAttrs
);
const
ThumbnailItemAttributes
*
pAttrs
);
void
addTextPrimitives
(
const
rtl
::
OUString
&
rText
,
const
ThumbnailItemAttributes
*
pAttrs
,
Point
aPos
,
drawinglayer
::
primitive2d
::
Primitive2DSequence
&
rSeq
);
static
drawinglayer
::
primitive2d
::
PolygonHairlinePrimitive2D
*
static
drawinglayer
::
primitive2d
::
PolygonHairlinePrimitive2D
*
createBorderLine
(
const
basegfx
::
B2DPolygon
&
rPolygon
);
createBorderLine
(
const
basegfx
::
B2DPolygon
&
rPolygon
);
...
...
sfx2/source/control/templatecontaineritem.cxx
Dosyayı görüntüle @
7c7520ba
...
@@ -84,8 +84,6 @@ void TemplateContainerItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
...
@@ -84,8 +84,6 @@ void TemplateContainerItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
Size
aThumbSize
(
(
maThumbnailArea
.
getWidth
()
-
3
*
nThumbPadding
)
/
2
,
(
maThumbnailArea
.
getHeight
()
-
3
*
nThumbPadding
)
/
2
);
Size
aThumbSize
(
(
maThumbnailArea
.
getWidth
()
-
3
*
nThumbPadding
)
/
2
,
(
maThumbnailArea
.
getHeight
()
-
3
*
nThumbPadding
)
/
2
);
// Draw thumbnail
// Draw thumbnail
Point
aPos
=
maPrev1Pos
;
for
(
int
i
=
0
;
i
<
4
;
++
i
)
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
{
long
nPosX
=
0
;
long
nPosX
=
0
;
...
@@ -153,21 +151,7 @@ void TemplateContainerItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
...
@@ -153,21 +151,7 @@ void TemplateContainerItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
}
}
}
}
// Draw centered text below thumbnail
addTextPrimitives
(
maTitle
,
pAttrs
,
maTextPos
,
aSeq
);
aPos
=
maTextPos
;
// Create the text primitive
basegfx
::
B2DHomMatrix
aTextMatrix
(
createScaleTranslateB2DHomMatrix
(
pAttrs
->
aFontSize
.
getX
(),
pAttrs
->
aFontSize
.
getY
(),
double
(
aPos
.
X
()
),
double
(
aPos
.
Y
()
)
)
);
aSeq
[
nCount
++
]
=
Primitive2DReference
(
new
TextSimplePortionPrimitive2D
(
aTextMatrix
,
maTitle
,
0
,
maTitle
.
getLength
(),
std
::
vector
<
double
>
(
),
pAttrs
->
aFontAttr
,
com
::
sun
::
star
::
lang
::
Locale
(),
Color
(
COL_BLACK
).
getBColor
()
)
);
pProcessor
->
process
(
aSeq
);
pProcessor
->
process
(
aSeq
);
}
}
...
...
sfx2/source/control/templatelocalview.cxx
Dosyayı görüntüle @
7c7520ba
...
@@ -51,12 +51,6 @@ void TemplateLocalView::Populate ()
...
@@ -51,12 +51,6 @@ void TemplateLocalView::Populate ()
{
{
OUString
aRegionName
(
mpDocTemplates
->
GetFullRegionName
(
i
));
OUString
aRegionName
(
mpDocTemplates
->
GetFullRegionName
(
i
));
if
((
sal_uInt32
)
aRegionName
.
getLength
()
>
mpItemAttrs
->
nMaxTextLenght
)
{
aRegionName
=
aRegionName
.
copy
(
0
,
mpItemAttrs
->
nMaxTextLenght
-
3
);
aRegionName
+=
"..."
;
}
TemplateContainerItem
*
pItem
=
new
TemplateContainerItem
(
*
this
);
TemplateContainerItem
*
pItem
=
new
TemplateContainerItem
(
*
this
);
pItem
->
mnId
=
i
+
1
;
pItem
->
mnId
=
i
+
1
;
pItem
->
maTitle
=
aRegionName
;
pItem
->
maTitle
=
aRegionName
;
...
@@ -69,12 +63,6 @@ void TemplateLocalView::Populate ()
...
@@ -69,12 +63,6 @@ void TemplateLocalView::Populate ()
OUString
aName
=
mpDocTemplates
->
GetName
(
i
,
j
);
OUString
aName
=
mpDocTemplates
->
GetName
(
i
,
j
);
OUString
aURL
=
mpDocTemplates
->
GetPath
(
i
,
j
);
OUString
aURL
=
mpDocTemplates
->
GetPath
(
i
,
j
);
if
((
sal_uInt32
)
aName
.
getLength
()
>
mpItemAttrs
->
nMaxTextLenght
)
{
aName
=
aName
.
copy
(
0
,
mpItemAttrs
->
nMaxTextLenght
-
3
);
aName
+=
"..."
;
}
TemplateItemProperties
aProperties
;;
TemplateItemProperties
aProperties
;;
aProperties
.
nId
=
j
+
1
;
aProperties
.
nId
=
j
+
1
;
aProperties
.
nDocId
=
j
;
aProperties
.
nDocId
=
j
;
...
@@ -162,12 +150,6 @@ sal_uInt16 TemplateLocalView::createRegion(const OUString &rName)
...
@@ -162,12 +150,6 @@ sal_uInt16 TemplateLocalView::createRegion(const OUString &rName)
OUString
aRegionName
=
rName
;
OUString
aRegionName
=
rName
;
if
((
sal_uInt32
)
aRegionName
.
getLength
()
>
mpItemAttrs
->
nMaxTextLenght
)
{
aRegionName
=
aRegionName
.
copy
(
0
,
mpItemAttrs
->
nMaxTextLenght
-
3
);
aRegionName
+=
"..."
;
}
TemplateContainerItem
*
pItem
=
new
TemplateContainerItem
(
*
this
);
TemplateContainerItem
*
pItem
=
new
TemplateContainerItem
(
*
this
);
pItem
->
mnId
=
nRegionId
+
1
;
pItem
->
mnId
=
nRegionId
+
1
;
pItem
->
maTitle
=
aRegionName
;
pItem
->
maTitle
=
aRegionName
;
...
...
sfx2/source/control/templateviewitem.cxx
Dosyayı görüntüle @
7c7520ba
...
@@ -108,34 +108,11 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
...
@@ -108,34 +108,11 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
// draw thumbnail borders
// draw thumbnail borders
aSeq
[
3
]
=
Primitive2DReference
(
createBorderLine
(
aBounds
));
aSeq
[
3
]
=
Primitive2DReference
(
createBorderLine
(
aBounds
));
// Draw centered text below thumbnail
addTextPrimitives
(
maTitle
,
pAttrs
,
maTextPos
,
aSeq
);
// Create the text primitive
basegfx
::
B2DHomMatrix
aTitleMatrix
(
createScaleTranslateB2DHomMatrix
(
pAttrs
->
aFontSize
.
getX
(),
pAttrs
->
aFontSize
.
getY
(),
double
(
maTextPos
.
X
()
),
double
(
maTextPos
.
Y
()
)
)
);
aSeq
[
4
]
=
Primitive2DReference
(
new
TextSimplePortionPrimitive2D
(
aTitleMatrix
,
maTitle
,
0
,
pAttrs
->
nMaxTextLenght
,
std
::
vector
<
double
>
(
),
pAttrs
->
aFontAttr
,
com
::
sun
::
star
::
lang
::
Locale
(),
Color
(
COL_BLACK
).
getBColor
()
)
);
if
(
!
maSubTitle
.
isEmpty
())
if
(
!
maSubTitle
.
isEmpty
())
{
{
basegfx
::
B2DHomMatrix
aSubTitleMatrix
(
createScaleTranslateB2DHomMatrix
(
addTextPrimitives
(
maSubTitle
,
pAttrs
,
maSubTitlePos
,
aSeq
);
pAttrs
->
aFontSize
.
getX
()
*
SUBTITLE_SCALE_FACTOR
,
pAttrs
->
aFontSize
.
getY
()
*
SUBTITLE_SCALE_FACTOR
,
double
(
maSubTitlePos
.
X
()
),
double
(
maSubTitlePos
.
Y
()
)
)
);
aSeq
[
5
]
=
Primitive2DReference
(
new
TextSimplePortionPrimitive2D
(
aSubTitleMatrix
,
maSubTitle
,
0
,
pAttrs
->
nMaxTextLenght
,
std
::
vector
<
double
>
(
),
pAttrs
->
aFontAttr
,
com
::
sun
::
star
::
lang
::
Locale
(),
Color
(
COL_BLACK
).
getBColor
()
)
);
}
}
pProcessor
->
process
(
aSeq
);
pProcessor
->
process
(
aSeq
);
...
...
sfx2/source/control/thumbnailviewitem.cxx
Dosyayı görüntüle @
7c7520ba
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <vcl/button.hxx>
#include <vcl/button.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svapp.hxx>
#include <vcl/texteng.hxx>
using
namespace
basegfx
;
using
namespace
basegfx
;
using
namespace
basegfx
::
tools
;
using
namespace
basegfx
::
tools
;
...
@@ -127,7 +128,8 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
...
@@ -127,7 +128,8 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
if
(
mbSelected
||
mbHover
)
if
(
mbSelected
||
mbHover
)
aFillColor
=
pAttrs
->
aHighlightColor
;
aFillColor
=
pAttrs
->
aHighlightColor
;
aSeq
[
0
]
=
Primitive2DReference
(
new
PolyPolygonColorPrimitive2D
(
sal_uInt32
nPrimitive
=
0
;
aSeq
[
nPrimitive
++
]
=
Primitive2DReference
(
new
PolyPolygonColorPrimitive2D
(
B2DPolyPolygon
(
Polygon
(
maDrawArea
,
5
,
5
).
getB2DPolygon
()),
B2DPolyPolygon
(
Polygon
(
maDrawArea
,
5
,
5
).
getB2DPolygon
()),
aFillColor
));
aFillColor
));
...
@@ -135,7 +137,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
...
@@ -135,7 +137,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
Point
aPos
=
maPrev1Pos
;
Point
aPos
=
maPrev1Pos
;
Size
aImageSize
=
maPreview1
.
GetSizePixel
();
Size
aImageSize
=
maPreview1
.
GetSizePixel
();
aSeq
[
1
]
=
Primitive2DReference
(
new
FillBitmapPrimitive2D
(
aSeq
[
nPrimitive
++
]
=
Primitive2DReference
(
new
FillBitmapPrimitive2D
(
createTranslateB2DHomMatrix
(
aPos
.
X
(),
aPos
.
Y
()),
createTranslateB2DHomMatrix
(
aPos
.
X
(),
aPos
.
Y
()),
FillBitmapAttribute
(
maPreview1
,
FillBitmapAttribute
(
maPreview1
,
B2DPoint
(
0
,
0
),
B2DPoint
(
0
,
0
),
...
@@ -156,27 +158,74 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
...
@@ -156,27 +158,74 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
aBounds
.
append
(
B2DPoint
(
fPosX
,
fPosY
+
fHeight
));
aBounds
.
append
(
B2DPoint
(
fPosX
,
fPosY
+
fHeight
));
aBounds
.
setClosed
(
true
);
aBounds
.
setClosed
(
true
);
aSeq
[
2
]
=
Primitive2DReference
(
createBorderLine
(
aBounds
));
aSeq
[
nPrimitive
++
]
=
Primitive2DReference
(
createBorderLine
(
aBounds
));
// Draw
centered
text below thumbnail
// Draw text below thumbnail
aPos
=
maTextPos
;
aPos
=
maTextPos
;
// Create the text primitive
addTextPrimitives
(
maTitle
,
pAttrs
,
maTextPos
,
aSeq
);
basegfx
::
B2DHomMatrix
aTextMatrix
(
createScaleTranslateB2DHomMatrix
(
pAttrs
->
aFontSize
.
getX
(),
pAttrs
->
aFontSize
.
getY
(),
double
(
aPos
.
X
()
),
double
(
aPos
.
Y
()
)
)
);
aSeq
[
3
]
=
Primitive2DReference
(
new
TextSimplePortionPrimitive2D
(
aTextMatrix
,
maTitle
,
0
,
pAttrs
->
nMaxTextLenght
,
std
::
vector
<
double
>
(
),
pAttrs
->
aFontAttr
,
com
::
sun
::
star
::
lang
::
Locale
(),
Color
(
COL_BLACK
).
getBColor
()
)
);
pProcessor
->
process
(
aSeq
);
pProcessor
->
process
(
aSeq
);
}
}
void
ThumbnailViewItem
::
addTextPrimitives
(
const
rtl
::
OUString
&
rText
,
const
ThumbnailItemAttributes
*
pAttrs
,
Point
aPos
,
Primitive2DSequence
&
rSeq
)
{
drawinglayer
::
primitive2d
::
TextLayouterDevice
aTextDev
;
rtl
::
OUString
aText
(
rText
);
TextEngine
aTextEngine
;
aTextEngine
.
SetMaxTextWidth
(
maDrawArea
.
getWidth
());
aTextEngine
.
SetText
(
rText
);
sal_Int32
nPrimitives
=
rSeq
.
getLength
();
rSeq
.
realloc
(
nPrimitives
+
aTextEngine
.
GetLineCount
(
0
));
// Create the text primitives
sal_uInt16
nLineStart
=
0
;
for
(
sal_uInt16
i
=
0
;
i
<
aTextEngine
.
GetLineCount
(
0
);
++
i
)
{
sal_uInt16
nLineLength
=
aTextEngine
.
GetLineLen
(
0
,
i
);
double
nLineWidth
=
aTextDev
.
getTextWidth
(
aText
,
nLineStart
,
nLineLength
);
bool
bTooLong
=
(
aPos
.
getY
()
+
aTextEngine
.
GetCharHeight
())
>
maDrawArea
.
Bottom
();
if
(
bTooLong
&&
(
nLineLength
+
nLineStart
)
<
rText
.
getLength
())
{
// Add the '...' to the last line to show, even though it may require to shorten the line
double
nDotsWidth
=
aTextDev
.
getTextWidth
(
rtl
::
OUString
(
"..."
),
0
,
3
);
sal_uInt16
nLength
=
nLineLength
-
1
;
while
(
nDotsWidth
+
aTextDev
.
getTextWidth
(
aText
,
nLineStart
,
nLength
)
>
maDrawArea
.
getWidth
()
&&
nLength
>
0
)
{
--
nLength
;
}
aText
=
aText
.
copy
(
0
,
nLineStart
+
nLength
);
aText
+=
"..."
;
nLineLength
=
nLength
+
3
;
}
double
nLineX
=
maDrawArea
.
Left
()
+
(
maDrawArea
.
getWidth
()
-
nLineWidth
)
/
2.0
;
basegfx
::
B2DHomMatrix
aTextMatrix
(
createScaleTranslateB2DHomMatrix
(
pAttrs
->
aFontSize
.
getX
(),
pAttrs
->
aFontSize
.
getY
(),
nLineX
,
double
(
aPos
.
Y
()
)
)
);
rSeq
[
nPrimitives
++
]
=
Primitive2DReference
(
new
TextSimplePortionPrimitive2D
(
aTextMatrix
,
aText
,
nLineStart
,
nLineLength
,
std
::
vector
<
double
>
(
),
pAttrs
->
aFontAttr
,
com
::
sun
::
star
::
lang
::
Locale
(),
Color
(
COL_BLACK
).
getBColor
()
)
);
nLineStart
+=
nLineLength
;
aPos
.
setY
(
aPos
.
getY
()
+
aTextEngine
.
GetCharHeight
());
if
(
bTooLong
)
break
;
}
}
drawinglayer
::
primitive2d
::
PolygonHairlinePrimitive2D
*
drawinglayer
::
primitive2d
::
PolygonHairlinePrimitive2D
*
ThumbnailViewItem
::
createBorderLine
(
const
basegfx
::
B2DPolygon
&
rPolygon
)
ThumbnailViewItem
::
createBorderLine
(
const
basegfx
::
B2DPolygon
&
rPolygon
)
{
{
...
...
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