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
a2a96edb
Kaydet (Commit)
a2a96edb
authored
Mar 09, 2012
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reorganize license dialog to avoid Resource leaks
üst
d527c1df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
37 deletions
+74
-37
appserv.cxx
sfx2/source/appl/appserv.cxx
+74
-37
No files found.
sfx2/source/appl/appserv.cxx
Dosyayı görüntüle @
a2a96edb
...
@@ -180,6 +180,78 @@ static void showDocument( const char* pBaseName )
...
@@ -180,6 +180,78 @@ static void showDocument( const char* pBaseName )
}
}
}
}
namespace
{
class
LicenseDialog
:
public
ModalDialog
{
private
:
FixedText
aText
;
OKButton
aShow
;
CancelButton
aClose
;
DECL_LINK
(
CancelHdl
,
void
*
);
DECL_LINK
(
ShowHdl
,
void
*
);
public
:
LicenseDialog
(
Window
*
pParent
=
NULL
);
};
LicenseDialog
::
LicenseDialog
(
Window
*
pParent
)
:
ModalDialog
(
pParent
,
SfxResId
(
DLG_HELP_LICENSING
))
,
aText
(
this
)
,
aShow
(
this
,
SfxResId
(
PB_LICENSING_SHOW
)
)
,
aClose
(
this
,
SfxResId
(
PB_LICENSING_CLOSE
)
)
{
aClose
.
SetClickHdl
(
LINK
(
this
,
LicenseDialog
,
CancelHdl
)
);
aShow
.
SetClickHdl
(
LINK
(
this
,
LicenseDialog
,
ShowHdl
)
);
String
aLicensing
;
for
(
int
i
=
STR_LICENSING_INFORMATION_1
;
i
<=
STR_LICENSING_INFORMATION_5
;
++
i
)
{
if
(
i
!=
STR_LICENSING_INFORMATION_1
)
aLicensing
+=
String
(
RTL_CONSTASCII_USTRINGPARAM
(
"
\n\n
"
)
);
aLicensing
+=
String
(
SfxResId
(
i
)
);
}
aText
.
SetText
(
aLicensing
);
// positions and sizes are computed to always fit the language
Size
aTextSize
(
aText
.
GetOptimalSize
(
WINDOWSIZE_PREFERRED
)
);
Size
aShowSize
(
aShow
.
GetOptimalSize
(
WINDOWSIZE_PREFERRED
)
);
Size
aCloseSize
(
aClose
.
GetOptimalSize
(
WINDOWSIZE_PREFERRED
)
);
long
nDelimX
=
12
;
long
nDelimY
=
12
;
long
nWidth
=
aTextSize
.
Width
()
+
2
*
nDelimX
;
long
nButtonY
=
aTextSize
.
Height
()
+
2
*
nDelimY
;
Size
aButtonSize
(
std
::
max
(
aShowSize
.
Width
(),
aCloseSize
.
Width
()
)
+
nDelimX
,
std
::
max
(
aShowSize
.
Height
(),
aCloseSize
.
Height
()
)
);
SetSizePixel
(
Size
(
nWidth
,
aTextSize
.
Height
()
+
3
*
nDelimY
+
aButtonSize
.
Height
()
)
);
aText
.
SetPosSizePixel
(
Point
(
nDelimX
,
nDelimY
),
aTextSize
);
aShow
.
SetPosSizePixel
(
Point
(
(
nWidth
-
nDelimX
)
/
2
-
aButtonSize
.
Width
(),
nButtonY
),
aButtonSize
);
aClose
.
SetPosSizePixel
(
Point
(
aShow
.
GetPosPixel
().
X
()
+
aButtonSize
.
Width
()
+
nDelimX
,
nButtonY
),
aButtonSize
);
aText
.
Show
();
FreeResource
();
}
IMPL_LINK_NOARG
(
LicenseDialog
,
CancelHdl
)
{
Close
();
return
0
;
}
IMPL_LINK_NOARG
(
LicenseDialog
,
ShowHdl
)
{
EndDialog
(
RET_OK
);
showDocument
(
"LICENSE"
);
return
0
;
}
}
void
SfxApplication
::
MiscExec_Impl
(
SfxRequest
&
rReq
)
void
SfxApplication
::
MiscExec_Impl
(
SfxRequest
&
rReq
)
{
{
bool
bDone
=
false
;
bool
bDone
=
false
;
...
@@ -377,43 +449,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
...
@@ -377,43 +449,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case
SID_SHOW_LICENSE
:
case
SID_SHOW_LICENSE
:
{
{
ModalDialog
aDialog
(
NULL
,
SfxResId
(
DLG_HELP_LICENSING
)
);
LicenseDialog
aDialog
;
aDialog
.
Execute
();
String
aLicensing
;
for
(
int
i
=
STR_LICENSING_INFORMATION_1
;
i
<=
STR_LICENSING_INFORMATION_5
;
++
i
)
{
if
(
i
!=
STR_LICENSING_INFORMATION_1
)
aLicensing
+=
String
(
RTL_CONSTASCII_USTRINGPARAM
(
"
\n\n
"
)
);
aLicensing
+=
String
(
SfxResId
(
i
)
);
}
FixedText
aText
(
&
aDialog
);
aText
.
SetText
(
aLicensing
);
OKButton
aShow
(
&
aDialog
,
SfxResId
(
PB_LICENSING_SHOW
)
);
CancelButton
aClose
(
&
aDialog
,
SfxResId
(
PB_LICENSING_CLOSE
)
);
// positions and sizes are computed to always fit the language
Size
aTextSize
(
aText
.
GetOptimalSize
(
WINDOWSIZE_PREFERRED
)
);
Size
aShowSize
(
aShow
.
GetOptimalSize
(
WINDOWSIZE_PREFERRED
)
);
Size
aCloseSize
(
aClose
.
GetOptimalSize
(
WINDOWSIZE_PREFERRED
)
);
long
nDelimX
=
12
;
long
nDelimY
=
12
;
long
nWidth
=
aTextSize
.
Width
()
+
2
*
nDelimX
;
long
nButtonY
=
aTextSize
.
Height
()
+
2
*
nDelimY
;
Size
aButtonSize
(
std
::
max
(
aShowSize
.
Width
(),
aCloseSize
.
Width
()
)
+
nDelimX
,
std
::
max
(
aShowSize
.
Height
(),
aCloseSize
.
Height
()
)
);
aDialog
.
SetSizePixel
(
Size
(
nWidth
,
aTextSize
.
Height
()
+
3
*
nDelimY
+
aButtonSize
.
Height
()
)
);
aText
.
SetPosSizePixel
(
Point
(
nDelimX
,
nDelimY
),
aTextSize
);
aShow
.
SetPosSizePixel
(
Point
(
(
nWidth
-
nDelimX
)
/
2
-
aButtonSize
.
Width
(),
nButtonY
),
aButtonSize
);
aClose
.
SetPosSizePixel
(
Point
(
aShow
.
GetPosPixel
().
X
()
+
aButtonSize
.
Width
()
+
nDelimX
,
nButtonY
),
aButtonSize
);
aText
.
Show
();
if
(
aDialog
.
Execute
()
==
RET_OK
)
showDocument
(
"LICENSE"
);
break
;
break
;
}
}
...
...
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