Re: #tdf51510: Change the DPI to get better resolution, but failed the unit test

2023-08-31 Thread sos
Sorry to come back to this: every document has a property called "Image 
Preferred DPI" that can be used to represent the printing intentions of 
that document.


Apparent dimensions are a result of deviding the available pixels in the 
Image by the print intentions .
if the user like to send the document to a professional printing house 
then all  images need to have a DPI of minimal 254, laser printers need 
150 DPI  and on screen presentations 96 DPI


Tomaz has this implemented a feature called "Image Preferred DPI" so  
the dimensions of an image in the document can been checked/controled  
by the number of pixels in the image and the print intentions off a 
document.


With a Preferred DPI of 254 and 2450 pixels in the image, the image can 
be displayed at a maximum size of 10 inches. If the image is smaller, 
then fewer than 2450 pixels are needed.
So the "Image Preferred DPI" can be used to determine the "Print 
Intentions" for a Document, and it can easily calculate how many DPI or 
pixels an image needs.

grtz
Fernand

On 31/08/2023 5:05, Lodev wrote:


Hi,

Tomaž Vajngerl 於 2023/8/31 03:13 寫道:

Hi,

On Tue, Aug 29, 2023 at 9:09 AM Lodev  wrote:

Sorry if I'm asking a stupid question here.  First, I've never seen or
used a document with "multiple instances that all point to the same
image in the document".

That's easy - drag the image while holding ctrl and drop. It will make
a copy of the Graphic, but it still references the same instance and
you can resize each one independently. If you save the document there
will be only one image saved.


Thanks.


And I take "the image in the document" or "The

size the image takes up in the document" seems to be the "Apparent
dimensions", 4.24" in this case.  Is it?

Yes - the document has a size and combined with the size of the image
(in the document, not what it is set in SVG) you can calculate the
actual needed DPI relative to the document.


That is, even if there are
multiple images in this document which the source is the same one (I
still don't know how to do that), shouldn't it be calculated regarding
to the "Apparent dimensions" here?  I mean, after all, that is what user
set in the document.

That's the point - what is important is the size of the image in the
document, not what the size is the SVG image.


  Since the image shown in the document is actually
4.24"x4.24", while the original svg file is 0.21"x0.21, shouldn't it be
20 times (4.24/0.21 ~= 20) DPI, that is, 96*20 = 1920 sent to xBitmap()?

Yes, that seems correct. But this is only for this case - another case
would need another factor. For example if you resize the image in the
document to 0.42 x 0.42, you would use the factor 2.


We tried to set Size(20,20) to get aDPI, or directly set aDPI to
(1920,1920), they both ended up 4.24"x4.24" with 99DPI, which is good
enough.  Do you think it a reasonable thought?

That's only for this image where 20 is correct - you would need
another number calculated per image. Also use a constant DPI factor as
I already said at the beginning, not the size of the output device.

So you will need to first find the place where conversion for the
embedded PNG and properly calculate the size at that place - not
inside this method.

The size should be the Apparent dimensions, since in the document it was
set to that size.  That's what we thought.

Yes - it needs to be the size in the document, not the size of SVG.


BTW, if so, how can we get the Apparent dimensions in this method?

You will have to set it from the outside as a parameter - as it
depends on the image and here you don't have the information.


So, that's what we thought - to calculate the necessary DPI by 
Apparent dimensions every time we export to docx.


Could you please give us some hint about where to get the Apparent 
dimensions?  It's not very trivial to us.  We'd like to give it a try 
to provide a patch for this issue.



Thanks for your help,

Dev


Re: #tdf51510: Change the DPI to get better resolution, but failed the unit test

2023-08-22 Thread sos

Yes,

but when using this settings you can avoid to have SVG's with a 
resolution who is not adapted to the print-intentsions off the docment.

254-300 Pixels par Inch for commercial printing
150 Pixels par Inch for Laser printing
96 Pixels par Inch for screen viewing only.

Do you mean also that the SVG's are  not included in the "Graphic SIze 
Check.."?


grtz

Fernand




On 22/08/2023 14:22, Tomaž Vajngerl wrote:

Hi,

On Tue, Aug 22, 2023 at 11:43 AM sos  wrote:

Hi, Tomaž,

maybe you over looked that there is now a user defined property
'*Image Preferred DPI*" for the document, so the resolution off
any image must depend on this settings, who are standard 96 DPI.

I know - I added that :) However that setting is currently only used 
for "Graphic SIze Check.." to warn if the document has an image that 
is too big or too small in resolution (not exactly what is set but 
there are margins around that value that are still allowed).


greetz

Fernand


Regards, Tomaž

Re: #tdf51510: Change the DPI to get better resolution, but failed the unit test

2023-08-22 Thread sos

Hi, Tomaž,

maybe you over looked that there is now a user defined property '*Image 
Preferred DPI*" for the document, so the resolution off any image must 
depend on this settings, who are standard 96 DPI.


greetz

Fernand

On 18/08/2023 16:01, Lodev wrote:



U ontvangt niet vaak e-mail van lo...@ossii.com.tw. Meer informatie 
over waarom dit belangrijk is 




Hi, Tomaž,

Tomaž Vajngerl 於 2023/8/11 17:31 寫道:

Hi,

On Fri, Aug 11, 2023 at 8:06 AM Lodev  wrote:

Hi,


We're trying to fix #tdf51510: "Exporting documents with embedded SVG to
doc or docx converts the image to low-resolution pixel graphics" since
it bothers us and it seems more and more bugs duplicated or related to
this one.  We changed in vcl/source/gdi/vectorgraphicdata.cxx:78

-Size
aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1),
MapMode(MapUnit::MapInch)));
+Size
aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(50, 50),
MapMode(MapUnit::MapInch)));

To get better resolutions.  It worked.  Exported docx file with embedded
png now gets better resolution.

However this change couldn't pass unit test :
sw/qa/extras/ooxmlexport/ooxmlexport16.cxx:762, tdf136841.docx . It
seems to be fixed, expecting low resolution converted images.

Since it didn't pass the unit test, we didn't commit the patch to
gerrit.  So here, first we'd like to know if this solution, changing
size(1,1) to size(50,50) is acceptable or not?

I wouldn't do it like that. The purpose of that LogicToPixel
conversion is to figure out the DPI (number of pixels/inch) of the
output device - changing that to 50 doesn't make sense considering
what that call tries to achieve (you ask what's the number of pixels
per 50inches).
The next issue is that this will result in a 50x bigger size - that's
a lot! Typically the device DPI is 96 - this makes it 50*96 = 4800,
which means a 3 x 3 inch image (not that A4 paper size is 8.3 x 11.7
inch, so 3x3 inch image is typical) will have the resolution of
14400x14400 pixels!
Note also that in ODF we store a PNG bitmap for vector images in
addition the the vector image, which serves as a fall-back. For that
we go through the same code path, so the file size would increase
significantly.

What I suggest is to not depend on the output device DPI (which causes
us a lot of trouble because the result then depends on the system and
OS) and set a constant but high enough DPI, that will be good enough
in most cases. 300DPI is usually good enough for printing so I think
that would be a good constant to use here (it's 3x bigger than typical
96DPI of an output device).

Tomaž


In fact, when we were doing more test, we found the behavior somewhat 
strange.


We used attachment 170646 in tdf#51510.

vcl/source/gdi/vectorgraphicdata.cxx, line 77:

    // get system DPI
    Size 
aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), 
MapMode(MapUnit::MapInch)));

    if (rTargetDPI.has_value())
    {
    aDPI = *rTargetDPI;
    }

    const uno::Reference< rendering::XBitmap > xBitmap(
    xPrimitive2DRenderer->rasterize(
comphelper::containerToSequence(rSequence),
    aViewParameters,
    aDPI.getWidth(),
    aDPI.getHeight(),
    aRealRect,
    nMaximumQuadraticPixels));

First, Size aDPI: 
Application::GetDefaultDevice()->LogicToPixel(Size(1,1), 
MapMode(MapUnit::MapInch)), here we did get aDPI is (96, 96).


However, after saving as docx, the PNG image information (in Compress 
Image dialog) we got is:


Actual dimensions: 0.21"x0.21" (21x21 px)

Apparent dimensions: 4.24" x 4.24" at 4 DPI

If we set LogicToPixel(Size(4,4), ...), we got:

Actual dimensions: 0.84"x0.84" (84x84 px)

Apparent dimensions: 4.24" x 4.24" at 19 DPI

Second, We then tried to directly assign 300DPI by adding

aDPI.setWidth(300);

aDPI.setHeight(300);

before calling xBitmap(xPrimitive2DRenderer0>rasterize()).  We printed 
aDPI.getWidth() and aDPI.getHeight() and did got 300, 300.


However the PNG image information saved in docx file

Actual dimensions: 0.68 x 0.68 (66x66 px)

Apparent dimensions: 4.24" x 4.24" at 15 DPI

Is the above way to correctly "set a constant but high enough DPI"?  
But even if I assigned 300DPI the result DPI is still very low.  So, 
what is the exactly way to set constant 300DPI?


BTW, the rTargetDPI was a parameter of 
convertPrimitive2DSequenceToBitmapEx, which  was called only once and 
the parameter rTargetDPI was never used.


That is, it is always nullptr by default, according to its 
declaration.  This parameter seems to be useless at all.



Any suggestion will be appreciated.


Thanks for your help.

Dev




Re: paste html using API

2023-03-27 Thread sos

We do it with the functions below

Function ClipboardAsText As String
Dim oClip As Variant, oClipContents As Variant, oTypes As Variant
Dim oConverter, convertedString As String
Dim i As Integer, iPlainLoc As Integer
iPlainLoc = -1
oClip = 
createUnoService("com.sun.star.datatransfer.clipboard.SystemClipboard")

oConverter = createUnoService("com.sun.star.script.Converter")
oClipContents = oClip.getContents()
oTypes = oClipContents.getTransferDataFlavors()
Dim msg As String
msg = "Sorry no usefull text in the ClipBoard found"
For i=LBound(oTypes) To UBound(oTypes)
If oTypes(i).MimeType = "text/plain;charset=utf-16" Then
iPlainLoc = i
Exit For
End If
Next i
If iPlainLoc >= 0 Then
convertedString = 
oConverter.convertToSimpleType(oClipContents.getTransferData(oTypes(iPlainLoc)), 
com.sun.star.uno.TypeClass.STRING)

ClipboardAsText=convertedString
End If
End Function

Sub CopyToClipBoard( sText )
' create SystemClipboard instance
oClip = CreateUnoService( _
"com.sun.star.datatransfer.clipboard.SystemClipboard")
oTR = createUnoListener("Tr_", _
"com.sun.star.datatransfer.XTransferable")
' set data
oClip.setContents(oTR,Null)
sTxtCString = sText
'oClip.flushClipboard() ' does not work
End Sub

Function Tr_getTransferData(aFlavor as com.sun.star.datatransfer.DataFlavor)
' wordt pas aangeroepen als we cntrol+V doen intss is sTxtCString reeds 
gezet

If (aFlavor.MimeType = "text/plain;charset=utf-16") Then
Tr_getTransferData() = sTxtCString
End If
End Function

Function Tr_getTransferDataFlavors()
Dim aFlavor As new com.sun.star.datatransfer.DataFlavor
aFlavor.MimeType = "text/plain;charset=utf-16"
aFlavor.HumanPresentableName = "Unicode-Text"
Tr_getTransferDataFlavors() = array(aFlavor)
End Function

Function Tr_isDataFlavorSupported( _
aFlavor as com.sun.star.datatransfer.DataFlavor) as Boolean
If aFlavor.MimeType = "text/plain;charset=utf-16" Then
Tr_isDataFlavorSupported = true
Else
Tr_isDataFlavorSupported = false
End If
End Function

hope it helps

Fernand

On 26/03/2023 22:26, Zorg wrote:


Thanks

Ok  it seem a goot way

maybe it is obvious but how can i paste the clipboard in my odt 
without using dispatch




Le 26/03/2023 à 21:20, Caolán McNamara a écrit :

On Sun, 2023-03-26 at 12:06 +0200, Zorg wrote:

... We have try using XTransferable but without any success.

I think it should be possible in headless mode to use the clipboard
apis to copy and paste within LibreOffice. But in this case the
clipboard is basically a fake clipboard only for the headless
libreoffice instance, one which doesn't interact with any real system
clipboard.

So for example in your current code I see that copy_with_format copies
into a true X clipboard via xclip so in headless more we can't paste
from there and it has to be non headless to get that to work.

But if the LibreOffice apis to put something into the clipboard are
used then I think it should work to "Paste" within LibreOffice and get
that content back out, even in headless more.

f.e. in this example at
https://ask.libreoffice.org/t/is-there-any-way-to-copy-calc-cell-content-and-paste-something-else/32173/11
there is:

oClip =
ctx.getServiceManager().createInstanceWithContext("com.sun.star.datatra
nsfer.clipboard.SystemClipboard", ctx)
oClip.setContents(transferable, None)

where "transferable" is implemented in that example as something that
only supports "text/plain;charset=utf-16" so if you change
copy_with_format to something that follow the model of the above
example implementation of an XTransferable to set a transferable that
provides the data and its mimetype as text/html I would expect it to
work.



Re: Headless mail merge

2022-04-07 Thread sos

Hallo,

I can send the macro's for mailmerge (email & print) starting from 
selected variable data in the Beamer (Datasource Browser) and using a 
writer document as template


Greetz

Fernand

On 4/7/2022 9:38 AM, mcmurchy1917techy wrote:


Hi Marco

I have a Base application with forms. On one form I press a button 
which then performs a macro which executes a mailmerge


The macro works out

  * what query to source the data dependent on which button has been
pressed
  * where to send the output dependent on which button has been pressed

If your script calls LO headless the macro could pick up instructions 
from data created by the script.


Is this any help?

Alex


On 06/04/2022 21:50, Andrew Pitonyak wrote:
The first step is always do it without a script until you like the 
result. Then you try to automate it.


I did it a few times many years ago and do not remember the process.

Get BlueMail for Android 
On Apr 6, 2022, at 3:37 PM, Marco Marinello  
wrote:


Hi Andew,


thank you for your answer. I'll take a look at the links you pointed to.

The idea is, starting from a template in odt/doc/docx, to "fill in the
gaps" and save the filled document. Is there any other way rather than
mail merge?


All the best,

Marco


Il 06/04/22 18:19, Andrew Pitonyak ha scritto:

I had planned on documenting how to do this some years back
and AndrewBase.odt, and my only notes say that I should
document the new e-mail merge API released in OpenOffice.org
 version 2.01; that was a long time
ago. I generally do not have reason to use mailmerge, but did
you want to send something by email or to print? Someone
posted a question about using mail merge with UNO in Basic
here:

https://ask.libreoffice.org/t/syntax-for-using-spreadsheet-as-data-source-in-emailmerge-macro/24831
From my perspective, the fact that they used the
server com.sun.star.text.MailMerge is useful in that it
provides a pointer to the service to look at. Another request
for help here:
https://forum.openoffice.org/en/forum/viewtopic.php?f=20=59312
No answer; sadly. In AndrewMacro.odt, there is an example
that merges a bunch of documents from a directory into a
single document and it is listed as being related to "mail
merge", so I assume that somebody had run a mail merge and
this processes created many documents. But again, I have not
run a mail merge in many years. On Wednesday, April 06, 2022
06:47 EDT, Marco Marinello  wrote:

Hi all, what's the easiest way to perform a mail-merge
with libreoffice by passing arguments from an automated
script? Should I use UNO? Do you have any reference?
Thanks in advance, Best, Marco 





Re: Writer Table Columns Access via Java API

2019-05-07 Thread sos
hallo

how it works with basic

"iFotW" is the with off a collumn

   Twidth = oViewCursor.TextTable.width
     TTotalpercent = oViewCursor.TextTable.TableColumnRelativeSum
     startcell = oViewCursor.cell.cellname
     Kindex = asc(left(oViewCursor.cell.cellname,1))-65

     tabstops = CurRow.TableColumnSeparators()

    if uBound(tabstops)< 0 then
     iFotW = tWidth
     else

     if kindex = 0 then
     iFotW = (twidth * tabstops(Kindex).position/TTotalpercent)
     elseif kindex -1 = ubound(tabstops) then
     iFotW = twidth - (twidth * 
tabstops(Kindex-1).position/TTotalpercent)
     else
     iFotW = (twidth * tabstops(Kindex).position/TTotalpercent) - 
(twidth * tabstops(Kindex-1).position/TTotalpercent)
     endif
     end if

Hop it helps

On 5/6/2019 11:00 AM, fxruby wrote:
> Hello,
>
> I'm currently writing a program using the libreoffice java api.
> It's a programm controlling the Writer component. I can insert tables,
> place images inside the table and also change the height of table rows.
> Now I want to change the width of a table column. But when I try to get
> a column, I always get an empty object.
>
> Here's what I do (it's JRuby code, but very similar to java):
>
> [27] pry(main)> table.java_object
> =>
> [Proxy:1640296160,7f207000c9b0;gcc3[0];d5b23e2451b4b4a295c975776715,Type[com.sun.star.text.XTextTable]]>
> [28] pry(main)> columns = table.columns
> => #
> [29] pry(main)> columns.java_object
> =>
> [Proxy:1534694976,7f207c000de0;gcc3[0];d5b23e2451b4b4a295c975776715,Type[com.sun.star.table.XTableColumns]]>
> [30] pry(main)> columns.getCount
> => 12
> [31] pry(main)> col = columns.getByIndex 0
> => nil
>
> I always get nil :(
>
> There's some kind of functionality behind the method, because if I enter
> a wrong index, an exception is raised
>
> [32] pry(main)> col = columns.getByIndex 13
> Java::ComSunStarLang::IndexOutOfBoundsException:
> from
> com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(com/sun/star/lib/uno/environments/remote/Job.java:158)
> [33] pry(main)>
>
> Is this a bug or what am I doing wrong?
>
> kind regards,
>
> Andy
> ___
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: Implementing interface for importing external data in calc

2019-03-21 Thread sos
hallo,

you can import data into a spreadsheet in 2 ways

Fast = connecting the Calcdoc to a databasedoc and using buildin "Importer" 
service oDBRange.getReferredCells.doImport(oDesc())

Slow = import cell by cell using a dataset or a array

fast

function ConnectCalc_to_DBdoc(Optional sqlcalc as String, sDocURL as String , 
optional sArea as string)
dim extt as string
extt = right(bstandnm , 3)
SearchFlags = com.sun.star.frame.FrameSearchFlag.CREATE +  
com.sun.star.frame.FrameSearchFlag.ALL

if ucase(extt) = "OTS" then 'calc template
 Dim args(3) As New com.sun.star.beans.PropertyValue
Dim URL As String
   ' URL = convertToUrl("T:\Template\TOOLS\Berichten_spreadsheet.ots")
URL = convertToUrl(sDocurl)
args(0).Name = "AsTemplate"
args(0).Value = True
args(1).Name = "MacroExecutionMode"
args(1).Value = com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN
args(2).Name = "FilterName"
args(2).Value = "calc8_template"
args(3).Name = "Hidden"
args(3).Value = false
ODS = StarDeskTop.LoadComponentFromUrl(URL, "_blank", 0, args())
else
 ODS = 
StarDesktop.loadComponentFromURL("private:factory/scalc","_blank",SearchFlags,Array())
   endif

oSheet = ODS.Sheets.getByIndex(0)
if ismissing(sArea) then
sArea = "A1"
endif
area = osheet.getCellRangeByName(sArea).getRangeAddress()' adres is nodig, 
niet de range opzich
if not oDS.DatabaseRanges.hasByName("MyImport") then
oDS.DatabaseRanges.addNewByName("MyImport",area)
endif
oDBRange = oDS.DataBaseRanges.getByName("MyImport")
oDBcontext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
if oDBcontext.hasbyname("mysql_native")then
oDBcontext.revokeDatabaseLocation("mysql_native")
endif

 oDBcontext.registerDatabaseLocation("mysql_native",converttoURL("\\your 
DBdoclocation")

oDB = oDBcontext.GetByName("mysql_native")
oDB.Password = "yourpassword"

' we make first a QUERY because a simple  SQLstring in the  ImportDescritor 
only works with  OO-SQL en not with a native SQL  (this is a bug)

oQdefs = oDB.QueryDefinitions
oQ = createUnoService("com.sun.star.sdb.QueryDefinition")
oQ.EscapeProcessing = False
oQ.command = sqlcalc
If oQDefs.hasByName("calcdoc") Then
  oQDefs.removeByName("calcdoc")', oQueryObject)
   End If
oQDefs.insertByName("calcdoc", oQ)

Dim oDesc(3) as new com.sun.star.beans.PropertyValue
oDesc(0).Name = "DatabaseName"
oDesc(0).Value = "mysql_native"
oDesc(1).Name = "SourceType"
oDesc(1).Value = com.sun.star.sheet.DataImportMode.QUERY
oDesc(2).Name = "SourceObject"
oDesc(2).Value = "calcdoc"
 '   oDesc(3).Name = "IsNative"  'must been false  !
  '  oDesc(3).Value = false
oDBRange.getReferredCells.doImport(oDesc())
oDBcontext.revokeDatabaseLocation("mysql_native")
oDS.DatabaseRanges.removeByName("MyImport")

Dim FileProperties(1) As New com.sun.star.beans.PropertyValue
Url = "file:///" & sDocurl
   FileProperties(0).Name = "Overwrite"
FileProperties(0).Value = True
FileProperties(1).Name = "FilterName"
if lcase(extt) = "xls" then
FileProperties(1).Value = "MS Excel 97"
else
FileProperties(1).Value = ""
end if

If NOT IsMissing(sDocurl) and len(sDocurl) > 5 and ucase(right(sDocurl,3)) 
<> "OTS" Then
oDS.storeAsURL(Url, FileProperties())
end if
ConnectionviaDBdoc = ODS
end FUNCTION

slow

Sub ResultSetToCalc(oResultGet)
Dim args(3) As New com.sun.star.beans.PropertyValue
args(1).Name = "MacroExecutionMode"
args(1).Value = com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN
args(2).name = "Hidden"
args(2).Value = true
ods = nothing
ODS = 
StarDesktop.LoadComponentFromUrl("private:factory/scalc","_default",0,args())
oSheet = ODS.Sheets.getByIndex(0)
oCellCursor = oSheet.createCursor()

xPos = 0
yPos = 3

For i = 0 To oResultGet.MetaData.ColumnCount - 1
Cell = oSheet.getCellByPosition(xPos + i, yPos)
Cell.String = oResultGet.MetaData.getColumnName(i+1)
Next i
oResultGet.beforeFirst()
while oResultGet.next()
yPos = yPos + 1
For i = 0 To oResultGet.MetaData.ColumnCount - 1
Cell = oSheet.getCellByPosition(xPos + i, yPos)
Cell.String = 
oResultGet.getString(oResultGet.findColumn(oResultGet.MetaData.getColumnName(i+1)))
Next i
wend

oCellCursor.gotoStartOfUsedArea(true)
oCellCursor.gotoEndOfUsedArea(true)
nFirstCol = oCellCursor.getRangeAddress().StartColumn
nLastCol = oCellCursor.getRangeAddress().EndColumn
nStartRow = oCellCursor.getRangeAddress().StartRow
nLastRow = oCellCursor.getRangeAddress().EndRow

oRange = oSheet.getCellRangeByPosition(nFirstCol, nStartRow, nLastCol, 
nStartRow)'Rij met de kolomnamen
oRange.CharWeight = com.sun.star.awt.FontWeight.BOLD

Re: need help to insert an image with a caption with the Libo java API

2019-02-13 Thread sos

On 2/13/2019 10:45 AM, Miklos Vajna via LibreOffice wrote:

Hi,

On Tue, Feb 12, 2019 at 09:27:15AM +, LORENZO Vincent 
 wrote:


I would like to add a caption, to an inserted image in a text
document, but I don't find how to do that... Please do you have
pointer/documentation for me ?



I think captions are just a UI feature. The doc model just stores a text
frame around the image and the image is followed by the caption itself.

(I.e. later it's not possible to reliably detect if some content around
an image in a frame was created by hand or using the captions UI code.)

So you can do the same "manually" using the UNO API. When in doubt, see
what UNO API the ODT import uses to create the doc model based on the
input markup.

yep, insert a Frame, insert a Image in the frame and add a caption

sub InsertIllustrationReference
  oDoc = ThisComponent
  oText = oDoc.getText()
  oViewCursor = oDoc.getCurrentController().getViewCursor()

  oReference = oDoc.createInstance("com.sun.star.text.textfield.GetReference")
  With oReference
.SourceName = "Illustration"
.ReferenceFieldPart = 
com.sun.star.text.ReferenceFieldPart.ONLY_SEQUENCE_NUMBER
.ReferenceFieldSource = 
com.sun.star.text.ReferenceFieldSource.SEQUENCE_FIELD
.SequenceNumber = 0
  End With

  oText.insertTextContent(oViewCursor, oReference, False)
end sub



Regards,

Miklos




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

Re: need advices and help about Bookmark API.

2019-01-11 Thread sos
Hallo,
We did some test to use RDF (also Miklos his advice) to store some information 
about images in a Writerdoc, before we stored the information in the 
ImageObject , what was not a good idea.
Greetz
Fernand

below the code who works well

const BASE_TYPE = 
"http://PMGopmaak.writer/Allgraphics;
const TYPE_NAME = "GraphicURL"

const FILE_NAME = "PMGopmaak.writer/Allgraphics.rdf"


Sub StoreRDF
  RemoveRDF()

  ' "graph" staat hier niet voor een graphic maar voor een ellement die data 
kan omschrijven en stockeren
  ' een "litera" is een string die we stockeren en kunnen opvragen
  doc = ThisComponent
  repo = doc.getRDFRepository()
  type_uri = GetTypeURI()
  graph_name = doc.addMetadataFile(FILE_NAME, Array(type_uri))
  named_graph = repo.getGraph(graph_name)

  value_uri = CreateURI(com.sun.star.rdf.URIs.RDF_VALUE)



  if doc.supportsService("com.sun.star.text.TextDocument") then

   oDocGraphics = doc.GraphicObjects

vAlleFotos = oDocGraphics.getElementNames()
aantal = oDocGraphics.count
 For iG = 0 to aantal - 1
iFotNr = ig + 1
 '   sFotMetNr = vAlleFotos(iG)
oGraphic1 = oDocGraphics.GetbyIndex(ig)
  named_graph.addStatement(CreateURI(oGraphic1.Name &":", 
"URL"),value_uri,CreateLiteral(Ographic1.Title))
  named_graph.addStatement(CreateURI(oGraphic1.Name &":", 
"ONDERSCHRIFT"),value_uri,CreateLiteral(Ographic1.Hyperlinkname))

  next IG

  End If

  doc.setModified(True)
End Sub

Sub ReadRDF()
zoek = "Image1:URL"
  doc = ThisComponent
  repo = doc.getRDFRepository()

  type_uri = GetTypeURI()

  graph_names = doc.getMetadataGraphsWithType(type_uri)

  If ubound(graph_names) = -1 then exit sub

  graph_name = graph_names(0)

  named_graph = repo.getGraph(graph_name)
  value_uri = CreateURI(com.sun.star.rdf.URIs.RDF_VALUE)

 ' named_graph.clear
  enume = named_graph.getStatements(Null, value_uri, Null)
 ' xray named_graph.getStatements(null, value_uri, Null)
  s = ""
   Do while Enume.hasMoreElements
st = enume.nextElement()
 name = st.Subject.StringValue
   sts = st.Object.StringValue
s = s & name & ": " & sts & chr(10)
print name
   ' if name = zoek  then
   ' print sts
  ' named_graph.removeStatements(st.Subject, value_uri,st.Object)
   ' exit do
  ' endif
 loop

  msgbox s
End Sub


Sub RemoveRDF
  doc = ThisComponent
  repo = doc.getRDFRepository()

  type_uri = GetTypeURI()
  graph_names = doc.getMetadataGraphsWithType(type_uri)
  if ubound(graph_names) = -1 then exit sub
  graph_name = graph_names(0)
  doc.removeMetadataFile(graph_name)
  doc.setModified(True)
End Sub


Function GetTypeURI() As variant
  GetTypeURI = CreateURI(BASE_TYPE & "/" & TYPE_NAME)
End Function


Function CreateURI(n, Optional l) As Variant
  If IsMissing(l) Then
a = Array(n)
  Else
a = Array(n, l)
  End If
  uri = CreateUnoServiceWithArguments("com.sun.star.rdf.URI", a)
  CreateURI = uri
End Function

Function CreateLiteral(v) As Variant
  a = Array(v)
  literal = CreateUnoServiceWithArguments("com.sun.star.rdf.Literal", a)
  CreateLiteral = literal
End Function






On 1/11/2019 9:27 AM, Miklos Vajna wrote:

Hi Vincent,

On Thu, Jan 10, 2019 at 02:13:58PM +, LORENZO Vincent 
 wrote:


Question 1:
Currently we are studying the possibility to use the Bookmark field's name to 
store these datas. We want to use the Bookmark with start and end tag, to get 
something like that.

  Some text
   

In reality, I would prefer to be able to use a more structured datas, extending 
the Bookmark object (or using another solution ? ) to get that, something like 
that:

   
   Some text
   

but I have no idea if it is possible and how to do that. Please, does someone 
have an idea to structure my datas ?
Of course, if you have a better solution than Bookmark, fell free to propose it.



Bookmark is just a string; one hack you can do is to give it a unique
name, which refers to a per-document custom metadata, where the value
disturbs the user less. But that's still just a string, so you need to
serialize/load to/from string if you want to store key-value pairs.

An alternative is to use RDF annotations, which allows more complex
structures:

https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/RDF_metadata

(Though you need to use archive.org or something like that to access it,
seems the Apache site is currently not available.)

One shortcoming of RDF is that it's ODF-only; while the per-doc custom
metadata + bookmarks works with most other formats as well.



So, in this example, I write text, I look for it, then I create a XTextRange 
and at the end, I can create the Bookmark. I'm not very have happy with this 
solution. I would prefer a solution without the search step, but I don't know 
how to get a valid XTextRange (I admit I don't yet well understand  the 
behavior of the API).
Please, do you have 

Re: HTML import filter very (too) basic

2019-01-09 Thread sos
Jens

We build or proper HTML export, for email-html-body's,  using the API and basic 
macro's, send me your odt file and we give it a try.

You can then always adapt our macro's to the HTML output you prefere

Greetz

Fernand

On 1/9/2019 7:06 AM, Noel Grandin wrote:

Nobody owns it, and you're welcome to file a bug, but there are already a ton 
of HTML import bugs, our support is really very basic.



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

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


Re: API-CHANGE - dropping string properties which use vnd.sun.star.GraphicObject URL

2018-03-13 Thread sos


On 13/03/2018 13:23, Tomaž Vajngerl wrote:

Hi,

On Tue, Mar 13, 2018 at 8:54 PM, sos <s...@pmg.be> wrote:

Hallo Tomaž,
We are heavy users off the Image API so lots off code repair ahead :-)
Reading your blog comments, it is not clear for me where the Original
ImageURL (URL adress on a server) could been stored.
Can you add a aditional propterty to the graphicobject or to the graphic ?
We mostly uses a lowres images for the editing work,  the Images are not
"linked" but stays  in the document, and then just before printing we
replace the lowres images with Highres Images.
Sill we (miss) use  the graphicobject "title" property to store the Orginal
image URL's. needed to replace lowres with highres images.

Yes' I'll add a way to expose the URL that is contained inside the
XGraphic or add a new interface for that so it will be possible in the
new code to do that. Currently only VCL Graphic object has this so I
just convert XGraphic to Graphic in filters, but that's not possible
to do in extensions :)

Tomaž,
Fine, you will complete our API with a tool to go from XGraphic to 
Graphic  !
Can you also made something less complex for translating a storedimage 
to Xgraphic , now it can been done using the GraphicProvider (storing to 
a Tempimage) and even more complicated when use streams.


How make a Xgraphic from stored Orginal Image.

function MakeXGraphic(originalPath,B,H)
 sfile = converttoURL(originalPath)
 graphic =  getGraphicFromUrl(sFile)
 storeGraphicToURL(graphic,B,H,converttoURL("C:\" & susername & 
"temp\GridGraphic.jpg"))
 xgraphic =  getGraphicFromUrl(converttoURL("C:\" & susername & 
"temp\GridGraphic.jpg"))

 MakeXGraphic = xgraphic
end function

function getGraphicFromUrl(sFileUrl as String) as Object
  oProvider = createUnoService("com.sun.star.graphic.GraphicProvider")
  Dim oPropsIN(1)as new com.sun.star.beans.PropertyValue
  oPropsIN(0).Name  = "URL"
  oPropsIN(0).Value = sFileUrl
  oPropsIN(1).Name  = "FilterData"
  oPropsIN(1).Value = aFilterData()
  getGraphicFromUrl = oProvider.queryGraphic(oPropsIN())
end function

sub storeGraphicToURL(xgraphic,B,H,exportURL)
gProvider = createUnoService("com.sun.star.graphic.GraphicProvider")
Dim bArgs(2) as new com.sun.star.beans.PropertyValue
'creating filter data
Dim aFilterData (3) as new com.sun.star.beans.PropertyValue
'properties valid for all filters
aFilterData(0).Name  = "PixelWidth"'
aFilterData(0).Value = B
aFilterData(1).Name  = "PixelHeight"
aFilterData(1).Value = H

'filter data for the image/jpeg MediaType
aFilterData(2).Name  ="Quality"
aFilterData(2).Value = 90
aFilterData(3).Name  ="ColorMode"
aFilterData(3).Value = 0

  bArgs(0).Name = "URL"
  bArgs(0).Value = exportURL
  bArgs(1).Name = "MimeType"
  bArgs(1).Value = "image/jpeg"
  bArgs(2).Name = "FilterData"
  bArgs(2).Value = aFilterdata
  gProvider.storeGraphic(xgraphic,bArgs())
end sub




Greetz

Fenand

Regards, Tomaž


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


Re: API-CHANGE - dropping string properties which use vnd.sun.star.GraphicObject URL

2018-03-13 Thread sos

Hallo Tomaž,
We are heavy users off the Image API so lots off code repair ahead :-)
Reading your blog comments, it is not clear for me where the Original 
ImageURL (URL adress on a server) could been stored.

Can you add a aditional propterty to the graphicobject or to the graphic ?
We mostly uses a lowres images for the editing work,  the Images are not 
"linked" but stays  in the document, and then just before printing we 
replace the lowres images with Highres Images.
Sill we (miss) use  the graphicobject "title" property to store the 
Orginal image URL's. needed to replace lowres with highres images.

Greetz

Fenand

On 13/03/2018 10:54, Tomaž Vajngerl wrote:

Hi,

I'm working on image handling re-work [1] [2] [3] and I need to drop
the GraphicURL (and similar properties like BackGraphicURL - see [3]
and most of the changes should be contained in [4] patch) of type
String and use a property of the type XGraphic. The reason is to make
reference-counting safe, which means that exposing internal URL's
(URLs with prefix vnd.sun.star.GraphicObject) will go away and
XGraphic will be used instead. Most of the details are written in [2]
and [3] so I won't write it here again.

[1] 
https://wiki.documentfoundation.org/Development/Budget2017#Image_handling_re-work
[2] 
https://tomazvajngerl.blogspot.com/2018/01/improving-image-handling-in-libreoffice.html
[3] 
https://tomazvajngerl.blogspot.com/2018/03/improving-image-handling-in-libreoffice.html
[4] https://gerrit.libreoffice.org/51201

Best Regards, Tomaž
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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


Re: Usage of ActiveX in Libre Office

2017-01-27 Thread sos
OkAny idea how we can test the behaviour with ActiveX removed ?GreetzFernand


Sent from my Samsung Galaxy smartphone.
 Original message From: Bryan Quigley 
<bryan.quig...@canonical.com> Date: 27/01/2017  18:09  (GMT+01:00) To: sos 
<s...@pmg.be> Cc: libreoffice@lists.freedesktop.org, libroffice@artavi.de 
Subject: Re: Usage of ActiveX in Libre Office 
I don't believe it would be affected, but it would need to be tested to be sure.

Thanks,
Bryan

On Wed, Jan 25, 2017 at 3:43 PM, sos <s...@pmg.be> wrote:
> Bryan,
> Please clarify, will stuff like
>
> oShell = CreateObject("WScript.Shell")
>
> Still working after removing ActiveX?
> If not: then lots off API code will been broken and this will been a BIG
> regression ?
>
> Greetz
>
> Fernand
>
>
> Sent from my Samsung Galaxy smartphone.
>
>  Original message 
> From: Bryan Quigley <bryan.quig...@canonical.com>
> Date: 25/01/2017 20:43 (GMT+01:00)
> To: libreoffice@lists.freedesktop.org, libroffice@artavi.de
> Subject: re: Usage of ActiveX in Libre Office
>
> Welcome and thanks for responding to notice!
>
> You're the first person (AFAICT) who has written in response to the
> deprecation notice.   My original intention was to remove it from the
> 5.2 release if we got no responses to that notice (that obviously
> hasn't happened).
>
> At this point the soonest release we could remove it from is 5.4
> (which might be around Aug 2017).  It's far from scheduled though.
>
> We really don't have much data to base this decision on, so I'll ask
> you instead.  Knowing keeping support has an impact on LibreOffice
> development, when do you think is reasonable for ActiveX support to be
> removed?
>
> What Windows version are you running?
>
> Kind regards,
> Bryan
>
> [The whole original thread - quite long]
> https://lists.freedesktop.org/archives/libreoffice/2015-December/071580.html
> ___
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


re: Usage of ActiveX in Libre Office

2017-01-25 Thread sos
Bryan,Please clarify, will stuff like
oShell = CreateObject("WScript.Shell")

Still working after removing ActiveX?If not: then lots off API code will been 
broken and this will been a BIG regression ?
Greetz
Fernand

Sent from my Samsung Galaxy smartphone.
 Original message From: Bryan Quigley 
 Date: 25/01/2017  20:43  (GMT+01:00) To: 
libreoffice@lists.freedesktop.org, libroffice@artavi.de Subject: re: Usage 
of ActiveX in Libre Office 
Welcome and thanks for responding to notice!

You're the first person (AFAICT) who has written in response to the
deprecation notice.   My original intention was to remove it from the
5.2 release if we got no responses to that notice (that obviously
hasn't happened).

At this point the soonest release we could remove it from is 5.4
(which might be around Aug 2017).  It's far from scheduled though.

We really don't have much data to base this decision on, so I'll ask
you instead.  Knowing keeping support has an impact on LibreOffice
development, when do you think is reasonable for ActiveX support to be
removed?

What Windows version are you running?

Kind regards,
Bryan

[The whole original thread - quite long]
https://lists.freedesktop.org/archives/libreoffice/2015-December/071580.html
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Macro encryption different in between 4.2 and 5.1

2016-07-12 Thread SOS


On 12/07/2016 15:07, Michael Stahl wrote:

On 12.07.2016 08:57, SOS wrote:

sorry i mixed up the situation
extension *Build in 4.2 and used in 5.1*:
must be:
extension *Build in 5.1 and used in 4.2*: the functions and Sub's in the
libraries are not available,  its only after opening the library
"manualy" and after entering the password that make the functions and
the sub's available in memory.
Build in 4.2 and used in 5.1 gives no problems

On 11/07/2016 17:05, SOS wrote:

A extension made with password protected Basic Libraries using LO 5.1
do not "load" properly the libraries under LO 4.2

We load a  password protected library using the folowing code.
If (Not GlobalScope.BasicLibraries.isLibraryLoaded("DbUtils")) Then
GlobalScope.BasicLibraries.LoadLibrary("DbUtils")
End If
extension Build and used in 4.2  makes all functions and sub's
available in memory.
extension Build and used in 5.1  makes all functions and sub's
available in memory.
extension Build in 4.2 and used in 5.1: the functions and Sub's in the
libraries are not available,  its only after opening the library
"manualy" and after entering the password that make the functions and
the sub's available in memory.

The extensions are build under Windows
There is a difference in size between the extension build in 5.1 and 4.2
5.1 gives 69 KB
4.2 gives 67 KB
There is no error after
"GlobalScope.BasicLibraries.LoadLibrary("DbUtils")
once the librarie is opened with the password, then
"GlobalScope.BasicLibraries.LoadLibrary("DbUtils")"  is working fine
even after closing LO !!

Can someone confirm this behavior and sould i filled a issue ?

hi Fernand,

there were numerous bugfixes for password protected libraries during
that time, like tdf#87530 tdf#68983 tdf#67685 tdf#52076 tdf#40173

but all those bugs were about just using the UI, probably nobody has
tested what happens when calling LoadLibrary() from a macro.

perhaps there is a new bug in LO 5.1 and we can fix it, or perhaps the
bug was in LO 4.2 which means it can't be fixed now, hard to tell
without a more thorough investigation - please file a bug with exact
steps to reproduce the problem.

Hallo Michael,

I can fill a issue with both versions of the encrypted macro Modules, 
but i suppose  its a waste of developer time to investigate,
I am developing new extensions  in 5.1 and the users of my extensions 
still using 4.2 as soon the users will upgrade to  5.1 the problem is 
gone.  and i can always use to make 4.2 extensions who works also fine 
with 5.1.


Thanks

Fernand

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


Re: Macro encryption different in between 4.2 and 5.1

2016-07-12 Thread SOS

sorry i mixed up the situation
extension *Build in 4.2 and used in 5.1*:
must be:
extension *Build in 5.1 and used in 4.2*: the functions and Sub's in the 
libraries are not available,  its only after opening the library  
"manualy" and after entering the password that make the functions and 
the sub's available in memory.

Build in 4.2 and used in 5.1 gives no problems

greetz
Fernand
On 11/07/2016 17:05, SOS wrote:
A extension made with password protected Basic Libraries using LO 5.1  
do not "load" properly the libraries under LO 4.2


We load a  password protected library using the folowing code.
If (Not GlobalScope.BasicLibraries.isLibraryLoaded("DbUtils")) Then
GlobalScope.BasicLibraries.LoadLibrary("DbUtils")
End If
extension Build and used in 4.2  makes all functions and sub's 
available in memory.
extension Build and used in 5.1  makes all functions and sub's 
available in memory.
extension Build in 4.2 and used in 5.1: the functions and Sub's in the 
libraries are not available,  its only after opening the library  
"manualy" and after entering the password that make the functions and 
the sub's available in memory.


The extensions are build under Windows
There is a difference in size between the extension build in 5.1 and 4.2
5.1 gives 69 KB
4.2 gives 67 KB
There is no error after 
"GlobalScope.BasicLibraries.LoadLibrary("DbUtils")
once the librarie is opened with the password, then 
"GlobalScope.BasicLibraries.LoadLibrary("DbUtils")"  is working fine 
even after closing LO !!


Can someone confirm this behavior and sould i filled a issue ?

Thanks

Fernand

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


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


Macro encryption different in between 4.2 and 5.1

2016-07-11 Thread SOS
A extension made with password protected Basic Libraries using LO 5.1  
do not "load" properly the libraries under LO 4.2


We load a  password protected library using the folowing code.
If (Not GlobalScope.BasicLibraries.isLibraryLoaded("DbUtils")) Then
GlobalScope.BasicLibraries.LoadLibrary("DbUtils")
End If
extension Build and used in 4.2  makes all functions and sub's available 
in memory.
extension Build and used in 5.1  makes all functions and sub's available 
in memory.
extension Build in 4.2 and used in 5.1: the functions and Sub's in the 
libraries are not available,  its only after opening the library  
"manualy" and after entering the password that make the functions and 
the sub's available in memory.


The extensions are build under Windows
There is a difference in size between the extension build in 5.1 and 4.2
5.1 gives 69 KB
4.2 gives 67 KB
There is no error after "GlobalScope.BasicLibraries.LoadLibrary("DbUtils")
once the librarie is opened with the password, then 
"GlobalScope.BasicLibraries.LoadLibrary("DbUtils")"  is working fine 
even after closing LO !!


Can someone confirm this behavior and sould i filled a issue ?

Thanks

Fernand

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


Re: Change in use of basic (uno) api since version 5.1?

2016-05-31 Thread SOS

Winfried,

On 31/05/2016 11:46, Winfried Donkers wrote:

Hi Fernand,


works as normal  for me on (windows) LO 5.1.2.2 greetz Fernand On



The LO-part of the scripts start with the line

Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )


Do you  mean that the following vbscript:

  option explicit

  Dim t

  set t = WScript.CreateObject( "com.sun.star.ServiceManager")
  msgbox "srv-mgr created"
  set t = nothing

  set t = CreateObject( "com.sun.star.ServiceManager")
  msgbox "srv-mgr created again"
  set t = nothing

runs without error on your machine with windows and LO5.1.2.2?

Here, I use LO 5.1.3.2 and Windows7-64; neither of the 2 CreateObject calls 
succeed.

Winfried

Nono Sorry
I just run under LO basic  the folowing sub where Xray returns the 
ServiceManager


sub test
Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )
xray oServiceManager
end sub




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


Re: Change in use of basic (uno) api since version 5.1?

2016-05-31 Thread SOS

Halo Winfried
works as normal  for me on (windows) LO 5.1.2.2
greetz
Fernand
On 31/05/2016 9:17, Winfried Donkers wrote:

Hi all,

I use basic scripts in our ERP system to open, create, modify, etc. Calc 
documents.
This worked fine with LibreOffice for years till version 5.1.

The LO-part of the scripts start with the line

   Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )

With LO version 5.1 this line produces an error (Err.Number is -2147418113, 
F8000).
There are no changes in the ERP system nor in the scripts, everything still 
works fine on machines with LO 5.0. Only the machines with LO 5.1 have this 
problem.

I couldn't find anything related in the release notes for version 5.1.
What has changed and what can I do to get the scripts working again with 
LibreOffice?


Winfried

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


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


Re: Handling the sidbar with API and macro's

2016-05-03 Thread sos
Hallo Katerina,Thanks, Laurent Goddard pointed me already in this 
direction.Problem is the need of a extension to make the "mydeck" 
sidebar.Secondly I need also to create some private controls to call some 
macro,s from the sidebar. I mean: how to call a macro from the sidebar in the 
same way we can customise our toolbars and menu"s for calling some 
macro'sGreetzFernand


Sent from my Samsung Galaxy smartphone.
 Original message From: Katarina Behrens 
 Date: 02/05/2016  11:19  (GMT+01:00) To: 
libreoffice@lists.freedesktop.org Subject: Re: Handling the sidbar with API and 
macro's 
Hi,

> Any news on if and how we can handle the sidebar using the API and Macro's ?

Since Libreoffice 5.1 (or was it 5.0 already?) sidebar has UNO API, so it can 
be 
used in macros or applications/programs that talk to Libreoffice via UNO API in 
any language that has UNO bindings (Basic, Python, Java, C++, Haskell etc.)

Entry point is XSidebarProvider [1] (available via XController2 unpublished 
interface). More relevant interfaces: XDecks, XDeck, XPanel

The following git commit [2] has some nice Basic example on how to use sidebar 
UNO API (hm, the example should perhaps move to some other location, a git 
commit is pretty bad place for it to be)

HTH

[1] 
http://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1ui_1_1XSidebarProvider.html
[2] 
https://cgit.freedesktop.org/libreoffice/core/commit/?id=a64999511ae654131d997eec9a3d78478cfc1c75
-- 

Katarina Behrens

Softwareentwicklerin LibreOffice
–––
CIB software GmbH
Geschäftsstelle Hamburg
Flachsland 10
22083 Hamburg
–––
T +49 (40) / 28 48 42 -235
F +49 (40) / 28 48 42 -100

katarina.behr...@cib.de
www.cib.de
–––
Sitz: München
Registergericht München, HRB 123286
Geschäftsführer: Dipl.-Ing. Ulrich Brandner
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Handling the sidbar with API and macro's

2016-04-28 Thread SOS

hallo,

Any news on if and how we can handle the sidebar using the API and Macro's ?

Thanks for any hints

Fernand

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


Re: Can Java Scripts no longer been called from basic macro ?

2016-04-16 Thread SOS

Oliver,
sorry but still the same error
An exception occurred
Type: com.sun.star.script.provider.ScriptFrameworkErrorException
Message: unsatisfied query for interface of type 
com.sun.star.script.provider.XScriptProvider!.


- Windows 8
- het scripts are on the machine  "C:\Program Files (x86)\LibreOffice 
4\share\Scripts\javascript\HelloWorld\helloworld.js"


but in de UI i can also not sea the Java libraries  maybe i must 
enabling something in the options to handle java ?


Greetz




On 14/04/2016 19:03, Oliver Brinzing wrote:

Hi,

this will work in LO 4 and LO 5:

OPTION EXPLICIT

Sub oJavaScriptMacro
Dim oMSPF as Object
Dim oSP as Object
Dim oScript as Object
oMSPF = 
GetDefaultContext.getValueByName("/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory")

oSP = oMSPF.createScriptProvider("")
' JavaScript Macro
oScript = 
oSP.getScript("vnd.sun.star.script:HelloWorld.helloworld.js?language=JavaScript=share")

oScript.invoke(Array(), Array(), Array())
End Sub

Regards
Oliver

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


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


Can Java Scripts no longer been called from basic macro ?

2016-04-14 Thread SOS

Hallo,

I need confirmation if a java script or macro can no longer (sinds (LO 
4) been called from a basic macro who was running fine on LO 3

using 4.4 I get a error calling the script:
oScript = 
oSP.getScript("vnd.sun.star.script:Library1\Macro1.js?language=JavaScript=user") 



the script is located under windows:

I made manually the directorys under 
Users\[UserName]\AppData\Roaming\LibreOffice\3\user\


"Scripts" directory
"JavaScript" directory
"Library1" directory with the Macro1.js file inside

C:\Users\[UserName]\AppData\Roaming\LibreOffice\3\user\Scripts\JavaScript\Library1\Macro1.js

the compleet examle from the "openoffice3.web.fc2.com" website:

Sub oJavaScriptMacro
Dim oMSPF as Object
Dim oSP as Object
Dim oScript as Object
oMSPF = GetDefaultContext.getValueByName( 
"/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory")

oSP = oMSPF.createScriptProvider("")
' JavaScript Macro
oScript = 
oSP.getScript"vnd.sun.star.script:Library1\Macro1.js?language=JavaScript=user") 


' Macro実行
oScript.invoke( array(),array(),array())
End Sub

Thanks for any help

Fernand

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


Re: alternatives to Firebird: sqlite

2016-03-08 Thread SOS


On 8/03/2016 17:33, Norbert Thiebaud wrote:

On Tue, Mar 8, 2016 at 5:47 AM, SOS <s...@pmg.be> wrote:

A disruptive solution could be to abandon the "embedded"  idea and replace
the current embedded engine by a new engine who use a spreadsheet file  as a
"editable" storage who is protected for accidental editing.

Yeah sure, let's encourage people to use a spreadsheet as a
database... as is it such a proven good, efficient and performant
idea


Sorry if i heard your feelings, but sea "disruptive" as something less worse 
than the current stuff :-) 

- 1 user only access
- loss off data
- no recovery..



Norbert


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


Re: alternatives to Firebird: sqlite

2016-03-08 Thread SOS


On 8/03/2016 15:47, Dan Lewis wrote:

On 03/08/2016 06:47 AM, SOS wrote:
A disruptive solution could be to abandon the "embedded"  idea and 
replace the current embedded engine by a new engine who use a 
spreadsheet file  as a "editable" storage who is protected for 
accidental editing.
Currently the use off a spreadsheet as database works fine en is fast 
enough for most small data sets. Just makes this system, editable.
For bigger data sets, users can and will use a database off there own 
choice yo  been connected to LO.

Greetz
Fernand
 Abandoning the "embedded" idea may be a good idea. One of the 
things that Base does is connect to a spreedsheet, but how does one 
use Base in this manner to create a relational database? Just how 
involved with such a speadsheet be? What would the RDBMS be for a 
relatational database? (DBMS is not designed for a relational database 
as I understand it.
That's what I mean with "new engine" who must be capable to make the 
relations-joins with SQL statements  between the different sheets in the 
spreadsheet.


 Dan

On 8/03/2016 9:02, Lionel Elie Mamane wrote:

On Tue, Mar 08, 2016 at 09:59:18AM +1100, Chris Sherlock wrote:


Oh, and I’m not sure if this brings much to the table, but I wonder
if we can simulate joins. After all, to get a right join you just
swap tables, and you can actually simulate a full outer join with
just a combination of other joins.

See the last part of
https://lists.freedesktop.org/archives/libreoffice/2016-March/073572.html 


"compatibility with other databases" was a reference to
https://bugs.documentfoundation.org/42165
https://cgit.freedesktop.org/libreoffice/core/commit/?id=c25bb400bbfe20b3b13237ed10935ec9d0f6d769 



In short: yes, it can be done.

All these issues add up, and in the end I summarise them as "It is
probably possible to build a 'compliant' database on top of SQLite,
but SQLite is not that by itself". That is, we can "use" SQLite as a
(big) chunk of our embedded database engine, which we would DEVELOP
OURSELVES, but it is not "take a database engine and embed it in
LibreOffice". It is "develop our own database engine, using SQLite as
a foundation that gets us many many percent of the way, but not the
full way". If someone wants to do that, and commits to maintaining it,
then fine. Glad to take patches / see it integrated. *If* it comes
with a serious intent of maintaining it! Note that the ODBC driver
basically does that. So yeah, doable. Can be redone. Maybe we could
even embed the ODBC driver in some way. I have some uncertainties
around this, because I think that ODBC drivers "need" a driver manager
(that's what the Microsoft documentations say somewhere), but I never
really understood completely why, and some FLOSS ODBC drivers *are*
meant (by their author) to be able to be used without driver manager,
I think.

See also
https://bugs.documentfoundation.org/show_bug.cgi?id=38811#c21


What SQLite does it not necessarily bad, it is *different*. Dynamic
typing has its uses and its advantages. Just as NoSQL. But it makes
them a "bad fit" for a framework centred around the "classic" / usual
strong-type SQL.



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


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


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


Re: alternatives to Firebird: sqlite

2016-03-08 Thread SOS
A disruptive solution could be to abandon the "embedded"  idea and 
replace the current embedded engine by a new engine who use a 
spreadsheet file  as a "editable" storage who is protected for 
accidental editing.
Currently the use off a spreadsheet as database works fine en is fast 
enough for most small data sets. Just makes this system, editable.
For bigger data sets, users can and will use a database off  there own 
choice yo  been connected to LO.

Greetz
Fernand

On 8/03/2016 9:02, Lionel Elie Mamane wrote:

On Tue, Mar 08, 2016 at 09:59:18AM +1100, Chris Sherlock wrote:


Oh, and I’m not sure if this brings much to the table, but I wonder
if we can simulate joins. After all, to get a right join you just
swap tables, and you can actually simulate a full outer join with
just a combination of other joins.

See the last part of
https://lists.freedesktop.org/archives/libreoffice/2016-March/073572.html
"compatibility with other databases" was a reference to
https://bugs.documentfoundation.org/42165
https://cgit.freedesktop.org/libreoffice/core/commit/?id=c25bb400bbfe20b3b13237ed10935ec9d0f6d769

In short: yes, it can be done.

All these issues add up, and in the end I summarise them as "It is
probably possible to build a 'compliant' database on top of SQLite,
but SQLite is not that by itself". That is, we can "use" SQLite as a
(big) chunk of our embedded database engine, which we would DEVELOP
OURSELVES, but it is not "take a database engine and embed it in
LibreOffice". It is "develop our own database engine, using SQLite as
a foundation that gets us many many percent of the way, but not the
full way". If someone wants to do that, and commits to maintaining it,
then fine. Glad to take patches / see it integrated. *If* it comes
with a serious intent of maintaining it! Note that the ODBC driver
basically does that. So yeah, doable. Can be redone. Maybe we could
even embed the ODBC driver in some way. I have some uncertainties
around this, because I think that ODBC drivers "need" a driver manager
(that's what the Microsoft documentations say somewhere), but I never
really understood completely why, and some FLOSS ODBC drivers *are*
meant (by their author) to be able to be used without driver manager,
I think.

See also
https://bugs.documentfoundation.org/show_bug.cgi?id=38811#c21


What SQLite does it not necessarily bad, it is *different*. Dynamic
typing has its uses and its advantages. Just as NoSQL. But it makes
them a "bad fit" for a framework centred around the "classic" / usual
strong-type SQL.



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


Re: DPI and screen resolution on OS X

2016-02-03 Thread SOS


On 3/02/2016 3:55, Kohei Yoshida wrote:

On Wed, 2016-02-03 at 10:52 +1100, Chris Sherlock wrote:

The other question is: why would we not want to the actual DPI and
screen resolution?

My understanding is that, historically, the OS provided a function to
query DPI but what gets returned from such function was not always
accurate (or always not accurate depending on who you ask).  So, the
workaround at the time was to assume that DPI is always 96 (and
hard-code that value) regardless of what the OS told you, which worked
just fine because the monitors used back in the day had the same screen
resolution.
Mostly DPI is found in the header of a pixelfile (taken by camera). 
Unfortunately it's not the photographer who gets to decide about the 
needed DPI.
DPI is actually a wrong definition for documents, Dots Per Inch is a 
definition used by output devices. Screens need a PIXEL par DOT but for 
print devices there is no precise correlation between the number of dots 
used by the device and the pixels needed in  the image for having a 
maximum image-view quality.

The print industry has come to some standards by trial and error.
- monitor screens need 96 - (220-retina) pixels per inch
- laser printers need 150 pixels per inch (up tot 2000 + dots)
- offset printers need 254 -300 pixels per inch (up to 3000 dots)

For a document we must use Pixels Per Inch which are calculated 
regarding the DPI needed by the final output device and represented in 
each document by  a "Print Intention" .
When producing docs for printing on an office laser printer we need less 
Pixels Per Inch than docs (magazines , books) which are printed on 
offset machines.
When an image is loaded, then the system can calculate the viewing size 
using the number of pixels needed by the "Print Intention". The user can 
then see the maximum size the image can have in his document without 
losing image  quality.


Hope it helps

Fernand


I'm not sure if that's a non-issue today.  I don't know enough about
this topic to tell you that with confidence.

Kohei

___
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: DPI and screen resolution on OS X

2016-02-03 Thread SOS


On 3/02/2016 11:32, Chris Sherlock wrote:

On 3 Feb 2016, at 7:24 PM, SOS <s...@pmg.be> wrote:


On 3/02/2016 3:55, Kohei Yoshida wrote:

On Wed, 2016-02-03 at 10:52 +1100, Chris Sherlock wrote:

The other question is: why would we not want to the actual DPI and
screen resolution?

My understanding is that, historically, the OS provided a function to
query DPI but what gets returned from such function was not always
accurate (or always not accurate depending on who you ask).  So, the
workaround at the time was to assume that DPI is always 96 (and
hard-code that value) regardless of what the OS told you, which worked
just fine because the monitors used back in the day had the same screen
resolution.

Mostly DPI is found in the header of a pixelfile (taken by camera). 
Unfortunately it's not the photographer who gets to decide about the needed DPI.
DPI is actually a wrong definition for documents, Dots Per Inch is a definition 
used by output devices. Screens need a PIXEL par DOT but for print devices 
there is no precise correlation between the number of dots used by the device 
and the pixels needed in  the image for having a maximum image-view quality.
The print industry has come to some standards by trial and error.
- monitor screens need 96 - (220-retina) pixels per inch
- laser printers need 150 pixels per inch (up tot 2000 + dots)
- offset printers need 254 -300 pixels per inch (up to 3000 dots)

Definitely true :-) Only in OS X’s case, it doesn’t actually report back the 
correct resolution unless you ask for the backing coordinate system.

The PPI business is a red herring I think I’ve introduced into this discussion 
I’m afraid. We calculate the PPI ourselves (and call it DPI) based on the 
reported pixels, and the size of the screen in mm (which we obviously convert 
to inches).
its a bit the wrong discussion: what we see on screen has no relevance: 
the user can "zoom" the document until he is happy with the image 
quality on screen
But in the current situation, LO users has no idea how big (size) he can 
place a image in a document.
When the doc is intented for online use (email and Web) then there is a 
minimum of 96 pixels par inch needed. More is no problem but is in many 
cases a overkill.
Who is editing a "book" or a "magazine" need minimal 254 pixels par inch 
to has a good image quality after printing.
When using less pixels the book pages  are looking fine on screen put 
shall have a creepy print quality
So having a new "DocumentProperty" indicating the needed pixels (for 
printing)  make it possible to make the "size" calculations before 
inserting.


I guess I’m curious as to what is relying on the screen resolution and PPI.

Although… it’s funny that we have the function SalGraphics::GetResolution, but 
that returns the PPI!

Chris
___
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: DPI and screen resolution on OS X

2016-02-03 Thread SOS


On 3/02/2016 13:01, Chris Sherlock wrote:

On 3 Feb 2016, at 10:35 PM, SOS <s...@pmg.be> wrote:


On 3/02/2016 11:32, Chris Sherlock wrote:

On 3 Feb 2016, at 7:24 PM, SOS <s...@pmg.be> wrote:

On 3/02/2016 3:55, Kohei Yoshida wrote:

On Wed, 2016-02-03 at 10:52 +1100, Chris Sherlock wrote:

The other question is: why would we not want to the actual DPI and
screen resolution?

My understanding is that, historically, the OS provided a function to
query DPI but what gets returned from such function was not always
accurate (or always not accurate depending on who you ask).  So, the
workaround at the time was to assume that DPI is always 96 (and
hard-code that value) regardless of what the OS told you, which worked
just fine because the monitors used back in the day had the same screen
resolution.

Mostly DPI is found in the header of a pixelfile (taken by camera). 
Unfortunately it's not the photographer who gets to decide about the needed DPI.
DPI is actually a wrong definition for documents, Dots Per Inch is a definition 
used by output devices. Screens need a PIXEL par DOT but for print devices 
there is no precise correlation between the number of dots used by the device 
and the pixels needed in  the image for having a maximum image-view quality.
The print industry has come to some standards by trial and error.
- monitor screens need 96 - (220-retina) pixels per inch
- laser printers need 150 pixels per inch (up tot 2000 + dots)
- offset printers need 254 -300 pixels per inch (up to 3000 dots)

Definitely true :-) Only in OS X’s case, it doesn’t actually report back the 
correct resolution unless you ask for the backing coordinate system.

The PPI business is a red herring I think I’ve introduced into this discussion 
I’m afraid. We calculate the PPI ourselves (and call it DPI) based on the 
reported pixels, and the size of the screen in mm (which we obviously convert 
to inches).

its a bit the wrong discussion: what we see on screen has no relevance: the user can 
"zoom" the document until he is happy with the image quality on screen
But in the current situation, LO users has no idea how big (size) he can place 
a image in a document.
When the doc is intented for online use (email and Web) then there is a minimum 
of 96 pixels par inch needed. More is no problem but is in many cases a 
overkill.
Who is editing a "book" or a "magazine" need minimal 254 pixels par inch to has 
a good image quality after printing.
When using less pixels the book pages  are looking fine on screen put shall 
have a creepy print quality
So having a new "DocumentProperty" indicating the needed pixels (for printing)  make it 
possible to make the "size" calculations before inserting.

We are actually detecting the PPI… with the greatest of respect, I’ve actually 
implemented some testing changes to detect the correct PPI and on my Mac is 
should actually be just over 200PPI…

ok but how did you detected the PPI ?
You need the "fysical" dots given by the manufactor off the screen. Then 
you cab devide the total dots by the size off the screen

Standard Led and LCD screens have around 100 dots par inch
A Retina screen on a tablet or a smartphone could have 150-300 dots par 
inch





I think this is going in the wrong direction. I worked for Epson about 13 years 
ago, so I have some knowledge of printing :-) I could talk your ear off on 
colour management and halftoning, and I probably know a bit too much about 
piezo-electric crystal technology…

I’m really trying to understand what is relying on the resolution and what sort 
of impact fixing the resolution detection might be having on OS X systems.

Chris


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


Re: DPI and screen resolution on OS X

2016-02-03 Thread SOS

hallo Armin
new comments inline on your remarks
On 3/02/2016 14:10, Armin Le Grand wrote:

Hi,

comments inline

Am 03.02.2016 um 12:35 schrieb SOS:


On 3/02/2016 11:32, Chris Sherlock wrote:

On 3 Feb 2016, at 7:24 PM, SOS <s...@pmg.be> wrote:


On 3/02/2016 3:55, Kohei Yoshida wrote:

On Wed, 2016-02-03 at 10:52 +1100, Chris Sherlock wrote:

The other question is: why would we not want to the actual DPI and
screen resolution?

My understanding is that, historically, the OS provided a function to
query DPI but what gets returned from such function was not always
accurate (or always not accurate depending on who you ask). So, the
workaround at the time was to assume that DPI is always 96 (and
hard-code that value) regardless of what the OS told you, which 
worked
just fine because the monitors used back in the day had the same 
screen

resolution.
Mostly DPI is found in the header of a pixelfile (taken by camera). 
Unfortunately it's not the photographer who gets to decide about 
the needed DPI.
DPI is actually a wrong definition for documents, Dots Per Inch is 
a definition used by output devices. Screens need a PIXEL par DOT 
but for print devices there is no precise correlation between the 
number of dots used by the device and the pixels needed in  the 
image for having a maximum image-view quality.

The print industry has come to some standards by trial and error.
- monitor screens need 96 - (220-retina) pixels per inch
- laser printers need 150 pixels per inch (up tot 2000 + dots)
- offset printers need 254 -300 pixels per inch (up to 3000 dots)
Definitely true :-) Only in OS X’s case, it doesn’t actually report 
back the correct resolution unless you ask for the backing 
coordinate system.


The PPI business is a red herring I think I’ve introduced into this 
discussion I’m afraid. We calculate the PPI ourselves (and call it 
DPI) based on the reported pixels, and the size of the screen in mm 
(which we obviously convert to inches).
its a bit the wrong discussion: what we see on screen has no 
relevance: the user can "zoom" the document until he is happy with 
the image quality on screen
But in the current situation, LO users has no idea how big (size) he 
can place a image in a document.
When the doc is intented for online use (email and Web) then there is 
a minimum of 96 pixels par inch needed. More is no problem but is in 
many cases a overkill.
Who is editing a "book" or a "magazine" need minimal 254 pixels par 
inch to has a good image quality after printing.
When using less pixels the book pages  are looking fine on screen put 
shall have a creepy print quality
So having a new "DocumentProperty" indicating the needed pixels (for 
printing)  make it possible to make the "size" calculations before 
inserting.


It is relevant. If you have a vector graphic and it gets converted to 
bitmap, the DPI from the system is used to define the resulting pixel 
size. Conversion to bitmap happens more often than it might seem. 
Examples:

- user chooses to do so (context menu, convert to bitmap)
- some exporters who are not capable using vector graphics
- PDF, e.g. PDF/1A which is not allowed to use transprencies and 
solves by creating bitmaps where graphics and transparent parts overlap

- 3D renderer which targets to bitmaps (chart, 3D objects)
Thus, the system DPI is essential. If on Mac, the bigger DPI will be 
used, it will enlarge all these conversions.

Thats the problem withn this "system DPI"
for screen viewing is 96 DPI OK  but far to less when the document needs 
to be printed
we need a replacement for the system DPI who is a value who must can 
differ par document


HTH!



I guess I’m curious as to what is relying on the screen resolution 
and PPI.


Although… it’s funny that we have the function 
SalGraphics::GetResolution, but that returns the PPI!


Chris
___
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 mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Setting data in Writer chart from Basic

2016-02-01 Thread sos
Did you tran


Sent from my Samsung Galaxy smartphone.Did you translate the solution into 
basic code?
Hi Fernand,

thanks for the ideas. Sadly nothing you or anybody else posted helped.
Finally I found this hack (here xChart has type Reference< XTextContent
> xChart):

  Reference < XEmbeddedObjectSupplier2 >xEOS2(xChart, UNO_QUERY_THROW);
  Reference < XEmbeddedObject >
xEmbObj(xEOS2->getExtendedControlOverEmbeddedObject());

  if (xEmbObj->getCurrentState() ==
com::sun::star::embed::EmbedStates::LOADED)
  xEmbObj->changeState( com::sun::star::embed::EmbedStates::RUNNING);
  if (xEmbObj->getCurrentState() ==
com::sun::star::embed::EmbedStates::RUNNING)
  xEmbObj->changeState(
com::sun::star::embed::EmbedStates::INPLACE_ACTIVE);
  if (xEmbObj->getCurrentState() ==
com::sun::star::embed::EmbedStates::INPLACE_ACTIVE)
  xEmbObj->changeState( com::sun::star::embed::EmbedStates::RUNNING);

which works on Windows. On Linux this works better:

  Reference < XEmbeddedObjectSupplier > xEOS(xChart, UNO_QUERY_THROW);
  Reference < ::com::sun::star::chart::XChartDocument >
cDoc(xEOS->getEmbeddedObject(), UNO_QUERY_THROW);

  Reference< XPropertySet > dProperties(cDoc->getDiagram(),
UNO_QUERY_THROW);
  Any type = dProperties->getPropertyValue(OU("SplineType"));
  dProperties->setPropertyValue(OU("SplineType"), makeAny(sal_uInt32(0)));
  dProperties->setPropertyValue(OU("SplineType"), makeAny(sal_uInt32(1)));
  dProperties->setPropertyValue(OU("SplineType"), type);

Regards,
    Jan

___
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: swriter drawing

2016-01-14 Thread SOS


On 14/01/2016 3:00, meilin wrote:

Hi!
we can draw some shapes in writer doc such as rect, line, circle and 
so on.

now i want to know how to draw these shapes to a virtual device.
i have already saw some code about drawing,but it's too hard for me to 
understand.
so i ask you for help, if you have some documents about drawing? 
please send me,thank you!

Yes i  exports Charts to a Dialog and also to a PNG grachip file
is use basic code below
we need the "Drawpage" with the chart in it
a "url" to save the png file

sub exportChart(Drawpage as object, url as string )
'prepare the renderer for the GraphicExportFilter
oRenderer = createUnoService("com.sun.star.graphic.GraphicRendererVCL")
Dim sRect as new com.sun.star.awt.Rectangle
 Wfactor = oChartDialog.size.width/oChartDialog.model.width
 Hfactor = oChartDialog.size.height/oChartDialog.model.height
sRect.X = 0
sRect.Y = 0
sRect.Height =  180*Hfactor  'de hight is in charhe
sRect.Width = 29*Wfactor

oRenderer.setPropertyValue("DestinationRect", sRect)
'the renderer shall paint to the dialog window
oRenderer.setPropertyValue("Device", 
oChartDialog.Peer.createGraphics.Device)

 Dim aArgs (1) as new com.sun.star.beans.PropertyValue
aArgs(0).Name  = "GraphicRenderer"
aArgs(0).Value = oRenderer
xExporter = 
createUnoService("com.sun.star.drawing.GraphicExportFilter" )

xExporter.setSourceDocument(oSheet.DrawPage.getByIndex(0))
xExporter.filter(aArgs()) 'export to the dialog

xExporter = 
createUnoService("com.sun.star.drawing.GraphicExportFilter")

xExporter.SetSourceDocument(Drawpage)

   Dim aURL as new com.sun.star.util.URL
   aURL.complete = url
   aArgs(0).Name  = "MediaType"
   aArgs(0).Value = "image/png"
   aArgs(1).Name  = "URL"
   aArgs(1).Value = aURL

REM Grafiek Opslaan
   xExporter.filter(aArgs()) ' export to a png file
End Sub

Hope it helps

Fernand





another problem
i want to draw some shapes in printpreview window, whether it's 
reasonable?


waiting for you help, thank you!



___
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: Remove ActiveX from LibreOffice

2016-01-12 Thread SOS

Bryan,

OK but someone must confirm that removing activeX has no influence on 
this API functions and the LO codebase can use the ATL stuff without 
activeX and the "CreateObject" will still been functioning.

greetez
Fernand

On 13/01/2016 5:19, Bryan Quigley wrote:

My understanding is that ATL can do the same thing with or without ActiveX.

https://en.wikipedia.org/wiki/Active_Template_Library

Although as I mentioned previously I'm not much of a Windows developer.

Thanks,
bryan

On Tue, Jan 12, 2016 at 3:25 AM, SOS <s...@pmg.be> wrote:

On 11/01/2016 20:32, Bryan Quigley wrote:

I propose we add it to the 5.1 release notes (and 5.2 notes too) as:
Intent to Remove ActiveX support in the 5.2 release.   If this change
negatively affects your Windows application please email the
LibreOffice development list with your use case and plan for moving
off of ActiveX.  We specifically only want feedback if use ActiveX to
embed LibreOffice components into your application.

I aam wondering if  the ActiveX stuff is used to build COM objects from
external DLL's ?
I uses (as example) a Windows videoplayer using basic and our API

Basic code:
if oSimpleFileAcces.Exists(filelocation) then
 MPlayer = CreateObject("WMPlayer.OCX.7")
 MPlayer.OpenPlayer(Filelocation)
endif

Greetz

Fernand



If no response, one week after 5.1.2 (Apr 10) is released let's make
the call to remove it (and update the release notes).  If we do get
responses we can obviously decide to change the plan as needed.

Anywhere else we should post this?

Thoughts?
Bryan

[1]
https://wiki.documentfoundation.org/ReleaseNotes/5.1#Feature_removal_.2F_deprecation
[2] https://wiki.documentfoundation.org/ReleaseNotes/5.2

On Sun, Jan 10, 2016 at 11:54 PM, Chris Sherlock
<chris.sherloc...@gmail.com> wrote:

On 11 Jan 2016, at 10:41 AM, Bryan Quigley <gqu...@gmail.com> wrote:

To look at this issue from another POV.. If someone showed up today
with an issue with a LO ActiveX control embedded in their application
that didn't work - what would our response be?  It's an outdated
technology that we're not investing in.


It probably shows a lack of adoption, but it doesn’t look like anyone
actually has reported issues with it...


My position on ActiveX is to leave it (lest we break applications in
the
wild,) and to *announce its deprecation* with two goals: first, solicit
the
feedback of LO ActiveX consumers and, if so inclined to continue using
it,
help in its support. And second, to flag a date in the future when
ActiveX
will be completely removed from LO codebase, pending sufficient reason
and
support by its consumers.

I'm happy with this.  I'd say a quicker timeframe is fine though.
  From the announce, if no one has found an application that uses
LO-embedded ActiveX remove it in a month or something.  I expect that
if there are some users they might not hear until the install the
version without it regardless of what we do.

Perhaps it should be announced in the release notes, with an actual
version where it will be removed.

Chris

___
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: Remove ActiveX from LibreOffice

2016-01-12 Thread SOS


On 13/01/2016 5:27, Bryan Quigley wrote:

Hi Rick,

ActiveX is deprecated by Microsoft and will be less useful (or not at
all) on newer MS browsers.  I'm unsure if it ever worked (or was
supposed to) let you embed ActiveX controls into LibreOffice itself.


Basic code running a Windows Mediaplayer:

 if oSimpleFileAcces.Exists(filelocation) then
MPlayer = CreateObject("WMPlayer.OCX.7")
MPlayer.OpenPlayer(Filelocation)
endif

works still fine under 5.1.0



Kind regards,
Bryan

On Mon, Jan 11, 2016 at 10:08 PM, Rick C. Hodgin
 wrote:

Why are you removing ActiveX from LibreOffice? Excel supports it, and it is
desirable for integration with Windows apps like C#, Visual Basic, Visual
FoxPro. It allows those other apps to integrate the app directly into their
app.

I have tried to use it previously, but could not find documentation for it.
If it's an unused feature, I'd suggest that's why than for other reasons.

Best regards,
Rick C. Hodgin




 Original Message 
From: Chris Sherlock
Sent: Mon, 11/01/2016 08:21 PM
To: Ashod Nakashian
CC: libreoffice ; Bryan Quigley
Subject: Re: Remove ActiveX from LibreOffice

That sounds pretty reasonable to me.

Out of interest, just how “integrated” is this with the code? If someone
wanted to create an external project on GitHub or some place like this,
would it be feasible?

I guess I’m trying to understand how much of core it touches… to reimplement
an ActiveX control outside of the main tree, would a developer need to fork
LibreOffice entirely, or could they maintain their codebranch entirely
seperately and update the control if necessary after we do our changes to
the main codebase?

I’m definitely for removing all vestiges of ActiveX from LO, but the more I
think about it the more I can see that some corporation somewhere might be
affected, far more so than the remove of NPAPI… giving them the option of a
control that can be maintained outside of the main project would be nice :-)

Chris

On 12 Jan 2016, at 9:37 AM, Ashod Nakashian  wrote:



On Mon, Jan 11, 2016 at 2:32 PM, Bryan Quigley  wrote:


Anywhere else we should post this?


Ideally the note would show up unintrusively upon loading/using the ActiveX
itself. Unfortunately we can't show a message box or some such UI, in case
the ActiveX is used non-interactively (in which case it'd block forever,
becoming unusable).

So the next best thing to do is include the note in the installation, which
should be hard to miss if made prominent (unless automated in silent mode).

This would get the attention of possibly the users, if not the developers
(who might not even test out new versions as they come out, and expect
things to work as before). Users can contact developers, I expect, or at
least plan accordingly. Regardless, all we want is to give advance warning
before the day someone installs a newer version and be met with the surprise
of missing ActiveX altogether.

The installation and release notes seem to be the most reasonable places, if
not upon using the ActiveX itself. Unless others have better ideas.



___
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: Remove ActiveX from LibreOffice

2016-01-12 Thread SOS


On 11/01/2016 20:32, Bryan Quigley wrote:

I propose we add it to the 5.1 release notes (and 5.2 notes too) as:
Intent to Remove ActiveX support in the 5.2 release.   If this change
negatively affects your Windows application please email the
LibreOffice development list with your use case and plan for moving
off of ActiveX.  We specifically only want feedback if use ActiveX to
embed LibreOffice components into your application.
I aam wondering if  the ActiveX stuff is used to build COM objects from 
external DLL's ?

I uses (as example) a Windows videoplayer using basic and our API

Basic code:
if oSimpleFileAcces.Exists(filelocation) then
MPlayer = CreateObject("WMPlayer.OCX.7")
MPlayer.OpenPlayer(Filelocation)
endif

Greetz

Fernand




If no response, one week after 5.1.2 (Apr 10) is released let's make
the call to remove it (and update the release notes).  If we do get
responses we can obviously decide to change the plan as needed.

Anywhere else we should post this?

Thoughts?
Bryan

[1] 
https://wiki.documentfoundation.org/ReleaseNotes/5.1#Feature_removal_.2F_deprecation
[2] https://wiki.documentfoundation.org/ReleaseNotes/5.2

On Sun, Jan 10, 2016 at 11:54 PM, Chris Sherlock
 wrote:

On 11 Jan 2016, at 10:41 AM, Bryan Quigley  wrote:

To look at this issue from another POV.. If someone showed up today
with an issue with a LO ActiveX control embedded in their application
that didn't work - what would our response be?  It's an outdated
technology that we're not investing in.


It probably shows a lack of adoption, but it doesn’t look like anyone actually 
has reported issues with it...


My position on ActiveX is to leave it (lest we break applications in the
wild,) and to *announce its deprecation* with two goals: first, solicit the
feedback of LO ActiveX consumers and, if so inclined to continue using it,
help in its support. And second, to flag a date in the future when ActiveX
will be completely removed from LO codebase, pending sufficient reason and
support by its consumers.

I'm happy with this.  I'd say a quicker timeframe is fine though.
 From the announce, if no one has found an application that uses
LO-embedded ActiveX remove it in a month or something.  I expect that
if there are some users they might not hear until the install the
version without it regardless of what we do.

Perhaps it should be announced in the release notes, with an actual version 
where it will be removed.

Chris

___
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: Is there a limit to the number of layers in a Writer Doc

2016-01-07 Thread SOS


On 7/01/2016 0:59, Chris Sherlock wrote:

I’ve just seen on IRC that there is at least one known issue with z-ordering 
already logged in bugzilla:

https://bugs.documentfoundation.org/show_bug.cgi?id=84127

The first description is exactly the same problem !

The problems starts when using "Bring Forward" and "Send Backward" we 
never had problems when only using "Bring to Front" or "Send To Back" or 
with a limited use of "Bring Forward" and "Send Backward"
After reading  the post from  Michael Stahl the conclusion could be that 
the Z-order at a certain point in the editing process visualy visualy 
been changed bij using "Bring Forward" and "Send Backward" but no longer 
can been "saved".
When reopening the document the object seems to  be in "heaven" or in 
"hell".
After using  "Bring to Front" or "Send To Back" the Z-order can again 
been saved , so i suppose "Send to Front" means "Place in "Heaven" 
without z-ordering ?


I found a document who i attached to the issue. The problem is very easy 
to notice when comparing the  (also attached) image of the document 
before saving with what we see after opening the document



 Fernand, the bug report is sort of long, but does this look like it 
could be a similar issue? What would be *really* helpful is an exact set 
of steps to reproduce the problem, but I know that’s sometimes quite 
difficult to get hold of. :-) Maybe some sort of test matrix of actions 
needs to be put together, though this could get too large to manage 
after a certain number of objects and actions moving the objects 
backwards and forwards occur. Chris

On 7 Jan 2016, at 10:51 AM, Chris Sherlock <chris.sherloc...@gmail.com> wrote:

Hey guys, cc’ing in the mailing list :-)

FWIW, can any developer point to the location of code that handles z-order 
within Writer drawings? I’m curious now myself!


On 7 Jan 2016, at 3:54 AM, SOS <s...@pmg.be> wrote:


On 6/01/2016 17:35, Chris Sherlock wrote:

This is most certainly a bug. But are you saying this occurs because of the 
number of times you bring an object forward and backwards,

using "Bring to Front " and using "Send to Back"  never gives problem ( i 
suppose using only 2 layers)

If it’s possible to locate an exact set of steps the users uses to get the 
problem, that would be very helpful :-)


only when the user uses "Bring Forward" or "Send Backward" to match the 
problems occur

or are you saying the document has lots of layers and you then seem to see the 
issue?

we do not  can see how many layers there are used

Do you have an example document?

i probably can find one or we trie to reproduce one. Can I send it to your mail 
adress ?

If it’s a confidential document, it’s best not to send to me. I’m not entirely 
certain how The Document Foundation handles confidential documents. Perhaps 
Michael Meeks or one of the more experienced devs might be able to help out.

If the document isn’t confidential, attach it to a bug report.

To log a bug, the location is https://bugs.documentfoundation.org

I would suggest creating an account for each member of your organization, and 
if you need updates and you have a central email address add that the CC list 
in bugzilla. If you get stuck with bugzilla, feel free to email me off list and 
I’m happy to assist.

Chris


Chris


On 7 Jan 2016, at 2:16 AM, SOS <s...@pmg.be> wrote:

Different objects (Images , Shapes...) can been moved (Arranged) back en 
forward in a Writer Doc.

Bring to Front
Bring forward
Send Backward
Send to back

Our editors are some times confronted with a situation where Writer (after 
saving and reopening) lost the saved position (layer) of some objects.
When using multiple times "Bring Forward" or "Bring Backward" Writer seems to 
lose control over the layers, on screen it looks  correct but after saving and reopening some 
objects are moved to a wrong layer.
As a workaround and to repair ,we advised only to use "Bring to Front" and "Send to 
Back" who  limits the number of used layers.
So:
Is there  a limit on the used layers who can been saved?
If there is a limit, then a warning is needed to avoid the loss of layers.
Is it a  bug who must been reported ? but who is very hard to reconstruct 
because we never could lay the finger on the real problem, to many objects or 
to many layers ?

Greetz

Fernand
___
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


Is there a limit to the number of layers in a Writer Doc

2016-01-06 Thread SOS
Different objects (Images , Shapes...) can been moved (Arranged) back en 
forward in a Writer Doc.


Bring to Front
Bring forward
Send Backward
Send to back

Our editors are some times confronted with a situation where Writer 
(after saving and reopening) lost the saved position (layer) of some 
objects.
When using multiple times "Bring Forward" or "Bring Backward" Writer 
seems to lose control over the layers, on screen it looks  correct but 
after saving and reopening some objects are moved to a wrong layer.
As a workaround and to repair ,we advised only to use "Bring to Front" 
and "Send to Back" who  limits the number of used layers.

So:
Is there  a limit on the used layers who can been saved?
If there is a limit, then a warning is needed to avoid the loss of layers.
Is it a  bug who must been reported ? but who is very hard to 
reconstruct because we never could lay the finger on the real problem, 
to many objects or to many layers ?


Greetz

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


Re: Two svg import filters

2015-12-20 Thread SOS


On 16/12/2015 13:13, Dennis Roczek wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi SOS,

Am 16.12.2015 um 10:54 schrieb SOS:


Greetz Fernand ps. a filter who imports PDF in to Writer: +10

We do already such. File --> open --> PDF (open in writer)

OK this is a filter who opens and makes a PDF "editable" in LO
what i love to have is a filter who places the PDF (1 page) unchanged as 
a graphic in writer


Greetz



Regards,

Dennis Roczek
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWcVVrAAoJEM4+Qf3OKrbZpGgQAMvDiTGxu/6WbzAObsuEZhz7
5AMhoMB+CijXmyf50Xz3YYsp5VbeAHTw1P/3rADhKpyhmKNylm33ax0OtFnLg41D
fJoQKtaEJcEcpOn0wz+1L9KMARj4OCsFpXw1Y93m1h0m14EQoROcUzNXC34JgblF
5b2Q/1dU27tB2BOGiKImHA9jJ7vGiFFEBzNJvIRIoGNvEM4LYPelw9J0JJgH1Guk
JO+S9wWC6tl7dyhjrIogz7L2q7Q16FCA3q7UH9dWYZXDg8ENl+FzUMu1eH+SlNTe
uKQRhYye1lJFnAJqELwVXLENFi7zpipZvriBxH2R8zcZS6n9PWbjPQtJVO3LVCa+
vmLWhN2I1KFGt9G1Y0tyAwKBOpukqQ2zspXcpLvTi/IrLT1HL32IE7Bu1i0pbdOo
ZcBox1Bo0r7uDI6MLbOpHpOz3hCIrLlxfRbwsYlFrgwZ4WS5oNvIxFHyuTbkXDUG
vWw3Rqd8VtGgUA4sVLVXb61qy6xciqzdM8wnKmeut35mo4PUHK9LZuMkLTh2UKCN
//vx3tBKUzWNvE49NTSPOa99c97njnzo9SlcfsBlt2nq619n202whHlZOI3ZzTbQ
LR8USESUID9FdKsLdSsLSHgYAGdiE3I53MCH7RbFoJISTtP0ZoPphjoCMy5zh8ps
dbOGyFqDfUI8Pg8oglxM
=6LGI
-END PGP SIGNATURE-


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


Re: Two svg import filters

2015-12-16 Thread SOS

+1 for Thorsten
For editing graphics there is Draw and  we need a filter who makes the 
original graphic editable
For publishing graphics there is Writer and  we need a filter who just 
imports and do not touch the original graphic

if the "one" filter can do both:Â  OK

Greetz
Fernand
ps. a filter who imports PDF in to Writer: +10


On 15/12/2015 23:46, Thorsten Behrens wrote:

Michael Stahl wrote:

i don't claim to know anything about SVG, but i just noticed that
filter/source/svg uses boost::spirit, and therefore i am +1 for
removing it.


That's so far the strongest case for removal here. ;)

Other than that, the two filters serve two very different purposes -
the document filter actually tries to map svg as well as possible to
ODF (it would work even better if LibreOffice's ODF filter would
support more of the syntax and semantics of SVG), to get *editable*
graphics.

As such, replacing the document importer with something that sticks
the image into a graphic object is missing the point IMO.

Cheers,

-- Thorsten


___
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: suggested method to create LibreOffice Extensions

2015-11-16 Thread SOS
Bernard Marcelly not only made Xray but also a exellent Extention 
Compiler 



writen in Basic and and adabtable to all your needs

greetz
Fernand


On 16/11/2015 10:52, Thomas Krumbein wrote:

Hey Andrea,

hmm, I will do an workshop tomorrow with a very equal questinary and
becouse I have used everytime BAB, I try to give you some more information:

Yes, BAB was and is a very usefull tool, unfortunatly Paolo do not
maintain it any more.
Because of an codechange in AOO for extensions, there is no way to
create the extension with this tool in both lines (AOO and LibO).
Jörg Schmidt did some work on the BAB and created two versions - one for
AOO and one for LibO with should work.

Additional we are planing at the moment, to rework the BAB, bt this
needs a little bit of money and we think about a crowdfounding network.

So, I will send you with seperat mail the version, I will use tomorrow
and I guess, this will work with LibO 5.x too (not really sure...).

Nevertheless LibreOffice need a tool like BAB - maybe with some
additional features - so I would appreciate your support for a new version.

Best regards
Thomas


Am 16.11.2015 09:52, schrieb Andrea Castellani:

Hello everyone,
almost three years ago I received help from this mailing list to create
an extension for LibreOffice, which became "FirmaconDike" (thanks!):
http://extensions.libreoffice.org/extension-center/firmacondike-1

Today I have to re-examine this issue in a LibreOffice lesson, in witch
I would like to explain how to create an extension "from scratch".

I thought to write a simple macro with students, such as "Hello world",
and explain step by step how to generate the oxt file.

Seeking documentation, I saw a lot of confusion on the subject and the
argument (as you know) is only present on the site of AOO.

I tried to use BAB Paolo Mantovani, both in the new version that in the
previous one, and it seemed a very good macro to create extensions.

The Extension oxt who created BAB does not work, then I fear that BAB is
incompatible with LibreOffice (I have the 5.0.2.2). Opening it, it gives
me an error:
(Com.sun.star.deployment.DeploymentException) {{Message = "You \ X00e8
an error occurred while enabling: HelloWorld" Context =
(com.sun.star.uno.XInterface) @ 7f2fec3ef8b0}, Cause = ( any)
{(com.sun.star.lang.IllegalArgumentException) {{{Message = "" Context =
(com.sun.star.uno.XInterface) @ 0}}, ArgumentPosition = (short) 0}}}

Here you can find the extension generated by BAB:
http://www.libreitalia.it/cloud/public.php?service=files=77d91958fb91ecab19ec2b0b62844d63

I have not tried a "reverse engineering" of oxt file to understand what
it changes from another oxt  (such as "FirmaconDike"), looking for
suggestions from you, who are much more experienced than me.

Does anyone have experience with BAB and LibreOffice?
What is the official method (or recommended one) to create extensions
for LibreOffice?

I apologize if you have already solved this problem in another thread

Thank you,

Andrea Castellani
www.libreitalia.it
___
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: Two svg import filters

2015-11-05 Thread SOS

From a users point of view:
Inserting a SVG-image in Writer, Calc or Impress must been done 
"unchanged" because users will in 99% off all cases not edit a Image.
Opening in Draw is a different game where in most cases the user has the 
intention tot edit a image and  save back SVG or  as  a  other format.


A same sort of  filter who import a PDF as Graphic  in Writer, Calc and 
Impress would be very nice to. Currently we need a third party app to 
convert PDF to SVG  before we can insert a PDF-file into writer, Calc or 
Impress


Greetz
Fernand


On 4/11/2015 13:30, Armin Le Grand wrote:

Hi,

Am 04.11.2015 um 13:11 schrieb Caolán McNamara:

We have svgio which is being used for insert->image->from file and
filter/source/svg which is being used for open file.

Which one is "the future", and what prevents us from using it in both
places ?


svgio: Imports SVG as Graphic, keeps SVG unchanged, embedded in ODF, 
can be exported again, can be broken to graphic objects to use/change 
geometrically


filter/source/svg: New for me, seems to directly convert on XML-Base 
from SVG to ODF by breaking at import time


future: Not sure, there are probably args for each. If you want to 
preserve the SVG unchanged, svgio and a resulting ODF with one graphic 
object and embedded original SVG might be preferred. Needs to be 
discussed.




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


--
ALG (PGP Key: EE1C 4B3F E751 D8BC C485 DEC1 3C59 F953 D81C F4A2)

___
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: zip/unzip jar archive or add/remove file using a Basic macro?

2015-10-12 Thread SOS

Regina,
found some basic code  from Laurent Godard

'*
' Zip Routines by Laurent Godard
'*

Sub ZipFolderToFile(source as string, cible as string, sMimetype as string)
'Author: laurent Godard - listes.god...@laposte.net
dim retour() as string

'création de l'instance du fichier Zip
LeFichierZip = createUnoService("com.sun.star.packages.Package")

'Dim aArg As New com.sun.star.beans.NamedValue
'aArg.Name = "PackageFormat"
'aArg.Value = False
'p.initialize(Array(cible, aArg))

dim args(0)
args(0)=ConvertToURL(cible)
LeFichierZip.initialize(args())

'création de la structure des repertoires dans le zip
call Recursedirectory(source, retour)

dim argsDir(0)

argsDir(0)=true
'on saute le premier --> repertoire contenant
'Pourra etre une option a terme
Repbase=retour(1)
For i=2 To UBound(retour)
chaine=mid(retour(i),len(repbase)+2)
decoupe=split(mid(retour(i),len(repbase)+1),getPathSeparator)
repZip=decoupe(UBound(decoupe))
azipper=LeFichierZip.createInstanceWithArguments(argsDir())
If len(chaine)<>len(repZip) then
RepPere=left(chaine,len(chaine)-len(repZip)-1)
RepPere=RemplaceChaine(reppere, getpathseparator, "/", false)
Else
RepPere=""
Endif
RepPereZip=LeFichierZip.getByHierarchicalName(RepPere)
RepPereZip.insertbyname(repzip, azipper)
Next i
'insertion des fichiers dans les bons repertoires

LeFichierZip.getByHierarchicalName("").setPropertyValue("MediaType", 
sMimetype)

dim args2(0)
args2(0)=false
oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
for i = 2 to UBound(retour)

'just testing the mid function in LO 4.0
 'strg = mid("Hallo", 7)
'if retour(i) = repbase then
'chaine = repbase
'else
'chaine = mid(retour(i), len(repbase) + 2)
'end if

chaine = mid(retour(i), len(repbase) + 2)
repzip = remplacechaine(chaine, getpathseparator, "/", false)
fichier = dir(retour(i)+getPathSeparator,0)

While fichier<>""
azipper = LeFichierZip.createInstanceWithArguments(args2())
oFile = oUcb.OpenFileRead(ConvertToURL(retour(i)+"/"+fichier))
azipper.SetInputStream(ofile)
RepPere = LeFichierZip.getByHierarchicalName(repZip)
RepPere.insertbyname(fichier, azipper)
fichier = dir()
Wend
next i
'Valide les changements
LeFichierZip.commitChanges()
oFile.closeInput()
'msgbox "C'est fini"
End Sub

'--
Sub RecurseDirectory(chemin, reponse as variant)
'Author: laurent Godard - listes.god...@laposte.net
'reponse est un tableau contenant la liste de tous les sous répertoires 
de chemin

redim preserve reponse(1 to 1)
compte=1
reponse(1)=chemin
repbase=1
rep=dir(convertTourl(chemin+"/"),16)
while rep<>""
if rep<>"." and rep<>".." then
compte=compte+1
redim preserve reponse(1 to compte)
reponse(compte)=convertfromurl(reponse(RepBase)+"/"+rep)
endif
rep=dir()
while rep="" and repbaseFunction RemplaceChaine(ByVal chaine As String, src As String, dest As 
String,_

casse As Boolean)
'Auteurs: Laurent Godard & Bernard Marcelly
' fournit une chaine dont toutes les occurences de src ont été 
remplacées par dest

'casse = true pour distinguer majuscules/minuscules, = false sinon
Dim lsrc As Integer, i As Integer, kas As Integer
Dim limite as string

limite=""
kas = iif(casse, 0, 1)
lsrc = len(src)
i = instr(1, chaine, src, kas)
while i<>0
while i<0
limite=limite+left(chaine,32000)
chaine=mid(chaine,32001)
i=instr(1, chaine, src, kas)
wend
' ici i est toujours positif non nul
if i>1 then
limite = limite + Left(chaine, i-1) +dest
else ' ici i vaut toujours 1
limite = limite +dest
endif
' raccourcir en deux temps car risque : i+src > 32767
chaine = Mid(chaine, i)
chaine = Mid(chaine, 1+lsrc)
i = instr(1, chaine, src, kas)
wend
RemplaceChaine = limite + chaine
End Function


Sub unzipFileFromArchive(strZipArchivePath As String, strSourceFileName 
As String, strDestinationFilePath As String)


  Dim blnExists   As Boolean
  Dim args(0) As Variant
  Dim objZipService   As Variant
  Dim objPackageStreamAs Variant
  Dim objOutputStream As Variant
  Dim objInputStream  As Variant
  Dim i   As Integer

'= 

  ' Unzip a 

Re: Internal API for LO supported formats

2015-09-16 Thread SOS

found in the API samples from OO
hope it helps
greetz

Fernand

REM   *  BASIC  *
Sub  Main
   oFF=  createUnoService(  "com.sun.star.document.FilterFactory"  )
   oFilterNames=  oFF.getElementNames()
 
   ' Now print the filter names.

'   For i = LBound( oFilterNames ) To UBound( oFilterNames )
'  Print oFilterNames(i)
'   Next
 
   ' Create a Writer doc and save the filter names to it.

   oDoc=  StarDesktop.loadComponentFromURL(  
"private:factory/swriter","_blank",0, Array()  )
   oText=  oDoc.getText()
   oCursor=  oText.createTextCursor()
   oCursor.gotoEnd(  False  )
 
   ' Print the filter names into a Writer document.

   For  i=  LBound(  oFilterNames)  To  UBound(  oFilterNames)
  oText.insertString(  oCursor, oFilterNames(i),False  )
  oText.insertControlCharacter(  oCursor, 
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False  )
   Next
End  Sub


On 16/09/2015 17:45, Pranav Kant wrote:

Hi,

Just wondering what is the internal API to query LO to fetch supported 
document formats.


Would be great to have that exposed via LOK too.

--
Regards,
Pranav Kant
http://pranavk.me 


___
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: Q: How to get the path of all opened spreadsheet documents

2015-06-11 Thread SOS


 Zhang

in basic i use this function

Function TaskonDesktop(DocPath as String) as Boolean

Dim oComponents as Object

' Search if one of the active Components ist the one that you 
search for

oComponents = StarDesktop.Components.CreateEnumeration
While oComponents.HasmoreElements
oComponent = oComponents.NextElement
'printUCase(oComponent.URL)   -   UCase(converttoURL(DocPath)
If UCase(oComponent.URL) = UCase(converttoURL(DocPath)) then
TaskonDesktop = True
Exit Function
End If
Wend
TaskonDesktop = False
End Function


hope it helps

Fernand


Hi Andrew,

Thanks a lot for your reply.

Q1: In your case do you only care about documents that have been 
saved... Ignoring new never saved to disk docs?


àWhat I want to get is all calc documents as long as the doc is 
opened, no matter it have been saved or not.


  So firstly, I want to know if it’s possible to do it in this case. 
If no, maybe I can only care the doc which have been saved and ignore 
which is not saved.


Q2: You enumerate the open components from the desktop object and 
check of the component is a calc document.


àSorry, I know how to get the desktop object, but I am not clear how 
to get the open component and check them as you mentioned.


  This is my gap, would you please give example code based on my 
comment for Q1?


Thanks in advanced!

Best Regards

William

-Original Message-
From: Andrew Pitonyak [mailto:and...@pitonyak.org]
Sent: 2015年6月5日19:15
To: Zhang, William
Cc: libreoffice@lists.freedesktop.org
Subject: Re: Q: How to get the path of all opened spreadsheet documents

No time to find the solution now But I have done this sort of 
thing in basic.


You enumerate the open components from the desktop object and check of 
the component is a calc document.


In your case do you only care about documents that have been saved... 
Ignoring new never saved to disk docs?


Think I can find a basic example of it helps

On Jun 4, 2015 10:35 PM, Zhang, William 
william.zh...@ptn.advantest.com 
mailto:william.zh...@ptn.advantest.com wrote:




 Hi,







 Request:



 In RedHat7, I want to get the path of all opened spreadsheet documents with 
Java.







 What I’ve done:



 1.I used Runtime.exec(cmd…) with Java code, the ‘cmd’was defined with 
“ps –ef | grep xxx”




 -if only one spreadsheet document opened, the returned info list the correct 
document, I can parse it and get the file path




 -but if multi spreadsheet documents opened, the returned process still only 
list the first document, I cannot get other documents.




2.I also test in bash, it seems “ps -ef”cannot list all files.







 So , I want to know is there any other way to do it. such as using UNO service with 
libreoffice API to get it.




 Anyone who knows it is much appreciate.







 Best Regards



 William







___
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: Uno sidebar API proposal

2015-04-29 Thread SOS

Laurent ,
More properties: Size , colors, background ?
What about having the DialogControls available (ProgressBar, Watch, 
Images, listbox.)


Greetz

Fernand

Hi all

The libreoffice sidebar can be enhanced by adding Decks and Panels via 
extensions
Unfortunatelly, there is no available UNO API to easily manipulate the 
sidebar, the decks, the panels once deployed


So I plan to write some (first ideas at the end of the mail)
(targeting calc  writer for the moment)

i did some premiminary PoC using the existing sfx2/sidebar stuff
There seems to be some limitations and i'll probably have to rework this

for example, only the current active deck object is available. deck 
seems to be rebuilt at each changes

why such a choice ?
would it be too costly to build/store all the desks/panels

I would like your opinion about the approach and be assured that this 
work will be not dropped (if i succeed as my skills are limited)


I'll work on a separate branch and will follow carefully the GSoC 
related to this sidebar topic


Any comment welcomme

Laurent

'--
firs ideas on an UNO Sidebar API


* currenController or XComponent ?
-- getSidebar -- see *currentSidebar

* currentSidebar
-- enable/disable : show or hides the sidebar (as menu view  
sidebar)

-- getDesks -- see *Desks
-- getEnabledDesksNames
-- getActiveDesk -- see *Desk

* Desks
-- count
-- getByName -- see *Desk
-- getByindex -- see *Desk

* Desk
-- show/hide (or activate ?)
-- enable/disable (same as the checkboxes of the sidebar 
customization dropdown menu)
-- setIndex : to control the dispaly order of desks icons ? moves 
down the other ? only for custom desks (deployed by extension) to 
preserve built-in desks layout ?

-- getPanels -- see *Panels
-- some properties (name, label, context ...)

* Panels
-- count
-- getByName -- see *Panel
-- getByindex -- see *Panel

* Panel
-- expand/collapse (with option for collapsing all the other if 
expand)
-- setIndex : to control the display order of panels in the deck 
? moves down the other ?
-- getDialog : get the dialog object to be able to access UI 
controls

-- some properties (name, label, )
___
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: Inserting Graphics in a Writer document

2015-04-15 Thread SOS


On 15/04/2015 16:00, Piet van Oostrum wrote:

Hello,

I am in the process of converting several Java LO programming examples to 
Python. My plan is to do all (or most) of them. Also I try to extend them. 
However I encountered some surprises.

I converted LibreOffice4.4_SDK/examples/java/Text/GraphicsInserter.java which 
inserts a graphic image in a new Writer document. Works without problems.

Then I decided to add some text also, and put the picture in the middle of the 
text.

The code goes like this:

 # Create a new Writer document, which will be automatically displayed
 doc = Desktop.loadComponentFromURL(private:factory/swriter, _blank, 0, 
())

 # Getting the text
 xText = doc.getText()

 # Getting a cursor on the document
 xTextCursor = xText.createTextCursor()

 # Inserting some text
 xText.insertString(xTextCursor, This is the first paragraph., False)
 xText.insertControlCharacter(xTextCursor, PARAGRAPH_BREAK, False)
 xText.insertString(xTextCursor, Some text before the graphic. , False)

 # Insert the graphic
 insertGraphic(doc, xText, xTextCursor, sUrl)

 # Inserting some more text
 xText.insertString(xTextCursor, Some text after the graphic., False)
 xText.insertControlCharacter(xTextCursor, PARAGRAPH_BREAK, False)
 xText.insertString(xTextCursor, This is the second paragraph., False)

def insertGraphic(doc, xText, cursor, sUrl):
 oGraphic = doc.createInstance(com.sun.star.text.TextGraphicObject)
 xText.insertString(cursor, ++, False)
 # Insert graphic between ++ and //
 xText.insertTextContent(cursor, oGraphic, False)
 # Setting the anchor type - must be done first, otherwise the graphic will 
be put after the //
 oGraphic.AnchorType = AS_CHARACTER
 xText.insertString(cursor, //, False)
 # Setting the graphic url
 oGraphic.GraphicURL = sUrl

 # Setting the width and height
 oGraphic.Width = 2000
 oGraphic.Height = 2000

The image is inserted in the middle of a paragraph and surrounded by ++ and // 
to indicate where it should be. This also works without problems.

Then I decided to change the order. First I insert all text; then I go back to 
the insertion point and insert the image. To my surprise the image ended up a 
couple of words later in the text

The insertion code is then:

 # Inserting some text
 xText.insertString(xTextCursor, This is the first paragraph., False)
 xText.insertControlCharacter(xTextCursor, PARAGRAPH_BREAK, False)
 xText.insertString(xTextCursor, Some text before the graphic. , False)

 # Inserting some more text
 xText.insertString(xTextCursor, Some text after the graphic., False)
 xText.insertControlCharacter(xTextCursor, PARAGRAPH_BREAK, False)
 xText.insertString(xTextCursor, This is the second paragraph., False)

 # Move the cursor
 xTextCursor.gotoPreviousParagraph(False)
 xTextCursor.gotoNextSentence(False)
did you sure you are here where you think you are ? and not at the end 
off the wro,g paragraph

trye
# Move the cursor xTextCursor.gotoPreviousParagraph(False)

 xTextCursor.gotoPreviousParagraph(False)
xTextCursor.gotoNextSentence(False)

hope it helps

Fernand

 
 # Insert the graphic

 insertGraphic(doc, xText, xTextCursor, sUrl)

Now I would expect ++Image// to be found just before Some text after the graphic. 
However the ++// is indeed inserted there, but the image appears after Some text after 
the, 4 words later. The image is indeed anchored to this position, as I can see when I 
manually insert some more text before it. So it is not a matter of an offset.

I have also tried to create another cursor with the endpoint of xTextCursor 
between the two sentences, and then use this to insert the graphic but that 
doesn't help.

Does anybody know what is happening here?


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


Re: LibreOffice crash

2015-03-26 Thread SOS

Piet,

first i alayw provide some information when storing not a empty array a 
you did


 Thiscomponent.storeToURL( ConvertToURL(sfile), Array( 
MakePropertyValue(FilterName, writer8, ReadOnly, False ))


and i allways do convertToURL(myURL) to been sure it's a correct URL 
(your URL seems corrrect)


Did you played around with

storeAsURL and storeAToURL

I  do the folowing check
  if fileexists(ConvertToURL(sfile)) then
Thiscomponent.storeToURL( ConvertToURL(sfile), Array( 
MakePropertyValue(FilterName, writer8, ReadOnly, False))

'bIsNewDoc = False
else
Thiscomponent.storeAsURL( ConvertToURL(sfile), Array( 
MakePropertyValue(FilterName, writer8, ReadOnly, False))

'bIsNewDoc = true
end if

Hope it helps

Fernand

On 26/03/2015 11:38, Piet van Oostrum wrote:

I am currently experimenting with programming LibreOffice through Python/UNO.
One thing I tried is to create a document, not with the loadComponentFromURL 
call from the desktop, but the route via the XLoadable interface,

After setting up the connection, getting the context, servicemanager, desktop, 
and XSCRIPTCONTEXT,
the following works:

calcdoc = 
smgr.createInstanceWithContext(com.sun.star.sheet.SpreadsheetDocument, 
context)
calcdoc.initNew() # or calcdoc.load()
sheets = calcdoc.getSheets()
sheet1 = sheets.getByName(Sheet1)

cell = sheet1.getCellByPosition(0,0)
cell.String = Hello World

calcdoc.storeAsURL(file:///Users/piet/TEST/LibreOffice/testcalc.ods, ())
calcdoc.close(True)

Of course I could have used
calcdoc = desktop.loadComponentFromURL(private:factory/scalc, _blank, 0, 
());
(or with a Hidden=True property)
but I just wanted to experiment with the createInstance version.

Now the above example works perfectly. It creates the spreadsheet, and nothing 
is shown on the screen.

Now when I do this with a Writer document:

textdoc = smgr.createInstanceWithContext(com.sun.star.text.TextDocument, 
context)

LibreOffice crashes with a segmentation fault. It looks like a null pointer is 
dereferenced or stored into. It seems to be in the event loop. So maybe there 
is some pointer not properly initialized.

Here is part of the crash report (Mac OS X 10.10.2). This happens both with 
LibreOffice 4.4.1.2 from the installer package and a self-compiled master 
version.

Process:   soffice [25385]
Path:  
/Users/USER/Downloads/*/LibreOfficeDev.app/Contents/MacOS/soffice
Identifier:org.libreoffice.script
Version:   4.5.0 (0)
Code Type: X86-64 (Native)
Parent Process:bash [71305]
Responsible:   Terminal [71161]
User ID:   501

Date/Time: 2015-03-26 11:23:20.020 +0100
OS Version:Mac OS X 10.10.2 (14C1510)
Report Version:11
Anonymous UUID:0AEBB0CD-ADAB-A830-FE6A-DB114A5C4135

Sleep/Wake UUID:   6AC2711A-D840-4BA5-9661-4545A1C4ABDB

Time Awake Since Boot: 90 seconds
Time Since Wake:   8400 seconds

Crashed Thread:10

Exception Type:EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:   KERN_INVALID_ADDRESS at 0x

VM Regions Near 0:
--
 __TEXT 00010feff000-00010ff0 [4K] r-x/rwx 
SM=COW  /Users/USER/Downloads/*/LibreOfficeDev.app/Contents/MacOS/soffice

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib  0x7fff93f494de mach_msg_trap + 10
1   libsystem_kernel.dylib  0x7fff93f4864f mach_msg + 55
2   com.apple.CoreFoundation0x7fff92a4ab34 
__CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation0x7fff92a49ffb __CFRunLoopRun + 1371
4   com.apple.CoreFoundation0x7fff92a49858 CFRunLoopRunSpecific 
+ 296
5   com.apple.HIToolbox 0x7fff92df2aef 
RunCurrentEventLoopInMode + 235
6   com.apple.HIToolbox 0x7fff92df286a 
ReceiveNextEventCommon + 431
7   com.apple.HIToolbox 0x7fff92df26ab 
_BlockUntilNextEventMatchingListInModeWithFilter + 71
8   com.apple.AppKit0x7fff87bbcf81 _DPSNextEvent + 964
9   com.apple.AppKit0x7fff87bbc730 -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
10  libvcllo.dylib  0x000111f80ee6 
AquaSalInstance::Yield(bool, bool) + 1094
11  libvcllo.dylib  0x000111f0e0ca Application::Yield() 
+ 74
12  libvcllo.dylib  0x000111f0e065 
Application::Execute() + 37
13  libsofficeapp.dylib 0x00010ff7ea75 
desktop::Desktop::Main() + 7573
14  libvcllo.dylib  0x000111f11812 ImplSVMain() + 50
15  libvcllo.dylib  0x000111f808b4 
AquaSalInstance::handleAppDefinedEvent(NSEvent*) + 84
16  libvcllo.dylib  0x000111fb65b1 -[VCL_NSApplication 

Re: Fwd: Re: Ask for help, Young developer request

2015-02-24 Thread SOS

probably you must use xStorable.store_As_URL
hope it help

Fernand

On 24/02/2015 10:48, Bartłomiej Mikos PrimeSoft Polska wrote:

Good Morning,

I tried use XModifiable to close xlsx file, my method for making pdf 
looks like that:


public void convertToPdf(String sourcePath, String destinyPath)
throws java.lang.Exception {

PropertyValue[] properties = new PropertyValue[3];

properties[0] = getHiddenProperty();

properties[1] = new PropertyValue();
properties[1].Name = UpdateDocMode;
properties[1].Value = new Short((short) 1);

properties[2] = new PropertyValue();
properties[2].Name = ReadOnly;
properties[2].Value = new Boolean(true);

String sourceURL = convertFilePathToURL(sourcePath);
String destinyURL = convertFilePathToURL(destinyPath);

XComponent xComponent = xComponentLoader.loadComponentFromURL(
sourceURL, _blank, 0, properties);

XModel xModel = UnoRuntime.queryInterface(XModel.class, 
xComponent);


XModifiable xModifiable = 
UnoRuntime.queryInterface(XModifiable.class,

xModel);

xModifiable.setModified(false);

XStorable xStorable = null;
if (xComponent != null) {
xStorable = UnoRuntime.queryInterface(XStorable.class, 
xComponent);


if (xStorable != null) {
properties = new PropertyValue[2];
properties[0] = getPDFWriterProperty();
properties[1] = new PropertyValue();
properties[1].Name = Wait;
properties[1].Value = new Boolean(true);

xStorable.storeToURL(destinyURL, properties);
}
}

//I tried use XModifiable here too

if (xStorable != null) {
XCloseable closeable = 
UnoRuntime.queryInterface(XCloseable.class,

xStorable);
if (closeable != null) {
try {
closeable.close(true);
} catch (CloseVetoException closeVetoException) {
   //exception problem
}
} else {
XComponent xComp = 
UnoRuntime.queryInterface(XComponent.class,

xStorable);
xComp.dispose();
}
}
}

It not helps with that issue. Maybe usefull information is that I used 
UpdateDocMode (all options) and there still appears warn window 
update/links [yes][no]. Have You some other tips which can help?.


Thanks you for Your interest,
Have a nice day.

W dniu 2015-02-20 o 14:35, Andrew Pitonyak pisze:

First use XModifiable and if
isModified is true call
setModified to set to false.

See of that helps.

On Feb 20, 2015 3:12 AM, 
=?UTF-8?Q?Bart=C5=82omiej_Mikos_PrimeSoft_Polska?=bartlomiej.mi...@primesoft.pl
  wrote:

Good Morning,

I have problem with use of java LibreOffice Api 4.3

Is a possible way to close XComponent (xlsx type) in save way?.

I have converting to pdf method. I use XStorable.storeToURL() The
converting works fine, but when I try to close like this:

  if (xStorable != null) {
  XCloseable closeable =
UnoRuntime.queryInterface(XCloseable.class, xStorable);
  if (closeable != null) {
  try {
  closeable.close(true);
  } catch (CloseVetoException closeVetoException) {
  //problem with xlsx files, always occure
  }
  } else {
  XComponent xComp =
UnoRuntime.queryInterface(XComponent.class, xStorable);
  xComp.dispose();
  }
  }

I tried to dispose a XController and the XFrame. In that case window is
closed, but in next time XComponentLoader cannot load the XComponent,
problem with socket etc.

Can You tell me what i should do to make it work fine?. Maybe i should
know more about something or You had some simillar problems?.

I hope You will find time to answer,
Have a nice day.


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


Z poważaniem,
Bartłomiej Mikos
--
Bartłomiej Mikos
software engineer
bartlomiej.mi...@primesoft.pl mailto:bartlomiej.mi...@primesoft.pl
www.primesoft.pl http://www.primesoft.pl

PrimeSoft Polska Sp. z o.o.
ul. Perkuna 25, 61-615 Poznań tel/fax 61/833-17-72
NIP 7831592998 Regon 634610845 KRS 221565 Kapitał zakł. 5pln
NORDEA Bank Polska S.A. PL 50 1440 1130   0336 0806

*Dla Państwa już od 10 lat*
Dnia 25 września 2014 roku odbyła się konferencja 10-lecie PrimeSoft 
Polska: okiem klienta, okiem dostawcy – wymiana doświadczeń 
biznesowych. W wydarzeniu wzięli udział przedstawiciele firm i 
instytucji będących klientami oraz partnerami biznesowymi PrimeSoft 
Polska. Relacja z wydarzenia http://www.youtube.com/watch?v=FjsrjSmaNaQ