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
3bc5e986
Kaydet (Commit)
3bc5e986
authored
Kas 14, 2014
tarafından
Michael Meeks
Kaydeden (comit)
Markus Mohrhard
Kas 15, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcldemo: dump and render all icons from images.zip when zoomed in.
Change-Id: I89f37b8a1ed70334a3485bc3ca06d04cfe6d0827
üst
f5b3ea83
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
40 deletions
+51
-40
impimagetree.hxx
vcl/inc/impimagetree.hxx
+5
-3
impimagetree.cxx
vcl/source/gdi/impimagetree.cxx
+32
-32
vcldemo.cxx
vcl/workben/vcldemo.cxx
+14
-5
No files found.
vcl/inc/impimagetree.hxx
Dosyayı görüntüle @
3bc5e986
...
...
@@ -55,6 +55,8 @@ public:
* be too late for the destructors of the bitmaps in m_iconCache)*/
void
shutDown
();
css
::
uno
::
Reference
<
css
::
container
::
XNameAccess
>
getNameAccess
();
private
:
bool
doLoadImage
(
OUString
const
&
name
,
OUString
const
&
style
,
...
...
@@ -62,8 +64,7 @@ private:
typedef
std
::
pair
<
OUString
,
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
container
::
XNameAccess
>
>
Path
;
css
::
uno
::
Reference
<
css
::
container
::
XNameAccess
>
>
Path
;
typedef
boost
::
unordered_map
<
OUString
,
bool
,
OUStringHash
>
CheckStyleCache
;
...
...
@@ -78,6 +79,8 @@ private:
bool
m_cacheIcons
;
IconLinkHash
m_linkHash
;
bool
checkPathAccess
();
void
setStyle
(
OUString
const
&
style
);
void
resetPaths
();
...
...
@@ -89,7 +92,6 @@ private:
void
loadImageLinks
();
void
parseLinkFile
(
boost
::
shared_ptr
<
SvStream
>
stream
);
OUString
const
&
getRealImageName
(
OUString
const
&
name
);
std
::
vector
<
OUString
>
getAllPaths
();
};
typedef
salhelper
::
SingletonRef
<
ImplImageTree
>
ImplImageTreeSingletonRef
;
...
...
vcl/source/gdi/impimagetree.cxx
Dosyayı görüntüle @
3bc5e986
...
...
@@ -248,17 +248,9 @@ bool ImplImageTree::find(
}
}
if
(
!
m_path
.
second
.
is
())
{
try
{
m_path
.
second
=
css
::
packages
::
zip
::
ZipFileAccess
::
createWithURL
(
comphelper
::
getProcessComponentContext
(),
m_path
.
first
+
".zip"
);
}
catch
(
const
css
::
uno
::
RuntimeException
&
)
{
throw
;
}
catch
(
const
css
::
uno
::
Exception
&
e
)
{
SAL_INFO
(
"vcl"
,
"ImplImageTree::find exception "
<<
e
.
Message
<<
" for "
<<
m_path
.
first
);
return
false
;
}
}
if
(
!
checkPathAccess
())
return
false
;
for
(
std
::
vector
<
OUString
>::
const_reverse_iterator
j
(
paths
.
rbegin
());
j
!=
paths
.
rend
();
++
j
)
{
...
...
@@ -288,21 +280,9 @@ void ImplImageTree::loadImageLinks()
}
}
if
(
!
m_path
.
second
.
is
()
)
{
try
{
m_path
.
second
=
css
::
packages
::
zip
::
ZipFileAccess
::
createWithURL
(
comphelper
::
getProcessComponentContext
(),
m_path
.
first
+
".zip"
);
}
catch
(
const
css
::
uno
::
RuntimeException
&
)
{
throw
;
}
catch
(
const
css
::
uno
::
Exception
&
e
)
{
SAL_INFO
(
"vcl"
,
"ImplImageTree::find exception "
<<
e
.
Message
<<
" for "
<<
m_path
.
first
);
return
;
}
}
if
(
!
checkPathAccess
())
return
;
if
(
m_path
.
second
->
hasByName
(
aLinkFilename
)
)
{
css
::
uno
::
Reference
<
css
::
io
::
XInputStream
>
s
;
...
...
@@ -349,21 +329,41 @@ OUString const & ImplImageTree::getRealImageName(OUString const & name)
return
it
->
second
;
}
std
::
vector
<
OUString
>
ImplImageTree
::
getAllPath
s
()
bool
ImplImageTree
::
checkPathAcces
s
()
{
std
::
vector
<
OUString
>
aNames
;
if
(
m_path
.
second
.
is
())
return
true
;
try
{
m_path
.
second
=
css
::
packages
::
zip
::
ZipFileAccess
::
createWithURL
(
comphelper
::
getProcessComponentContext
(),
m_path
.
first
+
".zip"
);
}
catch
(
const
css
::
uno
::
RuntimeException
&
)
{
throw
;
}
catch
(
const
css
::
uno
::
Exception
&
e
)
{
SAL_INFO
(
"vcl"
,
"ImplImageTree::zip file location exception "
<<
e
.
Message
<<
" for "
<<
m_path
.
first
);
return
false
;
}
return
m_path
.
second
.
is
();
}
return
aNames
;
css
::
uno
::
Reference
<
css
::
container
::
XNameAccess
>
ImplImageTree
::
getNameAccess
()
{
checkPathAccess
();
return
m_path
.
second
;
}
// For vcldemo / debugging
SAL_DLLPUBLIC
std
::
vector
<
OUString
>
ImageTree_getAllImageNames
();
SAL_DLLPUBLIC
css
::
uno
::
Sequence
<
OUString
>
ImageTree_getAllImageNames
();
/// Recursively dump all names ...
std
::
vector
<
OUString
>
ImageTree_getAllImageNames
()
css
::
uno
::
Sequence
<
OUString
>
ImageTree_getAllImageNames
()
{
static
ImplImageTreeSingletonRef
aImageTree
;
return
aImageTree
.
getAllPaths
();
css
::
uno
::
Reference
<
css
::
container
::
XNameAccess
>
xRef
(
aImageTree
->
getNameAccess
()
);
return
xRef
->
getElementNames
();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/workben/vcldemo.cxx
Dosyayı görüntüle @
3bc5e986
...
...
@@ -31,7 +31,7 @@
#endif
// debugging hook just for us
SAL_DLLPUBLIC
std
::
vector
<
OUString
>
ImageTree_getAllImageNames
();
SAL_DLLPUBLIC
css
::
uno
::
Sequence
<
OUString
>
ImageTree_getAllImageNames
();
using
namespace
css
;
...
...
@@ -566,6 +566,7 @@ public:
struct
DrawIcons
:
public
RegionRenderer
{
std
::
vector
<
OUString
>
maIconNames
;
std
::
vector
<
BitmapEx
>
maIcons
;
bool
bHasLoadedAll
;
DrawIcons
()
:
bHasLoadedAll
(
false
)
...
...
@@ -596,18 +597,24 @@ public:
"cmd/lc_hyperlinkdialog.png"
,
};
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
pNames
);
i
++
)
maIcons
.
push_back
(
BitmapEx
(
OUString
::
createFromAscii
(
pNames
[
i
])));
{
maIconNames
.
push_back
(
OUString
::
createFromAscii
(
pNames
[
i
]));
maIcons
.
push_back
(
BitmapEx
(
maIconNames
[
i
]));
}
}
void
LoadAllI
con
s
()
void
LoadAllI
mage
s
()
{
if
(
bHasLoadedAll
)
return
;
bHasLoadedAll
=
true
;
std
::
vector
<
OUString
>
aAllIcons
=
ImageTree_getAllImageNames
();
for
(
size_t
i
=
0
;
i
<
aAllIcons
.
size
();
i
++
)
css
::
uno
::
Sequence
<
OUString
>
aAllIcons
=
ImageTree_getAllImageNames
();
for
(
sal_Int32
i
=
0
;
i
<
aAllIcons
.
getLength
()
&&
i
<
1024
;
i
++
)
{
maIconNames
.
push_back
(
aAllIcons
[
i
]);
maIcons
.
push_back
(
BitmapEx
(
aAllIcons
[
i
]));
}
}
void
doDrawIcons
(
OutputDevice
&
rDev
,
Rectangle
r
)
...
...
@@ -617,6 +624,7 @@ public:
for
(
size_t
i
=
0
;
i
<
maIcons
.
size
();
i
++
)
{
Size
aSize
(
maIcons
[
i
].
GetSizePixel
());
// sAL_DEBUG("Draw icon '" << maIconNames[i] << "'");
rDev
.
DrawBitmapEx
(
p
,
maIcons
[
i
]);
p
.
Move
(
aSize
.
Width
(),
0
);
if
(
aSize
.
Height
()
>
nMaxH
)
...
...
@@ -635,6 +643,7 @@ public:
{
if
(
rCtx
.
meStyle
==
RENDER_EXPANDED
)
{
LoadAllImages
();
doDrawIcons
(
rDev
,
r
);
}
else
...
...
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