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
cea87907
Kaydet (Commit)
cea87907
authored
Ock 28, 2013
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use SvtModuleOptions::ClassifyFactoryByServiceName to determine module
Change-Id: Ic0f8101c2619bf83feddbe0bd74d0b88941bbbe7
üst
0b7aef11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
67 deletions
+62
-67
srchdlg.cxx
svx/source/dialog/srchdlg.cxx
+62
-67
No files found.
svx/source/dialog/srchdlg.cxx
Dosyayı görüntüle @
cea87907
...
...
@@ -25,6 +25,7 @@
#include <svl/slstitm.hxx>
#include <svl/itemiter.hxx>
#include <svl/style.hxx>
#include <unotools/moduleoptions.hxx>
#include <unotools/searchopt.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objsh.hxx>
...
...
@@ -693,30 +694,32 @@ void SvxSearchDialog::InitControls_Impl()
}
}
// -----------------------------------------------------------------------
namespace
{
SvtModuleOptions
::
EFactory
getModule
(
SfxBindings
&
rBindings
)
{
SvtModuleOptions
::
EFactory
eFactory
(
SvtModuleOptions
::
E_UNKNOWN_FACTORY
);
try
{
const
uno
::
Reference
<
frame
::
XFrame
>
xFrame
=
rBindings
.
GetActiveFrame
();
uno
::
Reference
<
frame
::
XModuleManager2
>
xModuleManager
(
frame
::
ModuleManager
::
create
(
::
comphelper
::
getProcessComponentContext
()));
OUString
aModuleIdentifier
=
xModuleManager
->
identify
(
xFrame
);
eFactory
=
SvtModuleOptions
::
ClassifyFactoryByServiceName
(
aModuleIdentifier
);
}
catch
(
const
uno
::
Exception
&
)
{
}
return
eFactory
;
}
}
void
SvxSearchDialog
::
CalculateDelta_Impl
()
{
DBG_ASSERT
(
pSearchItem
,
"no search item"
);
bool
bDrawApp
=
false
;
bool
bCalcApp
=
false
;
bool
bWriterApp
=
false
;
bool
bImpressApp
=
false
;
const
uno
::
Reference
<
frame
::
XFrame
>
xFrame
=
rBindings
.
GetActiveFrame
();
uno
::
Reference
<
frame
::
XModuleManager2
>
xModuleManager
(
frame
::
ModuleManager
::
create
(
::
comphelper
::
getProcessComponentContext
())
);
try
{
::
rtl
::
OUString
aModuleIdentifier
=
xModuleManager
->
identify
(
xFrame
);
bCalcApp
=
aModuleIdentifier
==
"com.sun.star.sheet.SpreadsheetDocument"
;
bDrawApp
=
aModuleIdentifier
==
"com.sun.star.drawing.DrawingDocument"
;
bImpressApp
=
aModuleIdentifier
==
"com.sun.star.presentation.PresentationDocument"
;
bWriterApp
=
aModuleIdentifier
==
"com.sun.star.text.TextDocument"
;
}
catch
(
uno
::
Exception
&
)
{
}
if
(
pImpl
->
bDeltaCalculated
)
return
;
else
...
...
@@ -726,7 +729,17 @@ void SvxSearchDialog::CalculateDelta_Impl()
SvtCJKOptions
aCJKOptions
;
pMoreBtn
->
AddWindow
(
&
aOptionsFL
);
if
(
!
bDrawApp
)
SvtModuleOptions
::
EFactory
eFactory
=
getModule
(
rBindings
);
bool
bDrawApp
=
eFactory
==
SvtModuleOptions
::
E_DRAW
;
bool
bWriterApp
=
eFactory
==
SvtModuleOptions
::
E_WRITER
||
eFactory
==
SvtModuleOptions
::
E_WRITERWEB
||
eFactory
==
SvtModuleOptions
::
E_WRITERGLOBAL
;
bool
bImpressApp
=
eFactory
==
SvtModuleOptions
::
E_IMPRESS
;
bool
bCalcApp
=
eFactory
==
SvtModuleOptions
::
E_CALC
;
if
(
!
bDrawApp
)
pMoreBtn
->
AddWindow
(
&
aLayoutBtn
);
if
(
bWriterApp
)
pMoreBtn
->
AddWindow
(
&
aNotesBtn
);
...
...
@@ -1987,24 +2000,6 @@ void SvxSearchDialog::SetItem_Impl( const SvxSearchItem* pItem )
IMPL_LINK
(
SvxSearchDialog
,
FocusHdl_Impl
,
Control
*
,
pCtrl
)
{
sal_Int32
nTxtLen
;
bool
bDrawApp
=
false
;
bool
bCalcApp
=
false
;
bool
bWriterApp
=
false
;
bool
bImpressApp
=
false
;
const
uno
::
Reference
<
frame
::
XFrame
>
xFrame
=
rBindings
.
GetActiveFrame
();
uno
::
Reference
<
frame
::
XModuleManager2
>
xModuleManager
(
frame
::
ModuleManager
::
create
(
::
comphelper
::
getProcessComponentContext
())
);
try
{
::
rtl
::
OUString
aModuleIdentifier
=
xModuleManager
->
identify
(
xFrame
);
bCalcApp
=
aModuleIdentifier
==
"com.sun.star.sheet.SpreadsheetDocument"
;
bDrawApp
=
aModuleIdentifier
==
"com.sun.star.drawing.DrawingDocument"
;
bImpressApp
=
aModuleIdentifier
==
"com.sun.star.presentation.PresentationDocument"
;
bWriterApp
=
aModuleIdentifier
==
"com.sun.star.text.TextDocument"
;
}
catch
(
uno
::
Exception
&
)
{
}
if
(
!
pImpl
->
bMultiLineEdit
)
nTxtLen
=
aSearchAttrText
.
GetText
().
getLength
();
else
...
...
@@ -2041,16 +2036,28 @@ IMPL_LINK( SvxSearchDialog, FocusHdl_Impl, Control *, pCtrl )
aSearchLB
.
SetSelection
(
Selection
(
SELECTION_MIN
,
SELECTION_MAX
)
);
ModifyHdl_Impl
(
(
ComboBox
*
)
pCtrl
);
if
(
bWriterApp
)
aLayoutBtn
.
SetText
(
bFormat
&&
nTxtLen
?
aLayoutStr
:
aLayoutWriterStr
);
if
(
bFormat
&&
nTxtLen
)
aLayoutBtn
.
SetText
(
aLayoutStr
);
else
{
if
(
bCalcApp
)
aLayoutBtn
.
SetText
(
bFormat
&&
nTxtLen
?
aLayoutStr
:
aLayoutCalcStr
);
{
SvtModuleOptions
::
EFactory
eFactory
=
getModule
(
rBindings
);
bool
bWriterApp
=
eFactory
==
SvtModuleOptions
::
E_WRITER
||
eFactory
==
SvtModuleOptions
::
E_WRITERWEB
||
eFactory
==
SvtModuleOptions
::
E_WRITERGLOBAL
;
bool
bCalcApp
=
eFactory
==
SvtModuleOptions
::
E_CALC
;
if
(
bWriterApp
)
aLayoutBtn
.
SetText
(
aLayoutWriterStr
);
else
aLayoutBtn
.
SetText
(
bFormat
&&
nTxtLen
?
aLayoutStr
:
aStylesStr
);
{
if
(
bCalcApp
)
aLayoutBtn
.
SetText
(
aLayoutCalcStr
);
else
aLayoutBtn
.
SetText
(
aStylesStr
);
}
}
return
0
;
}
...
...
@@ -2162,35 +2169,23 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl)
IMPL_LINK_NOARG
(
SvxSearchDialog
,
NoFormatHdl_Impl
)
{
bool
bDrawApp
=
false
;
bool
bCalcApp
=
false
;
bool
bWriterApp
=
false
;
bool
bImpressApp
=
false
;
const
uno
::
Reference
<
frame
::
XFrame
>
xFrame
=
rBindings
.
GetActiveFrame
();
uno
::
Reference
<
frame
::
XModuleManager2
>
xModuleManager
(
frame
::
ModuleManager
::
create
(
::
comphelper
::
getProcessComponentContext
())
);
try
{
::
rtl
::
OUString
aModuleIdentifier
=
xModuleManager
->
identify
(
xFrame
);
bCalcApp
=
aModuleIdentifier
==
"com.sun.star.sheet.SpreadsheetDocument"
;
bDrawApp
=
aModuleIdentifier
==
"com.sun.star.drawing.DrawingDocument"
;
bImpressApp
=
aModuleIdentifier
==
"com.sun.star.presentation.PresentationDocument"
;
bWriterApp
=
aModuleIdentifier
==
"com.sun.star.text.TextDocument"
;
}
catch
(
uno
::
Exception
&
)
{
}
if
(
bCalcApp
)
SvtModuleOptions
::
EFactory
eFactory
=
getModule
(
rBindings
);
bool
bWriterApp
=
eFactory
==
SvtModuleOptions
::
E_WRITER
||
eFactory
==
SvtModuleOptions
::
E_WRITERWEB
||
eFactory
==
SvtModuleOptions
::
E_WRITERGLOBAL
;
bool
bCalcApp
=
eFactory
==
SvtModuleOptions
::
E_CALC
;
if
(
bCalcApp
)
aLayoutBtn
.
SetText
(
aLayoutCalcStr
);
else
{
if
(
bWriterApp
)
if
(
bWriterApp
)
aLayoutBtn
.
SetText
(
aLayoutWriterStr
);
else
aLayoutBtn
.
SetText
(
aStylesStr
);
}
bFormat
=
sal_False
;
aLayoutBtn
.
Check
(
sal_False
);
...
...
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