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
b5a509e2
Kaydet (Commit)
b5a509e2
authored
Kas 19, 2011
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ManageNames: improve layout of ManageNames dialog
üst
ce26c58c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
28 deletions
+89
-28
namedlg.hrc
sc/source/ui/inc/namedlg.hrc
+6
-3
namedlg.hxx
sc/source/ui/inc/namedlg.hxx
+10
-2
namedlg.cxx
sc/source/ui/namedlg/namedlg.cxx
+45
-6
namedlg.src
sc/source/ui/src/namedlg.src
+28
-17
No files found.
sc/source/ui/inc/namedlg.hrc
Dosyayı görüntüle @
b5a509e2
...
@@ -31,8 +31,8 @@
...
@@ -31,8 +31,8 @@
#define BTN_HELP 5
#define BTN_HELP 5
#define BTN_MORE 6
#define BTN_MORE 6
#define BTN_DELETE 57
#define BTN_DELETE 57
#define BTN_
CLOSE
62
#define BTN_
NAME_OK
62
#define BTN_CANCEL 73
#define BTN_
NAME_
CANCEL 73
#define BTN_SELECT 74
#define BTN_SELECT 74
#define FT_SCOPE 7
#define FT_SCOPE 7
...
@@ -57,5 +57,8 @@
...
@@ -57,5 +57,8 @@
#define STR_HEADER_NAME 69
#define STR_HEADER_NAME 69
#define STR_HEADER_RANGE 70
#define STR_HEADER_RANGE 70
#define STR_HEADER_SCOPE 71
#define STR_HEADER_SCOPE 71
#define STR_ERR_NAME_EXISTS 73
#define STR_ERR_NAME_INVALID 74
#define STR_DEFAULT_INFO 75
#define FT_INFO
_LINE
72
#define FT_INFO 72
sc/source/ui/inc/namedlg.hxx
Dosyayı görüntüle @
b5a509e2
...
@@ -86,19 +86,25 @@ private:
...
@@ -86,19 +86,25 @@ private:
PushButton
maBtnAdd
;
PushButton
maBtnAdd
;
PushButton
maBtnDelete
;
PushButton
maBtnDelete
;
PushButton
maBtnSelect
;
PushButton
maBtnSelect
;
OKButton
maBtnOk
;
PushButton
maBtnOk
;
Cancel
Button
maBtnCancel
;
Push
Button
maBtnCancel
;
MoreButton
maBtnMore
;
MoreButton
maBtnMore
;
FixedText
maFtInfo
;
const
String
mErrMsgInvalidSym
;
const
String
mErrMsgInvalidSym
;
const
rtl
::
OUString
maErrMsgModifiedFailed
;
const
rtl
::
OUString
maErrMsgModifiedFailed
;
const
::
rtl
::
OUString
maGlobalNameStr
;
const
::
rtl
::
OUString
maGlobalNameStr
;
const
rtl
::
OUString
maErrInvalidNameStr
;
const
rtl
::
OUString
maErrNameInUse
;
const
rtl
::
OUString
maStrInfoDefault
;
ScViewData
*
mpViewData
;
ScViewData
*
mpViewData
;
ScDocument
*
mpDoc
;
ScDocument
*
mpDoc
;
const
ScAddress
maCursorPos
;
const
ScAddress
maCursorPos
;
Selection
maCurSel
;
Selection
maCurSel
;
std
::
map
<
rtl
::
OUString
,
ScRangeName
*>
maRangeMap
;
private
:
private
:
void
Init
();
void
Init
();
void
UpdateChecks
(
ScRangeData
*
pData
);
void
UpdateChecks
(
ScRangeData
*
pData
);
...
@@ -106,6 +112,8 @@ private:
...
@@ -106,6 +112,8 @@ private:
void
UpdateNames
();
void
UpdateNames
();
void
CalcCurTableAssign
(
String
&
aAssign
,
ScRangeData
*
pRangeData
);
void
CalcCurTableAssign
(
String
&
aAssign
,
ScRangeData
*
pRangeData
);
bool
IsNameValid
();
bool
AddPushed
();
bool
AddPushed
();
void
RemovePushed
();
void
RemovePushed
();
...
...
sc/source/ui/namedlg/namedlg.cxx
Dosyayı görüntüle @
b5a509e2
...
@@ -45,6 +45,8 @@
...
@@ -45,6 +45,8 @@
#include "namedlg.hxx"
#include "namedlg.hxx"
#include "viewdata.hxx"
#include "viewdata.hxx"
#include "globalnames.hxx"
#include "sfx2/app.hxx"
#include "sfx2/app.hxx"
#include <vcl/msgbox.hxx>
#include <vcl/msgbox.hxx>
...
@@ -115,13 +117,17 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
...
@@ -115,13 +117,17 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
maBtnAdd
(
this
,
ScResId
(
BTN_ADD
)
),
maBtnAdd
(
this
,
ScResId
(
BTN_ADD
)
),
maBtnDelete
(
this
,
ScResId
(
BTN_DELETE
)
),
maBtnDelete
(
this
,
ScResId
(
BTN_DELETE
)
),
maBtnSelect
(
this
,
ScResId
(
BTN_SELECT
)
),
maBtnSelect
(
this
,
ScResId
(
BTN_SELECT
)
),
maBtnOk
(
this
,
ScResId
(
BTN_
CLOSE
)
),
maBtnOk
(
this
,
ScResId
(
BTN_
NAME_OK
)
),
maBtnCancel
(
this
,
ScResId
(
BTN_CANCEL
)
),
maBtnCancel
(
this
,
ScResId
(
BTN_
NAME_
CANCEL
)
),
maBtnMore
(
this
,
ScResId
(
BTN_MORE
)
),
maBtnMore
(
this
,
ScResId
(
BTN_MORE
)
),
maFtInfo
(
this
,
ScResId
(
FT_INFO
)
),
//
//
mErrMsgInvalidSym
(
ScResId
(
STR_INVALIDSYMBOL
)
),
mErrMsgInvalidSym
(
ScResId
(
STR_INVALIDSYMBOL
)
),
maErrMsgModifiedFailed
(
ResId
::
toString
(
ScResId
(
STR_MODIFYFAILED
)
)
),
maErrMsgModifiedFailed
(
ResId
::
toString
(
ScResId
(
STR_MODIFYFAILED
)
)
),
maGlobalNameStr
(
ResId
::
toString
(
ScResId
(
STR_GLOBAL_SCOPE
))
),
maGlobalNameStr
(
ResId
::
toString
(
ScResId
(
STR_GLOBAL_SCOPE
))
),
maErrInvalidNameStr
(
ResId
::
toString
(
ScResId
(
STR_ERR_NAME_INVALID
))),
maErrNameInUse
(
ResId
::
toString
(
ScResId
(
STR_ERR_NAME_EXISTS
))),
maStrInfoDefault
(
ResId
::
toString
(
ScResId
(
STR_DEFAULT_INFO
))),
//
//
mpViewData
(
ptrViewData
),
mpViewData
(
ptrViewData
),
mpDoc
(
ptrViewData
->
GetDocument
()
),
mpDoc
(
ptrViewData
->
GetDocument
()
),
...
@@ -144,9 +150,8 @@ void ScNameDlg::Init()
...
@@ -144,9 +150,8 @@ void ScNameDlg::Init()
OSL_ENSURE
(
mpViewData
&&
mpDoc
,
"ViewData oder Document nicht gefunden!"
);
OSL_ENSURE
(
mpViewData
&&
mpDoc
,
"ViewData oder Document nicht gefunden!"
);
//init UI
//init UI
std
::
map
<
rtl
::
OUString
,
ScRangeName
*>
aTabRangeNameMap
;
mpDoc
->
GetRangeNameMap
(
maRangeMap
);
mpDoc
->
GetTabRangeNameMap
(
aTabRangeNameMap
);
mpRangeManagerTable
=
new
ScRangeManagerTable
(
&
maNameMgrCtrl
,
mpDoc
->
GetRangeName
(),
maRangeMap
);
mpRangeManagerTable
=
new
ScRangeManagerTable
(
&
maNameMgrCtrl
,
mpDoc
->
GetRangeName
(),
aTabRangeNameMap
);
mpRangeManagerTable
->
SetSelectHdl
(
LINK
(
this
,
ScNameDlg
,
SelectionChangedHdl_Impl
)
);
mpRangeManagerTable
->
SetSelectHdl
(
LINK
(
this
,
ScNameDlg
,
SelectionChangedHdl_Impl
)
);
mpRangeManagerTable
->
SetDeselectHdl
(
LINK
(
this
,
ScNameDlg
,
SelectionChangedHdl_Impl
)
);
mpRangeManagerTable
->
SetDeselectHdl
(
LINK
(
this
,
ScNameDlg
,
SelectionChangedHdl_Impl
)
);
...
@@ -182,6 +187,7 @@ void ScNameDlg::Init()
...
@@ -182,6 +187,7 @@ void ScNameDlg::Init()
}
}
UpdateNames
();
UpdateNames
();
IsNameValid
();
mpViewData
->
GetSimpleArea
(
aRange
);
mpViewData
->
GetSimpleArea
(
aRange
);
aRange
.
Format
(
aAreaStr
,
ABS_DREF3D
,
mpDoc
,
aRange
.
Format
(
aAreaStr
,
ABS_DREF3D
,
mpDoc
,
...
@@ -244,6 +250,38 @@ void ScNameDlg::UpdateChecks(ScRangeData* pData)
...
@@ -244,6 +250,38 @@ void ScNameDlg::UpdateChecks(ScRangeData* pData)
maBtnRowHeader
.
Check
(
pData
->
HasType
(
RT_ROWHEADER
)
);
maBtnRowHeader
.
Check
(
pData
->
HasType
(
RT_ROWHEADER
)
);
}
}
bool
ScNameDlg
::
IsNameValid
()
{
rtl
::
OUString
aScope
=
maLbScope
.
GetSelectEntry
();
rtl
::
OUString
aName
=
maEdName
.
GetText
();
ScRangeName
*
pRangeName
=
NULL
;
if
(
aScope
==
maGlobalNameStr
)
{
pRangeName
=
maRangeMap
.
find
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
STR_GLOBAL_RANGE_NAME
)))
->
second
;
}
else
{
pRangeName
=
maRangeMap
.
find
(
aScope
)
->
second
;
}
if
(
!
ScRangeData
::
IsNameValid
(
aName
,
mpDoc
))
{
maEdName
.
SetControlBackground
(
GetSettings
().
GetStyleSettings
().
GetHighlightColor
());
maFtInfo
.
SetText
(
maErrInvalidNameStr
);
return
false
;
}
else
if
(
pRangeName
&&
pRangeName
->
findByUpperName
(
ScGlobal
::
pCharClass
->
upper
(
aName
)))
{
maEdName
.
SetControlBackground
(
GetSettings
().
GetStyleSettings
().
GetHighlightColor
());
maFtInfo
.
SetText
(
maErrNameInUse
);
return
false
;
}
maEdName
.
SetControlBackground
(
GetSettings
().
GetStyleSettings
().
GetFieldColor
());
maFtInfo
.
SetText
(
maStrInfoDefault
);
return
true
;
}
//updates the table and the buttons
//updates the table and the buttons
void
ScNameDlg
::
UpdateNames
()
void
ScNameDlg
::
UpdateNames
()
{
{
...
@@ -366,6 +404,7 @@ void ScNameDlg::RemovePushed()
...
@@ -366,6 +404,7 @@ void ScNameDlg::RemovePushed()
void
ScNameDlg
::
NameModified
()
void
ScNameDlg
::
NameModified
()
{
{
IsNameValid
();
rtl
::
OUString
aName
=
maEdName
.
GetText
();
rtl
::
OUString
aName
=
maEdName
.
GetText
();
aName
=
aName
.
trim
();
aName
=
aName
.
trim
();
rtl
::
OUString
aExpr
=
maEdAssign
.
GetText
();
rtl
::
OUString
aExpr
=
maEdAssign
.
GetText
();
...
...
sc/source/ui/src/namedlg.src
Dosyayı görüntüle @
b5a509e2
...
@@ -46,37 +46,37 @@ ModelessDialog RID_SCDLG_NAMES
...
@@ -46,37 +46,37 @@ ModelessDialog RID_SCDLG_NAMES
{
{
HelpID = "sc:PushButton:RID_SCDLG_NAMES:BTN_ADD";
HelpID = "sc:PushButton:RID_SCDLG_NAMES:BTN_ADD";
Pos = MAP_APPFONT ( 6 , 200 ) ;
Pos = MAP_APPFONT ( 6 , 200 ) ;
Size = MAP_APPFONT (
5
0 , 14 ) ;
Size = MAP_APPFONT (
4
0 , 14 ) ;
Text [ en-US ] = "Add" ;
Text [ en-US ] = "Add" ;
TabStop = TRUE ;
TabStop = TRUE ;
DefButton = TRUE ;
DefButton = TRUE ;
};
};
PushButton BTN_DELETE
PushButton BTN_DELETE
{
{
Pos = MAP_APPFONT(
168
, 200) ;
Pos = MAP_APPFONT(
50
, 200) ;
Size = MAP_APPFONT (
5
0, 14 ) ;
Size = MAP_APPFONT (
4
0, 14 ) ;
Text [ en-US ] = "~Delete" ;
Text [ en-US ] = "~Delete" ;
TabStop = TRUE ;
TabStop = TRUE ;
};
};
PushButton BTN_
CLOSE
PushButton BTN_
NAME_OK
{
{
Pos = MAP_APPFONT ( 1
0
8 , 225 ) ;
Pos = MAP_APPFONT ( 1
2
8 , 225 ) ;
Size = MAP_APPFONT (
5
0 , 14 ) ;
Size = MAP_APPFONT (
4
0 , 14 ) ;
Text [ en-US ] = "
Close
" ;
Text [ en-US ] = "
OK
" ;
TabStop = TRUE ;
TabStop = TRUE ;
};
};
PushButton BTN_CANCEL
PushButton BTN_
NAME_
CANCEL
{
{
Pos = MAP_APPFONT ( 1
6
8 , 225 ) ;
Pos = MAP_APPFONT ( 1
7
8 , 225 ) ;
Size = MAP_APPFONT (
5
0 , 14 ) ;
Size = MAP_APPFONT (
4
0 , 14 ) ;
Text [ en-US ] = "C
lose
" ;
Text [ en-US ] = "C
ancel
" ;
TabStop = TRUE ;
TabStop = TRUE ;
};
};
PushButton BTN_SELECT
PushButton BTN_SELECT
{
{
Pos = MAP_APPFONT ( 1
0
8 , 200 ) ;
Pos = MAP_APPFONT ( 1
2
8 , 200 ) ;
Size = MAP_APPFONT (
5
0 , 14 ) ;
Size = MAP_APPFONT (
9
0 , 14 ) ;
Text [ en-US ] = "
Clos
e" ;
Text [ en-US ] = "
Select Rang
e" ;
TabStop = TRUE ;
TabStop = TRUE ;
};
};
...
@@ -191,10 +191,9 @@ ModelessDialog RID_SCDLG_NAMES
...
@@ -191,10 +191,9 @@ ModelessDialog RID_SCDLG_NAMES
Text [ en-US ] = "Document (Global)" ;
Text [ en-US ] = "Document (Global)" ;
};
};
FixedText FT_INFO
_LINE
FixedText FT_INFO
{
{
Border = TRUE;
Pos = MAP_APPFONT( 6, 127 );
Pos = MAP_APPFONT( 6, 130 );
Size = MAP_APPFONT( 210, 14 );
Size = MAP_APPFONT( 210, 14 );
TabStop = FALSE;
TabStop = FALSE;
};
};
...
@@ -218,4 +217,16 @@ ModelessDialog RID_SCDLG_NAMES
...
@@ -218,4 +217,16 @@ ModelessDialog RID_SCDLG_NAMES
{
{
Text [en-US] = "Scope";
Text [en-US] = "Scope";
};
};
String STR_ERR_NAME_EXISTS
{
Text [ en-US ] = "Invalid name. Already in use for the selected scope.";
};
String STR_ERR_NAME_INVALID
{
Text [ en-US ] = "Invalid name. Only use letters, numbers and underscore and don't use names like cell addresses";
};
String STR_DEFAULT_INFO
{
Text [en-US] = "Select cells in the document to update the range.";
};
};
};
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