Re: [dev] RestrictedPath working under Windows?

2006-07-17 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Allen,

 That's easy to find.  There are only about a dozen matches in the source
 code for RestrictedPath and RestrictedPaths ;-)

:)

 On Windows XP, you have both system variables and user variables.  If
 both values are set, the user value overrides the system value.  In fact, I
 just tried this, setting two different values for RestrictedPath, one in a
 system variable in the other in a user variable, and OOo used the user
 value.

Let me say it this way: The concept clearly has it flaws, but it was a
sufficient for the target audience at the time it was implemented.

Please consider that the whole feature is not (and was never intended to
be) a security feature, but more a convenience thing. You can always
find ways to break out of the box provided by the RestrictedPaths (e.g.
you can put an URL into a text document and click onto it). It's really
an UI thing only. If one wanted to make this error-prove, a completely
different approach would be needed, hooking into the UCB which provides
low level access to file/contents.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Database   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] RestrictedPath working under Windows?

2006-07-17 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Joerg,

 So how was that supposed to be used? I assume that would be by editing 
 the soffice script to set that variable before invoking soffice.bin? 
 (Otherwise a user could always overwrite an environment variable just as 
 easily.) Not well suited for Windows use then, where there is no 
 existing script 

If I remember the requirements correctly, the idea was to set up the
variable system-wide, and let only people use the machines who'd be
confused if you'd tell them you can change an environment variable.
Environ-what?

Something like this :)

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Database   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] RestrictedPath working under Windows?

2006-07-17 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Allen,

 It would be less complex and therefore less prone to system administrator
 and programmer error to just treat a nil and empty string the same.  I
 suggest:

I don't have a strong preference here. In theory, treating nil and
empty list equally is somewhat ... dirty, so I would  probably still
prefer distinguishing them ...

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Database   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] how to select a paragraph

2006-07-17 Thread Sascha Jensen

Mohammad Alhammouri schrieb:

You can install an XSelectionChangeListener. This will notify you 
whenever selection changes. Inside the listener you can use the 
principle demostrated in the script



xsel = thiscomponent.currentcontroller.getselection
xrange = xsel(0)
xcur = thiscomponent.gettext.createtextcursorbyrange( xrange )
xcur.gotostartofparagraph( false )
xcur.gotoendofparagraph( true )
msgbox xcur.getstring


to get the whole content of the selected paragraph.


for example you could do the following inside the selectionChanged 
method of your XSelectionChangeListener implementation:

(C++)

void SelectionChangeListener::selectionChanged( const 
css::lang::EventObject Event )

{
css::uno::Any anySelection;
	css::uno::Reference css::view::XSelectionSupplier  selectionSupplier( 
Event.Source, css::uno::UNO_QUERY);

// get the selection
anySelection = selectionSupplier-getSelection();

// check if it is a XIndexAccess (containing XTextRanges)
// because there might be something else selected
css::uno::Reference css::container::XIndexAccess  xtrs(0);
anySelection = xtrs;
if( xtrs.is())
{
// take the first selection an create a TextCursor
css::uno::Reference css::text::XTextRange  tr (
 xtrs-getByIndex(sal_Int32(0)),css::uno::UNO_QUERY) ;
css::uno::Reference css::text::XSimpleText  sText ( 
 tr-getText() ,css::uno::UNO_QUERY) ;
css::uno::Reference css::text::XTextCursor  tCursor =
 sText-createTextCursorByRange( tr );   
// use the textcursor to select the whole thing
tCursor-gotoStart(false);
tCurosr-gotoEnt(true);
css::uno::Reference css::text::XTextRange  cr
 (tCursor, css::uno::UNO_QUERY) ;
// get the string
rtl::OUString textString = cr-getString();
}

}

so far,
Sascha





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] Warning free code: the missing modules

2006-07-17 Thread Stephan Bergmann

Bjoern Milcke wrote:

Hi Stephan,

I can add EXTERNAL_WARNINGS_NOT_ERRORS=TRUE to every makefile.mk in 
sch on CWS sb58 to effectively exempt it from warning-freedom, just as 
I did for binfilter.


Yes, please.

testhxx only found (very few) problems in memchrt.hxx, and only on 
wntmsci10[.pro], so getting those headers into shape so that they do 
not break sc/sd/sw is hopefully no big deal (and can probably done in 
one of the CWS for sc/sd/sw?).


That sounds good. The CWS to fix this in could be the same where the 
variables in makefile.mk are added, so we have only one warnings-CWS 
that contains sch.


As stated above, I already added modification of the sch makefile.mks to 
sb58 (simply because I had the awk script for doing the same to 
binfilter still lying around), but I would like to keep sb58 a 
no-real-changes-to-the-code CWS (so that it does not need testing). 
Hence, any changes to sch/memchrt.hxx will need to go into another CWS.


-Stephan


-Bjoern


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] Ask a question: xmlkywd.hxx can delete from code

2006-07-17 Thread 程家亮
In the file SRC680_ROOT\xmloff\inc\xmlkywd.hxx, there are some comment:

  THIS FILE IS DEPRECATED. IT IS SUPERSEDED BY XMLTOKEN.HXX.
  Please use xmltoken.hxx / xmltoken.cxx from now on.

So I think I can delete the file xmlkywd.hxx and xmltoken.cxx from codes, and I
am right? Please tell me. Thanks  :-) 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] Question

2006-07-17 Thread Hugo Pérez Bruno

Hi

How can I export data from a recordset in Visual Basic 6.0 to OOoCalc?

Thanks
Hugo


[dev] make a python script in makefile.mk?

2006-07-17 Thread Leibowitz, Michael
I'm having some trouble with making scripts in my makefile.mk.  In
UNIX, I use UNIXTEXT = $(MISC)/dbbe_enable.sh  That seems to work.
However, on Windows, I don't know of any similar variable.  I tried
putting in my own target:

# --- Targets --

.INCLUDE : target.mk

$(MISC)$/dbbe_enable.py: dbbe_enable.py
+cp $? $@

But, this doesn't seem to have any effect.  Any hints??

--
Michael Leibowitz
Software Engineer, Channel Platform Solutions Group
Intel Corporation
michael.leibowitz at intel.com
+1 503 264 7621

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] how to create your own configuration reader in OpenOffice.org (configmgrrc)

2006-07-17 Thread Christian Andersson
see answers inline


Joerg Barfurth wrote:
 Hi Christian,
 
 from what I understand this stuff can only be done in c++ right now, not
 java.

 
 Not so. The backends are accessed as UNO services and can be written in
 any language suitable for writing UNO components. This includes Java and
 even Python.

My information about this is a little bit dated I think the last time we
checked if we could use java was on the 1.1.x series of OOo, not 2.0.x
series. I've searched the mailiong list but cannot find the mail
regarding this, so I might be totally wrong.
Anyway, if it now works in OOo 2.0.x that is a great benefit for me,
since I don't have to learn c++ :-)

 The only premise is that the UNO language binding does not access the
 configuration database for its own startup configuration. IIRC that used
 to be a problem with Java in OOo 1.1.x, but shouldn't be the case any
 more in OOo 2.

hopefully it does not need to, since the url from where it needs to
download the files are specified in the configmgrrc file..

 We did create a modified version of the Configuration chapter in the
 developer's guide that explains the services and interfaces involved in
 this. Unfortunately it seems to have not made it into the OOo 2.0
 version of the guide. I'll check if I can find it somewhere and get it
 up onto the website.

That would be very much appreciated. and if you could telt us the url of
this document when/if you find it and have it uploaded :-)


 The short summary is: You need to create a UNO service that implements
 one of the abstract services
 com.sun.star.configuration.backend.SingleLayerStratum [1] or
 com.sun.star.configuration.backend.MultiLayerStratum [2].
 
 This essentially amounts to implementing the methods of the
 XSingleLayerStratum or XMultiLayerStratum interface to return a Layer
 object whose XLayer::readData method reads and parses from your data store.
 
 If you store your data in the 'xcu' XML format, you can use the existing
  com.sun.star.configuration.backend.xml.LayerParser service to implement
 the Layer object. All you need to do is provide an XInputStream to read
 the data.

ok, this sounds doable, adn I'm looking forward to start testing it next
week :-)

 
 If I manage to write my own configurationreader can this then be
 installed using unopkg? or do I have to compile it within my own version
 of OpenOffice.org?

 
 You can install such a backend using unopkg add --shared. That will not
 automatically enable its use for the standard configuration stack
 though. To activate it for that purpose, you need to add it to the
 CFG_Strata entry in $officeinstall/program/bootstrap.
don't you mean $officeinstall/program/configmgr[rc|.ini] ?`because that
is where I have changed CFG_Strata variable before? and looking in
bootstrap now, it shows no such variable..


 Alternatively you can have your SingleLayerStratum register itself as an
 instance of service com.sun.star.configuration.backend.PlatformBackend.
 In that case it will be used automatically through the special
 'SystemIntegration' backend service.
 Warning: this service is still declared 'unpublished' and thus is
 subject to change in a future version. (I do think that is unlikely,
 though and changes will be announced using the interface-announce
 mailing list.)

well, if this is as well-documented in the developersguide as the rest
of the configuration system, I'll probably try to add it to the
configmgr file :-)


-- 
Christian Andersson - [EMAIL PROTECTED]

Configuration and Collaboration for OpenOffice.org
Open Framework Systems AS http://www.ofs.no

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] make a python script in makefile.mk?

2006-07-17 Thread Hans-Joachim Lankenau
hi!

UNIXTEXT was introduced to make sure the resulting file gets cleaned
from dos lineends.
there is currently nothing similar available for windows :(

Leibowitz, Michael wrote:
 I'm having some trouble with making scripts in my makefile.mk.  In
 UNIX, I use UNIXTEXT = $(MISC)/dbbe_enable.sh  That seems to work.
 However, on Windows, I don't know of any similar variable.  I tried
 putting in my own target:
 
 # --- Targets --
 
 .INCLUDE : target.mk

# insert your target in the dependency chain
ALLTAR : $(MISC)$/dbbe_enable.py
 
 $(MISC)$/dbbe_enable.py: dbbe_enable.py
 +cp $? $@
 
 But, this doesn't seem to have any effect.  Any hints??
 

better use $(COPY) or $(GNUCOPY) instead of cp

tschau...

ause

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] Warning free code: the missing modules

2006-07-17 Thread Christian Lohmaier
Hi *,

On Fri, Jul 14, 2006 at 10:00:57AM +0200, Stephan Bergmann wrote:
 Christian Lohmaier wrote:
 On Thu, Jul 13, 2006 at 06:04:41PM +0200, Stephan Bergmann wrote:
 Now that CWS warnings01 is integrated and most of the OOo modules are 
 C/C++ warning free for the standard platforms (unxlngi6, unxsoli4, 
 unxsols4, wntmsci10),
 
 only for specific compiler versions.
 gcc 4.0.[23] at least cannot compile OOo without disabling the warnings
 for quite a lot of dirs.
 
 Please wait until CWS warningfixes02 is integrated, or manually apply 
 the patch from http://www.openoffice.org/issues/show_bug.cgi?id=66577. 

I already have that one applied, but still, many, many directories need
the warnings != errors switch. (around 90)

  With those changes integrated, OOo should compile fine at least with 
 GCC 4.1.1.  I encountered spurious warnings with GCC 4.0.2 that I would 
 consider errors of GCC, and which disappeared for GCC 4.1.1.  This might 
 rule out GCC 4.0.2 as an appropriate compiler for OOo.

Unfortunately :-(

 [...] 
 Which modules are missing?  As of SRC680m176, the situation is as follows:
 
 m175 and m176 don't compile here either because typesizes.h is not
 generated/ typesconfig is not built and not run. (but build walked
 through the directory) - not sure why But that's another story
 anyway.
 
 You mean, unrelated to the warnings are errors thing?  (Otherwise, I 
 would be interested in an issue id.)

Not related to the warnings are errors thing. I now tracked it down to a
broken patch that I applied
(http://qa.openoffice.org/issues/show_bug.cgi?id=67199 - I thought I had
the latest one, but my scripts applied the parallel-solenv-urd.diff one
instead)...

 Opinions, anyone?
 
 I'd like to have a statement of what compiler versions will be/are still
 supported by OOo.
 
 The official Sun Hamburg builds are done with GCC 3.4.1 (plus a 
 visibility patch and one other minor tweak, I think).  Other versions 
 are also known to work, either by chance, or after some people put in 
 enough effort to make it work.  Other versions are known not to work, 
 either due to errors in GCC or in OOo (wasn't that the case for GCC 
 4.0.0? I'm always bad at remembering such details).

I'm feared but nevertheless expected the by chance answer...

 I personally would love to see as many versions of GCC supported as 
 possible, but there are certainly practical limits to this. 

So in future, the only way to build with those other compiler versions
is to either patch a lot of makefiles or to disable the warnings=errors
flag completely?

As you wrote in comment 3 to issue 66577 that gcc 4.0 generates warnings
or stuff like this

  void f(com::sun::star::uno::Any const  a) {
sal_Bool b;
if (a = b) {
  // warning if b is used here
}
  }


To me (I have no programming skills), this looks like a warning similar
to you'd better put parentheses around that expression to avoid
ambiguity (You'd better set a value for b or you may get weired
results) - but I cannot tell whether that is worth fixing or not.

From your comment I guess you don't think it is worth fixing.

(And if it is not worth fixing, would declaring it do harm? 
You had some lines for fixing these kind of warnings in your
firsthalf.diff, but removed them from your second patch, that's why I'm
asking)

 [...]

ciao
Christian
-- 
NP: Soulfly - Soulfly II

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [dev] RestrictedPath working under Windows?

2006-07-17 Thread Allen Pulsifer
  I would also be interested in changing RestrictedPath from an 
  environmental variable to a configuration (.xcs/.xcu) setting.

I'm realizing that it make this useful, a system administrator would
probably need a way to insert the user's username or WinNT domain\username
into the path.  So for example, the system administrator could set
RestrictedPath to \\fileserver\userfiles\$(username) and OOo would make the
appropriate substitution.  The same feature would be useful with any of the
path variables in org.openoffice.Office.Common/Path.  See
http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_2
_7_2_Path_Variables

Is there a way to do this already?

If not, I think it would make sense to add this to
framework\source\services\substitutepathvars.cxx (and possibly also to
svtools\source\config\pathoptions.cxx

Allen

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[dev] paragraph number

2006-07-17 Thread Mohammad Alhammouri

Hello there,

is there a similar function to the page number function  xPageCursor.getPage(),
that finds the paragraph number  within the text document.
if not is there any way to find that number in JAVA ?

thanks in advance.

Regards,
Mohammad.


RE: [dev] make a python script in makefile.mk?

2006-07-17 Thread Leibowitz, Michael
Thanks.  Although perhaps not the cleanest way to do it, I switched to
just having d.lst deliver it directly from the source dir.

--
Michael Leibowitz
Software Engineer, Channel Platform Solutions Group
Intel Corporation
michael.leibowitz at intel.com
+1 503 264 7621


-Original Message-
From: Hans-Joachim Lankenau [mailto:[EMAIL PROTECTED]
Sent: Monday, July 17, 2006 8:29 AM
To: dev@openoffice.org
Subject: Re: [dev] make a python script in makefile.mk?

hi!

UNIXTEXT was introduced to make sure the resulting file gets cleaned
from dos lineends.
there is currently nothing similar available for windows :(

Leibowitz, Michael wrote:
 I'm having some trouble with making scripts in my makefile.mk.  In
 UNIX, I use UNIXTEXT = $(MISC)/dbbe_enable.sh  That seems to work.
 However, on Windows, I don't know of any similar variable.  I tried
 putting in my own target:

 # --- Targets --

 .INCLUDE : target.mk

# insert your target in the dependency chain
ALLTAR : $(MISC)$/dbbe_enable.py

 $(MISC)$/dbbe_enable.py: dbbe_enable.py
 +cp $? $@

 But, this doesn't seem to have any effect.  Any hints??


better use $(COPY) or $(GNUCOPY) instead of cp

tschau...

ause

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]