[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - 4 commits - sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Nov 7 21:38:42 PST 2012
sc/source/ui/inc/xmlsourcedlg.hrc | 4 ++--
sc/source/ui/inc/xmlsourcedlg.hxx | 8 ++++++--
sc/source/ui/src/xmlsourcedlg.src | 28 +++++++++++++++++-----------
sc/source/ui/xmlsource/xmlsourcedlg.cxx | 23 +++++++++++++++++++++--
4 files changed, 46 insertions(+), 17 deletions(-)
New commits:
commit dcfae841de4676aff3e0d732f93451ee4185343f
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed Nov 7 22:27:35 2012 -0500
Handler methods for OK and Cancel.
Change-Id: I8637543dc10ade3e75205031581eeaadd1b7ca4d
diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx
index b75f323..058058a 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -92,6 +92,9 @@ private:
bool IsChildrenDirty(SvTreeListEntry* pEntry) const;
+ void OkPressed();
+ void CancelPressed();
+
DECL_LINK(GetFocusHdl, Control*);
DECL_LINK(LoseFocusHdl, Control*);
DECL_LINK(BtnPressedHdl, Button*);
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 69fb08d..2fd452d 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -37,9 +37,9 @@ ScXMLSourceDlg::ScXMLSourceDlg(
maFtSourceFile(this, ScResId(FT_SOURCE_FILE)),
maFtMapXmlDoc(this, ScResId(FL_MAP_XML_TO_DOCUMENT)),
maFtMappedCellTitle(this, ScResId(FT_MAPPED_CELL_TITLE)),
+ maLbTree(this, ScResId(LB_SOURCE_TREE)),
maRefEdit(this, this, ScResId(ED_MAPPED_CELL)),
maRefBtn(this, ScResId(BTN_MAPPED_CELL), &maRefEdit, this),
- maLbTree(this, ScResId(LB_SOURCE_TREE)),
maBtnOk(this, ScResId(BTN_OK)),
maBtnCancel(this, ScResId(BTN_CANCEL)),
maImgFileOpen(ScResId(IMG_FILE_OPEN)),
@@ -54,7 +54,10 @@ ScXMLSourceDlg::ScXMLSourceDlg(
maBtnSelectSource.SetModeImage(maImgFileOpen);
FreeResource();
- maBtnSelectSource.SetClickHdl(LINK(this, ScXMLSourceDlg, BtnPressedHdl));
+ Link aBtnHdl = LINK(this, ScXMLSourceDlg, BtnPressedHdl);
+ maBtnSelectSource.SetClickHdl(aBtnHdl);
+ maBtnOk.SetClickHdl(aBtnHdl);
+ maBtnCancel.SetClickHdl(aBtnHdl);
Link aLink = LINK(this, ScXMLSourceDlg, GetFocusHdl);
maRefEdit.SetGetFocusHdl(aLink);
@@ -388,6 +391,17 @@ bool ScXMLSourceDlg::IsChildrenDirty(SvTreeListEntry* pEntry) const
return false;
}
+void ScXMLSourceDlg::OkPressed()
+{
+ // Store the xml link data to document.
+ Close();
+}
+
+void ScXMLSourceDlg::CancelPressed()
+{
+ Close();
+}
+
IMPL_LINK(ScXMLSourceDlg, GetFocusHdl, Control*, pCtrl)
{
HandleGetFocus(pCtrl);
@@ -404,6 +418,10 @@ IMPL_LINK(ScXMLSourceDlg, BtnPressedHdl, Button*, pBtn)
{
if (pBtn == &maBtnSelectSource)
SelectSourceFile();
+ else if (pBtn == &maBtnOk)
+ OkPressed();
+ else if (pBtn == &maBtnCancel)
+ CancelPressed();
return 0;
}
commit e01ca0f69bc7cc1e7ddbf176c5c8769036eeca0c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed Nov 7 22:12:40 2012 -0500
Added OK button next to the Cancel button.
Change-Id: I05782d9be74b3fddd34b79f3e15b43800b654d87
diff --git a/sc/source/ui/inc/xmlsourcedlg.hrc b/sc/source/ui/inc/xmlsourcedlg.hrc
index a5df403..748bed5 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hrc
+++ b/sc/source/ui/inc/xmlsourcedlg.hrc
@@ -9,8 +9,8 @@
#include "sc.hrc"
-#define BTN_OK 0
-#define BTN_CANCEL 1
+#define BTN_OK 1
+#define BTN_CANCEL 2
#define FL_SOURCE_FILE 10
#define BTN_SELECT_SOURCE_FILE 11
diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx
index 052f96e..b75f323 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -43,6 +43,7 @@ class ScXMLSourceDlg : public ScAnyRefDlg
formula::RefEdit maRefEdit;
formula::RefButton maRefBtn;
+ OKButton maBtnOk;
CancelButton maBtnCancel;
Image maImgFileOpen;
diff --git a/sc/source/ui/src/xmlsourcedlg.src b/sc/source/ui/src/xmlsourcedlg.src
index ef6a8f4..99d6f56 100644
--- a/sc/source/ui/src/xmlsourcedlg.src
+++ b/sc/source/ui/src/xmlsourcedlg.src
@@ -104,6 +104,12 @@ ModelessDialog RID_SCDLG_XML_SOURCE
MaskColor = STD_MASKCOLOR ;
};
+ OKButton BTN_OK
+ {
+ Pos = MAP_APPFONT ( 139 , 181 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+
CancelButton BTN_CANCEL
{
Pos = MAP_APPFONT ( 194 , 181 ) ;
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index eae0f99..69fb08d 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -40,6 +40,7 @@ ScXMLSourceDlg::ScXMLSourceDlg(
maRefEdit(this, this, ScResId(ED_MAPPED_CELL)),
maRefBtn(this, ScResId(BTN_MAPPED_CELL), &maRefEdit, this),
maLbTree(this, ScResId(LB_SOURCE_TREE)),
+ maBtnOk(this, ScResId(BTN_OK)),
maBtnCancel(this, ScResId(BTN_CANCEL)),
maImgFileOpen(ScResId(IMG_FILE_OPEN)),
mpDoc(pDoc),
commit b648726a4df0b793539c1fdb8b393e751e3df0ea
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed Nov 7 20:57:22 2012 -0500
Re-order the controls, to get the tab order right.
Change-Id: Icc776b86c8d5a4cb5eca8970478531449245c06e
diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx
index c283ec4..052f96e 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -38,10 +38,10 @@ class ScXMLSourceDlg : public ScAnyRefDlg
FixedLine maFtMapXmlDoc;
FixedText maFtMappedCellTitle;
- formula::RefEdit maRefEdit;
- formula::RefButton maRefBtn;
ScXMLSourceTree maLbTree;
+ formula::RefEdit maRefEdit;
+ formula::RefButton maRefBtn;
CancelButton maBtnCancel;
diff --git a/sc/source/ui/src/xmlsourcedlg.src b/sc/source/ui/src/xmlsourcedlg.src
index 0148ee9..ef6a8f4 100644
--- a/sc/source/ui/src/xmlsourcedlg.src
+++ b/sc/source/ui/src/xmlsourcedlg.src
@@ -48,6 +48,14 @@ ModelessDialog RID_SCDLG_XML_SOURCE
Text [ en-US ] = "Map to document";
};
+ Control LB_SOURCE_TREE
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 52 ) ;
+ Size = MAP_APPFONT ( 130 , 120 ) ;
+ TabStop = TRUE ;
+ };
+
FixedText FT_MAPPED_CELL_TITLE
{
Pos = MAP_APPFONT( 145, 55 );
@@ -72,14 +80,6 @@ ModelessDialog RID_SCDLG_XML_SOURCE
QuickHelpText [ en-US ] = "Shrink" ;
};
- Control LB_SOURCE_TREE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 52 ) ;
- Size = MAP_APPFONT ( 130 , 120 ) ;
- TabStop = TRUE ;
- };
-
Image IMG_ELEMENT_DEFAULT
{
ImageBitmap = Bitmap { File = "page.png" ; };
commit ccc97fb98201d6e0bb08c84dbac3f575ed04a5fb
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed Nov 7 20:55:05 2012 -0500
Put the tree control on the left side.
As discussed with Mirek in Prague.
Change-Id: I0f66516a0b226ae66225f3fe8341b132a0b90c6c
diff --git a/sc/source/ui/src/xmlsourcedlg.src b/sc/source/ui/src/xmlsourcedlg.src
index 9d76d97..0148ee9 100644
--- a/sc/source/ui/src/xmlsourcedlg.src
+++ b/sc/source/ui/src/xmlsourcedlg.src
@@ -50,7 +50,7 @@ ModelessDialog RID_SCDLG_XML_SOURCE
FixedText FT_MAPPED_CELL_TITLE
{
- Pos = MAP_APPFONT( 12, 55 );
+ Pos = MAP_APPFONT( 145, 55 );
Size = MAP_APPFONT ( 100 , 8 ) ;
Text [ en-US ] = "Linked cell";
@@ -59,14 +59,14 @@ ModelessDialog RID_SCDLG_XML_SOURCE
Edit ED_MAPPED_CELL
{
Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 67 ) ;
+ Pos = MAP_APPFONT ( 145 , 67 ) ;
Size = MAP_APPFONT ( 69 , 12 ) ;
TabStop = TRUE ;
};
ImageButton BTN_MAPPED_CELL
{
- Pos = MAP_APPFONT ( 83 , 66 ) ;
+ Pos = MAP_APPFONT ( 216 , 66 ) ;
Size = MAP_APPFONT ( 13 , 15 ) ;
TabStop = FALSE ;
QuickHelpText [ en-US ] = "Shrink" ;
@@ -75,7 +75,7 @@ ModelessDialog RID_SCDLG_XML_SOURCE
Control LB_SOURCE_TREE
{
Border = TRUE ;
- Pos = MAP_APPFONT ( 114 , 50 ) ;
+ Pos = MAP_APPFONT ( 6 , 52 ) ;
Size = MAP_APPFONT ( 130 , 120 ) ;
TabStop = TRUE ;
};
More information about the Libreoffice-commits
mailing list