[Libreoffice-commits] help.git: Changes to 'refs/remotes/origin/feature/layout'

2014-09-29 Thread Timo Richter

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: [Libreoffice] [GSoC] conversion program

2011-10-20 Thread Timo
Hi everybody,

I give you these criticism as a hint about my conversion program that I
created as a gsoc project. If you want anything to change, please
contact me.
- Start pages defined via --startpage are applied for all CHM files.
This might conflict with the idea of language separation inside CHM
files.
- My program applies bugfixes on mwlib dynamically. I have not tested
what happens if the mwlib project adds my bugfixes to their standard
version.
- According to the mwlib mailing list, Arabic and Hebrew are not yet
supported. But at this time these languages are being implemented.
- The index list consists of keywords. You can find it in the index tab
of your CHM browser or Yelp. All page titles have been marked as
keywords but it is also possible to mark more or other words as keywords
for the index tab.
- CHM is being compiled with a nonfree external compiler from Microsoft.
Where do you want to go today? To solve this bug it is a very good idea
to implement our own chm compiler. Because wine would not have to be
used, the whole program would be faster.

Nevertheless the conversion program does what it should.


Timo


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


[Libreoffice] [GSoC] [helpfiles] Report

2011-07-09 Thread Timo
Dear everbody,

Andras gave me a helpful feedback about my program. Because of that I
discovered some issues and added them to my list. There are several
things which need to be done. (see below)

So far I fixed some bugs in my convert.py. Also I implemented the
feature to set a custom start page. The execution of wine works better
now because it restores the user´s settings after it´s done.

This is my todo-list:
Set correct article titles
 - getArtNames shall add the translated titles to its output
 - Replacement of titles in docbook.xml
Create a docbook for each language
 - getArtNames shall create a list ordered by language
Change the layout of output to title + hr + content.
 - Set another stylesheet for xslt
Make wine optional. On windows prefer direct execution of HHC.
Avoid creation of links to external foreign sites
Include images in page titles
Implement index creation
 - Maybe switch to a framework that does that for me
 - Might be important for the feature that the help file opens correctly
and at the correct place on each platform.
Improve the usage of convert.py
 - Accept command line parameters


Cheers,

Timo


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


[Libreoffice] [GSoC] [helpfiles] commit

2011-07-01 Thread Timo
Hello everybody,

this is what I have done in the meantime. I implemented a program that
converts an xml to chm and docbook. Here is the draft.* Also here is the
installer that installs HTML Help Compiler on wine. Because the native
install file doesnt work on wine, this program does the installation.

In the future I will extend the usage of convert.py so that it is
possible to enter in- and output as a parameter. Also I like to make
sure that OSX and Yelp create their indexes. This is probably neccessary
for the next step. Combine the help and LibreOffice so that the help
file opens correctly and at the correct place on each platform.


Best wishes,

Timo


* see attachment

From 3df28aaa3c414d06e3283479f9f1f8fc0cca9f9d Mon Sep 17 00:00:00 2001
From: timo t...@pc1.org
Date: Fri, 1 Jul 2011 16:56:18 +0200
Subject: [PATCH] Committer: timo t...@iera.de 	new file:  
 wiki-to-help/HHC/htmlhelp.reg 	new file:  
 wiki-to-help/HHC/install_hhc.sh 	new file:  
 wiki-to-help/convert.py 	new file:  
 wiki-to-help/test2.xml

My files contain a list of its dependencies in their heads.
HHC/install_hhc.sh should be run first. convert.py converts test2.xml into several formats to test/
---
 helpcontent2/wiki-to-help/HHC/htmlhelp.reg   |   12 +
 helpcontent2/wiki-to-help/HHC/install_hhc.sh |   60 
 helpcontent2/wiki-to-help/convert.py |  133 +
 helpcontent2/wiki-to-help/test2.xml  |  381 ++
 4 files changed, 586 insertions(+), 0 deletions(-)
 create mode 100644 helpcontent2/wiki-to-help/HHC/htmlhelp.reg
 create mode 100755 helpcontent2/wiki-to-help/HHC/install_hhc.sh
 create mode 100755 helpcontent2/wiki-to-help/convert.py
 create mode 100644 helpcontent2/wiki-to-help/test2.xml

diff --git a/helpcontent2/wiki-to-help/HHC/htmlhelp.reg b/helpcontent2/wiki-to-help/HHC/htmlhelp.reg
new file mode 100644
index 000..e38e0ef
--- /dev/null
+++ b/helpcontent2/wiki-to-help/HHC/htmlhelp.reg
@@ -0,0 +1,12 @@
+REGEDIT4
+
+[HKEY_CURRENT_USER\Software\Wine]
+Version=win2k
+
+[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides]
+itircl=native
+itss=native
+
+[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides]
+itircl=native
+itss=native
diff --git a/helpcontent2/wiki-to-help/HHC/install_hhc.sh b/helpcontent2/wiki-to-help/HHC/install_hhc.sh
new file mode 100755
index 000..ba93c78
--- /dev/null
+++ b/helpcontent2/wiki-to-help/HHC/install_hhc.sh
@@ -0,0 +1,60 @@
+#!/bin/bash -e
+# -e  Exit immediately if a command exits with a non-zero status.
+
+# This installs Microsofts HHC (HTML Help Compiler)
+# Copyright 2011 Timo Richter and others.
+# Licensed under GNU GPLv3
+# Depends on: wine, wget, cabextract
+#
+# Usage of HHC: wine c:\\htmlhelp\\hhc.exe c:\\test\\htmlhelp.hhp
+#
+# Changes:  Set installation directory to c:\htmlhelp
+#   Copy also itcc.dll, this is neccessary
+#   No execution of htmlhelp.exe installer needed
+#   Abortion of install if anything fails, e.g. the download of HHC.
+#
+
+echo Please wait
+
+cd $(dirname $0) # cd to path of this script
+
+
+WINEPREFIX=${WINEPREFIX:=$HOME/.wine}
+test -d $WINEPREFIX || wineprefixcreate 2 /dev/null
+HHDIR=${WINEPREFIX}/dosdevices/c:/htmlhelp
+mkdir $HHDIR
+
+# Setup the registry
+# Set Wine's Windows version to Windows 2000 (or above), and add an override to use the native itss.dll, both via winecfg.
+wine regedit htmlhelp.reg
+
+cd $HHDIR
+
+# Install HTML Help Workshop
+wget -O htmlhelp.exe 'http://go.microsoft.com/fwlink/?LinkId=14188'
+cabextract -F hhc.exe htmlhelp.exe
+cabextract -F HHA.dll htmlhelp.exe
+
+# Install ITSS.DLL
+cabextract -F hhupd.exe htmlhelp.exe
+cabextract -F itircl.dll hhupd.exe
+cabextract -F itss.dll hhupd.exe
+cabextract -F itcc.dll htmlhelp.exe
+cp -a itircl.dll $WINEPREFIX/drive_c/windows/system32/
+cp -a itcc.dll $WINEPREFIX/drive_c/windows/system32/
+cp -a itss.dll $WINEPREFIX/drive_c/windows/system32/
+wine regsvr32 'C:\WINDOWS\SYSTEM32\itcc.dll'
+wine regsvr32 'C:\WINDOWS\SYSTEM32\itircl.dll'
+wine regsvr32 'C:\WINDOWS\SYSTEM32\itss.dll'
+
+# Install MFC40.DLL
+wget -N http://activex.microsoft.com/controls/vc/mfc40.cab
+cabextract -F mfc40.exe mfc40.cab
+cabextract -F mfc40.dll mfc40.exe
+cp -a mfc40.dll $WINEPREFIX/drive_c/windows/system32/
+
+echo
+echo Done.
+
+exit 0
+
diff --git a/helpcontent2/wiki-to-help/convert.py b/helpcontent2/wiki-to-help/convert.py
new file mode 100755
index 000..5e3e400
--- /dev/null
+++ b/helpcontent2/wiki-to-help/convert.py
@@ -0,0 +1,133 @@
+#!/usr/bin/env python
+
+Convert an XML-Dump to platformspecific help files.
+Copyright 2011 Timo Richter
+Licensed under GNU GPLv3
+
+This program depends on:
+mwlib
+python
+python-lxml
+xsltproc
+Microsoft HHC: http://go.microsoft.com/fwlink/?LinkId=14188
+
+
+
+
+import xml.dom.minidom as minidom
+import subprocess, tempfile, os, shutil
+
+class Wine(object):
+#driveletter=j: #final
+
+def __init__(self,workingDir,driveletter):
+ Setup the wine

[Libreoffice] Report [GSoC] [helpfiles]

2011-06-01 Thread Timo
Hello everybody,

this is what I have done since the last report:
- Used HTML Help Compiler (HHC) to create a CHM-file.
- Implemented a bash script that installs HHC with wine. With this
script the HH-Compiler is platform independent. Bash and wine binaries
exist for many platforms.

These are the tasks for the future:
- Test the conversions to CHM with the real libreoffice help. That
computer will take long.
- Implement the conversion to html

At the moment I am stuck using mwlib to create docbook files. I can pass
the names of articles to mwlib´s executable. Those articles will be
converted. Either I need to find a quick way to select all articles or I
create an algorithm. The algorithm shall parse the xmldump and make a
list of all article names. At the moment I aim to search the mwlib code
and find a way.


Best wishes,

Timo



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


[Libreoffice] Report [GSoC] [helpfiles]

2011-05-22 Thread Timo
Hello everybody,

this is what I have done so far:
- Searched several libraries that parse wikicode
- Used a python library which parses wikisyntax
- Used a python library which outputs docbook-files
- Discovered an implementation of CHM-Compiler in freepascal

These are the tasks for the future:
- Implement bindings between the freepascal-CHM-Compiler and a modern
object orientated programming language
- Depending on the complexity of used libraries, implement classes for
the help converter
- Implement the conversion to CHM
- Implement the conversion to html
- Testing and documentation


Best wishes,

Timo


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


[Libreoffice] Online help [GSoC] [helpfiles]

2011-05-15 Thread Timo
Hello,

I would like to have access to the api of the online help mediawiki. The
API looks like this: http://wiki.services.openoffice.org/w/api.php
How can I reach this on http://help.libreoffice.org/?


Regards,

Timo


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


[Libreoffice] [GSoC] Report

2011-05-05 Thread Timo
Hi,

this week I am very busy because of the university. I will work on next
week.


Regards,

Timo


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


Re: [Libreoffice] [Patch] Re: complete

2011-04-25 Thread Timo
Updated Laurent`s eMail address in MsgBox.

Am Mittwoch, den 20.04.2011, 23:51 +0200 schrieb Timo:
 Hi,
 
 I don´t know where the master is and how the scp2-directory works. Here
 is a diff from debians mailmerge.py. mailmerge.py.diff is licensed under
 LGPLv3+. The license text for MsgBox is inside the file.
 Within debian libreoffice obviously never uses the built in python. 
 Note that now python errors are displayed twice on the GNU OS. I suggest
 that libreoffice shall be modified so that there will be only one
 message. Also once upon a time an error box shall be implemented in
 pythonscript.py so that it can be used for python errors from all
 plugins. 
 
 
 regards,
 
 Timo
 
 
 
 
 Am Mittwoch, den 20.04.2011, 15:48 +0100 schrieb Michael Meeks:
  Hi Timo,
  
  On Thu, 2011-04-14 at 17:50 +0200, Timo wrote:
   Maybe this task should be moved to “completed”?
   http://wiki.documentfoundation.org/Easy_Hacks#Make_python_.2F_mail-merge_debuggable
  
  I read your last mail, and I was not certain that it is working :-) so
  sadly the code didn't get merged.
  
  Do you think you could re-send your code as a patch vs. master: with
  the new msgbox.py file added ? we should also have a patch for scp2/ to
  install the new python file too (git grep for mailmerge.py in there).
  Also good to add [PATCH] to the Subject to get some priority review :-)
  [ also confirm the LGPLv3+/MPL license ].
  
MessageBoxButtons as well as XSCRIPTCONTEXT do not exist for me. Python
doesn´t find them and they are documented as “not published” [1]. 
  
  Did you get over this ? presumably you are running this using the
  python embedded with libreoffice, rather than some external python ?
  
[3] see screenshot Bildschirmfoto.png
  
  Looks nice :-)
  
  Great work,
  
  Michael.
  
 
 ___
 LibreOffice mailing list
 LibreOffice@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/libreoffice

43a45,49
 from com.sun.star.awt import WindowDescriptor
 from com.sun.star.awt.WindowClass import MODALTOP
 import MsgBox
 
47a54,69
 def showError(ctx,text):
 		box = MsgBox.MsgBox(ctx)
 		box.addButton(OK)
 		box.renderFromBoxSize(400)
 		box.numberOfLines = 10
 		box.show(text,0,Error)
 		exit(1)	
 
225,226c247,257
 
 		self.server.sendmail(sendermail, truerecipients, msg.as_string())
---
 		
 		try:
 			self.server.sendmail(sendermail, truerecipients, msg.as_string())
 		except smtplib.SMTPRecipientsRefused as inst:
 			msg = 
 			for key,val in inst.recipients.iteritems():
 msg+=val[1]+\n
 			showError(self.ctx,msg)
 		except Exception as inst:
 			showError(self.ctx,str(inst))
 		#except smtplib.SMTPException:
# -*- encoding: iso-8859-15 -*-
#
#   The Contents of this file are made available subject to the terms of
#   the following license
#
#  - GNU Lesser General Public License Version 2.1
#
#   GNU Lesser General Public License Version 2.1
#   =
#   Copyright 2005 by Sun Microsystems, Inc.
#   901 San Antonio Road, Palo Alto, CA 94303, USA
#
#   This library is free software; you can redistribute it and/or
#   modify it under the terms of the GNU Lesser General Public
#   License version 2.1, as published by the Free Software Foundation.
#
#   This library is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#   Lesser General Public License for more details.
#
#   You should have received a copy of the GNU Lesser General Public
#   License along with this library; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
#   MA  02111-1307  USA
#
#
#   The Initial Developer of the Original Code is: Laurent Godard listes.god...@laposte.net
#   All Rights Reserved.
#
#   Contributor(s): 
#   
#*

#prepare pythoin environnement - Add the path of this class
from os import path
from sys import modules
from sys import path as syspath
#print modules
#the_path = path.dirname (path.abspath (modules[__main__].__file__))
#print the_path
#print syspath

#pyUNO program itself
import uno, unohelper

# UNO GUI toolkit
from com.sun.star.awt.WindowClass import TOP, SIMPLE
from com.sun.star.awt.PushButtonType import STANDARD as standard
from com.sun.star.awt.PushButtonType import OK as ok
from com.sun.star.awt.PushButtonType import CANCEL as cancel
from com.sun.star.awt.PushButtonType import HELP as help
from com.sun.star.awt.TextAlign import CENTER as center
from com.sun.star.awt.TextAlign import LEFT as left
from com.sun.star.awt.TextAlign import RIGHT as right

# used UNO listeners
from com.sun.star.awt import XActionListener

class MsgBox(unohelper.Base):
Inspect UNO object, link to sdk and recusrsive calls

def __init__(self

[Libreoffice] [Patch] Re: complete

2011-04-20 Thread Timo
Hi,

I don´t know where the master is and how the scp2-directory works. Here
is a diff from debians mailmerge.py. mailmerge.py.diff is licensed under
LGPLv3+. The license text for MsgBox is inside the file.
Within debian libreoffice obviously never uses the built in python. 
Note that now python errors are displayed twice on the GNU OS. I suggest
that libreoffice shall be modified so that there will be only one
message. Also once upon a time an error box shall be implemented in
pythonscript.py so that it can be used for python errors from all
plugins. 


regards,

Timo




Am Mittwoch, den 20.04.2011, 15:48 +0100 schrieb Michael Meeks:
 Hi Timo,
 
 On Thu, 2011-04-14 at 17:50 +0200, Timo wrote:
  Maybe this task should be moved to “completed”?
  http://wiki.documentfoundation.org/Easy_Hacks#Make_python_.2F_mail-merge_debuggable
 
   I read your last mail, and I was not certain that it is working :-) so
 sadly the code didn't get merged.
 
   Do you think you could re-send your code as a patch vs. master: with
 the new msgbox.py file added ? we should also have a patch for scp2/ to
 install the new python file too (git grep for mailmerge.py in there).
 Also good to add [PATCH] to the Subject to get some priority review :-)
 [ also confirm the LGPLv3+/MPL license ].
 
   MessageBoxButtons as well as XSCRIPTCONTEXT do not exist for me. Python
   doesn´t find them and they are documented as “not published” [1]. 
 
   Did you get over this ? presumably you are running this using the
 python embedded with libreoffice, rather than some external python ?
 
   [3] see screenshot Bildschirmfoto.png
 
   Looks nice :-)
 
   Great work,
 
   Michael.
 

43a45,49
 from com.sun.star.awt import WindowDescriptor
 from com.sun.star.awt.WindowClass import MODALTOP
 import MsgBox
 
47a54,69
 def showError(ctx,text):
 		box = MsgBox.MsgBox(ctx)
 		box.addButton(OK)
 		box.renderFromBoxSize(400)
 		box.numberOfLines = 10
 		box.show(text,0,Error)
 		exit(1)	
 
225,226c247,257
 
 		self.server.sendmail(sendermail, truerecipients, msg.as_string())
---
 		
 		try:
 			self.server.sendmail(sendermail, truerecipients, msg.as_string())
 		except smtplib.SMTPRecipientsRefused as inst:
 			msg = 
 			for key,val in inst.recipients.iteritems():
 msg+=val[1]+\n
 			showError(self.ctx,msg)
 		except Exception as inst:
 			showError(self.ctx,str(inst))
 		#except smtplib.SMTPException:
# -*- encoding: iso-8859-15 -*-
#
#   The Contents of this file are made available subject to the terms of
#   the following license
#
#  - GNU Lesser General Public License Version 2.1
#
#   GNU Lesser General Public License Version 2.1
#   =
#   Copyright 2005 by Sun Microsystems, Inc.
#   901 San Antonio Road, Palo Alto, CA 94303, USA
#
#   This library is free software; you can redistribute it and/or
#   modify it under the terms of the GNU Lesser General Public
#   License version 2.1, as published by the Free Software Foundation.
#
#   This library is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#   Lesser General Public License for more details.
#
#   You should have received a copy of the GNU Lesser General Public
#   License along with this library; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
#   MA  02111-1307  USA
#
#
#   The Initial Developer of the Original Code is: Laurent Godard lgod...@indesko.com
#   All Rights Reserved.
#
#   Contributor(s): 
#   
#*

#prepare pythoin environnement - Add the path of this class
from os import path
from sys import modules
from sys import path as syspath
#print modules
#the_path = path.dirname (path.abspath (modules[__main__].__file__))
#print the_path
#print syspath

#pyUNO program itself
import uno, unohelper

# UNO GUI toolkit
from com.sun.star.awt.WindowClass import TOP, SIMPLE
from com.sun.star.awt.PushButtonType import STANDARD as standard
from com.sun.star.awt.PushButtonType import OK as ok
from com.sun.star.awt.PushButtonType import CANCEL as cancel
from com.sun.star.awt.PushButtonType import HELP as help
from com.sun.star.awt.TextAlign import CENTER as center
from com.sun.star.awt.TextAlign import LEFT as left
from com.sun.star.awt.TextAlign import RIGHT as right

# used UNO listeners
from com.sun.star.awt import XActionListener

class MsgBox(unohelper.Base):
Inspect UNO object, link to sdk and recusrsive calls

def __init__(self, aContext):
acontext : a Valid UNO context


self.VERSION = '0.1'
self.ctx = aContext
self.smgr = aContext.ServiceManager
# UI Dialog object
self.dialog=None
# List of openned Listeners
self.lst_listeners={}
#UI parameters

Re: [Libreoffice] complete

2011-04-14 Thread Timo
Maybe this task should be moved to “completed”?
http://wiki.documentfoundation.org/Easy_Hacks#Make_python_.2F_mail-merge_debuggable


Am Montag, den 11.04.2011, 21:26 +0200 schrieb Timo:
 Hi Michael,
 
 MessageBoxButtons as well as XSCRIPTCONTEXT do not exist for me. Python
 doesn´t find them and they are documented as “not published” [1]. I
 think it would be nice to use createMessageBox() and to have a dynamic
 size and a nice error icon. But with the use of Laurent´s implementation
 I could solve the task. [2]
 
 With the modified mailmerge.py I get the expected pythonerror in a
 messagebox after closing the MsgBox. [3] In fact all pythonerrors are
 reported like this on my computer. What does it look like on nonfree
 platforms? In fact it is better to display only one error message.
 
 Not all python errors are reported in a message by default. If there are
 syntax errors at the beginning of the file, office remains silent. This
 is problem. 
 
 When there is a MsgBox that works for everybody I suggest to implement
 it into pythonscript.py so that it is being used for all exceptions. 
 
 
 regards,
 
 Timo
 
 
 [1]
 http://api.openoffice.org/docs/common/ref/com/sun/star/awt/MessageBoxButtons.html#BUTTONS_OK
 
 [2] see mailmerge.py and MsgBox.py from the attachments
 
 [3] see screenshot Bildschirmfoto.png
 
 
 Am Montag, den 11.04.2011, 17:01 +0100 schrieb Michael Meeks:
  Hi Timo,
  
  On Sat, 2011-04-09 at 02:22 +0200, Timo wrote:
   Is there a way to test the pythonfile within office? At the moment each
   time i kill soffice, restart writer and click
  
  So - after a bit more digging; I got to here:
  
  class MessageBox:
  def __init__(self, XParentWindow):
  try:
  if XParentWindow is None:
  frame = XSCRIPTCONTEXT.getDesktop().getCurrentFrame()
  XParentWindow = frame.getContainerWindow()
  self.Parent = XParentWindow
  self.Toolkit = XParentWindow.getToolkit()
  except:
  raise AttributeError, 'Did not get a valid parent window'
  
  def msgbox(self, message='', flag=0, title=''):
  '''Wrapper for com.sun.star.awt.XMessageBoxFactory.'''
  rect = uno.createUnoStruct('com.sun.star.awt.Rectangle')
  dlg = self.Toolkit.createMessageBox(self.Parent, rect, errorbox, 
  1, title, message)
  dlg.execute()
  
  
  Which at least works for me, though I couldn't see why the
  com.sun.star.awt.MessageBoxButtons set of constants wouldn't work nicely
  for me.
  
  When I whack that into my system's TableSample.py and add:
  
  box = MessageBox(None)
  box.msgbox (What is this ?)
  
  to createTable() - I get a nice message-box first :-) I bound running
  that macro to F4 to make it quicker to loop iterate / check the code
   
  The UNO API is pretty fearsome to use, it can help to read the
  interface comments in offapi/ but it is not for the faint hearted,
  clearly :-)
  
  I guess, seeing how broken the C++ side is - with helpful comments
  like:
  
  if(!bIsLoggedIn)
  {
  OSL_FAIL(create error message);
  return;
  }
  
  that simply don't create an error message, or do anything useful -
  perhaps a chunk of the work needed is on the C++ side anyway.
  
  HTH,
  
  Michael.
  
 
 ___
 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


[Libreoffice] GSoC: Easy Hack: Make python / mail-merge debuggable

2011-04-08 Thread Timo
Dear Developer-Team,

I am applying for the GSoC-project dealing with conversion of
helpfiles. 
Before I start that project I like to help with the task to make
mailmerge debuggable.* What action exactly makes office display a
message? exit() did, raise Exception did, but print did not. I added a
Tk messagebox in the attatched version. This requires python-tk. Now it
prints only the human-readable errormessage-text. What does a prefered
output look like, that can be understood easily by a user?


kind regards,

Timo


*
http://wiki.documentfoundation.org/Easy_Hacks#Make_python_.2F_mail-merge_debuggable

# Caolan McNamara caol...@redhat.com
# a simple email mailmerge component

# manual installation for hackers, not necessary for users
# cp mailmerge.py /usr/lib/openoffice.org2.0/program
# cd /usr/lib/openoffice.org2.0/program
# ./unopkg add --shared mailmerge.py
# edit ~/.openoffice.org2/user/registry/data/org/openoffice/Office/Writer.xcu
# and change EMailSupported to as follows...
#  prop oor:name=EMailSupported oor:type=xs:boolean
#   valuetrue/value
#  /prop

import unohelper
import uno
import re

#to implement com::sun::star::mail::XMailServiceProvider
#and
#to implement com.sun.star.mail.XMailMessage

from com.sun.star.mail import XMailServiceProvider
from com.sun.star.mail import XMailService
from com.sun.star.mail import XSmtpService
from com.sun.star.mail import XConnectionListener
from com.sun.star.mail import XAuthenticator
from com.sun.star.mail import XMailMessage
from com.sun.star.mail.MailServiceType import SMTP
from com.sun.star.mail.MailServiceType import POP3
from com.sun.star.mail.MailServiceType import IMAP
from com.sun.star.uno import XCurrentContext
from com.sun.star.lang import IllegalArgumentException
from com.sun.star.lang import EventObject
from com.sun.star.mail import SendMailMessageFailedException

from email.MIMEBase import MIMEBase
from email.Message import Message
from email import Encoders
from email.Header import Header
from email.MIMEMultipart import MIMEMultipart
from email.Utils import formatdate
from email.Utils import parseaddr

import sys, smtplib, imaplib, poplib
import Tkinter, tkMessageBox

dbg = False

class PyMailSMTPService(unohelper.Base, XSmtpService):
	def __init__( self, ctx ):
		self.ctx = ctx
		self.listeners = []
		self.supportedtypes = ('Insecure', 'Ssl')
		self.server = None
		self.connectioncontext = None
		self.notify = EventObject()
		if dbg:
			print  sys.stderr, PyMailSMPTService init
	def addConnectionListener(self, xListener):
		if dbg:
			print  sys.stderr, PyMailSMPTService addConnectionListener
		self.listeners.append(xListener)
	def removeConnectionListener(self, xListener):
		if dbg:
			print  sys.stderr, PyMailSMPTService removeConnectionListener
		self.listeners.remove(xListener)
	def getSupportedConnectionTypes(self):
		if dbg:
			print  sys.stderr, PyMailSMPTService getSupportedConnectionTypes
		return self.supportedtypes
	def connect(self, xConnectionContext, xAuthenticator):
		self.connectioncontext = xConnectionContext
		if dbg:
			print  sys.stderr, PyMailSMPTService connect
		server = xConnectionContext.getValueByName(ServerName)
		if dbg:
			print  sys.stderr, server
		port = xConnectionContext.getValueByName(Port)
		if dbg:
			print  sys.stderr, port
		self.server = smtplib.SMTP(server, port)
		if dbg:
			self.server.set_debuglevel(1)
		connectiontype = xConnectionContext.getValueByName(ConnectionType)
		if dbg:
			print  sys.stderr, connectiontype
		if connectiontype == 'Ssl':
			self.server.ehlo()
			self.server.starttls()
			self.server.ehlo()

		user = xAuthenticator.getUserName().encode('ascii')
		password = xAuthenticator.getPassword().encode('ascii')
		if user != '':
			if dbg:
print  sys.stderr, 'Logging in, username of', user
			self.server.login(user, password)

		for listener in self.listeners:
			listener.connected(self.notify)
	def disconnect(self):
		if dbg:
			print  sys.stderr, PyMailSMPTService disconnect
		if self.server:
			self.server.quit()
			self.server = None
		for listener in self.listeners:
			listener.disconnected(self.notify)
	def isConnected(self):
		if dbg:
			print  sys.stderr, PyMailSMPTService isConnected
		return self.server != None
	def getCurrentConnectionContext(self):
		if dbg:
			print  sys.stderr, PyMailSMPTService getCurrentConnectionContext
		return self.connectioncontext
	def sendMailMessage(self, xMailMessage):
		COMMASPACE = ', '

		if dbg:
			print  sys.stderr, PyMailSMPTService sendMailMessage
		recipients = xMailMessage.getRecipients()
		sendermail = xMailMessage.SenderAddress
		sendername = xMailMessage.SenderName
		subject = xMailMessage.Subject
		ccrecipients = xMailMessage.getCcRecipients()
		bccrecipients = xMailMessage.getBccRecipients()
		if dbg:
			print  sys.stderr, PyMailSMPTService subject, subject
			print  sys.stderr, PyMailSMPTService from, sendername.encode('utf-8')
			print  sys.stderr, PyMailSMTPService from, sendermail
			print  sys.stderr, PyMailSMPTService

Re: [Libreoffice] GSoC: Easy Hack: Make python / mail-merge debuggable

2011-04-08 Thread Timo
Is there a way to test the pythonfile within office? At the moment each
time i kill soffice, restart writer and click
ExtrasSerienbriefversenden. 
MessageBox.showMessage() actually doesnt react. May somebody have a look
at that function?
Do the nonfree software prefering people see the python output?


Am Freitag, den 08.04.2011, 14:22 +0100 schrieb Michael Meeks:
 Hi Timo,
 
 On Fri, 2011-04-08 at 14:00 +0200, Timo wrote:
  I am applying for the GSoC-project dealing with conversion of
  helpfiles. 
 
   Cool ! :-) good to see your submission.
 
  Before I start that project I like to help with the task to make
  mailmerge debuggable.* What action exactly makes office display a
  message ?
 
   Riight :-) that is tricky; I think this needs to be a GUI thing, since
 most of our errors seem to happen to end-users who need to be able to
 debug the problem.
 
   exit() did, raise Exception did, but print did not.
 
   Right; and of course we have lots of windows users, who tend to get
 most of the problems here, and who have no console.
 
   I added a Tk messagebox in the attatched version. This requires python-tk.
  Now it prints only the human-readable errormessage-text. What does a
  prefered output look like, that can be understood easily by a user?
 
   Well :-) I suggest we do two things.
 
   First - use the UNO toolkit/ APIs to create and throw up a dialog, and
 encapsulate this nicely in a python function somewhere;
 
   There is some sample code to read before you write your version for
 this here:
 
   http://www.oooforum.org/forum/viewtopic.phtml?t=9602
 
   It is hard to use python-tk, since we don't bundle that with
 LibreOffice, and our python is typically built-in.
 
   So - creating a dialog popup function that will show a message and an
 ok button using the UNO toolkit API would be the first step.
 
   From then, I guess we need to work out which pieces are most likely to
 fail :-) I suppose that testing is the key piece here, you know -
 dis-connecting yourself while talking to the remote server etc. etc. but
 I guess the key thing is to get that dialog goodness in there, so we can
 expand its use over time.
 
   Does that make sense ? :-)
 
   Thanks,
 
   Michael.
 

# Caolan McNamara caol...@redhat.com
# a simple email mailmerge component

# manual installation for hackers, not necessary for users
# cp mailmerge.py /usr/lib/openoffice.org2.0/program
# cd /usr/lib/openoffice.org2.0/program
# ./unopkg add --shared mailmerge.py
# edit ~/.openoffice.org2/user/registry/data/org/openoffice/Office/Writer.xcu
# and change EMailSupported to as follows...
#  prop oor:name=EMailSupported oor:type=xs:boolean
#   valuetrue/value
#  /prop

import unohelper
import uno
import re

#to implement com::sun::star::mail::XMailServiceProvider
#and
#to implement com.sun.star.mail.XMailMessage

from com.sun.star.mail import XMailServiceProvider
from com.sun.star.mail import XMailService
from com.sun.star.mail import XSmtpService
from com.sun.star.mail import XConnectionListener
from com.sun.star.mail import XAuthenticator
from com.sun.star.mail import XMailMessage
from com.sun.star.mail.MailServiceType import SMTP
from com.sun.star.mail.MailServiceType import POP3
from com.sun.star.mail.MailServiceType import IMAP
from com.sun.star.uno import XCurrentContext
from com.sun.star.lang import IllegalArgumentException
from com.sun.star.lang import EventObject
from com.sun.star.mail import SendMailMessageFailedException

from email.MIMEBase import MIMEBase
from email.Message import Message
from email import Encoders
from email.Header import Header
from email.MIMEMultipart import MIMEMultipart
from email.Utils import formatdate
from email.Utils import parseaddr

import sys, smtplib, imaplib, poplib
import Tkinter, tkMessageBox

dbg = False


class MessageBox:
'''Message box for OpenOffice.org, like the one in the Basic macro language. To specify a MsgBox type, use the named constants of this class or the equivalent numbers described in the StarBasic online help. Specify a parent window on initialization.'''

# Named constants for ease of use:
OK = 0
OK_CANCEL = 1
ABORT_RETRY_IGNORE = 2
YES_NO_CANCEL = 3
YES_NO = 4
RETRY_CANCEL = 5
ERROR = 16
QUERY = 32
WARN = 48
INFO = 64
DEFAULT_FIRST = 128
DEFAULT_SECOND = 256
DEFAULT_THIRD = 512
RESULT_OK = 1
RESULT_CANCEL = 2
RESULT_ABORT = 3
RESULT_RETRY = 4
RESULT_IGNORE = 5
RESULT_YES = 6
RESULT_NO = 7

# Mapping above StarBasic MsgBox constants to awt.MessageBoxButtons and icons:
dInput = {
OK_CANCEL : BUTTONS_OK_CANCEL,
# the following constant should be named BUTTONS_ABORT_RETRY_IGNORE:
ABORT_RETRY_IGNORE : BUTTONS_ABORT_IGNORE_RETRY,
YES_NO_CANCEL : BUTTONS_YES_NO_CANCEL,
YES_NO : BUTTONS_YES_NO,
RETRY_CANCEL : BUTTONS_RETRY_CANCEL,
ERROR : 'errorbox',
QUERY

[Libreoffice] Removed some commented out code in calc

2010-12-10 Thread Timo Heino
There you go! Hope it works for you.

Timo H.
From 8da85e6725a0be25617fa326fed7c92723867fcf Mon Sep 17 00:00:00 2001
From: Timo Heino era...@gmail.com
Date: Fri, 10 Dec 2010 16:04:41 +0200
Subject: [PATCH] Removed commented code


Signed-off-by: Timo Heino era...@gmail.com
---
 chart2/source/model/inc/BaseCoordinateSystem.hxx |   22 --
 chart2/source/model/inc/ChartTypeManager.hxx |1 -
 chart2/source/model/inc/Diagram.hxx  |9 -
 3 files changed, 0 insertions(+), 32 deletions(-)

diff --git a/chart2/source/model/inc/BaseCoordinateSystem.hxx b/chart2/source/model/inc/BaseCoordinateSystem.hxx
index 6b7584c..2cb9d9d 100644
--- a/chart2/source/model/inc/BaseCoordinateSystem.hxx
+++ b/chart2/source/model/inc/BaseCoordinateSystem.hxx
@@ -92,12 +92,6 @@ protected:
 //  XCoordinateSystem 
 virtual ::sal_Int32 SAL_CALL getDimension()
 throw (::com::sun::star::uno::RuntimeException);
-// not implemented
-// virtual ::rtl::OUString SAL_CALL getCoordinateSystemType()
-// throw (::com::sun::star::uno::RuntimeException);
-// not implemented
-// virtual ::rtl::OUString SAL_CALL getViewServiceName()
-// throw (::com::sun::star::uno::RuntimeException);
 virtual void SAL_CALL setAxisByDimension(
 ::sal_Int32 nDimension,
 const ::com::sun::star::uno::Reference ::com::sun::star::chart2::XAxis  xAxis,
@@ -128,22 +122,6 @@ protected:
 throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
 
-//  XCloneable 
-// not implemented
-// virtual ::com::sun::star::uno::Reference
-// ::com::sun::star::util::XCloneable  SAL_CALL createClone()
-// throw (::com::sun::star::uno::RuntimeException);
-
-//  XServiceInfo 
-// not implemented
-// virtual ::rtl::OUString SAL_CALL getImplementationName()
-// throw (::com::sun::star::uno::RuntimeException);
-// virtual ::sal_Bool SAL_CALL supportsService(
-// const ::rtl::OUString ServiceName )
-// throw (::com::sun::star::uno::RuntimeException);
-// virtual ::com::sun::star::uno::Sequence ::rtl::OUString  SAL_CALL getSupportedServiceNames()
-// throw (::com::sun::star::uno::RuntimeException);
-
 //  XModifyBroadcaster 
 virtual void SAL_CALL addModifyListener(
 const ::com::sun::star::uno::Reference ::com::sun::star::util::XModifyListener  aListener )
diff --git a/chart2/source/model/inc/ChartTypeManager.hxx b/chart2/source/model/inc/ChartTypeManager.hxx
index 1cc8794..2a3a449 100644
--- a/chart2/source/model/inc/ChartTypeManager.hxx
+++ b/chart2/source/model/inc/ChartTypeManager.hxx
@@ -44,7 +44,6 @@ namespace chart
 class ChartTypeManager :
 public ::cppu::WeakImplHelper2
 ::com::sun::star::lang::XMultiServiceFactory,
-// ::com::sun::star::lang::XMultiComponentFactory,
 ::com::sun::star::chart2::XChartTypeManager 
 {
 public:
diff --git a/chart2/source/model/inc/Diagram.hxx b/chart2/source/model/inc/Diagram.hxx
index 3b9a077..c243a97 100644
--- a/chart2/source/model/inc/Diagram.hxx
+++ b/chart2/source/model/inc/Diagram.hxx
@@ -110,16 +110,7 @@ protected:
 virtual void SAL_CALL getFastPropertyValue(
 ::com::sun::star::uno::Any rValue, sal_Int32 nHandle ) const;
 
-// 	virtual sal_Bool SAL_CALL convertFastPropertyValue
-// ( ::com::sun::star::uno::Any  rConvertedValue,
-//   ::com::sun::star::uno::Any  rOldValue,
-//   sal_Int32 nHandle,
-//   const ::com::sun::star::uno::Any rValue )
-// 		throw (::com::sun::star::lang::IllegalArgumentException);
-
 //  XDiagram 
-// virtual ::rtl::OUString SAL_CALL getChartTypeTemplateServiceName()
-// throw (::com::sun::star::uno::RuntimeException);
 virtual ::com::sun::star::uno::Reference
 ::com::sun::star::beans::XPropertySet  SAL_CALL getWall()
 throw (::com::sun::star::uno::RuntimeException);
-- 
1.7.1

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


[Libreoffice] Some commented out code removed again

2010-12-10 Thread Timo Heino
This time with 1 (hopefully) working fixed if-statelement :)

Timo H.
From 9c1ac82d6904aa43010c310a9d84c64bdf5b419d Mon Sep 17 00:00:00 2001
From: Timo Heino era...@gmail.com
Date: Fri, 10 Dec 2010 23:23:45 +0200
Subject: [PATCH] More commented out code removed

I try to take smallish control over commented out code ;)

Next time before commits i would like to see if someone really makes sure there is no commented out doe :|

Timo

p.s. (only one time i occured small error on if-statelement; fixed it (i think so))

Signed-off-by: Timo Heino era...@gmail.com
---
 chart2/source/model/main/Axis.hxx|7 ---
 chart2/source/model/main/ChartModel.cxx  |9 -
 chart2/source/model/main/ChartModel.hxx  |7 ---
 chart2/source/model/main/DataPointProperties.hxx |1 -
 chart2/source/model/main/FormattedString.hxx |7 ---
 chart2/source/model/main/Legend.hxx  |7 ---
 chart2/source/model/main/PageBackground.hxx  |7 ---
 chart2/source/model/main/Title.hxx   |7 ---
 chart2/source/model/main/Wall.hxx|7 ---
 9 files changed, 0 insertions(+), 59 deletions(-)

diff --git a/chart2/source/model/main/Axis.hxx b/chart2/source/model/main/Axis.hxx
index e9adcc9..c81a751 100644
--- a/chart2/source/model/main/Axis.hxx
+++ b/chart2/source/model/main/Axis.hxx
@@ -96,13 +96,6 @@ protected:
 getPropertySetInfo()
 throw (::com::sun::star::uno::RuntimeException);
 
-// 	virtual sal_Bool SAL_CALL convertFastPropertyValue
-// ( ::com::sun::star::uno::Any  rConvertedValue,
-//   ::com::sun::star::uno::Any  rOldValue,
-//   sal_Int32 nHandle,
-//   const ::com::sun::star::uno::Any rValue )
-// 		throw (::com::sun::star::lang::IllegalArgumentException);
-
 //  XAxis 
 virtual void SAL_CALL setScaleData( const ::com::sun::star::chart2::ScaleData rScaleData )
 throw (::com::sun::star::uno::RuntimeException);
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 9681666..d32a5cb 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -495,9 +495,7 @@ uno::Reference uno::XInterface  SAL_CALL ChartModel::getCurrentSelection() thr
 uno::Any aSel = xSelectionSupl-getSelection();
 rtl::OUString aObjectCID;
 if( aSel = aObjectCID )
-{
 xReturn.set( ObjectIdentifier::getObjectPropertySet( aObjectCID, Reference XChartDocument (this)));
-}
 }
 }
 return xReturn;
@@ -531,13 +529,6 @@ void SAL_CALL ChartModel::dispose() throw(uno::RuntimeException)
 DisposeHelper::DisposeAndClear( m_xPageBackground );
 DisposeHelper::DisposeAndClear( m_xXMLNamespaceMap );
 
-// not owner of storage
-// if( m_xStorage.is())
-// {
-// Reference lang::XComponent  xComp( m_xStorage, uno::UNO_QUERY );
-// if( xComp.is())
-// xComp-dispose();
-// }
 m_xStorage.clear();
 
 if( m_xOldModelAgg.is())
diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/source/model/main/ChartModel.hxx
index 062fde0..57ceeb5 100644
--- a/chart2/source/model/main/ChartModel.hxx
+++ b/chart2/source/model/main/ChartModel.hxx
@@ -87,14 +87,9 @@ namespace impl
 
 // Note: needed for queryInterface (if it calls the base-class implementation)
 typedef ::comphelper::WeakImplHelper20
-// 		 ::com::sun::star::frame::XModel		//comprehends XComponent (required interface), base of XChartDocument
  ::com::sun::star::util::XCloseable		//comprehends XCloseBroadcaster
 ,::com::sun::star::frame::XStorable2	//(extension of XStorable)
-// 		,::com::sun::star::frame::XStorable		//(required interface) base of XStorable2
 ,::com::sun::star::util::XModifiable	//comprehends XModifyBroadcaster (required interface)
-//	,::com::sun::star::uno::XWeak			// implemented by WeakImplHelper(optional interface)
-//	,::com::sun::star::uno::XInterface		// implemented by WeakImplHelper(optional interface)
-//	,::com::sun::star::lang::XTypeProvider	// implemented by WeakImplHelper
 ,::com::sun::star::lang::XServiceInfo
 ,::com::sun::star::chart2::XChartDocument  // derived from XModel
 ,::com::sun::star::chart2::data::XDataReceiver   // public API
@@ -136,8 +131,6 @@ private:
 ::com::sun::star::uno::Reference ::com::sun::star::frame::XController 	m_xCurrentController;
 sal_uInt16	m_nControllerLockCount;
 
-//	::com::sun::star::uno::Sequence ::com::sun::star::beans::PropertyValue 	m_aPrinterOptions;
-
 ::com::sun::star::uno::Reference ::com::sun::star::uno::XComponentContext  m_xContext;
 ::com::sun::star::uno::Reference ::com::sun::star::uno::XAggregation   m_xOldModelAgg;
 
diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx

[Libreoffice] [PATCH] More easy-hacks completed

2010-11-23 Thread Timo Heino
Am i too crazy if i hunt these? ;)

Cheers, Timo
From 1a14fc7f4638e4f362ed18ac72c86f35483662d3 Mon Sep 17 00:00:00 2001
From: Timo Heino era...@gmail.com
Date: Tue, 23 Nov 2010 17:16:13 +0200
Subject: [PATCH] More 'easy-hacks' completed

Removed some commented out code. 
chart2/source/controller/chartapiwrapper/ cleaned. Moving to next 1

Signed-off-by: Timo Heino era...@gmail.com
---
 .../controller/chartapiwrapper/TitleWrapper.cxx|4 
 .../chartapiwrapper/UpDownBarWrapper.cxx   |3 ---
 .../chartapiwrapper/UpDownBarWrapper.hxx   |3 ---
 .../chartapiwrapper/WallFloorWrapper.cxx   |1 -
 4 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index 7f99597..23cef15 100644
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -197,7 +197,6 @@ const Sequence Property   lcl_GetPropertySequence()
 ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
 ::chart::LineProperties::AddPropertiesToVector( aProperties );
 ::chart::FillProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedProperties::AddPropertiesToVector( aProperties );
 ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
 ::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
 ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
@@ -553,9 +552,6 @@ Sequence OUString  TitleWrapper::getSupportedServiceNames_Static()
 aServices[ 1 ] = C2U( com.sun.star.drawing.Shape );
 aServices[ 2 ] = C2U( com.sun.star.xml.UserDefinedAttributeSupplier );
 aServices[ 3 ] = C2U( com.sun.star.style.CharacterProperties );
-// aServices[ 4 ] = C2U( com.sun.star.beans.PropertySet );
-// aServices[ 5 ] = C2U( com.sun.star.drawing.FillProperties );
-// aServices[ 6 ] = C2U( com.sun.star.drawing.LineProperties );
 
 return aServices;
 }
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
index e638032..ed81fb9 100644
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
@@ -70,7 +70,6 @@ const Sequence Property   lcl_GetPropertySequence()
 
 ::chart::LineProperties::AddPropertiesToVector( aProperties );
 ::chart::FillProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedProperties::AddPropertiesToVector( aProperties );
 ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
 
 // and sort them for access via bsearch
@@ -254,8 +253,6 @@ void SAL_CALL UpDownBarWrapper::setPropertyValues( const uno::Sequence ::rtl::O
 }
 }
 //todo: store unknown properties elsewhere
-//if( bUnknownProperty )
-//throw beans::UnknownPropertyException();
 }
 uno::Sequence uno::Any  SAL_CALL UpDownBarWrapper::getPropertyValues( const uno::Sequence ::rtl::OUString  rNameSeq )
 throw (uno::RuntimeException)
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
index 496c47b..88dce1c 100644
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
@@ -63,9 +63,6 @@ class UpDownBarWrapper : public MutexContainer
 , ::com::sun::star::beans::XMultiPropertySet
 , ::com::sun::star::beans::XPropertyState
 , ::com::sun::star::beans::XMultiPropertyStates  
-//	, ::com::sun::star::uno::XWeak			// implemented by WeakImplHelper(optional interface)
-//	, ::com::sun::star::uno::XInterface		// implemented by WeakImplHelper
-//	, ::com::sun::star::lang::XTypeProvider	// implemented by WeakImplHelper
 
 {
 public:
diff --git a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
index a2de469..2a69e0c 100644
--- a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
@@ -72,7 +72,6 @@ const Sequence Property   lcl_GetPropertySequence()
 ::std::vector ::com::sun::star::beans::Property  aProperties;
 ::chart::FillProperties::AddPropertiesToVector( aProperties );
 ::chart::LineProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedProperties::AddPropertiesToVector( aProperties );
 ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties

[Libreoffice] [Patch] Still cleaning out calc

2010-11-23 Thread Timo Heino
I'm sorry if i didn't send these in 1 file :(

Timo
From f6b21adc81beff1cd7dc9c385057c9895d7e3b68 Mon Sep 17 00:00:00 2001
From: Timo Heino era...@gmail.com
Date: Wed, 24 Nov 2010 08:43:29 +0200
Subject: [PATCH 1/3] Removed commented out code


Signed-off-by: Timo Heino era...@gmail.com
---
 .../dialogs/ChartTypeDialogController.cxx  |1 -
 chart2/source/controller/dialogs/DataBrowser.cxx   |   13 -
 .../controller/dialogs/dlg_InsertAxis_Grid.cxx |1 -
 3 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index afb572e..0c7a1f1 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -678,7 +678,6 @@ const tTemplateServiceChartTypeParameterMap LineChartDialogController::getTempl
 ( C2U( com.sun.star.chart2.template.StackedLine ),ChartTypeParameter(3,false,false,GlobalStackMode_STACK_Y,false,true) )
 ( C2U( com.sun.star.chart2.template.PercentStackedLine ), ChartTypeParameter(3,false,false,GlobalStackMode_STACK_Y_PERCENT,false,true) )
 //---
-//( C2U( com.sun.star.chart2.template.ThreeDLine ), ChartTypeParameter(4,false,true,GlobalStackMode_NONE,false,true) )
 ( C2U( com.sun.star.chart2.template.StackedThreeDLine ),  ChartTypeParameter(4,false,true,GlobalStackMode_STACK_Y,false,true) )
 ( C2U( com.sun.star.chart2.template.PercentStackedThreeDLine ),   ChartTypeParameter(4,false,true,GlobalStackMode_STACK_Y_PERCENT,false,true) )
 ( C2U( com.sun.star.chart2.template.ThreeDLineDeep ), ChartTypeParameter(4,false,true,GlobalStackMode_STACK_Z,false,true) )
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index f316a07..62f87db 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -1012,19 +1012,6 @@ void DataBrowser::PaintCell(
 if( ! bEnabled )
 rDev.SetTextColor( GetSettings().GetStyleSettings().GetDisableColor() );
 
-// TEST
-// if( nColumnId == 1 )
-// // categories
-// rDev.SetFillColor( Color( 0xff, 0xff, 0xff ));
-// else if( nColumnId == 2 )
-// // x-values
-// rDev.SetFillColor( Color( 0xf0, 0xf0, 0xff ));
-// else
-// // y-values
-// rDev.SetFillColor( Color( 0xff, 0xff, 0xf0 ));
-
-// rDev.DrawRect( rRect );
-
 // draw the text
 rDev.DrawText( aPos, aText );
 
diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
index 408f38d..c6bb7aa 100644
--- a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
@@ -113,7 +113,6 @@ SchAxisDlg::SchAxisDlg( Window* pWindow
 aCbSecondaryZ.Hide();
 
 Size aSize( GetSizePixel() );
-//aSize.Height() -= aCbSecondaryZ.GetSizePixel().Height();
 aSize.Height() -= ( aCbSecondaryZ.GetPosPixel().Y() - aCbSecondaryY.GetPosPixel().Y() );
 SetSizePixel(aSize);
 }
-- 
1.7.1

From c338b2bd62c9bf4746df68b8dd1eda554cfb717e Mon Sep 17 00:00:00 2001
From: Timo Heino era...@gmail.com
Date: Wed, 24 Nov 2010 08:57:15 +0200
Subject: [PATCH 2/3] Even more commented out code removed


Signed-off-by: Timo Heino era...@gmail.com
---
 .../controller/dialogs/ObjectNameProvider.cxx  |   20 
 .../controller/dialogs/dlg_ObjectProperties.cxx|3 ---
 2 files changed, 0 insertions(+), 23 deletions(-)

diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index bb51775..5d090e7 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -317,7 +317,6 @@ rtl::OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural
 }
 break;
 case OBJECTTYPE_DATA_STOCK_RANGE:
-//aRet=String(SchResId());
 break;
 case OBJECTTYPE_DATA_STOCK_LOSS:
 aRet=String(SchResId(STR_OBJECT_STOCK_LOSS));
@@ -578,13 +577,6 @@ rtl::OUString ObjectNameProvider::getHelpText( const rtl::OUString rObjectCID,
 aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), lcl_getDataSeriesName( rObjectCID, xChartModel ) );
 }
 }
-/*
-else if( OBJECTTYPE_DIAGRAM == eObjectType )
-{
-//todo different names for different diagram types ???
-//or different names for series of diferent charttypes
-}
-*/
 else if( OBJECTTYPE_DATA_CURVE == eObjectType )
 {
 if( bVerbose

[Libreoffice] Removed some commented out code

2010-11-22 Thread Timo Heino
Check attachment and comments please. (so i know can i search more these)
From 382e3715abb3f8ee718192f6974a50b862b2a1f0 Mon Sep 17 00:00:00 2001
From: Timo Heino era...@gmail.com
Date: Mon, 22 Nov 2010 18:32:45 +0200
Subject: [PATCH] Removed commented out code

Removed code that was commented out from some files inside
calc/chart2/source/controller/accessibility/ folder.

Signed-off-by: Timo Heino era...@gmail.com
---
 .../controller/accessibility/AccessibleBase.cxx|1 -
 .../accessibility/AccessibleChartElement.cxx   |   31 --
 .../accessibility/AccessibleChartView.cxx  |3 -
 .../accessibility/ChartElementFactory.cxx  |   64 
 4 files changed, 0 insertions(+), 99 deletions(-)

diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx
index 2b7eaec..1bc5425 100644
--- a/chart2/source/controller/accessibility/AccessibleBase.cxx
+++ b/chart2/source/controller/accessibility/AccessibleBase.cxx
@@ -779,7 +779,6 @@ awt::Rectangle SAL_CALL AccessibleBase::getBounds()
 if( xParent.is() )
 aParentLocOnScreen = xParent-getLocationOnScreen();
 
-// aOffset = aParentLocOnScreen - GetUpperLeftOnScreen()
 awt::Point aULOnScreen = GetUpperLeftOnScreen();
 awt::Point aOffset( aParentLocOnScreen.X - aULOnScreen.X,
 aParentLocOnScreen.Y - aULOnScreen.Y );
diff --git a/chart2/source/controller/accessibility/AccessibleChartElement.cxx b/chart2/source/controller/accessibility/AccessibleChartElement.cxx
index dd00d7e..f0cee9c 100644
--- a/chart2/source/controller/accessibility/AccessibleChartElement.cxx
+++ b/chart2/source/controller/accessibility/AccessibleChartElement.cxx
@@ -130,30 +130,6 @@ void AccessibleChartElement::InitTextEdit()
 ASSERT_EXCEPTION( ex );
 }
 }
-// OSL_ASSERT( m_pTextHelper == 0 );
-
-// // /-- solar
-// SolarMutexGuard aSolarGuard;
-// Window* pWindow( VCLUnoHelper::GetWindow( GetInfo().m_xWindow ));
-// if( pWindow )
-// {
-// // we need ChartController::m_pDrawViewWrapper here
-// SdrView * pView = 0;
-// if( pView )
-// {
-// SdrObject * pTextObj = m_pDrawViewWrapper-getTextEditObject();
-// if( pTextObj )
-// {
-// SvxEditSource * pEditSource = new SvxEditSource( pTextObj, pView, pWindow );
-// m_pTextHelper = new ::accessibility::AccessibleTextHelper(
-// ::std::auto_ptr SvxEditSource ( pEditSource ));
-// if( m_pTextHelper )
-// m_pTextHelper-SetEventSource( this );
-// }
-// }
-// }
-// // \-- solar
-// }
 
 // 
 // 
@@ -169,14 +145,7 @@ Reference XAccessible  AccessibleChartElement::ImplGetAccessibleChildById( sal
 Reference XAccessible  xResult;
 
 if( m_bHasText )
-{
 xResult.set( m_xTextHelper-getAccessibleChild( i ));
-// /-- solar
-// SolarMutexGuard aSolarGuard;
-// if( m_pTextHelper )
-// xResult.set( m_pTextHelper-GetChild( i ) );
-// \-- solar
-}
 else
 xResult.set( AccessibleBase::ImplGetAccessibleChildById( i ));
 
diff --git a/chart2/source/controller/accessibility/AccessibleChartView.cxx b/chart2/source/controller/accessibility/AccessibleChartView.cxx
index b816204..1b3280f 100644
--- a/chart2/source/controller/accessibility/AccessibleChartView.cxx
+++ b/chart2/source/controller/accessibility/AccessibleChartView.cxx
@@ -93,9 +93,6 @@ awt::Rectangle AccessibleChartView::GetWindowPosSize() const
 if( ! xWindow.is())
 return awt::Rectangle();
 
-// this should do, but it doesn't = HACK
-// return xWindow-getPosSize();
-
 awt::Rectangle aBBox( xWindow-getPosSize() );
 
 Window* pWindow( VCLUnoHelper::GetWindow( GetInfo().m_xWindow ));
diff --git a/chart2/source/controller/accessibility/ChartElementFactory.cxx b/chart2/source/controller/accessibility/ChartElementFactory.cxx
index c630ff9..3fff9b7 100644
--- a/chart2/source/controller/accessibility/ChartElementFactory.cxx
+++ b/chart2/source/controller/accessibility/ChartElementFactory.cxx
@@ -77,70 +77,6 @@ AccessibleBase* ChartElementFactory::CreateChartElement( const AccessibleElement
 }
 
 return 0;
-
-/*
-sal_uInt16 nObjId = rId.GetObjectId();
-switch( nObjId )
-{
-case CHOBJID_LEGEND:
-return new AccLegend( pParent );
-case AccLegendEntry::ObjectId:
-return new AccLegendEntry( pParent, rId.GetIndex1() );
-
-case CHOBJID_TITLE_MAIN:
-return new AccTitle( pParent, Title::MAIN );
-case CHOBJID_TITLE_SUB:
-return new AccTitle( pParent, Title::SUB );
-case CHOBJID_DIAGRAM_TITLE_X_AXIS

[Libreoffice] More cleanup in calc

2010-11-22 Thread Timo Heino
Removed more commented out code
From 508c82de834dc890a2b00702147a55c4603c4bb1 Mon Sep 17 00:00:00 2001
From: Timo Heino era...@gmail.com
Date: Mon, 22 Nov 2010 20:14:43 +0200
Subject: [PATCH] More commented out code removed in calc


Signed-off-by: Timo Heino era...@gmail.com
---
 .../controller/chartapiwrapper/AreaWrapper.cxx |1 -
 .../controller/chartapiwrapper/AxisWrapper.cxx |3 ---
 .../chartapiwrapper/ChartDocumentWrapper.cxx   |   13 -
 .../chartapiwrapper/DataSeriesPointWrapper.cxx |6 --
 .../controller/chartapiwrapper/DiagramWrapper.cxx  |6 --
 .../controller/chartapiwrapper/DiagramWrapper.hxx  |5 -
 .../controller/chartapiwrapper/GridWrapper.cxx |1 -
 .../controller/chartapiwrapper/LegendWrapper.cxx   |4 
 .../chartapiwrapper/MinMaxLineWrapper.cxx  |3 ---
 .../chartapiwrapper/MinMaxLineWrapper.hxx  |3 ---
 10 files changed, 0 insertions(+), 45 deletions(-)

diff --git a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
index ba7cbd4..cb92ec6 100644
--- a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
@@ -70,7 +70,6 @@ const Sequence Property   lcl_GetPropertySequence()
 ::std::vector ::com::sun::star::beans::Property  aProperties;
 ::chart::LineProperties::AddPropertiesToVector( aProperties );
 ::chart::FillProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedProperties::AddPropertiesToVector( aProperties );
 ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
 
 // and sort them for access via bsearch
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 3498f8c..26c8357 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -337,7 +337,6 @@ const Sequence Property   lcl_GetPropertySequence()
 lcl_AddPropertiesToVector( aProperties );
 ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
 ::chart::LineProperties::AddPropertiesToVector( aProperties );
-// ::chart::NamedLineProperties::AddPropertiesToVector( aProperties );
 ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
 ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
 
@@ -584,8 +583,6 @@ Sequence OUString  AxisWrapper::getSupportedServiceNames_Static()
 aServices[ 0 ] = C2U( com.sun.star.chart.ChartAxis );
 aServices[ 1 ] = C2U( com.sun.star.xml.UserDefinedAttributeSupplier );
 aServices[ 2 ] = C2U( com.sun.star.style.CharacterProperties );
-// aServices[ 3 ] = C2U( com.sun.star.beans.PropertySet );
-// aServices[ 4 ] = C2U( com.sun.star.drawing.LineProperties );
 
 return aServices;
 }
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index e123340..d7d24fc 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -1498,19 +1498,6 @@ uno::Sequence ::rtl::OUString  SAL_CALL ChartDocumentWrapper::getAvailableServ
 
 return aResult;
 
-// // shapes
-// // uno::Sequence OUString  aDrawServices( SvxUnoDrawMSFactory::getAvailableServiceNames() );
-// // const OUString * pArr = aDrawServices.getConstArray();
-// // aServices.insert( aServices.end(), pArr, pArr + aDrawServices.getLength() );
-// }
-
-
-// add-ins
- //uno::Sequence OUString  aAddIns( GetAddInCollection().GetAddInNames() );
-// pArr = aAddIns.getConstArray();
-// aServices.insert( aServices.end(), pArr, pArr + aAddIns.getLength() );
-
-// return ContainerToSequence( aServices );
 }
 
 //  XAggregation 
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index 7cbdb4b..1b46b17 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -730,13 +730,7 @@ const std::vector WrappedProperty*  DataSeriesPointWrapper::createWrappedPrope
 WrappedDataCaptionProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
 WrappedScaleTextProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
 
-//add unnamed fill properties (different inner names here)
-// aWrappedProperties.push_back( new  WrappedUnnamedProperty( C2U( FillGradient ), C2U( GradientName ) ) );
-// aWrappedProperties.push_back( new  WrappedUnnamedProperty( C2U( FillHatch ), C2U( HatchName