<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Roundtrip to Shanghai via Tokyo &#187; vcl</title>
	<atom:link href="http://kohei.us/tag/vcl/feed/" rel="self" type="application/rss+xml" />
	<link>http://kohei.us</link>
	<description>Kohei Yoshida&#039;s Webspace</description>
	<lastBuildDate>Tue, 22 May 2012 04:18:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Missing vcl resource</title>
		<link>http://kohei.us/2007/07/11/missing-vcl-resource/</link>
		<comments>http://kohei.us/2007/07/11/missing-vcl-resource/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 03:17:58 +0000</pubDate>
		<dc:creator>Kohei Yoshida</dc:creator>
				<category><![CDATA[]]></category>
		<category><![CDATA[code snippet]]></category>
		<category><![CDATA[openoffice.org]]></category>
		<category><![CDATA[vcl]]></category>

		<guid isPermaLink="false">http://kohei.us/2007/07/11/missing-vcl-resource/</guid>
		<description><![CDATA[At one point in the past, I started getting this annoying error message dialog on startup, and OO.o simply shuts itself down after that. It happened whenever I installed the trunk version of ooo-build with ooinstall (with an -l option &#8230; <a href="http://kohei.us/2007/07/11/missing-vcl-resource/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At one point in the past, I started getting this annoying error message dialog </p>
<p><img src='http://kohei.us/wp-content/uploads/2007/07/resource_warning.jpg' alt='VCL resource warning dialog on startup' /></p>
<p>on startup, and OO.o simply shuts itself down after that.  It happened whenever I installed the trunk version of ooo-build with <strong>ooinstall</strong> (with an -l option for linking), or the upstream build with <strong>linkoo</strong>.  These two commands are two, totally separate scripts, but they both create symbolic links to the shared libraries and resources in the installation directory, to their respective location in the build (actually <strong>ooinstall</strong> makes use of <strong>linkoo</strong> for the -l functionality).  This setting allows a fast iteration of code change, compilation and testing without having to manually swap the shared libraries each time they get modified in the build.  But because of this problem I was not able to use linkoo with the upstream build, or ooinstall -l with the trunk ooo-build, and was forced to <em>manually</em> set symlink to the modules I was working on.  (Somehow, the 2.2 and 2.1 branches of ooo-build didn&#8217;t have this problem.)</p>
<p>But today, after not having been able to use an automatically symlinked installation for a long, long time, I got tired of it and decided to jump into the code, to see what causes this problem.</p>
<p>After a little tracing of the code, I finally found the offending code block (<strong>tools/source/rc/resmgr.cxx#244</strong>):</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> ResMgrContainer<span style="color: #008080;">::</span><span style="color: #007788;">init</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #666666;">// get resource path</span>
    std<span style="color: #008080;">::</span><span style="color: #007788;">list</span><span style="color: #000080;">&lt;</span> OUString <span style="color: #000080;">&gt;</span> aDirs<span style="color: #008080;">;</span>
    sal_Int32 nIndex <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #666666;">// 1. relative to current module (&lt;installation&gt;/program/resource)</span>
    OUString libraryFileUrl<span style="color: #008080;">;</span>
    <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> Module<span style="color: #008080;">::</span><span style="color: #007788;">getUrlFromAddress</span><span style="color: #008000;">&#40;</span>
            <span style="color: #0000ff;">reinterpret_cast</span><span style="color: #000080;">&lt;</span> oslGenericFunction <span style="color: #000080;">&gt;</span><span style="color: #008000;">&#40;</span>ResMgrContainer<span style="color: #008080;">::</span><span style="color: #007788;">release</span><span style="color: #008000;">&#41;</span>,
            libraryFileUrl<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span>
        nIndex <span style="color: #000080;">=</span> libraryFileUrl.<span style="color: #007788;">lastIndexOf</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">'/'</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    DBG_ASSERT<span style="color: #008000;">&#40;</span> nIndex <span style="color: #000080;">&gt;</span> <span style="color: #0000dd;">0</span>, <span style="color: #FF0000;">&quot;module resolution failed&quot;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> nIndex <span style="color: #000080;">&gt;</span> <span style="color: #0000dd;">0</span> <span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        OUStringBuffer aBuf<span style="color: #008000;">&#40;</span> libraryFileUrl.<span style="color: #007788;">getLength</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">+</span> <span style="color: #0000dd;">16</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        aBuf.<span style="color: #007788;">append</span><span style="color: #008000;">&#40;</span> libraryFileUrl.<span style="color: #007788;">getStr</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, nIndex<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// copy inclusive '/'</span>
        aBuf.<span style="color: #007788;">appendAscii</span><span style="color: #008000;">&#40;</span> <span style="color: #FF0000;">&quot;resource&quot;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        aDirs.<span style="color: #007788;">push_back</span><span style="color: #008000;">&#40;</span> aBuf.<span style="color: #007788;">makeStringAndClear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #666666;">// 2. in STAR_RESOURCEPATH</span>
    ....</pre></div></div>

<p>Here is what the code does.  It tries to locate all of the resources (.res) files and put their locations into an internal data structure.  To do it, it needs to know where to find the resource files.  It cleverly determines the resource file directory by first getting the absolute path of the module where the code resides (<strong>libtl680li.so</strong>), and move down to the resource file directory from that location.  In the normal installation, the modules are located in the <strong>[installation root]/program/</strong>, and the resources directory is only one level down.</p>
<p>However, when the shared library in question is a symbolic link (symlink) to another file, the code ends up getting the path of the actual file the symlink points to, instead of the path of that symlink (via <strong>dladdr</strong> call), and this causes the above problem.</p>
<p>There is an easy workaround.  Since it&#8217;s only the shared library where the <strong>ResMgrContainer</strong> class is (which is <strong>libtl680li.so</strong> as mentioned) needs to be the actual file, <em>you can simply delete the symlink that points to libtl680li.so, and put the original file in its place</em>.  Then OO.o launches just fine.  You can leave all the other symlinked shared libraries alone.  The only problem with this workaround is, if you want to hack at the tools code, you would need to manually swap the shared library on each module re-build, but for me, that&#8217;s not a major problem (I don&#8217;t hack at the tools code).</p>
]]></content:encoded>
			<wfw:commentRss>http://kohei.us/2007/07/11/missing-vcl-resource/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hack Week: Helping make OO.o&#8217;s dialog resizable</title>
		<link>http://kohei.us/2007/06/26/hack-week-helping-make-ooos-dialog-resizable/</link>
		<comments>http://kohei.us/2007/06/26/hack-week-helping-make-ooos-dialog-resizable/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 04:38:31 +0000</pubDate>
		<dc:creator>Kohei Yoshida</dc:creator>
				<category><![CDATA[]]></category>
		<category><![CDATA[hack week]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[novell]]></category>
		<category><![CDATA[openoffice.org]]></category>
		<category><![CDATA[vcl]]></category>

		<guid isPermaLink="false">http://blog.kohei.us/2007/06/26/hack-week-helping-make-ooos-dialog-resizable/</guid>
		<description><![CDATA[So, this is day one for Novell&#8217;s Hack Week. This week, we, Novell hackers, are allowed to work on whatever project we like. And I chose to work on making VCL dialog resizable. Michael Meeks already did the ground work, &#8230; <a href="http://kohei.us/2007/06/26/hack-week-helping-make-ooos-dialog-resizable/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, this is day one for Novell&#8217;s Hack Week.  This week, we, Novell hackers, are allowed to work on whatever project we like.  And I chose to work on <a href="http://wiki.services.openoffice.org/wiki/VCL_UI_Rework">making VCL dialog resizable</a>.</p>
<p>Michael Meeks already did the ground work, and all I&#8217;m trying to do is to do what I can in one week to expand on his work.  This is also one of on-going GSoC tasks, so I&#8217;m also co-ordinating with the student who&#8217;s been assigned to work on this (his name is Ricardo Cruz) so that we won&#8217;t step on each other&#8217;s toes.</p>
<p>Here is what I did today.  I added a wrapper code for a list box control so that I can actually use it in my resizable dialog and add items to it.  Let&#8217;s show some screenshots here.</p>
<p><img src="http://blog.kohei.us/wp-content/uploads/2007/06/dialog_small.png" alt="OO.o resizable dialog demo (small)" /></p>
<p><img src="http://blog.kohei.us/wp-content/uploads/2007/06/dialog_large.png" alt="OO.o resizable dialog demo (large)" /></p>
<p>I posted two shots of the same, but differently-sized dialog just to show that it&#8217;s resizable.  Pretty cool, huh? :-)</p>
<p>Oh, BTW, since I&#8217;m away from my normal business this week, I won&#8217;t be working on the OOXML filter.  I&#8217;ll be back on my regular schedule on next Monday.</p>
]]></content:encoded>
			<wfw:commentRss>http://kohei.us/2007/06/26/hack-week-helping-make-ooos-dialog-resizable/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

