/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Instead of re-using the GtkPrintSettings that nsIPrintSettings is // wrapping, we'll create a new one to deserialize to and replace it // within nsIPrintSettings.
GtkPrintSettings* newGtkPrintSettings = gtk_print_settings_new();
for (uint32_t i = 0; i < data.GTKPrintSettings().Length(); ++i) {
CStringKeyValue pair = data.GTKPrintSettings()[i];
gtk_print_settings_set(newGtkPrintSettings, pair.key().get(),
pair.value().get());
}
// nsPrintSettingsGTK is holding a reference to newGtkPrintSettings
g_object_unref(newGtkPrintSettings);
newGtkPrintSettings = nullptr; return NS_OK;
}
nsresult nsPrintSettingsServiceGTK::_CreatePrintSettings(
nsIPrintSettings** _retval) {
*_retval = nullptr;
nsPrintSettingsGTK* printSettings = new nsPrintSettingsGTK(); // does not initially ref count
NS_ENSURE_TRUE(printSettings, NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(*_retval = printSettings); // ref count
return NS_OK;
}
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.