For gnome in shell/source/backends/gconfbe/gconfaccess.cxx we fill in the user's name information from glib's "g_get_real_name" (search for "givenname" and "g_get_real_name" in there. It would be nice to fill in the defaults under windows as well SHGetUserDisplayName (http://undoc.airesoft.co.uk/shell32.dll/SHGetUserDisplayName.php) looks about right. In officecfg/registry/data/org/openoffice/UserProfile.xcu there is <prop oor:name="givenname" install:module="gconflockdown"> <value oor:external= "com.sun.star.configuration.backend.GconfBackend givenname"/> </prop> which makes the configuration check that module to get that givenname property. If that was changed to... <prop oor:name="givenname"> <value install:module="unixdesktop" oor:external= "com.sun.star.configuration.backend.GconfBackend givenname"/> <value install:module="unixdesktop" oor:external= "com.sun.star.configuration.backend.WinInetBackend givenname"/> </prop> then it would also ask the windows backend in shell/source/backends/wininetbe/wininetbackend.cxx through WinInetBackend::getPropertyValue for "givenname" and some attempt to use SHGetUserDisplayName there might get us a fairly useful default value
Ordinal-exported functions are NEVER right.
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Removing comma from whiteboard (please use a space to delimit values in this field) https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Whiteboard#Getting_Started
That SHGetUserDisplayName() seems to be undocumented, so we definitely should *not* use that. Which is what Urmas meant, I guess.
I think GetUserNameEx should do the trick for windows https://msdn.microsoft.com/en-us/library/ms724435%28VS.85%29.aspx
I am attempting to add the default entry in on windows, however I am having trouble with this. Main affected file: shell/source/backends/desktopbe/desktopbackend.cxx Currently I am trying to set the value manually in desktopbackend.cxx. I am doing this by returning the value "brent" in the Default::getPropertyValue function. Since the officecfg/registry/data/org/openoffice/UserProfile.xcu has this: <prop oor:name="givenname"> <value install:module="unixdesktop" oor:external="com.sun.star.configuration.backend.DesktopBackend givenname"/> </prop> I figured that it would call getPropertyValue to get the "givenname" value. Since it would call getPropertyValue, the function should return "brent". This would then automatically fill in the tools->options->user data name value correct? However it does not seem to fill it in. Oh and before I did this I recompiled the shell, officecfg, and postprocess modules (shell contained the backend) so that these changes may take affect. Then I ran LibreOffice. I was wondering if this was because the program no longer checks for default values using the UserProfile.xcu file or if there was another reason. Either way the value is not appearing within the box. Should I try re-making the whole program instead of just the few affected modules? Am I missing something?
This is probably only called on first-start so rm -rf instdir/user and restart LibreOffice should retrigger "first-start"
(In reply to ritztro from comment #6) > Currently I am trying to set the value manually in desktopbackend.cxx. I am > doing this by returning the value "brent" in the Default::getPropertyValue > function. Since the officecfg/registry/data/org/openoffice/UserProfile.xcu > has this: > <prop oor:name="givenname"> > <value install:module="unixdesktop" > oor:external="com.sun.star.configuration.backend.DesktopBackend givenname"/> > </prop> The install:module="unixdesktop" attribute means that this oor:external value will only be used on Unix (Linux), not on Windows. Something like > diff --git a/officecfg/Configuration_officecfg.mk b/officecfg/Configuration_officecfg.mk > index 7e2af03..b7e8625 100644 > --- a/officecfg/Configuration_officecfg.mk > +++ b/officecfg/Configuration_officecfg.mk > @@ -69,6 +69,7 @@ $(eval $(call gb_Configuration_add_spool_modules,registry,officecfg/registry/dat > org/openoffice/Setup-reportbuilder.xcu \ > org/openoffice/Setup-start.xcu \ > org/openoffice/UserProfile-unixdesktop.xcu \ > + org/openoffice/UserProfile-unxwnt.xcu \ > org/openoffice/VCL-gconflockdown.xcu \ > org/openoffice/VCL-unixdesktop.xcu \ > org/openoffice/Office/Accelerators-macosx.xcu \ > diff --git a/officecfg/registry/data/org/openoffice/UserProfile.xcu b/officecfg/registry/data/org/openoffice/UserProfile.xcu > index b41756a..c206366 100644 > --- a/officecfg/registry/data/org/openoffice/UserProfile.xcu > +++ b/officecfg/registry/data/org/openoffice/UserProfile.xcu > @@ -20,7 +20,7 @@ > <oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="UserProfile" oor:package="org.openoffice"> > <node oor:name="Data"> > <prop oor:name="givenname"> > - <value install:module="unixdesktop" oor:external="com.sun.star.configuration.backend.DesktopBackend givenname"/> > + <value install:module="unxwnt" oor:external="com.sun.star.configuration.backend.DesktopBackend givenname"/> > </prop> > <prop oor:name="sn"> > <value install:module="unixdesktop" oor:external="com.sun.star.configuration.backend.DesktopBackend sn"/> > diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk > index a568832..f10c18b 100644 > --- a/postprocess/CustomTarget_registry.mk > +++ b/postprocess/CustomTarget_registry.mk > @@ -312,6 +312,7 @@ postprocess_FILES_main += \ > $(postprocess_MOD)/org/openoffice/Office/Paths-unixdesktop.xcu \ > $(postprocess_MOD)/org/openoffice/Office/Paths-unxwnt.xcu \ > $(postprocess_MOD)/org/openoffice/UserProfile-unixdesktop.xcu \ > + $(postprocess_MOD)/org/openoffice/UserProfile-unxwnt.xcu \ > $(postprocess_MOD)/org/openoffice/VCL-unixdesktop.xcu > # Inet-unixdesktop.xcu must come after Inet.xcu > # VCL-unixdesktop.xcu must come after VCL.xcu > @@ -322,6 +323,7 @@ postprocess_FILES_main += \ > $(postprocess_MOD)/org/openoffice/Office/Accelerators-unxwnt.xcu \ > $(postprocess_MOD)/org/openoffice/Office/Common-wnt.xcu \ > $(postprocess_MOD)/org/openoffice/Office/Paths-unxwnt.xcu \ > + $(postprocess_MOD)/org/openoffice/UserProfile-unxwnt.xcu \ > $(postprocess_MOD)/org/openoffice/ucb/Configuration-win.xcu > # Inet-wnt.xcu must come after Inet.xcu > postprocess_DRIVERS += ado (and rebuilding at least officecfg and postprocess) should make your changes work.
Alright well I made that change to UserProfile.xcu... However it still is not working. Maybe I am doing something wrong in desktopbackend.cxx? Here is what I did just as a quick test: css::uno::Any Default::getPropertyValue(OUString const & PropertyName) throw ( css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) { //Added these next 5 lines if ( PropertyName == "givenname") { css::uno::Any value = "brent"; return css::uno::makeAny(value); } if ( PropertyName == "EnableATToolSupport" || PropertyName == "ExternalMailer" || PropertyName == "SourceViewFontHeight" || PropertyName == "SourceViewFontName" || PropertyName == "TemplatePathVariable" || PropertyName == "WorkPathVariable" || PropertyName == "ooInetFTPProxyName" || PropertyName == "ooInetFTPProxyPort" || PropertyName == "ooInetHTTPProxyName" || PropertyName == "ooInetHTTPProxyPort" || PropertyName == "ooInetHTTPSProxyName" || PropertyName == "ooInetHTTPSProxyPort" || PropertyName == "ooInetNoProxy" || PropertyName == "ooInetProxyType" || PropertyName == "givenname" || PropertyName == "sn" ) { return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); } throw css::beans::UnknownPropertyException( PropertyName, static_cast< cppu::OWeakObject * >(this)); } When I go to the options my name still does not appear (I did delete the user directory every time). Any more help is appreciated :)
The desktopbe library is currently only built on Linux, see the start of shell/Module_shell.mk: > $(eval $(call gb_Module_add_targets,shell,\ > $(if $(filter-out MACOSX WNT,$(OS)),Library_desktopbe) \ > Library_localebe \ > ))
Okay so I went onto linux to see if my code would even work first.. And I ended up changing my code to this: if ( PropertyName == "givenname") { return css::uno::makeAny(OUString("brent")); } After I deleted the user directory. I then recompiled the shell, officecfg, and postprocess (last two just to be safe). Then when I ran the program the value was still not there. Is there any reason that maybe the system got discontinued somewhere else in the code or am I missing something? Because based off this, if it is requesting the value and will fill in the space with the value given, this should work and show this value. Any more help is appreciated and has been greatly appreciated thus far (Thanks Caolána and Stephan) :)
See createInstance in shell/source/backends/desktopbe/desktopbackend.cxx. The code you modified in Default::getPropertyValue would only get used on Linux if your desktop environment did not match one of the more specific overrides of the desktop backend (for GNOME/KDE/KDE4).
Migrating Whiteboard tags to Keywords: (easyHack, difficultyBeginner, skillCpp) [NinjaEdit]
I want to work on this bug....any leads on how to proceed further ?
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
this is now also broken on linux after commit 3cf557c12d27f1b2250e69a543136da098112d80 Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com> Date: Fri Oct 16 12:15:55 2015 +0100 drop gconf integration as per ESC decision
This also should be done for Mac OS.
See https://git.libreoffice.org/core/+/f154f63cb662f02415d5cb0051011bdb5d0d523c