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
ae71b830
Kaydet (Commit)
ae71b830
authored
Agu 25, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reduce nesting at SID_CHINESE_CONVERSION
Change-Id: I9ebf5f39b58839b79bdef9a93a2113d7566d05da
üst
78d6eb63
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
38 deletions
+37
-38
drwtxtsh.cxx
sw/source/uibase/shells/drwtxtsh.cxx
+37
-38
No files found.
sw/source/uibase/shells/drwtxtsh.cxx
Dosyayı görüntüle @
ae71b830
...
@@ -170,7 +170,6 @@ void SwDrawTextShell::SetAttrToMarked(const SfxItemSet& rAttr)
...
@@ -170,7 +170,6 @@ void SwDrawTextShell::SetAttrToMarked(const SfxItemSet& rAttr)
if
(
aNullRect
!=
aOutRect
)
if
(
aNullRect
!=
aOutRect
)
{
{
GetShell
().
GetDrawView
()
->
SetAttributes
(
rAttr
);
GetShell
().
GetDrawView
()
->
SetAttributes
(
rAttr
);
// Init();
}
}
}
}
...
@@ -283,63 +282,66 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
...
@@ -283,63 +282,66 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
void
SwDrawTextShell
::
ExecDrawLingu
(
SfxRequest
&
rReq
)
void
SwDrawTextShell
::
ExecDrawLingu
(
SfxRequest
&
rReq
)
{
{
SwWrtShell
&
rSh
=
GetShell
();
SwWrtShell
&
rSh
=
GetShell
();
OutlinerView
*
pO
LV
=
pSdrView
->
GetTextEditOutlinerView
();
OutlinerView
*
pO
utlinerView
=
pSdrView
->
GetTextEditOutlinerView
();
if
(
rSh
.
GetDrawView
()
->
GetMarkedObjectList
().
GetMarkCount
()
)
if
(
rSh
.
GetDrawView
()
->
GetMarkedObjectList
().
GetMarkCount
()
)
{
{
switch
(
rReq
.
GetSlot
())
switch
(
rReq
.
GetSlot
())
{
{
case
SID_THESAURUS
:
case
SID_THESAURUS
:
pO
LV
->
StartThesaurus
();
pO
utlinerView
->
StartThesaurus
();
break
;
break
;
case
SID_HANGUL_HANJA_CONVERSION
:
case
SID_HANGUL_HANJA_CONVERSION
:
pO
LV
->
StartTextConversion
(
LANGUAGE_KOREAN
,
LANGUAGE_KOREAN
,
NULL
,
pO
utlinerView
->
StartTextConversion
(
LANGUAGE_KOREAN
,
LANGUAGE_KOREAN
,
NULL
,
i18n
::
TextConversionOption
::
CHARACTER_BY_CHARACTER
,
true
,
false
);
i18n
::
TextConversionOption
::
CHARACTER_BY_CHARACTER
,
true
,
false
);
break
;
break
;
case
SID_CHINESE_CONVERSION
:
case
SID_CHINESE_CONVERSION
:
{
{
//open ChineseTranslationDialog
//open ChineseTranslationDialog
Reference
<
XComponentContext
>
xContext
(
Reference
<
XComponentContext
>
xContext
=
comphelper
::
getProcessComponentContext
();
::
cppu
::
defaultBootstrap_InitialComponentContext
()
);
//@todo get context from calc if that has one
if
(
!
xContext
.
is
())
if
(
xContext
.
is
())
return
;
{
Reference
<
lang
::
XMultiComponentFactory
>
xMCF
(
xContext
->
getServiceManager
()
);
Reference
<
lang
::
XMultiComponentFactory
>
xMCF
(
xContext
->
getServiceManager
());
if
(
xMCF
.
is
())
if
(
!
xMCF
.
is
())
{
return
;
Reference
<
ui
::
dialogs
::
XExecutableDialog
>
xDialog
(
xMCF
->
createInstanceWithContext
(
OUString
sService
(
"com.sun.star.linguistic2.ChineseTranslationDialog"
);
OUString
(
"com.sun.star.linguistic2.ChineseTranslationDialog"
)
Reference
<
ui
::
dialogs
::
XExecutableDialog
>
xDialog
(
,
xContext
),
UNO_QUERY
);
xMCF
->
createInstanceWithContext
(
sService
,
xContext
),
UNO_QUERY
);
Reference
<
lang
::
XInitialization
>
xInit
(
xDialog
,
UNO_QUERY
);
if
(
xInit
.
is
()
)
Reference
<
lang
::
XInitialization
>
xInit
(
xDialog
,
UNO_QUERY
);
{
if
(
!
xInit
.
is
())
return
;
// initialize dialog
// initialize dialog
Reference
<
awt
::
XWindow
>
xDialogParentWindow
(
0
);
Reference
<
awt
::
XWindow
>
xDialogParentWindow
(
0
);
Sequence
<
Any
>
aSeq
(
1
);
Sequence
<
Any
>
aSequence
(
1
);
Any
*
pArray
=
aSeq
.
getArray
();
Any
*
pArray
=
aSequence
.
getArray
();
PropertyValue
aParam
;
PropertyValue
aParam
;
aParam
.
Name
=
"ParentWindow"
;
aParam
.
Name
=
"ParentWindow"
;
aParam
.
Value
<<=
makeAny
(
xDialogParentWindow
);
aParam
.
Value
<<=
makeAny
(
xDialogParentWindow
);
pArray
[
0
]
<<=
makeAny
(
aParam
);
pArray
[
0
]
<<=
makeAny
(
aParam
);
xInit
->
initialize
(
aSeq
);
xInit
->
initialize
(
aSequence
);
//execute dialog
//execute dialog
sal_Int16
nDialogRet
=
xDialog
->
execute
();
sal_Int16
nDialogRet
=
xDialog
->
execute
();
if
(
RET_OK
==
nDialogRet
)
if
(
RET_OK
==
nDialogRet
)
{
{
//get some parameters from the dialog
//get some parameters from the dialog
bool
bToSimplified
=
true
;
bool
bToSimplified
=
true
;
bool
bUseVariants
=
true
;
bool
bUseVariants
=
true
;
bool
bCommonTerms
=
true
;
bool
bCommonTerms
=
true
;
Reference
<
beans
::
XPropertySet
>
xProp
(
xDialog
,
UNO_QUERY
);
Reference
<
beans
::
XPropertySet
>
xPropertySet
(
xDialog
,
UNO_QUERY
);
if
(
xProp
.
is
()
)
if
(
xPropertySet
.
is
()
)
{
{
try
try
{
{
xProp
->
getPropertyValue
(
"IsDirectionToSimplified"
)
>>=
bToSimplified
;
xPropertySet
->
getPropertyValue
(
"IsDirectionToSimplified"
)
>>=
bToSimplified
;
xProp
->
getPropertyValue
(
"IsUseCharacterVariants"
)
>>=
bUseVariants
;
xPropertySet
->
getPropertyValue
(
"IsUseCharacterVariants"
)
>>=
bUseVariants
;
xProp
->
getPropertyValue
(
"IsTranslateCommonTerms"
)
>>=
bCommonTerms
;
xPropertySet
->
getPropertyValue
(
"IsTranslateCommonTerms"
)
>>=
bCommonTerms
;
}
}
catch
(
const
Exception
&
)
catch
(
const
Exception
&
)
{
{
...
@@ -350,21 +352,18 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
...
@@ -350,21 +352,18 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
sal_Int16
nSourceLang
=
bToSimplified
?
LANGUAGE_CHINESE_TRADITIONAL
:
LANGUAGE_CHINESE_SIMPLIFIED
;
sal_Int16
nSourceLang
=
bToSimplified
?
LANGUAGE_CHINESE_TRADITIONAL
:
LANGUAGE_CHINESE_SIMPLIFIED
;
sal_Int16
nTargetLang
=
bToSimplified
?
LANGUAGE_CHINESE_SIMPLIFIED
:
LANGUAGE_CHINESE_TRADITIONAL
;
sal_Int16
nTargetLang
=
bToSimplified
?
LANGUAGE_CHINESE_SIMPLIFIED
:
LANGUAGE_CHINESE_TRADITIONAL
;
sal_Int32
nOptions
=
bUseVariants
?
i18n
::
TextConversionOption
::
USE_CHARACTER_VARIANTS
:
0
;
sal_Int32
nOptions
=
bUseVariants
?
i18n
::
TextConversionOption
::
USE_CHARACTER_VARIANTS
:
0
;
if
(
!
bCommonTerms
)
if
(
!
bCommonTerms
)
nOptions
=
nOptions
|
i18n
::
TextConversionOption
::
CHARACTER_BY_CHARACTER
;
nOptions
=
nOptions
|
i18n
::
TextConversionOption
::
CHARACTER_BY_CHARACTER
;
Font
aTargetFont
=
OutputDevice
::
GetDefaultFont
(
DEFAULTFONT_CJK_TEXT
,
Font
aTargetFont
=
OutputDevice
::
GetDefaultFont
(
DEFAULTFONT_CJK_TEXT
,
nTargetLang
,
DEFAULTFONT_FLAGS_ONLYONE
);
nTargetLang
,
DEFAULTFONT_FLAGS_ONLYONE
);
pOLV
->
StartTextConversion
(
nSourceLang
,
nTargetLang
,
&
aTargetFont
,
nOptions
,
false
,
false
);
pOutlinerView
->
StartTextConversion
(
nSourceLang
,
nTargetLang
,
&
aTargetFont
,
nOptions
,
false
,
false
);
}
}
}
Reference
<
lang
::
XComponent
>
xComponent
(
xDialog
,
UNO_QUERY
);
Reference
<
lang
::
XComponent
>
xComponent
(
xDialog
,
UNO_QUERY
);
if
(
xComponent
.
is
()
)
if
(
xComponent
.
is
()
)
xComponent
->
dispose
();
xComponent
->
dispose
();
}
}
}
}
break
;
break
;
default
:
default
:
...
...
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