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
6cc45bb7
Kaydet (Commit)
6cc45bb7
authored
Kas 20, 2000
tarafından
Michael Brauer
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Auto style pool cache
üst
6e66b2fc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
136 additions
and
14 deletions
+136
-14
impastp1.cxx
xmloff/source/style/impastp1.cxx
+21
-3
impastp4.cxx
xmloff/source/style/impastp4.cxx
+68
-3
impastpl.hxx
xmloff/source/style/impastpl.hxx
+19
-6
xmlaustp.cxx
xmloff/source/style/xmlaustp.cxx
+28
-2
No files found.
xmloff/source/style/impastp1.cxx
Dosyayı görüntüle @
6cc45bb7
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: impastp1.cxx,v $
* $RCSfile: impastp1.cxx,v $
*
*
* $Revision: 1.
3
$
* $Revision: 1.
4
$
*
*
* last change: $Author: mib $ $Date: 2000-11-
07 13:33:06
$
* last change: $Author: mib $ $Date: 2000-11-
20 10:15:09
$
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -59,6 +59,9 @@
...
@@ -59,6 +59,9 @@
*
*
************************************************************************/
************************************************************************/
#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
#endif
#ifndef _XMLOFF_XMLASTPL_IMPL_HXX
#ifndef _XMLOFF_XMLASTPL_IMPL_HXX
#include "impastpl.hxx"
#include "impastpl.hxx"
#endif
#endif
...
@@ -82,7 +85,8 @@ XMLFamilyData_Impl::XMLFamilyData_Impl(
...
@@ -82,7 +85,8 @@ XMLFamilyData_Impl::XMLFamilyData_Impl(
const
OUString
&
rStrPrefix
,
const
OUString
&
rStrPrefix
,
sal_Bool
bAsFam
)
sal_Bool
bAsFam
)
:
mnFamily
(
nFamily
),
maStrFamilyName
(
rStrName
),
mxMapper
(
rMapper
),
maStrPrefix
(
rStrPrefix
),
:
mnFamily
(
nFamily
),
maStrFamilyName
(
rStrName
),
mxMapper
(
rMapper
),
maStrPrefix
(
rStrPrefix
),
mnCount
(
0
),
mnName
(
0
),
bAsFamily
(
bAsFam
)
mnCount
(
0
),
mnName
(
0
),
bAsFamily
(
bAsFam
),
pCache
(
0
)
{
{
mpParentList
=
new
SvXMLAutoStylePoolParentsP_Impl
(
5
,
5
);
mpParentList
=
new
SvXMLAutoStylePoolParentsP_Impl
(
5
,
5
);
mpNameList
=
new
SvXMLAutoStylePoolNamesP_Impl
(
5
,
5
);
mpNameList
=
new
SvXMLAutoStylePoolNamesP_Impl
(
5
,
5
);
...
@@ -92,6 +96,13 @@ XMLFamilyData_Impl::~XMLFamilyData_Impl()
...
@@ -92,6 +96,13 @@ XMLFamilyData_Impl::~XMLFamilyData_Impl()
{
{
if
(
mpParentList
)
delete
mpParentList
;
if
(
mpParentList
)
delete
mpParentList
;
if
(
mpNameList
)
delete
mpNameList
;
if
(
mpNameList
)
delete
mpNameList
;
DBG_ASSERT
(
!
pCache
||
!
pCache
->
Count
(),
"auto style pool cache is not empty!"
);
if
(
pCache
)
{
while
(
pCache
->
Count
()
)
delete
pCache
->
Remove
(
0UL
);
}
}
}
void
XMLFamilyData_Impl
::
ClearEntries
()
void
XMLFamilyData_Impl
::
ClearEntries
()
...
@@ -99,6 +110,13 @@ void XMLFamilyData_Impl::ClearEntries()
...
@@ -99,6 +110,13 @@ void XMLFamilyData_Impl::ClearEntries()
if
(
mpParentList
)
if
(
mpParentList
)
delete
mpParentList
;
delete
mpParentList
;
mpParentList
=
new
SvXMLAutoStylePoolParentsP_Impl
(
5
,
5
);
mpParentList
=
new
SvXMLAutoStylePoolParentsP_Impl
(
5
,
5
);
DBG_ASSERT
(
!
pCache
||
!
pCache
->
Count
(),
"auto style pool cache is not empty!"
);
if
(
pCache
)
{
while
(
pCache
->
Count
()
)
delete
pCache
->
Remove
(
0UL
);
}
}
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
...
...
xmloff/source/style/impastp4.cxx
Dosyayı görüntüle @
6cc45bb7
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: impastp4.cxx,v $
* $RCSfile: impastp4.cxx,v $
*
*
* $Revision: 1.
5
$
* $Revision: 1.
6
$
*
*
* last change: $Author: mib $ $Date: 2000-11-
07 13:33:06
$
* last change: $Author: mib $ $Date: 2000-11-
20 10:15:09
$
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -174,7 +174,8 @@ void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString&
...
@@ -174,7 +174,8 @@ void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString&
OUString
SvXMLAutoStylePoolP_Impl
::
Add
(
sal_Int32
nFamily
,
OUString
SvXMLAutoStylePoolP_Impl
::
Add
(
sal_Int32
nFamily
,
const
OUString
&
rParent
,
const
OUString
&
rParent
,
const
vector
<
XMLPropertyState
>&
rProperties
)
const
vector
<
XMLPropertyState
>&
rProperties
,
sal_Bool
bCache
)
{
{
OUString
sName
;
OUString
sName
;
sal_uInt32
nPos
;
sal_uInt32
nPos
;
...
@@ -205,11 +206,44 @@ OUString SvXMLAutoStylePoolP_Impl::Add( sal_Int32 nFamily,
...
@@ -205,11 +206,44 @@ OUString SvXMLAutoStylePoolP_Impl::Add( sal_Int32 nFamily,
if
(
pParent
->
Add
(
pFamily
,
rProperties
,
sName
)
)
if
(
pParent
->
Add
(
pFamily
,
rProperties
,
sName
)
)
pFamily
->
mnCount
++
;
pFamily
->
mnCount
++
;
if
(
bCache
)
{
if
(
!
pFamily
->
pCache
)
pFamily
->
pCache
=
new
SvXMLAutoStylePoolCache_Impl
(
256
,
256
);
if
(
pFamily
->
pCache
->
Count
()
<
MAX_CACHE_SIZE
)
pFamily
->
pCache
->
Insert
(
new
OUString
(
sName
),
pFamily
->
pCache
->
Count
()
);
}
}
}
return
sName
;
return
sName
;
}
}
OUString
SvXMLAutoStylePoolP_Impl
::
AddToCache
(
sal_Int32
nFamily
,
const
OUString
&
rParent
)
{
sal_uInt32
nPos
;
XMLFamilyData_Impl
*
pFamily
=
0
;
XMLFamilyData_Impl
aTmp
(
nFamily
);
if
(
maFamilyList
.
Seek_Entry
(
&
aTmp
,
&
nPos
)
)
{
pFamily
=
maFamilyList
.
GetObject
(
nPos
);
}
DBG_ASSERT
(
pFamily
,
"SvXMLAutoStylePool_Impl::Add: unknown family"
);
if
(
pFamily
)
{
if
(
!
pFamily
->
pCache
)
pFamily
->
pCache
=
new
SvXMLAutoStylePoolCache_Impl
(
256
,
256
);
if
(
pFamily
->
pCache
->
Count
()
<
MAX_CACHE_SIZE
)
pFamily
->
pCache
->
Insert
(
new
OUString
(
rParent
),
pFamily
->
pCache
->
Count
()
);
}
return
rParent
;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
//
// Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list
// Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list
...
@@ -244,6 +278,37 @@ OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily,
...
@@ -244,6 +278,37 @@ OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily,
return
sName
;
return
sName
;
}
}
OUString
SvXMLAutoStylePoolP_Impl
::
FindAndRemoveCached
(
sal_Int32
nFamily
)
const
{
OUString
sName
;
sal_uInt32
nPos
;
XMLFamilyData_Impl
aTmp
(
nFamily
);
XMLFamilyData_Impl
*
pFamily
=
0
;
if
(
maFamilyList
.
Seek_Entry
(
&
aTmp
,
&
nPos
)
)
{
pFamily
=
maFamilyList
.
GetObject
(
nPos
);
}
DBG_ASSERT
(
pFamily
,
"SvXMLAutoStylePool_Impl::Find: unknown family"
);
if
(
pFamily
)
{
DBG_ASSERT
(
pFamily
->
pCache
,
"family doesn't have a cache"
);
// The cache may be empty already. This happens if it was filled
// completly.
if
(
pFamily
->
pCache
&&
pFamily
->
pCache
->
Count
()
)
{
OUString
*
pName
=
pFamily
->
pCache
->
Remove
(
0UL
);
sName
=
*
pName
;
delete
pName
;
}
}
return
sName
;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
//
// export
// export
...
...
xmloff/source/style/impastpl.hxx
Dosyayı görüntüle @
6cc45bb7
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: impastpl.hxx,v $
* $RCSfile: impastpl.hxx,v $
*
*
* $Revision: 1.
3
$
* $Revision: 1.
4
$
*
*
* last change: $Author: mib $ $Date: 2000-11-
07 13:33:06
$
* last change: $Author: mib $ $Date: 2000-11-
20 10:15:09
$
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -97,14 +97,20 @@ class SvXMLAutoStylePoolNamesP_Impl;
...
@@ -97,14 +97,20 @@ class SvXMLAutoStylePoolNamesP_Impl;
class
SvXMLAttributeList
;
class
SvXMLAttributeList
;
class
SvXMLExportPropertyMapper
;
class
SvXMLExportPropertyMapper
;
#define MAX_CACHE_SIZE 65536
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
//
// Implementationclass for stylefamily-information
// Implementationclass for stylefamily-information
//
//
typedef
::
rtl
::
OUString
*
OUStringPtr
;
DECLARE_LIST
(
SvXMLAutoStylePoolCache_Impl
,
OUStringPtr
)
class
XMLFamilyData_Impl
class
XMLFamilyData_Impl
{
{
public
:
public
:
SvXMLAutoStylePoolCache_Impl
*
pCache
;
sal_uInt32
mnFamily
;
sal_uInt32
mnFamily
;
::
rtl
::
OUString
maStrFamilyName
;
::
rtl
::
OUString
maStrFamilyName
;
UniReference
<
SvXMLExportPropertyMapper
>
mxMapper
;
UniReference
<
SvXMLExportPropertyMapper
>
mxMapper
;
...
@@ -120,9 +126,11 @@ public:
...
@@ -120,9 +126,11 @@ public:
XMLFamilyData_Impl
(
sal_Int32
nFamily
,
const
::
rtl
::
OUString
&
rStrName
,
XMLFamilyData_Impl
(
sal_Int32
nFamily
,
const
::
rtl
::
OUString
&
rStrName
,
const
UniReference
<
SvXMLExportPropertyMapper
>
&
rMapper
,
const
UniReference
<
SvXMLExportPropertyMapper
>
&
rMapper
,
const
::
rtl
::
OUString
&
rStrPrefix
,
sal_Bool
bAsFamily
=
sal_True
);
const
::
rtl
::
OUString
&
rStrPrefix
,
sal_Bool
bAsFamily
=
sal_True
);
XMLFamilyData_Impl
(
sal_Int32
nFamily
)
:
mnFamily
(
nFamily
),
mpParentList
(
NULL
),
XMLFamilyData_Impl
(
sal_Int32
nFamily
)
:
mpNameList
(
NULL
),
mnCount
(
0
),
mnName
(
0
)
mnFamily
(
nFamily
),
mpParentList
(
NULL
),
mpNameList
(
NULL
),
mnCount
(
0
),
mnName
(
0
),
pCache
(
0
)
{}
{}
~
XMLFamilyData_Impl
();
~
XMLFamilyData_Impl
();
...
@@ -227,10 +235,15 @@ public:
...
@@ -227,10 +235,15 @@ public:
void
RegisterName
(
sal_Int32
nFamily
,
const
::
rtl
::
OUString
&
rName
);
void
RegisterName
(
sal_Int32
nFamily
,
const
::
rtl
::
OUString
&
rName
);
::
rtl
::
OUString
Add
(
sal_Int32
nFamily
,
const
::
rtl
::
OUString
&
rParent
,
::
rtl
::
OUString
Add
(
sal_Int32
nFamily
,
const
::
rtl
::
OUString
&
rParent
,
const
::
std
::
vector
<
XMLPropertyState
>&
rProperties
);
const
::
std
::
vector
<
XMLPropertyState
>&
rProperties
,
sal_Bool
bCache
=
sal_False
);
::
rtl
::
OUString
AddToCache
(
sal_Int32
nFamily
,
const
::
rtl
::
OUString
&
rParent
);
::
rtl
::
OUString
Find
(
sal_Int32
nFamily
,
const
::
rtl
::
OUString
&
rParent
,
::
rtl
::
OUString
Find
(
sal_Int32
nFamily
,
const
::
rtl
::
OUString
&
rParent
,
const
::
std
::
vector
<
XMLPropertyState
>&
rProperties
)
const
;
const
::
std
::
vector
<
XMLPropertyState
>&
rProperties
)
const
;
::
rtl
::
OUString
FindAndRemoveCached
(
sal_Int32
nFamily
)
const
;
void
exportXML
(
sal_Int32
nFamily
,
void
exportXML
(
sal_Int32
nFamily
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XDocumentHandler
>
&
rHandler
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XDocumentHandler
>
&
rHandler
,
const
SvXMLUnitConverter
&
rUnitConverter
,
const
SvXMLUnitConverter
&
rUnitConverter
,
...
...
xmloff/source/style/xmlaustp.cxx
Dosyayı görüntüle @
6cc45bb7
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: xmlaustp.cxx,v $
* $RCSfile: xmlaustp.cxx,v $
*
*
* $Revision: 1.
7
$
* $Revision: 1.
8
$
*
*
* last change: $Author: mib $ $Date: 2000-11-
07 13:33:06
$
* last change: $Author: mib $ $Date: 2000-11-
20 10:15:09
$
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -275,6 +275,26 @@ OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily,
...
@@ -275,6 +275,26 @@ OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily,
return
pImpl
->
Add
(
nFamily
,
rParent
,
rProperties
);
return
pImpl
->
Add
(
nFamily
,
rParent
,
rProperties
);
}
}
OUString
SvXMLAutoStylePoolP
::
AddAndCache
(
sal_Int32
nFamily
,
const
vector
<
XMLPropertyState
>&
rProperties
)
{
OUString
sEmpty
;
return
pImpl
->
Add
(
nFamily
,
sEmpty
,
rProperties
,
sal_True
);
}
OUString
SvXMLAutoStylePoolP
::
AddAndCache
(
sal_Int32
nFamily
,
const
OUString
&
rParent
,
const
vector
<
XMLPropertyState
>&
rProperties
)
{
return
pImpl
->
Add
(
nFamily
,
rParent
,
rProperties
,
sal_True
);
}
OUString
SvXMLAutoStylePoolP
::
AddAndCache
(
sal_Int32
nFamily
,
const
OUString
&
rParent
)
{
return
pImpl
->
AddToCache
(
nFamily
,
rParent
);
}
OUString
SvXMLAutoStylePoolP
::
Find
(
sal_Int32
nFamily
,
OUString
SvXMLAutoStylePoolP
::
Find
(
sal_Int32
nFamily
,
const
vector
<
XMLPropertyState
>&
rProperties
)
const
const
vector
<
XMLPropertyState
>&
rProperties
)
const
{
{
...
@@ -289,6 +309,12 @@ OUString SvXMLAutoStylePoolP::Find( sal_Int32 nFamily,
...
@@ -289,6 +309,12 @@ OUString SvXMLAutoStylePoolP::Find( sal_Int32 nFamily,
return
pImpl
->
Find
(
nFamily
,
rParent
,
rProperties
);
return
pImpl
->
Find
(
nFamily
,
rParent
,
rProperties
);
}
}
OUString
SvXMLAutoStylePoolP
::
FindAndRemoveCached
(
sal_Int32
nFamily
)
const
{
return
pImpl
->
FindAndRemoveCached
(
nFamily
);
}
void
SvXMLAutoStylePoolP
::
exportXML
(
sal_Int32
nFamily
,
void
SvXMLAutoStylePoolP
::
exportXML
(
sal_Int32
nFamily
,
const
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XDocumentHandler
>
&
rHandler
,
const
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XDocumentHandler
>
&
rHandler
,
const
SvXMLUnitConverter
&
rUnitConverter
,
const
SvXMLUnitConverter
&
rUnitConverter
,
...
...
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