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
e377a65a
Kaydet (Commit)
e377a65a
authored
Kas 08, 2014
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: remove pointless inheritance of SwChapterNumRules from SwBaseNumRules
Change-Id: I5426977d4ed5539d79335df0aa4bcccd71dd8966
üst
f7c14f57
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
57 deletions
+32
-57
outline.cxx
sw/source/ui/misc/outline.cxx
+2
-2
StoredChapterNumbering.cxx
sw/source/uibase/config/StoredChapterNumbering.cxx
+12
-12
uinums.cxx
sw/source/uibase/config/uinums.cxx
+11
-25
uinums.hxx
sw/source/uibase/inc/uinums.hxx
+7
-18
No files found.
sw/source/ui/misc/outline.cxx
Dosyayı görüntüle @
e377a65a
...
...
@@ -91,13 +91,13 @@ IMPL_LINK_INLINE_END( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
void
SwNumNamesDlg
::
SetUserNames
(
const
OUString
*
pList
[])
{
sal_uInt16
nSelect
=
0
;
for
(
sal_uInt16
i
=
0
;
i
<
SwBase
NumRules
::
nMaxRules
;
++
i
)
for
(
sal_uInt16
i
=
0
;
i
<
SwChapter
NumRules
::
nMaxRules
;
++
i
)
{
if
(
pList
[
i
])
{
m_pFormBox
->
RemoveEntry
(
i
);
m_pFormBox
->
InsertEntry
(
*
pList
[
i
],
i
);
if
(
i
==
nSelect
&&
nSelect
<
SwBase
NumRules
::
nMaxRules
)
if
(
i
==
nSelect
&&
nSelect
<
SwChapter
NumRules
::
nMaxRules
)
nSelect
++
;
}
}
...
...
sw/source/uibase/config/StoredChapterNumbering.cxx
Dosyayı görüntüle @
e377a65a
...
...
@@ -46,7 +46,7 @@ class StoredChapterNumberingRules
{
private
:
// TODO in case this ever becomes accessible via api need a invalidate
Sw
Base
NumRules
&
m_rNumRules
;
Sw
Chapter
NumRules
&
m_rNumRules
;
sal_uInt16
const
m_nIndex
;
SwNumRulesWithName
*
GetOrCreateRules
()
...
...
@@ -63,11 +63,11 @@ private:
public
:
StoredChapterNumberingRules
(
Sw
Base
NumRules
&
rNumRules
,
sal_uInt16
const
nIndex
)
Sw
Chapter
NumRules
&
rNumRules
,
sal_uInt16
const
nIndex
)
:
m_rNumRules
(
rNumRules
)
,
m_nIndex
(
nIndex
)
{
assert
(
m_nIndex
<
Sw
Base
NumRules
::
nMaxRules
);
assert
(
m_nIndex
<
Sw
Chapter
NumRules
::
nMaxRules
);
}
// XNamed
...
...
@@ -324,13 +324,13 @@ class StoredChapterNumberingRootContext
:
public
SvXMLImportContext
{
private
:
Sw
Base
NumRules
&
m_rNumRules
;
Sw
Chapter
NumRules
&
m_rNumRules
;
size_t
m_nCounter
;
::
std
::
vector
<
tools
::
SvRef
<
SvxXMLListStyleContext
>>
m_Contexts
;
public
:
StoredChapterNumberingRootContext
(
Sw
Base
NumRules
&
rNumRules
,
SvXMLImport
&
rImport
,
Sw
Chapter
NumRules
&
rNumRules
,
SvXMLImport
&
rImport
,
sal_uInt16
const
nPrefix
,
OUString
const
&
rLocalName
)
:
SvXMLImportContext
(
rImport
,
nPrefix
,
rLocalName
)
,
m_rNumRules
(
rNumRules
)
...
...
@@ -340,7 +340,7 @@ public:
virtual
void
EndElement
()
SAL_OVERRIDE
{
assert
(
m_Contexts
.
size
()
<
Sw
Base
NumRules
::
nMaxRules
);
assert
(
m_Contexts
.
size
()
<
Sw
Chapter
NumRules
::
nMaxRules
);
for
(
auto
iter
=
m_Contexts
.
begin
();
iter
!=
m_Contexts
.
end
();
++
iter
)
{
uno
::
Reference
<
container
::
XIndexReplace
>
const
xRule
(
...
...
@@ -360,7 +360,7 @@ public:
if
(
XML_NAMESPACE_TEXT
==
nPrefix
&&
IsXMLToken
(
rLocalName
,
XML_OUTLINE_STYLE
))
{
++
m_nCounter
;
if
(
m_nCounter
<=
Sw
Base
NumRules
::
nMaxRules
)
if
(
m_nCounter
<=
Sw
Chapter
NumRules
::
nMaxRules
)
{
SvxXMLListStyleContext
*
const
pContext
(
new
SvxXMLListStyleContext
(
GetImport
(),
...
...
@@ -384,12 +384,12 @@ class StoredChapterNumberingImport
:
public
SvXMLImport
{
private
:
Sw
Base
NumRules
&
m_rNumRules
;
Sw
Chapter
NumRules
&
m_rNumRules
;
public
:
StoredChapterNumberingImport
(
uno
::
Reference
<
uno
::
XComponentContext
>
const
&
xContext
,
Sw
Base
NumRules
&
rNumRules
)
Sw
Chapter
NumRules
&
rNumRules
)
:
SvXMLImport
(
xContext
,
"sw::StoredChapterNumberingImport"
,
IMPORT_ALL
)
,
m_rNumRules
(
rNumRules
)
{
...
...
@@ -408,7 +408,7 @@ public:
}
};
void
ExportStoredChapterNumberingRules
(
Sw
Base
NumRules
&
rRules
,
void
ExportStoredChapterNumberingRules
(
Sw
Chapter
NumRules
&
rRules
,
SvStream
&
rStream
,
OUString
const
&
rFileName
)
{
uno
::
Reference
<
uno
::
XComponentContext
>
const
xContext
(
...
...
@@ -432,7 +432,7 @@ void ExportStoredChapterNumberingRules(SwBaseNumRules & rRules,
// ... and the import needs to map from name to display-name then!
std
::
set
<
OUString
>
charStyles
;
std
::
vector
<
uno
::
Reference
<
container
::
XIndexReplace
>>
numRules
;
for
(
size_t
i
=
0
;
i
<
Sw
Base
NumRules
::
nMaxRules
;
++
i
)
for
(
size_t
i
=
0
;
i
<
Sw
Chapter
NumRules
::
nMaxRules
;
++
i
)
{
if
(
SwNumRulesWithName
const
*
pRule
=
rRules
.
GetRules
(
i
))
{
...
...
@@ -461,7 +461,7 @@ void ExportStoredChapterNumberingRules(SwBaseNumRules & rRules,
}
}
void
ImportStoredChapterNumberingRules
(
Sw
Base
NumRules
&
rRules
,
void
ImportStoredChapterNumberingRules
(
Sw
Chapter
NumRules
&
rRules
,
SvStream
&
rStream
,
OUString
const
&
rFileName
)
{
uno
::
Reference
<
uno
::
XComponentContext
>
const
xContext
(
...
...
sw/source/uibase/config/uinums.cxx
Dosyayı görüntüle @
e377a65a
...
...
@@ -54,16 +54,16 @@ using namespace ::com::sun::star;
An old rule at that position will be overwritten.
*/
Sw
BaseNumRules
::
SwBaseNumRules
(
const
OUString
&
rFileName
)
:
sFileName
(
rFileName
)
,
Sw
ChapterNumRules
::
SwChapterNumRules
(
)
:
sFileName
(
OUString
(
CHAPTER_FILENAME
))
,
nVersion
(
0
),
bModified
(
false
)
{
Init
();
}
void
Sw
Base
NumRules
::
Save
()
void
Sw
Chapter
NumRules
::
Save
()
{
if
(
bModified
)
{
...
...
@@ -87,13 +87,13 @@ void SwBaseNumRules::Save()
}
}
Sw
BaseNumRules
::~
SwBase
NumRules
()
Sw
ChapterNumRules
::~
SwChapter
NumRules
()
{
for
(
sal_uInt16
i
=
0
;
i
<
nMaxRules
;
++
i
)
delete
pNumRules
[
i
];
}
void
Sw
Base
NumRules
::
Init
()
void
Sw
Chapter
NumRules
::
Init
()
{
for
(
sal_uInt16
i
=
0
;
i
<
nMaxRules
;
++
i
)
pNumRules
[
i
]
=
0
;
...
...
@@ -107,15 +107,16 @@ void SwBaseNumRules::Init()
}
}
void
Sw
Base
NumRules
::
CreateEmptyNumRule
(
sal_uInt16
const
nIndex
)
void
Sw
Chapter
NumRules
::
CreateEmptyNumRule
(
sal_uInt16
const
nIndex
)
{
assert
(
nIndex
<
nMaxRules
);
assert
(
!
pNumRules
[
nIndex
]);
pNumRules
[
nIndex
]
=
new
SwNumRulesWithName
;
}
void
Sw
Base
NumRules
::
ApplyNumRules
(
const
SwNumRulesWithName
&
rCopy
,
sal_uInt16
nIdx
)
void
Sw
Chapter
NumRules
::
ApplyNumRules
(
const
SwNumRulesWithName
&
rCopy
,
sal_uInt16
nIdx
)
{
bModified
=
true
;
OSL_ENSURE
(
nIdx
<
nMaxRules
,
"Array der NumRules ueberindiziert."
);
if
(
!
pNumRules
[
nIdx
]
)
pNumRules
[
nIdx
]
=
new
SwNumRulesWithName
(
rCopy
);
...
...
@@ -124,7 +125,7 @@ void SwBaseNumRules::ApplyNumRules(const SwNumRulesWithName &rCopy, sal_uInt16 n
Save
();
// store it immediately
}
bool
Sw
Base
NumRules
::
Store
(
SvStream
&
rStream
)
bool
Sw
Chapter
NumRules
::
Store
(
SvStream
&
rStream
)
{
rStream
.
WriteUInt16
(
ACT_NUM_VERSION
);
// Write, what positions are occupied by a rule
...
...
@@ -142,7 +143,7 @@ bool SwBaseNumRules::Store(SvStream &rStream)
return
true
;
}
int
Sw
Base
NumRules
::
Load
(
SvStream
&
rStream
)
int
Sw
Chapter
NumRules
::
Load
(
SvStream
&
rStream
)
{
int
rc
=
0
;
...
...
@@ -173,21 +174,6 @@ int SwBaseNumRules::Load(SvStream &rStream)
return
rc
;
}
SwChapterNumRules
::
SwChapterNumRules
()
:
SwBaseNumRules
(
OUString
(
CHAPTER_FILENAME
))
{
}
SwChapterNumRules
::~
SwChapterNumRules
()
{
}
void
SwChapterNumRules
::
ApplyNumRules
(
const
SwNumRulesWithName
&
rCopy
,
sal_uInt16
nIdx
)
{
bModified
=
true
;
SwBaseNumRules
::
ApplyNumRules
(
rCopy
,
nIdx
);
}
SwNumRulesWithName
::
SwNumRulesWithName
(
const
SwNumRule
&
rCopy
,
const
OUString
&
rName
)
:
maName
(
rName
)
...
...
sw/source/uibase/inc/uinums.hxx
Dosyayı görüntüle @
e377a65a
...
...
@@ -62,7 +62,7 @@ class SW_DLLPUBLIC SwNumRulesWithName
protected
:
friend
class
sw
::
StoredChapterNumberingRules
;
friend
class
Sw
Base
NumRules
;
friend
class
Sw
Chapter
NumRules
;
void
SetName
(
const
OUString
&
rSet
)
{
maName
=
rSet
;}
void
SetNumFmt
(
size_t
,
SwNumFmt
const
&
,
OUString
const
&
);
SwNumRulesWithName
();
...
...
@@ -83,7 +83,7 @@ public:
void
GetNumFmt
(
size_t
,
SwNumFmt
const
*&
,
OUString
const
*&
)
const
;
};
class
Sw
Base
NumRules
class
Sw
Chapter
NumRules
{
public
:
enum
{
nMaxRules
=
MAX_NUM_RULES
};
// currently 9 defined forms
...
...
@@ -100,8 +100,8 @@ protected:
void
Save
();
public
:
Sw
BaseNumRules
(
const
OUString
&
rFileName
);
virtual
~
Sw
Base
NumRules
();
Sw
ChapterNumRules
(
);
virtual
~
Sw
Chapter
NumRules
();
inline
const
SwNumRulesWithName
*
GetRules
(
sal_uInt16
nIdx
)
const
;
void
CreateEmptyNumRule
(
sal_uInt16
nIdx
);
// for import
...
...
@@ -111,18 +111,7 @@ public:
};
class
SwChapterNumRules
:
public
SwBaseNumRules
{
public
:
SwChapterNumRules
();
virtual
~
SwChapterNumRules
();
virtual
void
ApplyNumRules
(
const
SwNumRulesWithName
&
rCopy
,
sal_uInt16
nIdx
)
SAL_OVERRIDE
;
};
inline
const
SwNumRulesWithName
*
SwBaseNumRules
::
GetRules
(
sal_uInt16
nIdx
)
const
inline
const
SwNumRulesWithName
*
SwChapterNumRules
::
GetRules
(
sal_uInt16
nIdx
)
const
{
OSL_ENSURE
(
nIdx
<
nMaxRules
,
"Array der NumRules ueberindiziert."
);
return
pNumRules
[
nIdx
];
...
...
@@ -133,9 +122,9 @@ namespace sw
{
void
ExportStoredChapterNumberingRules
(
Sw
Base
NumRules
&
rRules
,
SvStream
&
rStream
,
OUString
const
&
);
Sw
Chapter
NumRules
&
rRules
,
SvStream
&
rStream
,
OUString
const
&
);
void
ImportStoredChapterNumberingRules
(
Sw
Base
NumRules
&
rRules
,
SvStream
&
rStream
,
OUString
const
&
);
Sw
Chapter
NumRules
&
rRules
,
SvStream
&
rStream
,
OUString
const
&
);
}
// namespace sw
...
...
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