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
704edbf7
Kaydet (Commit)
704edbf7
authored
Nis 08, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert DIC_ERR_ constants to scoped enum
Change-Id: I083f1b7f21b18c5067b01c82fa8fec467a3d0c50
üst
6bf94344
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
35 deletions
+37
-35
SpellDialog.cxx
cui/source/dialogs/SpellDialog.cxx
+12
-11
optdict.cxx
cui/source/options/optdict.cxx
+4
-3
unolingu.cxx
editeng/source/misc/unolingu.cxx
+4
-4
unolingu.hxx
include/editeng/unolingu.hxx
+2
-1
misc.hxx
include/linguistic/misc.hxx
+5
-6
misc.cxx
linguistic/source/misc.cxx
+6
-6
olmenu.cxx
sw/source/uibase/lingu/olmenu.cxx
+4
-4
No files found.
cui/source/dialogs/SpellDialog.cxx
Dosyayı görüntüle @
704edbf7
...
...
@@ -64,6 +64,7 @@ using namespace ::com::sun::star;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
beans
;
using
namespace
::
com
::
sun
::
star
::
linguistic2
;
using
namespace
linguistic
;
// struct SpellDialog_Impl ---------------------------------------------
...
...
@@ -249,7 +250,7 @@ SpellDialog::~SpellDialog()
Reference
<
XSearchableDictionaryList
>
xDicList
(
SvxGetDictionaryList
()
);
if
(
xDicList
.
is
())
{
linguistic
::
SaveDictionaries
(
xDicList
);
SaveDictionaries
(
xDicList
);
}
delete
pImpl
;
...
...
@@ -577,11 +578,11 @@ IMPL_LINK_NOARG(SpellDialog, ChangeAllHdl)
OUString
aOldWord
(
m_pSentenceED
->
GetErrorText
()
);
SvxPrepareAutoCorrect
(
aOldWord
,
aString
);
Reference
<
XDictionary
>
aXDictionary
(
SvxGetChangeAllList
(),
UNO_QUERY
);
sal_uInt8
nAdded
=
linguistic
::
AddEntryToDic
(
aXDictionary
,
DictionaryError
nAdded
=
AddEntryToDic
(
aXDictionary
,
aOldWord
,
true
,
aString
,
eLang
);
if
(
nAdded
==
D
IC_ERR_
NONE
)
if
(
nAdded
==
D
ictionaryError
::
NONE
)
{
SpellUndoAction_Impl
*
pAction
=
new
SpellUndoAction_Impl
(
SPELLUNDO_CHANGE_ADD_TO_DICTIONARY
,
aDialogUndoLink
);
...
...
@@ -626,10 +627,10 @@ IMPL_LINK( SpellDialog, IgnoreAllHdl, Button *, pButton )
else
{
OUString
sErrorText
(
m_pSentenceED
->
GetErrorText
());
sal_uInt8
nAdded
=
linguistic
::
AddEntryToDic
(
aXDictionary
,
DictionaryError
nAdded
=
AddEntryToDic
(
aXDictionary
,
sErrorText
,
false
,
OUString
(),
LANGUAGE_NONE
);
if
(
nAdded
==
D
IC_ERR_
NONE
)
if
(
nAdded
==
D
ictionaryError
::
NONE
)
{
SpellUndoAction_Impl
*
pAction
=
new
SpellUndoAction_Impl
(
SPELLUNDO_CHANGE_ADD_TO_DICTIONARY
,
aDialogUndoLink
);
...
...
@@ -910,16 +911,16 @@ int SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu )
if
(
xDicList
.
is
())
xDic
=
xDicList
->
getDictionaryByName
(
aDicName
);
sal_Int16
nAddRes
=
DIC_ERR_
UNKNOWN
;
DictionaryError
nAddRes
=
DictionaryError
::
UNKNOWN
;
if
(
xDic
.
is
())
{
nAddRes
=
linguistic
::
AddEntryToDic
(
xDic
,
aNewWord
,
false
,
OUString
(),
LANGUAGE_NONE
);
nAddRes
=
AddEntryToDic
(
xDic
,
aNewWord
,
false
,
OUString
(),
LANGUAGE_NONE
);
// save modified user-dictionary if it is persistent
uno
::
Reference
<
frame
::
XStorable
>
xSavDic
(
xDic
,
uno
::
UNO_QUERY
);
if
(
xSavDic
.
is
())
xSavDic
->
store
();
if
(
nAddRes
==
D
IC_ERR_
NONE
)
if
(
nAddRes
==
D
ictionaryError
::
NONE
)
{
SpellUndoAction_Impl
*
pAction
=
new
SpellUndoAction_Impl
(
SPELLUNDO_CHANGE_ADD_TO_DICTIONARY
,
aDialogUndoLink
);
...
...
@@ -928,10 +929,10 @@ int SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu )
m_pSentenceED
->
AddUndoAction
(
pAction
);
}
// failed because there is already an entry?
if
(
D
IC_ERR_
NONE
!=
nAddRes
&&
xDic
->
getEntry
(
aNewWord
).
is
())
nAddRes
=
D
IC_ERR_
NONE
;
if
(
D
ictionaryError
::
NONE
!=
nAddRes
&&
xDic
->
getEntry
(
aNewWord
).
is
())
nAddRes
=
D
ictionaryError
::
NONE
;
}
if
(
D
IC_ERR_
NONE
!=
nAddRes
)
if
(
D
ictionaryError
::
NONE
!=
nAddRes
)
{
SvxDicError
(
this
,
nAddRes
);
return
0
;
// don't continue
...
...
cui/source/options/optdict.cxx
Dosyayı görüntüle @
704edbf7
...
...
@@ -39,6 +39,7 @@
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
linguistic2
;
using
namespace
linguistic
;
// static ----------------------------------------------------------------
...
...
@@ -597,7 +598,7 @@ IMPL_LINK(SvxEditDictionaryDialog, NewDelHdl, PushButton*, pBtn)
OUString
sEntry
(
aNewWord
);
OUString
aReplaceStr
(
pReplaceED
->
GetText
());
sal_Int16
nAddRes
=
DIC_ERR_
UNKNOWN
;
DictionaryError
nAddRes
=
DictionaryError
::
UNKNOWN
;
sal_Int32
nPos
=
pAllDictsLB
->
GetSelectEntryPos
();
if
(
nPos
!=
LISTBOX_ENTRY_NOTFOUND
&&
!
aNewWord
.
isEmpty
())
{
...
...
@@ -624,10 +625,10 @@ IMPL_LINK(SvxEditDictionaryDialog, NewDelHdl, PushButton*, pBtn)
aRplcText
,
LanguageTag
(
xDic
->
getLocale
()
).
getLanguageType
(),
false
);
}
}
if
(
D
IC_ERR_
NONE
!=
nAddRes
)
if
(
D
ictionaryError
::
NONE
!=
nAddRes
)
SvxDicError
(
this
,
nAddRes
);
if
(
D
IC_ERR_
NONE
==
nAddRes
&&
!
sEntry
.
isEmpty
())
if
(
D
ictionaryError
::
NONE
==
nAddRes
&&
!
sEntry
.
isEmpty
())
{
// insert new entry in list-box etc...
...
...
editeng/source/misc/unolingu.cxx
Dosyayı görüntüle @
704edbf7
...
...
@@ -822,16 +822,16 @@ SvxDicListChgClamp::~SvxDicListChgClamp()
}
}
short
SvxDicError
(
vcl
::
Window
*
pParent
,
sal_Int16
nError
)
short
SvxDicError
(
vcl
::
Window
*
pParent
,
linguistic
::
DictionaryError
nError
)
{
short
nRes
=
0
;
if
(
DIC_ERR_
NONE
!=
nError
)
if
(
linguistic
::
DictionaryError
::
NONE
!=
nError
)
{
int
nRid
;
switch
(
nError
)
{
case
DIC_ERR_
FULL
:
nRid
=
RID_SVXSTR_DIC_ERR_FULL
;
break
;
case
DIC_ERR_
READONLY
:
nRid
=
RID_SVXSTR_DIC_ERR_READONLY
;
break
;
case
linguistic
:
:
DictionaryError
::
FULL
:
nRid
=
RID_SVXSTR_DIC_ERR_FULL
;
break
;
case
linguistic
:
:
DictionaryError
::
READONLY
:
nRid
=
RID_SVXSTR_DIC_ERR_READONLY
;
break
;
default
:
nRid
=
RID_SVXSTR_DIC_ERR_UNKNOWN
;
SAL_WARN
(
"editeng"
,
"unexpected case"
);
...
...
include/editeng/unolingu.hxx
Dosyayı görüntüle @
704edbf7
...
...
@@ -35,6 +35,7 @@
class
LinguMgrExitLstnr
;
namespace
vcl
{
class
Window
;
}
namespace
linguistic
{
enum
class
DictionaryError
;
}
...
...
@@ -181,7 +182,7 @@ EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
// misc functions
EDITENG_DLLPUBLIC
short
SvxDicError
(
vcl
::
Window
*
pParent
,
sal_Int16
nError
);
EDITENG_DLLPUBLIC
short
SvxDicError
(
vcl
::
Window
*
pParent
,
linguistic
::
DictionaryError
nError
);
#endif
...
...
include/linguistic/misc.hxx
Dosyayı görüntüle @
704edbf7
...
...
@@ -63,11 +63,10 @@ namespace linguistic
// AddEntryToDic return values
#define DIC_ERR_NONE 0
#define DIC_ERR_FULL 1
#define DIC_ERR_READONLY 2
#define DIC_ERR_UNKNOWN 3
#define DIC_ERR_NOT_EXISTS 4
enum
class
DictionaryError
{
NONE
,
FULL
,
READONLY
,
UNKNOWN
,
NOT_EXISTS
};
// values asigned to capitalization types
enum
CapType
...
...
@@ -166,7 +165,7 @@ bool IsIgnoreControlChars( const ::com::sun::star::beans::PropertyValues &rPrope
const
OUString
&
rWord
,
sal_Int16
nLanguage
,
bool
bSearchPosDics
,
bool
bSearchSpellEntry
);
LNG_DLLPUBLIC
sal_uInt8
AddEntryToDic
(
LNG_DLLPUBLIC
DictionaryError
AddEntryToDic
(
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
linguistic2
::
XDictionary
>
&
rxDic
,
const
OUString
&
rWord
,
bool
bIsNeg
,
const
OUString
&
rRplcTxt
,
sal_Int16
nRplcLang
,
...
...
linguistic/source/misc.cxx
Dosyayı görüntüle @
704edbf7
...
...
@@ -350,14 +350,14 @@ bool SaveDictionaries( const uno::Reference< XSearchableDictionaryList > &xDicLi
return
bRet
;
}
sal_uInt8
AddEntryToDic
(
DictionaryError
AddEntryToDic
(
uno
::
Reference
<
XDictionary
>
&
rxDic
,
const
OUString
&
rWord
,
bool
bIsNeg
,
const
OUString
&
rRplcTxt
,
sal_Int16
/* nRplcLang */
,
bool
bStripDot
)
{
if
(
!
rxDic
.
is
())
return
D
IC_ERR_
NOT_EXISTS
;
return
D
ictionaryError
::
NOT_EXISTS
;
OUString
aTmp
(
rWord
);
if
(
bStripDot
)
...
...
@@ -372,18 +372,18 @@ sal_uInt8 AddEntryToDic(
}
bool
bAddOk
=
rxDic
->
add
(
aTmp
,
bIsNeg
,
rRplcTxt
);
sal_uInt8
nRes
=
DIC_ERR_
NONE
;
DictionaryError
nRes
=
DictionaryError
::
NONE
;
if
(
!
bAddOk
)
{
if
(
rxDic
->
isFull
())
nRes
=
D
IC_ERR_
FULL
;
nRes
=
D
ictionaryError
::
FULL
;
else
{
uno
::
Reference
<
frame
::
XStorable
>
xStor
(
rxDic
,
UNO_QUERY
);
if
(
xStor
.
is
()
&&
xStor
->
isReadonly
())
nRes
=
D
IC_ERR_
READONLY
;
nRes
=
D
ictionaryError
::
READONLY
;
else
nRes
=
D
IC_ERR_
UNKNOWN
;
nRes
=
D
ictionaryError
::
UNKNOWN
;
}
}
...
...
sw/source/uibase/lingu/olmenu.cxx
Dosyayı görüntüle @
704edbf7
...
...
@@ -749,9 +749,9 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
}
}
else
{
OUString
sWord
(
m_xSpellAlt
->
getWord
());
sal_Int16
nAddRes
=
linguistic
::
AddEntryToDic
(
xDictionary
,
linguistic
::
DictionaryError
nAddRes
=
linguistic
::
AddEntryToDic
(
xDictionary
,
sWord
,
false
,
OUString
(),
LANGUAGE_NONE
);
if
(
DIC_ERR_
NONE
!=
nAddRes
&&
!
xDictionary
->
getEntry
(
sWord
).
is
())
if
(
linguistic
::
DictionaryError
::
NONE
!=
nAddRes
&&
!
xDictionary
->
getEntry
(
sWord
).
is
())
{
SvxDicError
(
&
m_pSh
->
GetView
().
GetViewFrame
()
->
GetWindow
(),
nAddRes
);
}
...
...
@@ -777,13 +777,13 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
if
(
xDic
.
is
())
{
sal_Int16
nAddRes
=
linguistic
::
AddEntryToDic
(
xDic
,
sWord
,
false
,
OUString
(),
LANGUAGE_NONE
);
linguistic
::
DictionaryError
nAddRes
=
linguistic
::
AddEntryToDic
(
xDic
,
sWord
,
false
,
OUString
(),
LANGUAGE_NONE
);
// save modified user-dictionary if it is persistent
uno
::
Reference
<
frame
::
XStorable
>
xSavDic
(
xDic
,
uno
::
UNO_QUERY
);
if
(
xSavDic
.
is
())
xSavDic
->
store
();
if
(
DIC_ERR_
NONE
!=
nAddRes
&&
!
xDic
->
getEntry
(
sWord
).
is
())
if
(
linguistic
::
DictionaryError
::
NONE
!=
nAddRes
&&
!
xDic
->
getEntry
(
sWord
).
is
())
{
SvxDicError
(
&
m_pSh
->
GetView
().
GetViewFrame
()
->
GetWindow
(),
nAddRes
);
}
...
...
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