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
21b8dc9f
Kaydet (Commit)
21b8dc9f
authored
Haz 21, 2001
tarafından
Peter Burow
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix: #87292# CreateHelpURL() and OpenHelpAgent() now static, GetHelp() removed
üst
e8acb9de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
89 deletions
+102
-89
sfxhelp.hxx
sfx2/inc/sfxhelp.hxx
+8
-6
sfxhelp.cxx
sfx2/source/appl/sfxhelp.cxx
+94
-83
No files found.
sfx2/inc/sfxhelp.hxx
Dosyayı görüntüle @
21b8dc9f
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: sfxhelp.hxx,v $
* $RCSfile: sfxhelp.hxx,v $
*
*
* $Revision: 1.1
3
$
* $Revision: 1.1
4
$
*
*
* last change: $Author:
mba $ $Date: 2001-06-19 07:18:52
$
* last change: $Author:
pb $ $Date: 2001-06-21 08:24:59
$
*
*
* 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
...
@@ -81,11 +81,12 @@ class SfxHelp : public Help
...
@@ -81,11 +81,12 @@ class SfxHelp : public Help
private
:
private
:
virtual
BOOL
Start
(
ULONG
nHelpId
,
const
Window
*
pWindow
);
virtual
BOOL
Start
(
ULONG
nHelpId
,
const
Window
*
pWindow
);
virtual
BOOL
Start
(
const
String
&
rURL
,
const
Window
*
pWindow
);
virtual
BOOL
Start
(
const
String
&
rURL
,
const
Window
*
pWindow
);
String
GetHelpModuleName
(
ULONG
nHelpId
);
String
GetHelpModuleName_Impl
(
ULONG
nHelpId
);
String
CreateHelpURL_Impl
(
ULONG
nHelpId
,
const
String
&
rModuleName
);
public
:
public
:
static
SfxHelp
*
GetHelp
();
SfxHelp
();
SfxHelp
();
~
SfxHelp
();
~
SfxHelp
();
void
SetTicket
(
const
String
&
rTicket
)
void
SetTicket
(
const
String
&
rTicket
)
...
@@ -94,8 +95,9 @@ public:
...
@@ -94,8 +95,9 @@ public:
{
aUser
=
rUser
;}
{
aUser
=
rUser
;}
virtual
XubString
GetHelpText
(
ULONG
nHelpId
,
const
Window
*
pWindow
);
virtual
XubString
GetHelpText
(
ULONG
nHelpId
,
const
Window
*
pWindow
);
void
OpenHelpAgent
(
SfxFrame
*
pFrame
,
ULONG
nHelpId
);
String
CreateHelpURL
(
ULONG
nHelpId
,
const
String
&
rModuleName
);
static
String
CreateHelpURL
(
ULONG
nHelpId
,
const
String
&
rModuleName
);
static
void
OpenHelpAgent
(
SfxFrame
*
pFrame
,
ULONG
nHelpId
);
};
};
#endif // #ifndef _SFX_HELP_HXX
#endif // #ifndef _SFX_HELP_HXX
...
...
sfx2/source/appl/sfxhelp.cxx
Dosyayı görüntüle @
21b8dc9f
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: sfxhelp.cxx,v $
* $RCSfile: sfxhelp.cxx,v $
*
*
* $Revision: 1.3
4
$
* $Revision: 1.3
5
$
*
*
* last change: $Author:
mba $ $Date: 2001-06-19 07:20:37
$
* last change: $Author:
pb $ $Date: 2001-06-21 08:27:19
$
*
*
* 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
...
@@ -208,7 +208,7 @@ SfxHelpOptions_Impl::SfxHelpOptions_Impl()
...
@@ -208,7 +208,7 @@ SfxHelpOptions_Impl::SfxHelpOptions_Impl()
}
}
default
:
default
:
DBG_ERROR
(
"Wrong
Type
!"
);
DBG_ERROR
(
"Wrong
Property
!"
);
break
;
break
;
}
}
}
}
...
@@ -406,7 +406,7 @@ SfxHelp::~SfxHelp()
...
@@ -406,7 +406,7 @@ SfxHelp::~SfxHelp()
delete
pImp
;
delete
pImp
;
}
}
String
SfxHelp
::
GetHelpModuleName
(
ULONG
nHelpId
)
String
SfxHelp
::
GetHelpModuleName
_Impl
(
ULONG
nHelpId
)
{
{
String
aModuleName
;
String
aModuleName
;
SfxViewFrame
*
pViewFrame
=
SfxViewFrame
::
Current
();
SfxViewFrame
*
pViewFrame
=
SfxViewFrame
::
Current
();
...
@@ -437,6 +437,60 @@ String SfxHelp::GetHelpModuleName( ULONG nHelpId )
...
@@ -437,6 +437,60 @@ String SfxHelp::GetHelpModuleName( ULONG nHelpId )
return
aModuleName
;
return
aModuleName
;
}
}
String
SfxHelp
::
CreateHelpURL_Impl
(
ULONG
nHelpId
,
const
String
&
rModuleName
)
{
// build up the help URL
String
aHelpURL
;
if
(
aTicket
.
Len
()
)
{
// if there is a ticket, we are inside a plugin, so a special Help URL must be sent
aHelpURL
=
DEFINE_CONST_UNICODE
(
"vnd.sun.star.cmd:help?"
);
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"HELP_Request_Mode=contextIndex&HELP_Session_Mode=context&HELP_CallMode=portal&HELP_Device=html"
);
if
(
!
nHelpId
)
{
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&startId=go"
);
}
else
{
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_ContextID=-"
);
aHelpURL
+=
String
::
CreateFromInt64
(
nHelpId
);
}
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_ProgramID="
);
aHelpURL
+=
rModuleName
;
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_User="
);
aHelpURL
+=
aUser
;
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_Ticket="
);
aHelpURL
+=
aTicket
;
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_Language="
);
aHelpURL
+=
aLanguageStr
;
if
(
aCountryStr
.
Len
()
)
{
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_Country="
);
aHelpURL
+=
aCountryStr
;
}
}
else
{
aHelpURL
=
String
::
CreateFromAscii
(
"vnd.sun.star.help://"
);
aHelpURL
+=
rModuleName
;
if
(
!
nHelpId
)
{
aHelpURL
+=
String
(
DEFINE_CONST_UNICODE
(
"/start"
)
);
}
else
{
aHelpURL
+=
'/'
;
aHelpURL
+=
String
::
CreateFromInt64
(
nHelpId
);
}
AppendConfigToken_Impl
(
aHelpURL
,
sal_True
);
}
return
aHelpURL
;
}
BOOL
SfxHelp
::
Start
(
const
String
&
rURL
,
const
Window
*
pWindow
)
BOOL
SfxHelp
::
Start
(
const
String
&
rURL
,
const
Window
*
pWindow
)
{
{
Reference
<
XTasksSupplier
>
xDesktop
(
::
comphelper
::
getProcessServiceFactory
()
->
createInstance
(
Reference
<
XTasksSupplier
>
xDesktop
(
::
comphelper
::
getProcessServiceFactory
()
->
createInstance
(
...
@@ -503,14 +557,14 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow )
...
@@ -503,14 +557,14 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow )
BOOL
SfxHelp
::
Start
(
ULONG
nHelpId
,
const
Window
*
pWindow
)
BOOL
SfxHelp
::
Start
(
ULONG
nHelpId
,
const
Window
*
pWindow
)
{
{
String
aHelpModuleName
(
GetHelpModuleName
(
nHelpId
)
);
String
aHelpModuleName
(
GetHelpModuleName
_Impl
(
nHelpId
)
);
String
aHelpURL
=
CreateHelpURL
(
nHelpId
,
aHelpModuleName
);
String
aHelpURL
=
CreateHelpURL
(
nHelpId
,
aHelpModuleName
);
return
Start
(
aHelpURL
,
pWindow
);
return
Start
(
aHelpURL
,
pWindow
);
}
}
XubString
SfxHelp
::
GetHelpText
(
ULONG
nHelpId
,
const
Window
*
pWindow
)
XubString
SfxHelp
::
GetHelpText
(
ULONG
nHelpId
,
const
Window
*
pWindow
)
{
{
String
aModuleName
=
GetHelpModuleName
(
nHelpId
);
String
aModuleName
=
GetHelpModuleName
_Impl
(
nHelpId
);
XubString
aHelpText
=
pImp
->
GetHelpText
(
nHelpId
,
aModuleName
);;
XubString
aHelpText
=
pImp
->
GetHelpText
(
nHelpId
,
aModuleName
);;
if
(
bIsDebug
)
if
(
bIsDebug
)
{
{
...
@@ -525,88 +579,45 @@ XubString SfxHelp::GetHelpText( ULONG nHelpId, const Window* pWindow )
...
@@ -525,88 +579,45 @@ XubString SfxHelp::GetHelpText( ULONG nHelpId, const Window* pWindow )
String
SfxHelp
::
CreateHelpURL
(
ULONG
nHelpId
,
const
String
&
rModuleName
)
String
SfxHelp
::
CreateHelpURL
(
ULONG
nHelpId
,
const
String
&
rModuleName
)
{
{
// build up the help URL
String
aURL
;
String
aHelpURL
;
SfxHelp
*
pHelp
=
SAL_STATIC_CAST
(
SfxHelp
*
,
Application
::
GetHelp
()
);
if
(
aTicket
.
Len
()
)
if
(
pHelp
)
{
aURL
=
pHelp
->
CreateHelpURL_Impl
(
nHelpId
,
rModuleName
);
// if there is a ticket, we are inside a plugin, so a special Help URL must be sent
return
aURL
;
aHelpURL
=
DEFINE_CONST_UNICODE
(
"vnd.sun.star.cmd:help?"
);
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"HELP_Request_Mode=contextIndex&HELP_Session_Mode=context&HELP_CallMode=portal&HELP_Device=html"
);
if
(
!
nHelpId
)
{
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&startId=go"
);
}
else
{
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_ContextID=-"
);
aHelpURL
+=
String
::
CreateFromInt64
(
nHelpId
);
}
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_ProgramID="
);
aHelpURL
+=
rModuleName
;
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_User="
);
aHelpURL
+=
aUser
;
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_Ticket="
);
aHelpURL
+=
aTicket
;
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_Language="
);
aHelpURL
+=
aLanguageStr
;
if
(
aCountryStr
.
Len
()
)
{
aHelpURL
+=
DEFINE_CONST_UNICODE
(
"&HELP_Country="
);
aHelpURL
+=
aCountryStr
;
}
}
else
{
aHelpURL
=
String
::
CreateFromAscii
(
"vnd.sun.star.help://"
);
aHelpURL
+=
rModuleName
;
if
(
!
nHelpId
)
{
aHelpURL
+=
String
(
DEFINE_CONST_UNICODE
(
"/start"
)
);
}
else
{
aHelpURL
+=
'/'
;
aHelpURL
+=
String
::
CreateFromInt64
(
nHelpId
);
}
AppendConfigToken_Impl
(
aHelpURL
,
sal_True
);
}
return
aHelpURL
;
}
}
void
SfxHelp
::
OpenHelpAgent
(
SfxFrame
*
pFrame
,
ULONG
nHelpId
)
void
SfxHelp
::
OpenHelpAgent
(
SfxFrame
*
pFrame
,
ULONG
nHelpId
)
{
{
SfxHelpOptions_Impl
*
pOpt
=
pImp
->
GetOptions
();
if
(
SvtHelpOptions
().
IsHelpAgentAutoStartMode
()
)
if
(
!
pOpt
->
HasId
(
nHelpId
)
)
return
;
try
{
{
URL
aURL
;
SfxHelp
*
pHelp
=
SAL_STATIC_CAST
(
SfxHelp
*
,
Application
::
GetHelp
()
);
aURL
.
Complete
=
CreateHelpURL
(
nHelpId
,
GetHelpModuleName
(
nHelpId
)
);
if
(
pHelp
)
Reference
<
XURLTransformer
>
xTrans
(
::
comphelper
::
getProcessServiceFactory
()
->
createInstance
(
rtl
::
OUString
::
createFromAscii
(
"com.sun.star.util.URLTransformer"
)),
UNO_QUERY
);
{
xTrans
->
parseStrict
(
aURL
);
SfxHelpOptions_Impl
*
pOpt
=
pHelp
->
pImp
->
GetOptions
();
if
(
!
pOpt
->
HasId
(
nHelpId
)
)
Reference
<
XDispatchProvider
>
xDispProv
(
pFrame
->
GetTopFrame
()
->
GetFrameInterface
(),
UNO_QUERY
);
return
;
Reference
<
XDispatch
>
xHelpDispatch
;
if
(
xDispProv
.
is
())
try
xHelpDispatch
=
xDispProv
->
queryDispatch
(
aURL
,
::
rtl
::
OUString
::
createFromAscii
(
"_helpagent"
),
FrameSearchFlag
::
PARENT
|
FrameSearchFlag
::
SELF
);
{
URL
aURL
;
DBG_ASSERT
(
xHelpDispatch
.
is
(),
"OpenHelpAgent: could not get a dispatcher!"
);
aURL
.
Complete
=
pHelp
->
CreateHelpURL_Impl
(
nHelpId
,
pHelp
->
GetHelpModuleName_Impl
(
nHelpId
)
);
if
(
xHelpDispatch
.
is
()
)
Reference
<
XURLTransformer
>
xTrans
(
::
comphelper
::
getProcessServiceFactory
()
->
createInstance
(
rtl
::
OUString
::
createFromAscii
(
"com.sun.star.util.URLTransformer"
)),
UNO_QUERY
);
xHelpDispatch
->
dispatch
(
aURL
,
Sequence
<
PropertyValue
>
()
);
xTrans
->
parseStrict
(
aURL
);
}
catch
(
const
Exception
&
)
Reference
<
XDispatchProvider
>
xDispProv
(
pFrame
->
GetTopFrame
()
->
GetFrameInterface
(),
UNO_QUERY
);
{
Reference
<
XDispatch
>
xHelpDispatch
;
DBG_ASSERT
(
sal_False
,
"OpenHelpAgent: caught an exception while executing the dispatch!"
);
if
(
xDispProv
.
is
())
xHelpDispatch
=
xDispProv
->
queryDispatch
(
aURL
,
::
rtl
::
OUString
::
createFromAscii
(
"_helpagent"
),
FrameSearchFlag
::
PARENT
|
FrameSearchFlag
::
SELF
);
DBG_ASSERT
(
xHelpDispatch
.
is
(),
"OpenHelpAgent: could not get a dispatcher!"
);
if
(
xHelpDispatch
.
is
()
)
xHelpDispatch
->
dispatch
(
aURL
,
Sequence
<
PropertyValue
>
()
);
}
catch
(
const
Exception
&
)
{
DBG_ASSERT
(
sal_False
,
"OpenHelpAgent: caught an exception while executing the dispatch!"
);
}
}
}
}
}
}
SfxHelp
*
SfxHelp
::
GetHelp
()
{
return
(
SfxHelp
*
)
Application
::
GetHelp
();
}
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