Bug 1185236 - Add AdjustPrintJobNameForIPP() wide version. r?karlt
MozReview-Commit-ID: AE3mvnrVAqn
--- a/gfx/thebes/PrintTarget.cpp
+++ b/gfx/thebes/PrintTarget.cpp
@@ -178,16 +178,27 @@ PrintTarget::AdjustPrintJobNameForIPP(co
uint32_t length =
RewindToPriorUTF8Codepoint(aAdjustedJobName.get(),
(IPP_JOB_NAME_LIMIT_LENGTH - 3U));
aAdjustedJobName.SetLength(length);
aAdjustedJobName.AppendLiteral("...");
}
}
+/* static */
+void
+PrintTarget::AdjustPrintJobNameForIPP(const nsAString& aJobName,
+ nsString& aAdjustedJobName)
+{
+ nsAutoCString jobName;
+ AdjustPrintJobNameForIPP(aJobName, jobName);
+
+ CopyUTF8toUTF16(jobName, aAdjustedJobName);
+}
+
/* static */ already_AddRefed<DrawTarget>
PrintTarget::CreateWrapAndRecordDrawTarget(DrawEventRecorder* aRecorder,
DrawTarget* aDrawTarget)
{
MOZ_ASSERT(aRecorder);
MOZ_ASSERT(aDrawTarget);
RefPtr<DrawTarget> dt;
--- a/gfx/thebes/PrintTarget.h
+++ b/gfx/thebes/PrintTarget.h
@@ -133,16 +133,18 @@ public:
* restricted to being called between BeginPage()/EndPage() calls, and the
* returned DrawTarget it is still valid to use after EndPage() has been
* called.
*/
virtual already_AddRefed<DrawTarget> GetReferenceDrawTarget(DrawEventRecorder* aRecorder);
static void AdjustPrintJobNameForIPP(const nsAString& aJobName,
nsCString& aAdjustedJobName);
+ static void AdjustPrintJobNameForIPP(const nsAString& aJobName,
+ nsString& aAdjustedJobName);
protected:
// Only created via subclass's constructors
explicit PrintTarget(cairo_surface_t* aCairoSurface, const IntSize& aSize);
// Protected because we're refcounted
virtual ~PrintTarget();