!344 编码问题修改

Merge pull request !344 from 梁瑾/master
This commit is contained in:
openharmony_ci 2024-09-06 08:12:39 +00:00 committed by Gitee
commit f01cf57949
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
8 changed files with 18 additions and 6 deletions

View File

@ -105,7 +105,7 @@ typedef struct {
int32_t (*onQueryProperties)(const char *printerId, const Print_StringList *propertyKeyList);
} Print_VendorExtension;
Print_VendorExtension* GetPrintVendorExtension();
Print_VendorExtension* GetPrintVendorExtension(void);
#ifdef __cplusplus
}

View File

@ -382,6 +382,7 @@ Print_ErrorCode OH_Print_RestorePrinterProperties(const char *printerId, const P
return PRINT_ERROR_NONE;
}
namespace {
class PrintDocumentAdapterWrapper : public PrintDocumentAdapter {
public:
explicit PrintDocumentAdapterWrapper(Print_PrintDocCallback PrintCallback);
@ -531,6 +532,7 @@ Print_PrintAttributes *PrintDocumentAdapterWrapper::BuildPrintAttributes(const P
attributes->pageMargin = printMargin;
return attributes.release();
}
}
Print_ErrorCode OH_Print_StartPrintByNative(const char *printJobName,
Print_PrintDocCallback printDocCallback,

View File

@ -163,6 +163,7 @@ void PrintModalUICallback::SendMessageBack()
PRINT_HILOGE("Failed to get uv_queue_work.");
delete printBaseContext;
delete work;
work = nullptr;
}
}

View File

@ -1105,6 +1105,10 @@ bool PrintCupsClient::VerifyPrintJob(JobParameters *jobParams, int &num_options,
bool PrintCupsClient::HandleFiles(JobParameters *jobParams, uint32_t num_files, http_t *http, uint32_t jobId)
{
if (jobParams == nullptr) {
PRINT_HILOGW("jobParams is null");
return false;
}
cups_file_t *fp = nullptr;
http_status_t status;
char buffer[8192];
@ -1159,6 +1163,11 @@ void PrintCupsClient::StartCupsJob(JobParameters *jobParams, CallbackFunc callba
PRINT_HILOGD("start job success, jobId: %{public}d", jobId);
JobMonitorParam *param = new (std::nothrow) JobMonitorParam { jobParams->serviceAbility,
jobParams->serviceJobId, jobId, jobParams->printerUri, jobParams->printerName, jobParams->printerId };
if (param == nullptr) {
PRINT_HILOGW("param is null");
callback();
return;
}
g_isFirstQueryState = true;
PRINT_HILOGD("MonitorJobState enter, cupsJobId: %{public}d", param->cupsJobId);
MonitorJobState(param, callback);

View File

@ -1012,7 +1012,7 @@ bool PrintServiceAbility::WritePreferenceToFile()
PRINT_HILOGE("The realPidFile is null.");
return false;
}
int32_t fd = open(printerPreferenceFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0740);
int32_t fd = open(printerPreferenceFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0640);
PRINT_HILOGD("SavePrinterPreferenceMap fd: %{public}d", fd);
if (fd < 0) {
PRINT_HILOGW("Failed to open file errno: %{public}s", std::to_string(errno).c_str());

View File

@ -186,7 +186,7 @@ bool PrintSystemData::SaveCupsPrinterMap()
PRINT_HILOGE("The realPidFile is null.");
return E_PRINT_SERVER_FAILURE;
}
int32_t fd = open(printerListFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0740);
int32_t fd = open(printerListFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0640);
PRINT_HILOGD("SaveCupsPrinterMap fd: %{public}d", fd);
if (fd < 0) {
PRINT_HILOGW("Failed to open file errno: %{public}s", std::to_string(errno).c_str());

View File

@ -314,7 +314,7 @@ bool PrintUserData::GetFileData(std::string &fileData)
PRINT_HILOGE("The realPidFile is null.");
return E_PRINT_SERVER_FAILURE;
}
int32_t fd = open(userDataFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0740);
int32_t fd = open(userDataFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0640);
PRINT_HILOGI("create file fd: %{public}d", fd);
if (fd < 0) {
PRINT_HILOGW("Failed to open file errno: %{public}s", std::to_string(errno).c_str());
@ -365,7 +365,7 @@ bool PrintUserData::SetUserDataToFile()
PRINT_HILOGE("The realPidFile is null.");
return E_PRINT_SERVER_FAILURE;
}
int32_t fd = open(userDataFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0740);
int32_t fd = open(userDataFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0640);
PRINT_HILOGI("SetUserDataToFile fd: %{public}d", fd);
if (fd < 0) {
PRINT_HILOGW("Failed to open file errno: %{public}s", std::to_string(errno).c_str());

View File

@ -263,7 +263,7 @@ void ScanSystemData::GetAddedScannerInfoList(std::vector<ScanDeviceInfo> &infoLi
bool ScanSystemData::SaveScannerMap()
{
int32_t fd = open(SCANNER_LIST_FILE.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0740);
int32_t fd = open(SCANNER_LIST_FILE.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0640);
SCAN_HILOGD("SaveScannerMap fd: %{public}d", fd);
if (fd < 0) {
SCAN_HILOGW("Failed to open file errno: %{public}s", std::to_string(errno).c_str());