Re: [Libreoffice] [PUSHED] partial patch for fdo#44551 libvisio: arrow head shapes not imported properly

2012-01-31 Thread Bruno Girin

On 31/01/12 11:22, Fridrich Strba wrote:

Hello, Bruno

On 31/01/12 00:35, Bruno Girin wrote:

Please find attached a partial patch to import line marker shapes from
Visio files. I would appreciate a review to confirm whether I am on the
right path or whether I should do something different.


Yes, currently this is the best approach to fill in for each id the 
right viewbox and path. I will have to find a way to parse it for the 
svg generation, but that is another question. That was an issue with 
the initial implementation too, but nothing unsolvable either.


Fine, I'll keep working on the remaining 40-odd IDs and may pick your 
brain at FOSDEM if I get stuck on any of them.


Cheers,

Bruno

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [REVIEW] partial patch for fdo#44551 libvisio: arrow head shapes not imported properly

2012-01-30 Thread Bruno Girin

Hi all,

Please find attached a partial patch to import line marker shapes from 
Visio files. I would appreciate a review to confirm whether I am on the 
right path or whether I should do something different.


Thanks,

Bruno

From cf68600551d3a1d88c7daaa9f2dc8f09afdb7481 Mon Sep 17 00:00:00 2001
From: Bruno Girin brunogi...@gmail.com
Date: Mon, 30 Jan 2012 23:31:47 +
Subject: [PATCH] Partial patch for fdo#44551

---
 src/lib/VSDXContentCollector.cpp |   52 +
 src/lib/VSDXContentCollector.h   |3 ++
 2 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/src/lib/VSDXContentCollector.cpp b/src/lib/VSDXContentCollector.cpp
index 2a4b36f..ee0fff0 100644
--- a/src/lib/VSDXContentCollector.cpp
+++ b/src/lib/VSDXContentCollector.cpp
@@ -451,15 +451,55 @@ void libvisio::VSDXContentCollector::_lineProperties(double strokeWidth, Colour
   // Deal with line markers (arrows, etc.)
   if (startMarker  0)
   {
-m_styleProps.insert(draw:marker-start-viewbox, 0 0 20 30);
-m_styleProps.insert(draw:marker-start-path, m10 0-10 30h20z);
-m_styleProps.insert(draw:marker-start-width, m_scale*(0.1/(strokeWidth*strokeWidth+1)+2.54*strokeWidth));
+m_styleProps.insert(draw:marker-start-viewbox, _linePropertiesMarkerViewbox(startMarker));
+m_styleProps.insert(draw:marker-start-path, _linePropertiesMarkerPath(startMarker));
+m_styleProps.insert(draw:marker-start-width, m_scale*(0.1/(strokeWidth*strokeWidth+1)+_linePropertiesMarkerWidth(startMarker)*strokeWidth));
   }
   if (endMarker  0)
   {
-m_styleProps.insert(draw:marker-end-viewbox, 0 0 20 30);
-m_styleProps.insert(draw:marker-end-path, m10 0-10 30h20z);
-m_styleProps.insert(draw:marker-end-width, m_scale*(0.1/(strokeWidth*strokeWidth+1)+2.54*strokeWidth));
+m_styleProps.insert(draw:marker-end-viewbox, _linePropertiesMarkerViewbox(endMarker));
+m_styleProps.insert(draw:marker-end-path, _linePropertiesMarkerPath(endMarker));
+m_styleProps.insert(draw:marker-end-width, m_scale*(0.1/(strokeWidth*strokeWidth+1)+_linePropertiesMarkerWidth(endMarker)*strokeWidth));
+  }
+}
+
+const char *libvisio::VSDXContentCollector::_linePropertiesMarkerViewbox(unsigned marker)
+{
+  switch (marker)
+  {
+case 2:
+  return 0 0 20 10;
+case 4:
+case 11:
+  return 0 0 20 20;
+default:
+  return 0 0 20 30;
+  }
+}
+
+const char *libvisio::VSDXContentCollector::_linePropertiesMarkerPath(unsigned marker)
+{
+  switch (marker)
+  {
+case 2:
+  return m10 0-10 10h20z;
+case 4:
+  return m10 0-10 20h20z;
+case 11:
+  return m0 0l10 0l0 10l-10 0z;
+default:
+  return m10 0-10 30h20z;
+  }
+}
+
+double libvisio::VSDXContentCollector::_linePropertiesMarkerWidth(unsigned marker)
+{
+  switch (marker)
+  {
+case 11:
+  return 1.27;
+default:
+  return 2.54;
   }
 }
 
diff --git a/src/lib/VSDXContentCollector.h b/src/lib/VSDXContentCollector.h
index bfd362e..9261e60 100644
--- a/src/lib/VSDXContentCollector.h
+++ b/src/lib/VSDXContentCollector.h
@@ -173,6 +173,9 @@ private:
 
   void _applyLinePattern();
   void _lineProperties(double strokeWidth, Colour c, unsigned linePattern, unsigned startMarker, unsigned endMarker, unsigned lineCap);
+  const char *_linePropertiesMarkerViewbox(unsigned marker);
+  const char *_linePropertiesMarkerPath(unsigned marker);
+  double _linePropertiesMarkerWidth(unsigned marker);
   void _fillAndShadowProperties(unsigned colourIndexFG, unsigned colourIndexBG, unsigned fillPattern,
 unsigned fillFGTransparency, unsigned fillBGTransparency,
 unsigned shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY);
-- 
1.7.5.4

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] Compiling question by a complete beginner

2012-01-22 Thread Bruno Girin

On 21/01/12 20:49, Bar?s, Akkurt wrote:
Hi, I'm a complete beginner in LibreOffice development and at the 
compiling step now. I tried instructions here: 
http://wiki.documentfoundation.org/Development/Native_Build But 
compilation failed while building the moz module. I tried instructions 
here: https://www.libreoffice.org/bugzilla/show_bug.cgi?id=39852 but 
the result is the same.


Then, i found this blog post and restarted compilation from the 
beginning: 
http://www.vogella.de/blog/2011/02/10/how-to-compile-libreoffice/ I 
got an error about helpcontent2.


Error message:
---
ERROR: error 65280 occurred while making 
/home/baris/libo/helpcontent2/source/auxiliary


 it seems that the error is inside 'helpcontent2', please re-run build
 inside this module to isolate the error and/or test your fix:
---

rm -Rf /home/baris/libo/helpcontent2/unxlngi6.pro 
http://unxlngi6.pro # optional module 'clean'

/bin/bash
cd /home/baris/libo
source ./Env.Host.sh http://Env.Host.sh
cd helpcontent2
build

when the problem is isolated and fixed exit and re-run 'make' from the 
top-level

---
I tried ./autogen.sh --with-languages and ./download and the commands 
above but, result is negative. I have directories such as artwork, 
base, calc in clone directory but i have no l10n directory there.


By the way, second way of compilation took 20 hours until the error. 
Isn't this a bit long? The first one took only 8-9 hours.


I'm using Ubuntu 11.04. Do you have any suggestions? Thanks, in advance.


Hi Baris,

I had exactly the same problem with Ubuntu 11.10 and it appears that for 
some reason moz doesn't build on Ubuntu. This was reported on this list 
in October: 
http://lists.freedesktop.org/archives/libreoffice/2011-October/019597.html


Now considering that moz is used for macro security settings and digital 
signatures, it's not essential to build it in order to have a working 
build. You can disable it as explained here: 
http://wiki.documentfoundation.org/Development/Native_Build#Disable_mozilla


In my case for instance, I run the following to get it to build:
./autogen.sh --with-num-cpus=4 --disable-mozilla

Happy building!

Bruno



___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] libvisio: how can I help?

2012-01-15 Thread Bruno Girin

On 12/01/12 08:14, Fridrich Strba wrote:
1) I install the git versions of libwpd/libwpg/libwps/libvisio (and 
libcdr for master builds) in the usual system prefix. For my 64-bit 
system it is --prefix=/usr --libdir=/usr/lib64


Would anybody be able to tell me where I can find the git repos for 
libwpd, libwpg and libwps please?


Thanks,

Bruno

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] libvisio: simple fix to prevent startMarker from disabling endMarker when both are non-zero

2012-01-15 Thread Bruno Girin

Hi all,

It appears that in libvisio, if a line has a start arrow, the end arrow 
gets ignored. You'll find attached a simple patch that fixes this.


Cheers,

Bruno

From f794fdd967d2eb9a9cd5d4d0fb16a1d19f65f168 Mon Sep 17 00:00:00 2001
From: Bruno Girin brunogi...@gmail.com
Date: Sun, 15 Jan 2012 16:25:12 +
Subject: [PATCH] Check endMarker even if startMarker is set

---
 src/lib/VSDXContentCollector.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lib/VSDXContentCollector.cpp b/src/lib/VSDXContentCollector.cpp
index 2851d3f..db9a02a 100644
--- a/src/lib/VSDXContentCollector.cpp
+++ b/src/lib/VSDXContentCollector.cpp
@@ -455,7 +455,7 @@ void libvisio::VSDXContentCollector::_lineProperties(double strokeWidth, Colour
 m_styleProps.insert(draw:marker-start-path, m10 0-10 30h20z);
 m_styleProps.insert(draw:marker-start-width, m_scale*0.118);
   }
-  else if (endMarker  0)
+  if (endMarker  0)
   {
 m_styleProps.insert(draw:marker-end-viewbox, 0 0 20 30);
 m_styleProps.insert(draw:marker-end-path, m10 0-10 30h20z);
-- 
1.7.5.4

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] libvisio: how can I help?

2012-01-11 Thread Bruno Girin

On 11/01/12 09:44, Fridrich Strba wrote:


Now, I just pushed a fix for some diagrams not having borders in 
shapes where the borders should be. Like the sample Brainstm.vsd. 
When/if I have time, I will try to go through your bugs and try to fix 
what can be fixable.


I saw you had a look at all of the bugs I filed. Thanks for the 
feedback! I will have a go at progressing the arrowhead ones (#44551 and 
#44576) and the pattern one (#44552).


Having said this, it raises a newby question: I have a git clone of the 
LO code in one folder and a git clone of the libvisio code in another. 
What is the simplest way to build and run LO so that it uses the 
libvisio library I'm working on rather than the one that came with it so 
that I can test my fixes?






Any chance you can be on IRC during CET day?

I wish but no. The job that pays the bills keeps me busy during the day,
UK time, and doesn't let me use any software that's not part of the
organisation's standard build.


There is always this possibility http://webchat.freenode.net/ for 
people being behind firewalls and inflexible administrators :)


I will try but my admins also blacklist a number of web sites :-)




I'll try to find my way and will drop you a note if I struggle. Worst
case scenario, I hope I'll see you at FOSDEM in a few weeks so I may
take the opportunity to ask a few questions then.


Wonderful! I look forward to meeting you. I am intending to make a 
small hands-on presentation/workshop about import filters. I would 
like to use the upcomming Corel Draw library (or if I have time to 
start the MS Publisher library) to show how easy it is to start 
working on filters using writerperfect framework.


In preparation, I plan to write a serie of blog entries about some 
basics about LO import/export filters. Let us see whether the Lord 
gives me enough time for that.


Please, keep testing, it is invaluable


No worries, I've got lots of testing material!

Bruno

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] libvisio: how can I help?

2012-01-09 Thread Bruno Girin

On 09/01/12 11:12, Fridrich Strba wrote:

Hello,

On 09/01/12 11:24, Michael Meeks wrote:

  I would like to start tackling some of them but as I'm not familiar
with the code base, I would welcome suggestions as to which ones are
likely to be reasonably easy hacks.

I'm not an expert on this - so treat this with a pinch of salt, until
Fridrich arrives ;-) From what I recall, most of Fridrich's filters
essentially generate SAX style events and these are rendered onto the
libwpg::WPGPaintInterface 'painter' - which in turn generates ODF.
So - to extend it; I'd save your broken document as flat ODF: a.fodg,
then tweak it to be the document it should be and re-save as b.fodg.
When you diff -u these two files you should see the elements and
attributes that have changed.
Armed with that, I'd poke at the libvisio code and the
WPGPaintInterface to see how it converts that good stuff, and the
attributes / elements associated with that  extend the code to handle
your cases.

Reasonably accurate account, given that Michael is a real novice in this
realm of spirit.

But, let me give a quick overview of libvisio architecture:

1) Two main api fuctions principally in VisioDocument.h:
a) isSupported
b) parse
One convenience function in the same header:
c) generateSVG

2) VSDXParser class is the base class for reading the documents.
VSD6Parser and VSD11Parser are derived classes that cater for
differences between the two formats.

3) Document is read twice and the reader classes call functions of the
VSDXCollector interface, first using the VSDXStylesCollector and second
time using the VSDXContentCollector to receive the information.

4) VSDXContentCollector is processing information received from parser
along with information collected by the VSDXStylesCollector and calling
the callbacks from the libwpg::WPGPaintInterface.

5) Some complications given the need to first store some elements of a
shape into memory and then output them using the information about in
which order they should be painted.


Thanks for the explanations, that's really useful!


Now, if you have cases of shapes that are not correctly converted, the
best is to take the document, copy it and try to create a minumum
document that still exhibits the problem. Then we can together
introspect it and try to find the reasons of that misbehaviour. Like
that I can help you to get into the logic of the file-format.


Thanks. Minimal examples will be useful anyway so I'll try to produce some.


Any chance you can be on IRC during CET day?


I wish but no. The job that pays the bills keeps me busy during the day, 
UK time, and doesn't let me use any software that's not part of the 
organisation's standard build.


I'll try to find my way and will drop you a note if I struggle. Worst 
case scenario, I hope I'll see you at FOSDEM in a few weeks so I may 
take the opportunity to ask a few questions then.


Bruno

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] libvisio: how can I help?

2012-01-08 Thread Bruno Girin

On 03/01/12 22:29, Bruno Girin wrote:

On 03/01/12 21:34, Fridrich Strba wrote:

Hello, Bruno,

If you are looking at something cool to do inside libvisio, I might 
have an idea or two :)


For the while, libvisio is converting binary MS Visio files in 
versions 6 (Visio 2000 and 2002) and 11 (Visio 2003 - 2010). There 
is another format that Visio can export to, and it is the XML version 
called also VDX. This file-format is specified (contrary to the 
binary one). If you could come with an abstract SAX interface and 
implement a parser of this file-format, it would fill some gap we 
have. But any bugfix is welcome.


Hi Fridrich,

Yes, I had a look at the VDX spec last year and it is indeed well 
documented and reasonably straight-forward, although there are 
difference between the 2003, 2007 and 2010 versions as far as I 
remember. I assume that all classes prefixed VSDX were designed to 
support both VSD and VDX and therefore should be shared between both 
types of parser?


I'd be very interested in working on that but in order not to 
over-commit myself and to get familiar with the code, I'll probably 
start with some tests and simple bug reports / patches.


I've been doing some tests with sample Visio files and I've now added a 
grand total of 7 bug reports [1]. I would like to start tackling some of 
them but as I'm not familiar with the code base, I would welcome 
suggestions as to which ones are likely to be reasonably easy hacks.


[1] 
https://bugs.freedesktop.org/buglist.cgi?query_format=advancedcomponent=Drawingproduct=LibreOfficeshort_desc=Libvisioshort_desc_type=allwordssubstrlist_id=31438


Cheers,

Bruno

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] libvisio: how can I help?

2012-01-03 Thread Bruno Girin

Hi all,

I discovered the existence of libvisio [1] while building LibO this 
morning. So first I'd like to thank Fridrich and Eilidh for the code and 
then I'd like to know: how can I help? I'm happy to work on code or test 
cases: I use Visio all the time at work so I often have weird and 
wonderful diagrams that I can feed through the parser.


[1] http://www.freedesktop.org/wiki/Software/libvisio

Cheers,

Bruno

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] libvisio: how can I help?

2012-01-03 Thread Bruno Girin

On 03/01/12 21:34, Fridrich Strba wrote:

Hello, Bruno,

If you are looking at something cool to do inside libvisio, I might 
have an idea or two :)


For the while, libvisio is converting binary MS Visio files in 
versions 6 (Visio 2000 and 2002) and 11 (Visio 2003 - 2010). There is 
another format that Visio can export to, and it is the XML version 
called also VDX. This file-format is specified (contrary to the binary 
one). If you could come with an abstract SAX interface and implement a 
parser of this file-format, it would fill some gap we have. But any 
bugfix is welcome.


Hi Fridrich,

Yes, I had a look at the VDX spec last year and it is indeed well 
documented and reasonably straight-forward, although there are 
difference between the 2003, 2007 and 2010 versions as far as I 
remember. I assume that all classes prefixed VSDX were designed to 
support both VSD and VDX and therefore should be shared between both 
types of parser?


I'd be very interested in working on that but in order not to 
over-commit myself and to get familiar with the code, I'll probably 
start with some tests and simple bug reports / patches.





Although in vacation, when I see that someone is interested to work on 
libvisio, I wake up to the e-mail writing mode :)


I know the feeling :-)


A small missing piece, libvisio's git repo is here:

http://cgit.freedesktop.org/libreoffice/contrib/libvisio/

Looking forward to the patches! :-)

Regards,
Kendy


Thanks Kendy!

Cheers,

Bruno

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice