Dekel Tsur <[EMAIL PROTECTED]> writes:

| On Tue, Nov 26, 2002 at 05:28:03PM +0200, Dekel Tsur wrote:
>> 
>> Here is the patch that implements the above for the QT frontend.
>> Please check that it works correctly with QT2.
>
| I had a small error in the patch above and it probably hadn't functioned
| correctly with QT2. Here is an updated version.
| I also modified the XForms code, but I didn't add font comboxes yet.
| Currently, you can select the foundry in the XForms frontend by typing
| family,foundry in the input box.
| I think I will apply this patch once someone confirm that it works with QT2,
| and I'll add font comboxes later.


>+void oldFontFormat(string & family, string & foundry)
+{
+       if (family.empty() || family[0] != '-')
+               return;
+       foundry = token(family, '-', 1);
+       family = token(family, '-', 2);
+       if (foundry == "*")
+               foundry = string();
+}

use erase to clear a string: foundry.erase()

Are you actually using anyting from boost.tuple? Or are you only using
std::pair? if so include <utility> instead of <boost/tuple/tuple.hpp<
(ok I see you use boost::tie)

+string makeFontName(string const & family, string const & foundry)
+{
+       if (foundry.empty())
+               return family;
+#if QT_VERSION  >= 300
+       return family + '[' + foundry + ']';
+#else
+       return foundry + '-' + family;
+#endif
+}

is it ok to not have ' ' after family in qt3 case?

+       string::size_type const idx = name.find('[');
+       if (idx == string::npos || idx == 0)
+               return make_pair(name, string());
+       return make_pair(name.substr(0, idx-1),
+                        name.substr(idx+1, name.size()-idx-2));

a bit more spaces sprinkled in would be nice "idx+1" -> "idx + 1" etc.
(all over the patch really)

qfont_loader.C: 

+string const fontName(string const & family, string const & foundry)
+{
+       if (foundry.empty())
+               return family;
+       else
+#if QT_VERSION  >= 300
+               return family + '[' + foundry + ']';
+#else
+               return foundry+"-"+family;
+#endif
+}
+

this looks sliktly wrong... (ok not wrong).

the else is not needed, too few spaces and then you are identical to
the function above...

other than this nitpicking, it is beginnig to look nice.


-- 
        Lgb

Reply via email to