diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-28 20:03:42 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-28 21:08:15 +0000 |
commit | 3c53039df67b35c495f69f14ccfad882e13a5950 (patch) | |
tree | 9012fea9f815afb0a48d3707173a77181f5b854f | |
parent | 7405c5a38546b026def5172dfade8e1c1e64d250 (diff) |
convert xml source dialog to .ui
I'd be a bit happier if I know how to use the dialog in order
to test it completely, but it should be unchanged.
Change-Id: Ie9c561aef7ff697b9e829f9cf0c7e6938c58b217
-rw-r--r-- | sc/AllLangResTarget_sc.mk | 1 | ||||
-rw-r--r-- | sc/UIConfig_scalc.mk | 1 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 4 | ||||
-rw-r--r-- | sc/source/ui/inc/xmlsourcedlg.hrc | 30 | ||||
-rw-r--r-- | sc/source/ui/inc/xmlsourcedlg.hxx | 33 | ||||
-rw-r--r-- | sc/source/ui/navipi/navipi.src | 18 | ||||
-rw-r--r-- | sc/source/ui/src/xmlsourcedlg.src | 122 | ||||
-rw-r--r-- | sc/source/ui/xmlsource/xmlsourcedlg.cxx | 142 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/xmlsourcedialog.ui | 257 |
9 files changed, 355 insertions, 253 deletions
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk index d7a01cea4732..225a43b33874 100644 --- a/sc/AllLangResTarget_sc.mk +++ b/sc/AllLangResTarget_sc.mk @@ -51,7 +51,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\ sc/source/ui/src/filter.src \ sc/source/ui/src/condformatdlg.src \ sc/source/ui/src/condformatmgr.src \ - sc/source/ui/src/xmlsourcedlg.src \ sc/source/ui/cctrl/checklistmenu.src \ sc/source/ui/navipi/navipi.src \ sc/source/ui/styleui/scstyles.src \ diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 8508fe7a038c..f919d7cb4f3d 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -152,6 +152,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/ungroupdialog \ sc/uiconfig/scalc/ui/validationdialog \ sc/uiconfig/scalc/ui/validationhelptabpage \ + sc/uiconfig/scalc/ui/xmlsourcedialog \ )) # vim: set noet sw=4 ts=4: diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 000a6e115e1e..91275e7a2110 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -984,6 +984,9 @@ #define IMG_LINE_STYLE7 (BMP_START + 17) #define IMG_LINE_STYLE8 (BMP_START + 18) #define IMG_LINE_STYLE9 (BMP_START + 19) +#define IMG_ELEMENT_DEFAULT (BMP_START + 20) +#define IMG_ELEMENT_REPEAT (BMP_START + 21) +#define IMG_ELEMENT_ATTRIBUTE (BMP_START + 22) #define BMP_END (BMP_START + 100) @@ -1100,7 +1103,6 @@ #define RID_ICON_SET_ENTRY (SC_DIALOGS_START + 158) #define RID_SCDLG_COND_FORMAT_MANAGER (SC_DIALOGS_START + 159) -#define RID_SCDLG_XML_SOURCE (SC_DIALOGS_START + 160) // defines for AlignmentPropertyPanel #define RID_PROPERTYPANEL_SC_ALIGNMENT (SC_DIALOGS_START + 161) diff --git a/sc/source/ui/inc/xmlsourcedlg.hrc b/sc/source/ui/inc/xmlsourcedlg.hrc deleted file mode 100644 index 748bed5f0d7c..000000000000 --- a/sc/source/ui/inc/xmlsourcedlg.hrc +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include "sc.hrc" - -#define BTN_OK 1 -#define BTN_CANCEL 2 - -#define FL_SOURCE_FILE 10 -#define BTN_SELECT_SOURCE_FILE 11 -#define FT_SOURCE_FILE 12 - -#define FL_MAP_XML_TO_DOCUMENT 20 -#define FT_MAPPED_CELL_TITLE 22 -#define ED_MAPPED_CELL 23 -#define BTN_MAPPED_CELL 24 -#define LB_SOURCE_TREE 25 - -#define IMG_ELEMENT_DEFAULT 50 -#define IMG_ELEMENT_REPEAT 51 -#define IMG_ELEMENT_ATTRIBUTE 52 -#define IMG_FILE_OPEN 53 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx index 7c227d67260a..8669405032d9 100644 --- a/sc/source/ui/inc/xmlsourcedlg.hxx +++ b/sc/source/ui/inc/xmlsourcedlg.hxx @@ -10,8 +10,9 @@ #ifndef __SC_XMLSOURCEDLG_HXX__ #define __SC_XMLSOURCEDLG_HXX__ -#include "vcl/button.hxx" -#include "vcl/fixed.hxx" +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/layout.hxx> #include "svtools/treelistbox.hxx" #include "expftext.hxx" @@ -26,30 +27,19 @@ class ScDocument; class ScRange; class ScOrcusXMLContext; -class ScXMLSourceTree : public SvTreeListBox -{ -public: - ScXMLSourceTree(Window* pParent, const ResId& rResId); -}; - class ScXMLSourceDlg : public ScAnyRefDlg { - FixedLine maFlSourceFile; - ImageButton maBtnSelectSource; - ScExpandedFixedText maFtSourceFile; - - FixedLine maFtMapXmlDoc; - - FixedText maFtMappedCellTitle; + PushButton* mpBtnSelectSource; + FixedText* mpFtSourceFile; - ScXMLSourceTree maLbTree; - formula::RefEdit maRefEdit; - formula::RefButton maRefBtn; + VclContainer* mpMapGrid; - OKButton maBtnOk; - CancelButton maBtnCancel; + SvTreeListBox* mpLbTree; + formula::RefEdit* mpRefEdit; + formula::RefButton* mpRefBtn; - Image maImgFileOpen; + PushButton* mpBtnOk; + CancelButton* mpBtnCancel; OUString maSrcPath; @@ -68,7 +58,6 @@ class ScXMLSourceDlg : public ScAnyRefDlg public: ScXMLSourceDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, ScDocument* pDoc); - virtual ~ScXMLSourceDlg(); virtual sal_Bool IsRefInputMode() const; virtual void SetReference(const ScRange& rRange, ScDocument* pDoc); diff --git a/sc/source/ui/navipi/navipi.src b/sc/source/ui/navipi/navipi.src index 54714df66af7..d72d00633d94 100644 --- a/sc/source/ui/navipi/navipi.src +++ b/sc/source/ui/navipi/navipi.src @@ -242,6 +242,24 @@ Image RID_IMG_DROP_COPY MaskColor = STD_MASKCOLOR ; }; +Image IMG_ELEMENT_DEFAULT +{ + ImageBitmap = Bitmap { File = "xml_element.png" ; }; + MaskColor = STD_MASKCOLOR ; +}; + +Image IMG_ELEMENT_REPEAT +{ + ImageBitmap = Bitmap { File = "xml_element_repeat.png" ; }; + MaskColor = STD_MASKCOLOR ; +}; + +Image IMG_ELEMENT_ATTRIBUTE +{ + ImageBitmap = Bitmap { File = "xml_attribute.png" ; }; + MaskColor = STD_MASKCOLOR ; +}; + // content description strings are also used in ScLinkTargetsObj String SCSTR_CONTENT_ROOT diff --git a/sc/source/ui/src/xmlsourcedlg.src b/sc/source/ui/src/xmlsourcedlg.src deleted file mode 100644 index ff9643bdc90c..000000000000 --- a/sc/source/ui/src/xmlsourcedlg.src +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include "xmlsourcedlg.hrc" - -ModelessDialog RID_SCDLG_XML_SOURCE -{ - HelpID = "sc:ModalDialog:RID_SCDLG_XML_SOURCE"; - Text [ en-US ] = "XML Source" ; - Size = MAP_APPFONT ( 250 , 200 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - - FixedLine FL_SOURCE_FILE - { - Pos = MAP_APPFONT ( 6 , 5 ) ; - Size = MAP_APPFONT ( 238 , 8 ) ; - - Text [ en-US ] = "Source file"; - }; - - ImageButton BTN_SELECT_SOURCE_FILE - { - Pos = MAP_APPFONT ( 6 , 17 ) ; - Size = MAP_APPFONT ( 13 , 15 ) ; - - QuickHelpText [ en-US ] = "Browse to set source file."; - }; - - FixedText FT_SOURCE_FILE - { - Pos = MAP_APPFONT ( 25 , 21 ) ; - Size = MAP_APPFONT ( 219 , 8 ) ; - - Text [ en-US ] = "- not set -"; - }; - - FixedLine FL_MAP_XML_TO_DOCUMENT - { - Pos = MAP_APPFONT ( 6 , 38 ) ; - Size = MAP_APPFONT ( 238 , 8 ) ; - - 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 ); - Size = MAP_APPFONT ( 100 , 8 ) ; - - Text [ en-US ] = "Mapped cell"; - }; - - Edit ED_MAPPED_CELL - { - Border = TRUE ; - Pos = MAP_APPFONT ( 145 , 67 ) ; - Size = MAP_APPFONT ( 69 , 12 ) ; - TabStop = TRUE ; - }; - - ImageButton BTN_MAPPED_CELL - { - Pos = MAP_APPFONT ( 216 , 66 ) ; - Size = MAP_APPFONT ( 13 , 15 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Shrink" ; - }; - - Image IMG_ELEMENT_DEFAULT - { - ImageBitmap = Bitmap { File = "xml_element.png" ; }; - MaskColor = STD_MASKCOLOR ; - }; - - Image IMG_ELEMENT_REPEAT - { - ImageBitmap = Bitmap { File = "xml_element_repeat.png" ; }; - MaskColor = STD_MASKCOLOR ; - }; - - Image IMG_ELEMENT_ATTRIBUTE - { - ImageBitmap = Bitmap { File = "xml_attribute.png" ; }; - MaskColor = STD_MASKCOLOR ; - }; - - Image IMG_FILE_OPEN - { - ImageBitmap = Bitmap { File = "file.png" ; }; - MaskColor = STD_MASKCOLOR ; - }; - - OKButton BTN_OK - { - Text [ en-US ] = "~Import" ; - Pos = MAP_APPFONT ( 139 , 181 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 194 , 181 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 5ae5c861da2c..5cd3cbd36999 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -8,8 +8,7 @@ */ #include "xmlsourcedlg.hxx" -#include "xmlsourcedlg.hrc" - +#include "sc.hrc" #include "scresid.hxx" #include "document.hxx" #include "orcusfilters.hxx" @@ -67,61 +66,56 @@ OUString getXPath( } -ScXMLSourceTree::ScXMLSourceTree(Window* pParent, const ResId& rResId) : - SvTreeListBox(pParent, rResId) {} - ScXMLSourceDlg::ScXMLSourceDlg( - SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, ScDocument* pDoc) : - ScAnyRefDlg(pB, pCW, pParent, RID_SCDLG_XML_SOURCE), - maFlSourceFile(this, ScResId(FL_SOURCE_FILE)), - maBtnSelectSource(this, ScResId(BTN_SELECT_SOURCE_FILE)), - 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, NULL, ScResId(ED_MAPPED_CELL)), - maRefBtn(this, ScResId(BTN_MAPPED_CELL), &maRefEdit, this), - maBtnOk(this, ScResId(BTN_OK)), - maBtnCancel(this, ScResId(BTN_CANCEL)), - maImgFileOpen(ScResId(IMG_FILE_OPEN)), - mpCurRefEntry(NULL), - mpDoc(pDoc), - mpActiveEdit(&maRefEdit), - mbDlgLostFocus(false) -{ + SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, ScDocument* pDoc) + : ScAnyRefDlg(pB, pCW, pParent, "XMLSourceDialog", + "modules/scalc/ui/xmlsourcedialog.ui") + , mpCurRefEntry(NULL) + , mpDoc(pDoc) + , mbDlgLostFocus(false) +{ + get(mpBtnSelectSource, "selectsource"); + get(mpFtSourceFile, "sourcefile"); + get(mpMapGrid, "mapgrid"); + get(mpLbTree, "tree"); + Size aTreeSize(mpLbTree->LogicToPixel(Size(130, 120), MAP_APPFONT)); + mpLbTree->set_width_request(aTreeSize.Width()); + mpLbTree->set_height_request(aTreeSize.Height()); + get(mpRefEdit, "edit"); + mpRefEdit->SetReferences(this, NULL); + get(mpRefBtn, "ref"); + mpRefBtn->SetReferences(this, mpRefEdit); + get(mpBtnCancel, "cancel"); + get(mpBtnOk, "ok"); + + mpActiveEdit = mpRefEdit; + maXMLParam.maImgElementDefault = Image(ScResId(IMG_ELEMENT_DEFAULT)); maXMLParam.maImgElementRepeat = Image(ScResId(IMG_ELEMENT_REPEAT)); maXMLParam.maImgAttribute = Image(ScResId(IMG_ELEMENT_ATTRIBUTE)); - maBtnSelectSource.SetModeImage(maImgFileOpen); - FreeResource(); - Link aBtnHdl = LINK(this, ScXMLSourceDlg, BtnPressedHdl); - maBtnSelectSource.SetClickHdl(aBtnHdl); - maBtnOk.SetClickHdl(aBtnHdl); - maBtnCancel.SetClickHdl(aBtnHdl); + mpBtnSelectSource->SetClickHdl(aBtnHdl); + mpBtnOk->SetClickHdl(aBtnHdl); + mpBtnCancel->SetClickHdl(aBtnHdl); Link aLink = LINK(this, ScXMLSourceDlg, GetFocusHdl); - maRefEdit.SetGetFocusHdl(aLink); - maRefBtn.SetGetFocusHdl(aLink); + mpRefEdit->SetGetFocusHdl(aLink); + mpRefBtn->SetGetFocusHdl(aLink); aLink = LINK(this, ScXMLSourceDlg, LoseFocusHdl); - maRefEdit.SetLoseFocusHdl(aLink); - maRefBtn.SetLoseFocusHdl(aLink); + mpRefEdit->SetLoseFocusHdl(aLink); + mpRefBtn->SetLoseFocusHdl(aLink); aLink = LINK(this, ScXMLSourceDlg, TreeItemSelectHdl); - maLbTree.SetSelectHdl(aLink); + mpLbTree->SetSelectHdl(aLink); aLink = LINK(this, ScXMLSourceDlg, RefModifiedHdl); - maRefEdit.SetModifyHdl(aLink); + mpRefEdit->SetModifyHdl(aLink); - maBtnOk.Disable(); + mpBtnOk->Disable(); SetNonLinkable(); - maBtnSelectSource.GrabFocus(); // Initial focus is on the select source button. -} - -ScXMLSourceDlg::~ScXMLSourceDlg() -{ + mpBtnSelectSource->GrabFocus(); // Initial focus is on the select source button. } sal_Bool ScXMLSourceDlg::IsRefInputMode() const @@ -198,7 +192,7 @@ void ScXMLSourceDlg::SelectSourceFile() // There should only be one file returned from the file picker. maSrcPath = aFiles[0]; - maFtSourceFile.SetText(maSrcPath); + mpFtSourceFile->SetText(maSrcPath); maHighlightedEntries.clear(); LoadSourceFileStructure(maSrcPath); } @@ -213,14 +207,14 @@ void ScXMLSourceDlg::LoadSourceFileStructure(const OUString& rPath) if (!mpXMLContext) return; - mpXMLContext->loadXMLStructure(maLbTree, maXMLParam); + mpXMLContext->loadXMLStructure(*mpLbTree, maXMLParam); } void ScXMLSourceDlg::HandleGetFocus(Control* pCtrl) { mpActiveEdit = NULL; - if (pCtrl == &maRefEdit || pCtrl == &maRefBtn) - mpActiveEdit = &maRefEdit; + if (pCtrl == mpRefEdit || pCtrl == mpRefBtn) + mpActiveEdit = mpRefEdit; if (mpActiveEdit) mpActiveEdit->SetSelection(Selection(0, SELECTION_MAX)); @@ -284,18 +278,18 @@ SvTreeListEntry* getReferenceEntry(SvTreeListBox& rTree, SvTreeListEntry* pCurEn void ScXMLSourceDlg::TreeItemSelected() { - SvTreeListEntry* pEntry = maLbTree.GetCurEntry(); + SvTreeListEntry* pEntry = mpLbTree->GetCurEntry(); if (!pEntry) return; if (!maHighlightedEntries.empty()) { // Remove highlights from all previously highlighted entries (if any). - std::for_each(maHighlightedEntries.begin(), maHighlightedEntries.end(), UnhighlightEntry(maLbTree)); + std::for_each(maHighlightedEntries.begin(), maHighlightedEntries.end(), UnhighlightEntry(*mpLbTree)); maHighlightedEntries.clear(); } - mpCurRefEntry = getReferenceEntry(maLbTree, pEntry); + mpCurRefEntry = getReferenceEntry(*mpLbTree, pEntry); ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*mpCurRefEntry); OSL_ASSERT(pUserData); @@ -304,10 +298,10 @@ void ScXMLSourceDlg::TreeItemSelected() if (rPos.IsValid()) { OUString aStr(rPos.Format(SCA_ABS_3D, mpDoc, mpDoc->GetAddressConvention())); - maRefEdit.SetRefString(aStr); + mpRefEdit->SetRefString(aStr); } else - maRefEdit.SetRefString(OUString()); + mpRefEdit->SetRefString(OUString()); switch (pUserData->meType) { @@ -328,12 +322,12 @@ void ScXMLSourceDlg::TreeItemSelected() void ScXMLSourceDlg::DefaultElementSelected(SvTreeListEntry& rEntry) { - if (maLbTree.GetChildCount(&rEntry) > 0) + if (mpLbTree->GetChildCount(&rEntry) > 0) { // Only an element with no child elements (leaf element) can be linked. bool bHasChild = false; ScOrcusXMLTreeParam::EntryData* pUserData = NULL; - for (SvTreeListEntry* pChild = maLbTree.FirstChild(&rEntry); pChild; pChild = maLbTree.NextSibling(pChild)) + for (SvTreeListEntry* pChild = mpLbTree->FirstChild(&rEntry); pChild; pChild = mpLbTree->NextSibling(pChild)) { pUserData = ScOrcusXMLTreeParam::getUserData(*pChild); OSL_ASSERT(pUserData); @@ -384,13 +378,13 @@ void ScXMLSourceDlg::RepeatElementSelected(SvTreeListEntry& rEntry) return; } - SvViewDataEntry* p = maLbTree.GetViewDataEntry(&rEntry); + SvViewDataEntry* p = mpLbTree->GetViewDataEntry(&rEntry); if (!p->IsHighlighted()) { // Highlight the entry if not highlighted already. This can happen // when the current entry is a child entry of a repeat element entry. p->SetHighlighted(true); - maLbTree.PaintEntry(&rEntry); + mpLbTree->PaintEntry(&rEntry); maHighlightedEntries.push_back(&rEntry); } @@ -404,7 +398,7 @@ void ScXMLSourceDlg::AttributeSelected(SvTreeListEntry& rEntry) // repeat elements. In attribute's case, it's okay to have the immediate // parent element linked (but not range-linked). - SvTreeListEntry* pParent = maLbTree.GetParent(&rEntry); + SvTreeListEntry* pParent = mpLbTree->GetParent(&rEntry); OSL_ASSERT(pParent); // attribute should have a parent element. ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*pParent); @@ -427,23 +421,17 @@ void ScXMLSourceDlg::AttributeSelected(SvTreeListEntry& rEntry) void ScXMLSourceDlg::SetNonLinkable() { - maFtMappedCellTitle.Disable(); - maRefEdit.Disable(); - maRefBtn.Disable(); + mpMapGrid->Disable(); } void ScXMLSourceDlg::SetSingleLinkable() { - maFtMappedCellTitle.Enable(); - maRefEdit.Enable(); - maRefBtn.Enable(); + mpMapGrid->Enable(); } void ScXMLSourceDlg::SetRangeLinkable() { - maFtMappedCellTitle.Enable(); - maRefEdit.Enable(); - maRefBtn.Enable(); + mpMapGrid->Enable(); } void ScXMLSourceDlg::SelectAllChildEntries(SvTreeListEntry& rEntry) @@ -454,9 +442,9 @@ void ScXMLSourceDlg::SelectAllChildEntries(SvTreeListEntry& rEntry) { SvTreeListEntry& r = *it; SelectAllChildEntries(r); // select recursively. - SvViewDataEntry* p = maLbTree.GetViewDataEntry(&r); + SvViewDataEntry* p = mpLbTree->GetViewDataEntry(&r); p->SetHighlighted(true); - maLbTree.PaintEntry(&r); + mpLbTree->PaintEntry(&r); maHighlightedEntries.push_back(&r); } } @@ -464,7 +452,7 @@ void ScXMLSourceDlg::SelectAllChildEntries(SvTreeListEntry& rEntry) bool ScXMLSourceDlg::IsParentDirty(SvTreeListEntry* pEntry) const { ScOrcusXMLTreeParam::EntryData* pUserData = NULL; - SvTreeListEntry* pParent = maLbTree.GetParent(pEntry); + SvTreeListEntry* pParent = mpLbTree->GetParent(pEntry); while (pParent) { pUserData = ScOrcusXMLTreeParam::getUserData(*pParent); @@ -479,7 +467,7 @@ bool ScXMLSourceDlg::IsParentDirty(SvTreeListEntry* pEntry) const // This is a repeat element. return true; } - pParent = maLbTree.GetParent(pParent); + pParent = mpLbTree->GetParent(pParent); } return false; } @@ -487,7 +475,7 @@ bool ScXMLSourceDlg::IsParentDirty(SvTreeListEntry* pEntry) const bool ScXMLSourceDlg::IsChildrenDirty(SvTreeListEntry* pEntry) const { ScOrcusXMLTreeParam::EntryData* pUserData = NULL; - for (SvTreeListEntry* pChild = maLbTree.FirstChild(pEntry); pChild; pChild = maLbTree.NextSibling(pChild)) + for (SvTreeListEntry* pChild = mpLbTree->FirstChild(pEntry); pChild; pChild = mpLbTree->NextSibling(pChild)) { pUserData = ScOrcusXMLTreeParam::getUserData(*pChild); OSL_ASSERT(pUserData); @@ -567,7 +555,7 @@ void ScXMLSourceDlg::OkPressed() for (; it != itEnd; ++it) { const SvTreeListEntry& rEntry = **it; - OUString aPath = getXPath(maLbTree, rEntry, aParam.maNamespaces); + OUString aPath = getXPath(*mpLbTree, rEntry, aParam.maNamespaces); const ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(rEntry); aParam.maCellLinks.push_back( @@ -589,7 +577,7 @@ void ScXMLSourceDlg::OkPressed() aRangeLink.maPos = pUserData->maLinkedPos; // Go through all its child elements. - getFieldLinks(aRangeLink, aParam.maNamespaces, maLbTree, rEntry); + getFieldLinks(aRangeLink, aParam.maNamespaces, *mpLbTree, rEntry); aParam.maRangeLinks.push_back(aRangeLink); } @@ -620,7 +608,7 @@ void ScXMLSourceDlg::CancelPressed() void ScXMLSourceDlg::RefEditModified() { - OUString aRefStr = maRefEdit.GetText(); + OUString aRefStr = mpRefEdit->GetText(); // Check if the address is valid. ScAddress aLinkedPos; @@ -629,7 +617,7 @@ void ScXMLSourceDlg::RefEditModified() // TODO: For some unknown reason, setting the ref invalid will hide the text altogether. // Find out how to make this work. -// maRefEdit.SetRefValid(bValid); +// mpRefEdit->SetRefValid(bValid); if (!bValid) aLinkedPos.SetInvalid(); @@ -665,7 +653,7 @@ void ScXMLSourceDlg::RefEditModified() // Enable the import button only when at least one link exists. bool bHasLink = !maCellLinks.empty() || !maRangeLinks.empty(); - maBtnOk.Enable(bHasLink); + mpBtnOk->Enable(bHasLink); } IMPL_LINK(ScXMLSourceDlg, GetFocusHdl, Control*, pCtrl) @@ -682,11 +670,11 @@ IMPL_LINK(ScXMLSourceDlg, LoseFocusHdl, Control*, pCtrl) IMPL_LINK(ScXMLSourceDlg, BtnPressedHdl, Button*, pBtn) { - if (pBtn == &maBtnSelectSource) + if (pBtn == mpBtnSelectSource) SelectSourceFile(); - else if (pBtn == &maBtnOk) + else if (pBtn == mpBtnOk) OkPressed(); - else if (pBtn == &maBtnCancel) + else if (pBtn == mpBtnCancel) CancelPressed(); return 0; } diff --git a/sc/uiconfig/scalc/ui/xmlsourcedialog.ui b/sc/uiconfig/scalc/ui/xmlsourcedialog.ui new file mode 100644 index 000000000000..689e270fe8c4 --- /dev/null +++ b/sc/uiconfig/scalc/ui/xmlsourcedialog.ui @@ -0,0 +1,257 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkDialog" id="XMLSourceDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">XML Source</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkFrame" id="itemframe"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <property name="row_homogeneous">True</property> + <child> + <object class="GtkButton" id="selectsource"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_markup" translatable="yes">Browse to set source file.</property> + <property name="image">image1</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="sourcefile"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">- not set -</property> + <property name="ellipsize">middle</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Source file</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="itemframe1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <property name="row_homogeneous">True</property> + <child> + <object class="svtlo-SvTreeListBox" id="tree:border"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="Tree List-selection1"/> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="mapgrid"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Mapped cell</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="foruilo-RefEdit" id="edit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="width_chars">20</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="foruilo-RefButton" id="ref"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Map to document</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">_Import</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + </action-widgets> + </object> + <object class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixbuf">sc/res/file.png</property> + </object> +</interface> |