[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-11-21 Thread Libreoffice Gerrit user
 sc/source/filter/orcus/xmlcontext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f1161eb78c9311a5de3ee8db92284f6c49900a7d
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Nov 21 10:58:24 2012 -0500

Adjusted for the orcus interface change on the master branch.

Change-Id: Ie99a1f90c55abf41f9f069fe26f19ed2f4370ae1

diff --git a/sc/source/filter/orcus/xmlcontext.cxx 
b/sc/source/filter/orcus/xmlcontext.cxx
index 9e0dbba..cc8eccd 100644
--- a/sc/source/filter/orcus/xmlcontext.cxx
+++ b/sc/source/filter/orcus/xmlcontext.cxx
@@ -171,7 +171,7 @@ bool ScOrcusXMLContextImpl::importXML(const 
ScOrcusImportXMLParam rParam)
 const char* path = aSysPath.getStr();
 try
 {
-orcus::orcus_xml filter(aFactory, NULL);
+orcus::orcus_xml filter(maNsRepo, aFactory, NULL);
 
 // Set cell links.
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-11-21 Thread Libreoffice Gerrit user
 sc/source/filter/orcus/xmlcontext.cxx |   27 +++
 1 file changed, 23 insertions(+), 4 deletions(-)

New commits:
commit a4c588ca5b5bbce9da8bd351ff96ef99cb3662c6
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Nov 21 12:01:51 2012 -0500

Display XML namespace IDs in the tree.

Change-Id: I7223b6ac750a5c96ce9638b490eeae109ed854ef

diff --git a/sc/source/filter/orcus/xmlcontext.cxx 
b/sc/source/filter/orcus/xmlcontext.cxx
index cc8eccd..86865cd 100644
--- a/sc/source/filter/orcus/xmlcontext.cxx
+++ b/sc/source/filter/orcus/xmlcontext.cxx
@@ -31,13 +31,33 @@ ScOrcusXMLTreeParam::EntryData setUserDataToEntry(
 return rStore.back();
 }
 
+OUString toString(const orcus::xml_structure_tree::entity_name entity, const 
orcus::xml_structure_tree::walker walker)
+{
+OUStringBuffer aBuf;
+if (entity.ns)
+{
+// Namespace exists.  Namespaces are displayed as ns0, ns1, ns2, 
+size_t index = walker.get_xmlns_index(entity.ns);
+if (index == orcus::xml_structure_tree::walker::index_not_found)
+// This namespace doesn't exist in this context. Something has 
gone wrong.
+aBuf.append(???);
+else
+{
+aBuf.append(ns);
+aBuf.append(static_castsal_Int32(index));
+}
+aBuf.append(':');
+}
+aBuf.append(OUString(entity.name.get(), entity.name.size(), 
RTL_TEXTENCODING_UTF8));
+return aBuf.makeStringAndClear();
+}
+
 void populateTree(
SvTreeListBox rTreeCtrl, orcus::xml_structure_tree::walker rWalker,
const orcus::xml_structure_tree::entity_name rElemName, bool bRepeat,
SvTreeListEntry* pParent, ScOrcusXMLTreeParam rParam)
 {
-OUString aName(rElemName.name.get(), rElemName.name.size(), 
RTL_TEXTENCODING_UTF8);
-SvTreeListEntry* pEntry = rTreeCtrl.InsertEntry(aName, pParent);
+SvTreeListEntry* pEntry = rTreeCtrl.InsertEntry(toString(rElemName, 
rWalker), pParent);
 if (!pEntry)
 // Can this ever happen!?
 return;
@@ -65,8 +85,7 @@ void populateTree(
 for (; it != itEnd; ++it)
 {
 orcus::xml_structure_tree::entity_name aAttrName = *it;
-SvTreeListEntry* pAttr = rTreeCtrl.InsertEntry(
-OUString(aAttrName.name.get(), aAttrName.name.size(), 
RTL_TEXTENCODING_UTF8), pEntry);
+SvTreeListEntry* pAttr = rTreeCtrl.InsertEntry(toString(aAttrName, 
rWalker), pEntry);
 
 if (!pAttr)
 continue;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-11-19 Thread Libreoffice Gerrit user
 sc/source/filter/orcus/orcusfiltersimpl.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit d4035c5bc8435ebd1a41544cb78fc8d7eddfbe63
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Mon Nov 19 15:47:10 2012 -0500

Get it to build after updating liborcus from latest master.

Change-Id: Ie9cace11bf869777ff0986d38e856e68ad8fdb57

diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx 
b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index 2584770..3fa23e1 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -311,8 +311,9 @@ bool ScOrcusFiltersImpl::loadXMLStructure(
 if (aStrm.empty())
 return false;
 
-orcus::xmlns_repository aNsRepo; // xml namespace repository.
-orcus::xml_structure_tree aXmlTree(aNsRepo);
+orcus::xmlns_repository repo; // xml namespace repository.
+orcus::xmlns_context cxt = repo.create_context();
+orcus::xml_structure_tree aXmlTree(cxt);
 try
 {
 aXmlTree.parse(aStrm[0], aStrm.size());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-11-13 Thread Libreoffice Gerrit user
 sc/source/ui/xmlsource/xmlsourcedlg.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit bcbe2cb737ad12a74272fa4af07a51870a947f4a
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Nov 13 15:36:14 2012 -0500

Setting a reference via ref picker should update the link ref data.

Change-Id: Ie1559e1ece8d57b09e68676f88991c67ff8db03e

diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx 
b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index f9c2c13..68e819e 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -127,6 +127,8 @@ void ScXMLSourceDlg::SetReference(const ScRange rRange, 
ScDocument* pDoc)
 OUString aStr;
 rRange.aStart.Format(aStr, SCA_ABS_3D, pDoc, pDoc-GetAddressConvention());
 mpActiveEdit-SetRefString(aStr);
+
+RefEditModified();
 }
 
 void ScXMLSourceDlg::Deactivate()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-11-13 Thread Libreoffice Gerrit user
 sc/source/ui/xmlsource/xmlsourcedlg.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit abc7bcaa11457aff57bfc45d765e297492a028b3
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Nov 13 17:07:18 2012 -0500

Enable the 'Import' button only when linked data exists.

It makes no sense to allow import if there is no link specified.

Change-Id: I3ff4bfa7fd78c79a2c4ee74c7a1a34d2b7a2d1c4

diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx 
b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index dd1ab74..08cf7cc 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -104,8 +104,10 @@ ScXMLSourceDlg::ScXMLSourceDlg(
 aLink = LINK(this, ScXMLSourceDlg, RefModifiedHdl);
 maRefEdit.SetModifyHdl(aLink);
 
+maBtnOk.Disable();
+
 SetNonLinkable();
-maBtnSelectSource.GrabFocus();
+maBtnSelectSource.GrabFocus(); // Initial focus is on the select source 
button.
 }
 
 ScXMLSourceDlg::~ScXMLSourceDlg()
@@ -559,6 +561,10 @@ void ScXMLSourceDlg::RefEditModified()
 else
 maCellLinks.erase(pEntry);
 }
+
+// Enable the import button only when at least one link exists.
+bool bHasLink = !maCellLinks.empty() || !maRangeLinks.empty();
+maBtnOk.Enable(bHasLink);
 }
 
 IMPL_LINK(ScXMLSourceDlg, GetFocusHdl, Control*, pCtrl)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-11-09 Thread Libreoffice Gerrit user
 sc/source/filter/orcus/orcusfiltersimpl.cxx |4 
 sc/source/ui/xmlsource/xmlsourcedlg.cxx |7 +--
 2 files changed, 1 insertion(+), 10 deletions(-)

New commits:
commit 2ad0600711e613d7955f445d6ebaa35a530f2751
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Fri Nov 9 23:04:29 2012 -0500

Remove debug statements.

Change-Id: I3e3d4863bef27e91b95f9e6cbe5c2daa81ece0b2

diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx 
b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index ba3701a..2584770 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -113,11 +113,8 @@ orcus::spreadsheet::iface::import_sheet* 
ScOrcusFactory::get_sheet(const char* s
 OUString aTabName(sheet_name, sheet_name_length, RTL_TEXTENCODING_UTF8);
 SCTAB nTab = -1;
 if (!mrDoc.GetTable(aTabName, nTab))
-{
 // Sheet by that name not found.
-fprintf(stdout, ScOrcusFactory::get_sheet:   no such sheet!!! 
(%s)\n, rtl::OUStringToOString(aTabName, RTL_TEXTENCODING_UTF8).getStr());
 return NULL;
-}
 
 // See if we already have an orcus sheet instance by that index.
 boost::ptr_vectorScOrcusSheet::iterator it =
@@ -349,7 +346,6 @@ public:
 InsertFieldPath(orcus::orcus_xml rFilter) : mrFilter(rFilter) {}
 void operator() (const OString rPath)
 {
-fprintf(stdout, InsertFieldPath::():   field path = '%s'\n, 
rPath.getStr());
 mrFilter.append_field_link(rPath.getStr());
 }
 };
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx 
b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 62d2f40..5f3a6e1 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -125,8 +125,6 @@ void ScXMLSourceDlg::SetReference(const ScRange rRange, 
ScDocument* pDoc)
 OUString aStr;
 rRange.aStart.Format(aStr, SCA_ABS_3D, pDoc, pDoc-GetAddressConvention());
 mpActiveEdit-SetRefString(aStr);
-
-fprintf(stdout, ScXMLSourceDlg::SetReference:   ref str = '%s'\n, 
rtl::OUStringToOString(aStr, RTL_TEXTENCODING_UTF8).getStr());
 }
 
 void ScXMLSourceDlg::Deactivate()
@@ -431,9 +429,8 @@ void getFieldLinks(ScOrcusImportXMLParam::RangeLink 
rRangeLink, const SvTreeLis
 {
 const SvTreeListEntry rChild = *it;
 OUString aPath = getXPath(rTree, rChild);
-
 const ScOrcusXMLTreeParam::EntryData* pUserData = 
ScOrcusXMLTreeParam::getUserData(rChild);
-fprintf(stdout, getFieldLinks:   path = '%s'  leaf = %d\n, 
rtl::OUStringToOString(aPath, RTL_TEXTENCODING_UTF8).getStr(), 
pUserData-mbLeafNode);
+
 if (pUserData  pUserData-mbLeafNode)
 {
 if (!aPath.isEmpty())
@@ -510,8 +507,6 @@ void ScXMLSourceDlg::RefEditModified()
 ScAddress aLinkedPos;
 sal_uInt16 nRes = aLinkedPos.Parse(aRefStr, mpDoc, 
mpDoc-GetAddressConvention());
 bool bValid = (nRes  SCA_VALID) == SCA_VALID;
-fprintf(stdout, ScXMLSourceDlg::RefEditModified:   ref str = '%s'  valid 
= %d\n,
-rtl::OUStringToOString(aRefStr, RTL_TEXTENCODING_UTF8).getStr(), 
bValid);
 
 // TODO: For some unknown reason, setting the ref invalid will hide the 
text altogether.
 // Find out how to make this work.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-10-12 Thread Libreoffice Gerrit user
 sc/source/ui/inc/xmlsourcedlg.hrc   |9 +
 sc/source/ui/inc/xmlsourcedlg.hxx   |1 +
 sc/source/ui/src/xmlsourcedlg.src   |   12 
 sc/source/ui/xmlsource/xmlsourcedlg.cxx |4 ++--
 4 files changed, 16 insertions(+), 10 deletions(-)

New commits:
commit 48225f78ca36ae6dd9b14ae5088a1ebfe257e32a
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Fri Oct 12 17:30:20 2012 -0400

Display selected tree item name on the dialog when clicked on.

Change-Id: If7f7d938f4eacfc921a1e591fa4e59c5c9cf127e

diff --git a/sc/source/ui/inc/xmlsourcedlg.hrc 
b/sc/source/ui/inc/xmlsourcedlg.hrc
index 67cf9b8..03cb645 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hrc
+++ b/sc/source/ui/inc/xmlsourcedlg.hrc
@@ -17,10 +17,11 @@
 #define FT_SOURCE_FILE 12
 
 #define FL_MAP_XML_TO_DOCUMENT 20
-#define FT_MAPPED_CELL_TITLE 21
-#define ED_MAPPED_CELL 22
-#define BTN_MAPPED_CELL 23
-#define LB_SOURCE_TREE 24
+#define FT_TREE_ITEM_NAME 21
+#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
diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx 
b/sc/source/ui/inc/xmlsourcedlg.hxx
index 75d698f..f946fb2 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -37,6 +37,7 @@ class ScXMLSourceDlg : public ScAnyRefDlg
 
 FixedLine maFtMapXmlDoc;
 
+FixedText maFtTreeItemName;
 FixedText maFtMappedCellTitle;
 formula::RefEdit   maEdit;
 formula::RefButton maBtnRb;
diff --git a/sc/source/ui/src/xmlsourcedlg.src 
b/sc/source/ui/src/xmlsourcedlg.src
index 4119601..342d47a 100644
--- a/sc/source/ui/src/xmlsourcedlg.src
+++ b/sc/source/ui/src/xmlsourcedlg.src
@@ -48,25 +48,29 @@ ModelessDialog RID_SCDLG_XML_SOURCE
 Text [ en-US ] = Map to document;
 };
 
-FixedText FT_MAPPED_CELL_TITLE
+FixedText FT_TREE_ITEM_NAME
 {
 Pos = MAP_APPFONT( 12, 52 );
 Size = MAP_APPFONT ( 100 , 8 ) ;
+};
 
-Text [ en-US ] = ;
+FixedText FT_MAPPED_CELL_TITLE
+{
+Pos = MAP_APPFONT( 12, 67 );
+Size = MAP_APPFONT ( 100 , 8 ) ;
 };
 
 Edit ED_MAPPED_CELL
 {
 Border = TRUE ;
-Pos = MAP_APPFONT ( 12 , 66 ) ;
+Pos = MAP_APPFONT ( 12 , 81 ) ;
 Size = MAP_APPFONT ( 69 , 12 ) ;
 TabStop = TRUE ;
 };
 
 ImageButton BTN_MAPPED_CELL
 {
-Pos = MAP_APPFONT ( 83 , 65 ) ;
+Pos = MAP_APPFONT ( 83 , 80 ) ;
 Size = MAP_APPFONT ( 13 , 15 ) ;
 TabStop = FALSE ;
 QuickHelpText [ en-US ] = Shrink ;
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx 
b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 1b9f213..6071f82 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -36,6 +36,7 @@ ScXMLSourceDlg::ScXMLSourceDlg(
 maBtnSelectSource(this, ScResId(BTN_SELECT_SOURCE_FILE)),
 maFtSourceFile(this, ScResId(FT_SOURCE_FILE)),
 maFtMapXmlDoc(this, ScResId(FL_MAP_XML_TO_DOCUMENT)),
+maFtTreeItemName(this, ScResId(FT_TREE_ITEM_NAME)),
 maFtMappedCellTitle(this, ScResId(FT_MAPPED_CELL_TITLE)),
 maEdit(this, this, ScResId(ED_MAPPED_CELL)),
 maBtnRb(this, ScResId(BTN_MAPPED_CELL), maEdit, this),
@@ -186,8 +187,7 @@ void ScXMLSourceDlg::TreeItemSelected()
 {
 SvLBoxEntry* pEntry = maLbTree.GetCurEntry();
 OUString aName = maLbTree.GetEntryText(pEntry);
-fprintf(stdout, ScXMLSourceDlg::TreeItemSelected:   name = '%s'\n,
-rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr());
+maFtTreeItemName.SetText(aName);
 }
 
 IMPL_LINK(ScXMLSourceDlg, GetFocusHdl, Control*, pCtrl)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-10-11 Thread Libreoffice Gerrit user
 sc/source/filter/orcus/orcusfiltersimpl.cxx |   20 
 sc/source/ui/xmlsource/xmlsourcedlg.cxx |2 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 94346b67249d9c6920c48a37c12115d82f06ec69
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Oct 11 12:23:28 2012 -0400

Disable update while populating the tree control.

Change-Id: Ic0f5822072a817addc7d296eceadf59467e5ba0f

diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx 
b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index 824eea9..31cd8ba 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -173,6 +173,8 @@ bool ScOrcusFiltersImpl::importCSV(ScDocument rDoc, const 
OUString rPath) cons
 return true;
 }
 
+namespace {
+
 void populateTree(
SvTreeListBox rTreeCtrl, orcus::xml_structure_tree::walker rWalker,
const orcus::xml_structure_tree::entity_name rElemName, bool bRepeat,
@@ -214,6 +216,23 @@ void populateTree(
 }
 }
 
+class TreeUpdateSwitch
+{
+SvTreeListBox mrTreeCtrl;
+public:
+TreeUpdateSwitch(SvTreeListBox rTreeCtrl) : mrTreeCtrl(rTreeCtrl)
+{
+mrTreeCtrl.SetUpdateMode(false);
+}
+
+~TreeUpdateSwitch()
+{
+mrTreeCtrl.SetUpdateMode(true);
+}
+};
+
+}
+
 bool ScOrcusFiltersImpl::loadXMLStructure(
SvTreeListBox rTreeCtrl, const rtl::OUString rPath,
const Image rImgDefaultElem, const Image rImgRepeatElem, const Image 
rImgElemAttr) const
@@ -235,6 +254,7 @@ bool ScOrcusFiltersImpl::loadXMLStructure(
 {
 aXmlTree.parse(aStrm[0], aStrm.size());
 
+TreeUpdateSwitch aSwitch(rTreeCtrl);
 rTreeCtrl.Clear();
 rTreeCtrl.SetDefaultCollapsedEntryBmp(rImgDefaultElem);
 rTreeCtrl.SetDefaultExpandedEntryBmp(rImgDefaultElem);
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx 
b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index cc255b8..5f244f2 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -151,8 +151,8 @@ void ScXMLSourceDlg::SelectSourceFile()
 if (!aFiles.getLength())
 return;
 
-maSrcPath = aFiles[0];
 // There should only be one file returned from the file picker.
+maSrcPath = aFiles[0];
 maFtSourceFile.SetText(maSrcPath);
 
 LoadSourceFileStructure(maSrcPath);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-10-10 Thread Libreoffice Gerrit user
 sc/source/ui/inc/xmlsourcedlg.hxx   |8 +++
 sc/source/ui/src/xmlsourcedlg.src   |7 +--
 sc/source/ui/xmlsource/xmlsourcedlg.cxx |   71 +---
 3 files changed, 76 insertions(+), 10 deletions(-)

New commits:
commit a94b5f1d038beb809c9201f49b32bd3465a79b6d
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Oct 11 00:20:46 2012 -0400

Get the reference edit box to work properly.

Change-Id: Ifd01fe05312c0ece867100019a9f84162e5778c4

diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx 
b/sc/source/ui/inc/xmlsourcedlg.hxx
index ee8225c..c145f8b 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -54,7 +54,8 @@ class ScXMLSourceDlg : public ScAnyRefDlg
 
 ScDocument* mpDoc;
 
-bool mbRefMode;
+formula::RefEdit* mpActiveEdit;
+bool mbDlgLostFocus;
 
 public:
 ScXMLSourceDlg(
@@ -63,6 +64,7 @@ public:
 
 virtual sal_Bool IsRefInputMode() const;
 virtual void SetReference(const ScRange rRange, ScDocument* pDoc);
+virtual void Deactivate();
 virtual void SetActive();
 virtual sal_Bool Close();
 
@@ -70,7 +72,11 @@ private:
 
 void SelectSourceFile();
 void LoadSourceFileStructure(const OUString rPath);
+void HandleGetFocus(Control* pCtrl);
+void HandleLoseFocus(Control* pCtrl);
 
+DECL_LINK(GetFocusHdl, Control*);
+DECL_LINK(LoseFocusHdl, Control*);
 DECL_LINK(BtnPressedHdl, Button*);
 };
 
diff --git a/sc/source/ui/src/xmlsourcedlg.src 
b/sc/source/ui/src/xmlsourcedlg.src
index d4ef5ce..4119601 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, 50 );
+Pos = MAP_APPFONT( 12, 52 );
 Size = MAP_APPFONT ( 100 , 8 ) ;
 
 Text [ en-US ] = ;
@@ -59,15 +59,14 @@ ModelessDialog RID_SCDLG_XML_SOURCE
 Edit ED_MAPPED_CELL
 {
 Border = TRUE ;
-Pos = MAP_APPFONT ( 12 , 63 ) ;
+Pos = MAP_APPFONT ( 12 , 66 ) ;
 Size = MAP_APPFONT ( 69 , 12 ) ;
 TabStop = TRUE ;
 };
 
-
 ImageButton BTN_MAPPED_CELL
 {
-Pos = MAP_APPFONT ( 83 , 62 ) ;
+Pos = MAP_APPFONT ( 83 , 65 ) ;
 Size = MAP_APPFONT ( 13 , 15 ) ;
 TabStop = FALSE ;
 QuickHelpText [ en-US ] = Shrink ;
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx 
b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 37e6c72..3a07997 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -34,8 +34,8 @@ ScXMLSourceDlg::ScXMLSourceDlg(
 maFtSourceFile(this, ScResId(FT_SOURCE_FILE)),
 maFtMapXmlDoc(this, ScResId(FL_MAP_XML_TO_DOCUMENT)),
 maFtMappedCellTitle(this, ScResId(FT_MAPPED_CELL_TITLE)),
-maEdit(this, ScResId(ED_MAPPED_CELL)),
-maBtnRb(this, ScResId(BTN_MAPPED_CELL)),
+maEdit(this, this, ScResId(ED_MAPPED_CELL)),
+maBtnRb(this, ScResId(BTN_MAPPED_CELL), maEdit, this),
 maLbTree(this, ScResId(LB_SOURCE_TREE)),
 maBtnCancel(this, ScResId(BTN_CANCEL)),
 maImgFileOpen(ScResId(IMG_FILE_OPEN)),
@@ -45,13 +45,21 @@ ScXMLSourceDlg::ScXMLSourceDlg(
 maStrCellLink(ScResId(STR_CELL_LINK).toString()),
 maStrRangeLink(ScResId(STR_RANGE_LINK).toString()),
 mpDoc(pDoc),
-mbRefMode(false)
+mpActiveEdit(maEdit),
+mbDlgLostFocus(false)
 {
 maBtnSelectSource.SetModeImage(maImgFileOpen);
 FreeResource();
 
 maBtnSelectSource.SetClickHdl(LINK(this, ScXMLSourceDlg, BtnPressedHdl));
 
+Link aLink = LINK(this, ScXMLSourceDlg, GetFocusHdl);
+maEdit.SetGetFocusHdl(aLink);
+maBtnRb.SetGetFocusHdl(aLink);
+aLink = LINK(this, ScXMLSourceDlg, LoseFocusHdl);
+maEdit.SetLoseFocusHdl(aLink);
+maBtnRb.SetLoseFocusHdl(aLink);
+
 maFtMappedCellTitle.SetText(maStrCellLink);
 }
 
@@ -61,16 +69,43 @@ ScXMLSourceDlg::~ScXMLSourceDlg()
 
 sal_Bool ScXMLSourceDlg::IsRefInputMode() const
 {
-return mbRefMode;
+return mpActiveEdit != NULL;
 }
 
 void ScXMLSourceDlg::SetReference(const ScRange rRange, ScDocument* pDoc)
 {
+if (!mpActiveEdit)
+return;
+
+if (rRange.aStart != rRange.aEnd)
+RefInputStart(mpActiveEdit);
+
+OUString aStr;
+rRange.aStart.Format(aStr, SCA_ABS_3D, pDoc, pDoc-GetAddressConvention());
+mpActiveEdit-SetRefString(aStr);
+}
+
+void ScXMLSourceDlg::Deactivate()
+{
+mbDlgLostFocus = true;
 }
 
 void ScXMLSourceDlg::SetActive()
 {
-GrabFocus();
+if (mbDlgLostFocus)
+{
+mbDlgLostFocus = false;
+if (mpActiveEdit)
+{
+mpActiveEdit-GrabFocus();
+}
+}
+else
+{
+GrabFocus();
+}
+
+RefInputDone();
 }
 
 sal_Bool ScXMLSourceDlg::Close()
@@ -114,6 +149,32 @@ void ScXMLSourceDlg::LoadSourceFileStructure(const 
OUString rPath)
 maLbTree, rPath, maImgElemDefault, maImgElemRepeat, 

[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-10-10 Thread Libreoffice Gerrit user
 sc/source/ui/inc/xmlsourcedlg.hxx   |4 +++
 sc/source/ui/xmlsource/xmlsourcedlg.cxx |   37 ++--
 2 files changed, 39 insertions(+), 2 deletions(-)

New commits:
commit d6508155a14e786cacca720191a3b85a8c0f86fd
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Oct 11 01:22:21 2012 -0400

Use sensible directory path for file picker, handle tree item select.

Change-Id: I2638b1d870ee6b7e6c8697a38df07872184df8c6

diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx 
b/sc/source/ui/inc/xmlsourcedlg.hxx
index c145f8b..965dae7 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -52,6 +52,8 @@ class ScXMLSourceDlg : public ScAnyRefDlg
 rtl::OUString maStrCellLink;
 rtl::OUString maStrRangeLink;
 
+rtl::OUString maSrcPath;
+
 ScDocument* mpDoc;
 
 formula::RefEdit* mpActiveEdit;
@@ -74,10 +76,12 @@ private:
 void LoadSourceFileStructure(const OUString rPath);
 void HandleGetFocus(Control* pCtrl);
 void HandleLoseFocus(Control* pCtrl);
+void TreeItemSelected();
 
 DECL_LINK(GetFocusHdl, Control*);
 DECL_LINK(LoseFocusHdl, Control*);
 DECL_LINK(BtnPressedHdl, Button*);
+DECL_LINK(TreeItemSelectHdl, void*);
 };
 
 #endif
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx 
b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 3a07997..cc255b8 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -16,6 +16,9 @@
 #include filter.hxx
 #include reffact.hxx
 
+#include unotools/pathoptions.hxx
+#include tools/urlobj.hxx
+
 #include com/sun/star/lang/XMultiServiceFactory.hpp
 #include com/sun/star/ui/dialogs/XFilePicker.hpp
 #include com/sun/star/ui/dialogs/ExecutableDialogResults.hpp
@@ -60,6 +63,8 @@ ScXMLSourceDlg::ScXMLSourceDlg(
 maEdit.SetLoseFocusHdl(aLink);
 maBtnRb.SetLoseFocusHdl(aLink);
 
+aLink = LINK(this, ScXMLSourceDlg, TreeItemSelectHdl);
+maLbTree.SetSelectHdl(aLink);
 maFtMappedCellTitle.SetText(maStrCellLink);
 }
 
@@ -125,6 +130,19 @@ void ScXMLSourceDlg::SelectSourceFile()
 if (!xFilePicker.is())
 return;
 
+if (maSrcPath.isEmpty())
+// Use default path.
+xFilePicker-setDisplayDirectory(SvtPathOptions().GetWorkPath());
+else
+{
+// Use the directory of current source file.
+INetURLObject aURL(maSrcPath);
+aURL.removeSegment();
+aURL.removeFinalSlash();
+OUString aPath = aURL.GetMainURL(INetURLObject::NO_DECODE);
+xFilePicker-setDisplayDirectory(aPath);
+}
+
 if (xFilePicker-execute() != ui::dialogs::ExecutableDialogResults::OK)
 // File picker dialog cancelled.
 return;
@@ -133,10 +151,11 @@ void ScXMLSourceDlg::SelectSourceFile()
 if (!aFiles.getLength())
 return;
 
+maSrcPath = aFiles[0];
 // There should only be one file returned from the file picker.
-maFtSourceFile.SetText(aFiles[0]);
+maFtSourceFile.SetText(maSrcPath);
 
-LoadSourceFileStructure(aFiles[0]);
+LoadSourceFileStructure(maSrcPath);
 }
 
 void ScXMLSourceDlg::LoadSourceFileStructure(const OUString rPath)
@@ -163,6 +182,14 @@ void ScXMLSourceDlg::HandleLoseFocus(Control* /*pCtrl*/)
 {
 }
 
+void ScXMLSourceDlg::TreeItemSelected()
+{
+SvLBoxEntry* pEntry = maLbTree.GetCurEntry();
+OUString aName = maLbTree.GetEntryText(pEntry);
+fprintf(stdout, ScXMLSourceDlg::TreeItemSelected:   name = '%s'\n,
+rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr());
+}
+
 IMPL_LINK(ScXMLSourceDlg, GetFocusHdl, Control*, pCtrl)
 {
 HandleGetFocus(pCtrl);
@@ -182,4 +209,10 @@ IMPL_LINK(ScXMLSourceDlg, BtnPressedHdl, Button*, pBtn)
 return 0;
 }
 
+IMPL_LINK_NOARG(ScXMLSourceDlg, TreeItemSelectHdl)
+{
+TreeItemSelected();
+return 0;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-10-03 Thread Libreoffice Gerrit user
 sc/source/filter/orcus/orcusfiltersimpl.cxx |   54 ++--
 sc/source/ui/xmlsource/xmlsourcedlg.cxx |9 
 2 files changed, 51 insertions(+), 12 deletions(-)

New commits:
commit c90b17535f7580f55e670305bd5ca3bbfc0636d3
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Oct 3 09:47:07 2012 -0400

Populate the tree box with real xml structure tree.

Change-Id: Ia91340cee5e25b118ae72a62e0d94cdc976bc14e

diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx 
b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index e5c5507..0afaee4 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -17,6 +17,9 @@
 #define __ORCUS_STATIC_LIB
 #include orcus/spreadsheet/import_interface.hpp
 #include orcus/orcus_csv.hpp
+#include orcus/xml_structure_tree.hpp
+#include orcus/xml_namespace.hpp
+#include orcus/global.hpp
 
 #include boost/ptr_container/ptr_vector.hpp
 
@@ -170,14 +173,59 @@ bool ScOrcusFiltersImpl::importCSV(ScDocument rDoc, 
const OUString rPath) cons
 return true;
 }
 
-bool ScOrcusFiltersImpl::loadXMLStructure(const OUString rPath, 
SvTreeListBox /*rTree*/) const
+void populateTree(SvTreeListBox rTree, orcus::xml_structure_tree::walker 
rWalker, const orcus::xml_structure_tree::element_name rElemName, SvLBoxEntry* 
pParent)
+{
+OUString aName(rElemName.name.get(), rElemName.name.size(), 
RTL_TEXTENCODING_UTF8);
+SvLBoxEntry* pEntry = rTree.InsertEntry(aName, pParent);
+if (pParent)
+rTree.Expand(pParent);
+
+orcus::xml_structure_tree::element_names_type aChildElements;
+rWalker.get_children(aChildElements);
+
+orcus::xml_structure_tree::element_names_type::const_iterator it = 
aChildElements.begin();
+orcus::xml_structure_tree::element_names_type::const_iterator itEnd = 
aChildElements.end();
+for (; it != itEnd; ++it)
+{
+rWalker.descend(*it);
+populateTree(rTree, rWalker, *it, pEntry);
+rWalker.ascend();
+}
+}
+
+bool ScOrcusFiltersImpl::loadXMLStructure(const OUString rPath, 
SvTreeListBox rTree) const
 {
 INetURLObject aURL(rPath);
 OString aSysPath = rtl::OUStringToOString(aURL.getFSysPath(SYSTEM_PATH), 
RTL_TEXTENCODING_UTF8);
 const char* path = aSysPath.getStr();
-fprintf(stdout, ScOrcusFiltersImpl::loadXMLStructure:   path = '%s'\n, 
path);
 
-// TODO: Load the tree box.
+// TODO: Use our own stream loading call instead of one from orcus.
+std::string aStrm;
+orcus::load_file_content(path, aStrm);
+
+if (aStrm.empty())
+return false;
+
+orcus::xmlns_repository aNsRepo; // xml namespace repository.
+orcus::xml_structure_tree aTree(aNsRepo);
+try
+{
+aTree.parse(aStrm[0], aStrm.size());
+}
+catch (const std::exception)
+{
+// Parsing of this XML file failed.
+return false;
+}
+
+rTree.Clear();
+
+orcus::xml_structure_tree::walker aWalker = aTree.get_walker();
+
+// Root element.
+orcus::xml_structure_tree::element aElem = aWalker.root();
+populateTree(rTree, aWalker, aElem.name, NULL);
+
 return true;
 }
 
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx 
b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index e94d132..39ccbe5 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -29,15 +29,6 @@ ScXMLSourceTree::ScXMLSourceTree(Window* pParent, const 
ResId rResId) :
 {
 SetDefaultExpandedEntryBmp(maImgElemDefault);
 SetDefaultCollapsedEntryBmp(maImgElemDefault);
-
-SvLBoxEntry* p = InsertEntry(OUString(Test1));
-p = InsertEntry(OUString(Test2));
-SvLBoxEntry* pPar = p;
-p = InsertEntry(OUString(Test3), p);
-Expand(pPar);
-pPar = p;
-p = InsertEntry(OUString(Test4), p);
-Expand(pPar);
 }
 
 ScXMLSourceDlg::ScXMLSourceDlg(Window* pParent, ScDocument* pDoc) :
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-10-03 Thread Libreoffice Gerrit user
 sc/source/filter/orcus/orcusfiltersimpl.cxx |   32 ++--
 1 file changed, 17 insertions(+), 15 deletions(-)

New commits:
commit 5ccf7847b43018e4afdbac1c94dffe22ab1dabc5
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Oct 3 09:51:52 2012 -0400

A little cleanup.

Change-Id: I04ac6b95fec116f13507f8f012320d522120fef3

diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx 
b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index 0afaee4..b07647b 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -173,12 +173,14 @@ bool ScOrcusFiltersImpl::importCSV(ScDocument rDoc, 
const OUString rPath) cons
 return true;
 }
 
-void populateTree(SvTreeListBox rTree, orcus::xml_structure_tree::walker 
rWalker, const orcus::xml_structure_tree::element_name rElemName, SvLBoxEntry* 
pParent)
+void populateTree(
+   SvTreeListBox rTreeCtrl, orcus::xml_structure_tree::walker rWalker,
+   const orcus::xml_structure_tree::element_name rElemName, SvLBoxEntry* 
pParent)
 {
 OUString aName(rElemName.name.get(), rElemName.name.size(), 
RTL_TEXTENCODING_UTF8);
-SvLBoxEntry* pEntry = rTree.InsertEntry(aName, pParent);
+SvLBoxEntry* pEntry = rTreeCtrl.InsertEntry(aName, pParent);
 if (pParent)
-rTree.Expand(pParent);
+rTreeCtrl.Expand(pParent);
 
 orcus::xml_structure_tree::element_names_type aChildElements;
 rWalker.get_children(aChildElements);
@@ -188,12 +190,12 @@ void populateTree(SvTreeListBox rTree, 
orcus::xml_structure_tree::walker rWalk
 for (; it != itEnd; ++it)
 {
 rWalker.descend(*it);
-populateTree(rTree, rWalker, *it, pEntry);
+populateTree(rTreeCtrl, rWalker, *it, pEntry);
 rWalker.ascend();
 }
 }
 
-bool ScOrcusFiltersImpl::loadXMLStructure(const OUString rPath, 
SvTreeListBox rTree) const
+bool ScOrcusFiltersImpl::loadXMLStructure(const OUString rPath, 
SvTreeListBox rTreeCtrl) const
 {
 INetURLObject aURL(rPath);
 OString aSysPath = rtl::OUStringToOString(aURL.getFSysPath(SYSTEM_PATH), 
RTL_TEXTENCODING_UTF8);
@@ -207,10 +209,18 @@ bool ScOrcusFiltersImpl::loadXMLStructure(const OUString 
rPath, SvTreeListBox
 return false;
 
 orcus::xmlns_repository aNsRepo; // xml namespace repository.
-orcus::xml_structure_tree aTree(aNsRepo);
+orcus::xml_structure_tree aXmlTree(aNsRepo);
 try
 {
-aTree.parse(aStrm[0], aStrm.size());
+aXmlTree.parse(aStrm[0], aStrm.size());
+
+rTreeCtrl.Clear();
+
+orcus::xml_structure_tree::walker aWalker = aXmlTree.get_walker();
+
+// Root element.
+orcus::xml_structure_tree::element aElem = aWalker.root();
+populateTree(rTreeCtrl, aWalker, aElem.name, NULL);
 }
 catch (const std::exception)
 {
@@ -218,14 +228,6 @@ bool ScOrcusFiltersImpl::loadXMLStructure(const OUString 
rPath, SvTreeListBox
 return false;
 }
 
-rTree.Clear();
-
-orcus::xml_structure_tree::walker aWalker = aTree.get_walker();
-
-// Root element.
-orcus::xml_structure_tree::element aElem = aWalker.root();
-populateTree(rTree, aWalker, aElem.name, NULL);
-
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-10-03 Thread Libreoffice Gerrit user
 sc/source/filter/orcus/orcusfiltersimpl.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit a017989394f3e420647678d0b7e8eb882794c6ed
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Oct 3 10:00:36 2012 -0400

Pass the 'repeat' flag of each element too, for recurring elements.

Change-Id: I2d5ad0724b45d448b18a04ec58f5f06c7aa86e2b

diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx 
b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index b07647b..721e5ee 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -175,8 +175,10 @@ bool ScOrcusFiltersImpl::importCSV(ScDocument rDoc, const 
OUString rPath) cons
 
 void populateTree(
SvTreeListBox rTreeCtrl, orcus::xml_structure_tree::walker rWalker,
-   const orcus::xml_structure_tree::element_name rElemName, SvLBoxEntry* 
pParent)
+   const orcus::xml_structure_tree::element_name rElemName, bool bRepeat, 
SvLBoxEntry* pParent)
 {
+// TODO: Make use of bRepeat flag.
+
 OUString aName(rElemName.name.get(), rElemName.name.size(), 
RTL_TEXTENCODING_UTF8);
 SvLBoxEntry* pEntry = rTreeCtrl.InsertEntry(aName, pParent);
 if (pParent)
@@ -189,8 +191,8 @@ void populateTree(
 orcus::xml_structure_tree::element_names_type::const_iterator itEnd = 
aChildElements.end();
 for (; it != itEnd; ++it)
 {
-rWalker.descend(*it);
-populateTree(rTreeCtrl, rWalker, *it, pEntry);
+orcus::xml_structure_tree::element aElem = rWalker.descend(*it);
+populateTree(rTreeCtrl, rWalker, *it, aElem.repeat, pEntry);
 rWalker.ascend();
 }
 }
@@ -220,7 +222,7 @@ bool ScOrcusFiltersImpl::loadXMLStructure(const OUString 
rPath, SvTreeListBox
 
 // Root element.
 orcus::xml_structure_tree::element aElem = aWalker.root();
-populateTree(rTreeCtrl, aWalker, aElem.name, NULL);
+populateTree(rTreeCtrl, aWalker, aElem.name, aElem.repeat, NULL);
 }
 catch (const std::exception)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-10-02 Thread Libreoffice Gerrit user
 sc/source/filter/orcus/orcusfiltersimpl.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit f7fed308a69eeba8fae7b389f1c26a1a6f326b12
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Oct 2 19:46:47 2012 -0400

orcus from master now has a new interface.

Change-Id: I1d03d5dd2b12cdc1eab2d599199c333d49d306b8

diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx 
b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index 7152b68..e5c5507 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -61,6 +61,9 @@ public:
 virtual void set_formula_result(row_t row, col_t col, const char* p, 
size_t n);
 virtual void set_shared_formula(
 row_t row, col_t col, formula_grammar_t grammar, size_t sindex,
+const char* p_formula, size_t n_formula);
+virtual void set_shared_formula(
+row_t row, col_t col, formula_grammar_t grammar, size_t sindex,
 const char* p_formula, size_t n_formula, const char* p_range, size_t 
n_range);
 virtual void set_shared_formula(row_t row, col_t col, size_t sindex);
 virtual void set_string(row_t row, col_t col, size_t sindex);
@@ -122,6 +125,12 @@ void ScOrcusSheet::set_formula_result(row_t /*row*/, col_t 
/*col*/, const char*
 
 void ScOrcusSheet::set_shared_formula(
 row_t /*row*/, col_t /*col*/, formula_grammar_t /*grammar*/, size_t 
/*sindex*/,
+const char* /*p_formula*/, size_t /*n_formula*/)
+{
+}
+
+void ScOrcusSheet::set_shared_formula(
+row_t /*row*/, col_t /*col*/, formula_grammar_t /*grammar*/, size_t 
/*sindex*/,
 const char* /*p_formula*/, size_t /*n_formula*/, const char* /*p_range*/, 
size_t /*n_range*/)
 {
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-09-28 Thread Libreoffice Gerrit user
 sc/source/ui/inc/xmlsourcedlg.hxx |4 +++-
 sc/source/ui/src/xmlsourcedlg.src |2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 82689aece5c8f9e344b71bf849f286252f6cd1b7
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Fri Sep 28 22:34:46 2012 -0400

Pop up a full path in case the path is cut off.

Change-Id: I7a5c1fe86c4162de6d3dec301cbea6299d07212d

diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx 
b/sc/source/ui/inc/xmlsourcedlg.hxx
index 44dd44e..6e32d12 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -15,6 +15,8 @@
 #include vcl/fixed.hxx
 #include svtools/svtreebx.hxx
 
+#include expftext.hxx
+
 #include boost/scoped_ptr.hpp
 
 class ScDocument;
@@ -31,7 +33,7 @@ class ScXMLSourceDlg : public ModalDialog
 {
 FixedLine maFlSourceFile;
 ImageButton maBtnSelectSource;
-FixedText maFtSourceFile;
+ScExpandedFixedText maFtSourceFile;
 
 FixedLine maFtMapXmlDoc;
 
diff --git a/sc/source/ui/src/xmlsourcedlg.src 
b/sc/source/ui/src/xmlsourcedlg.src
index 86f8a7d..f55110b 100644
--- a/sc/source/ui/src/xmlsourcedlg.src
+++ b/sc/source/ui/src/xmlsourcedlg.src
@@ -35,7 +35,7 @@ ModalDialog RID_SCDLG_XML_SOURCE
 FixedText FT_SOURCE_FILE
 {
 Pos = MAP_APPFONT ( 25 , 21 ) ;
-Size = MAP_APPFONT ( 225 , 8 ) ;
+Size = MAP_APPFONT ( 219 , 8 ) ;
 
 Text [ en-US ] = - not set -;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-09-26 Thread Libreoffice Gerrit user
 sc/source/ui/inc/cellsh.hxx   |1 +
 sc/source/ui/view/cellsh1.cxx |5 +
 sc/source/ui/view/cellsh2.cxx |2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit dc94f80727fe18f5e00417b0f23ba09e80d14d6b
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Sep 26 17:41:01 2012 -0400

Separate method to launch xml source dialog.

Change-Id: Iac7898d695cd7659f44944d6615a91d4e2b6a52e

diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index 88043ce..c2f7f01 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -67,6 +67,7 @@ private:
 const String _rSource, sal_uLong _nRefresh, SfxRequest 
_rRequest );
 
 void ExecuteDataPilotDialog();
+void ExecuteXMLSourceDialog();
 void ExecuteSubtotals(SfxRequest rReq);
 
 DECL_LINK( ClipboardChanged, TransferableDataHelper* );
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index a1cdc8c..220896e 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2439,6 +2439,11 @@ void ScCellShell::ExecuteDataPilotDialog()
 }
 }
 
+void ScCellShell::ExecuteXMLSourceDialog()
+{
+fprintf(stdout, ScCellShell::ExecuteXMLSourceDialog:   launch xml 
dialog\n);
+}
+
 void ScCellShell::ExecuteSubtotals(SfxRequest rReq)
 {
 ScTabViewShell* pTabViewShell = GetViewData()-GetViewShell();
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index f1d6395..0370dc4 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -746,7 +746,7 @@ void ScCellShell::ExecuteDB( SfxRequest rReq )
 break;
 
 case SID_MANAGE_XML_SOURCE:
-fprintf(stdout, ScCellShell::ExecuteDB:   
SID_MANAGE_XML_SOURCE\n);
+ExecuteXMLSourceDialog();
 break;
 case FID_VALIDATION:
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-09-26 Thread Libreoffice Gerrit user
 sc/source/ui/src/xmlsourcedlg.src |   19 +++
 1 file changed, 19 insertions(+)

New commits:
commit 558e9b49d0e7bdbf90524a7d72326325a46d849a
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Sep 26 21:06:00 2012 -0400

I forgot to add this.

Change-Id: Idf3600f0194326365e90fbf683cd2133656d3d91

diff --git a/sc/source/ui/src/xmlsourcedlg.src 
b/sc/source/ui/src/xmlsourcedlg.src
new file mode 100644
index 000..7d67abe
--- /dev/null
+++ b/sc/source/ui/src/xmlsourcedlg.src
@@ -0,0 +1,19 @@
+
+/*
+ * 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
+
+ModalDialog RID_SCDLG_XML_SOURCE
+{
+HelpID = sc:ModalDialog:RID_SCDLG_XML_SOURCE;
+Text [ en-US ] = XML Source ;
+Size = MAP_APPFONT ( 250 , 135 ) ;
+Moveable = TRUE ;
+Closeable = TRUE ;
+};
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

2012-09-25 Thread Libreoffice Gerrit user
 sc/source/filter/xml/xmlcelli.cxx |   15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit ee023e0baddf409085304ca534e2327579490699
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Sep 25 19:53:26 2012 -0400

Leave the formula cell dirty when a cached result is not given.

This sometimes is the case especially with hand-crafted flat ODS.

Change-Id: I0db374e424b250bcded526149ed2c27aabc3d722

diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index 3b6ca50..f82738c 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -135,6 +135,8 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( 
ScXMLImport rImport,
 bSolarMutexLocked(false),
 bFormulaTextResult(false)
 {
+rtl::math::setNan(fValue); // NaN by default
+
 rXMLImport.SetRemoveLastChar(false);
 rXMLImport.GetTables().AddColumn(bTempIsCovered);
 const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList-getLength() : 0;
@@ -732,10 +734,17 @@ void 
ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const
 if(pFCell)
 {
 if( bFormulaTextResult  pOUTextValue )
+{
 pFCell-SetHybridString( *pOUTextValue );
-else
-pFCell-SetHybridDouble( fValue );
-pFCell-ResetDirty();
+pFCell-ResetDirty();
+}
+else if (!rtl::math::isNan(fValue))
+{
+pFCell-SetHybridDouble(fValue);
+pFCell-ResetDirty();
+}
+
+// Leave the cell dirty when the cached result is not given.
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits